aboutsummaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-01-19 19:59:48 -0500
committerCash Costello <cash.costello@gmail.com>2012-01-19 19:59:48 -0500
commita2e4f84be4da51b7ec8fbe625b1b26dde2ad9289 (patch)
tree456380886ee6418e426aadd578298000bde5f88a /classes
parentd24d480f6510b3817f3e85699714ca6ed7ab234c (diff)
downloadelgg-a2e4f84be4da51b7ec8fbe625b1b26dde2ad9289.tar.gz
elgg-a2e4f84be4da51b7ec8fbe625b1b26dde2ad9289.tar.bz2
small changes before a preview 2 release
Diffstat (limited to 'classes')
-rw-r--r--classes/TidypicsImage.php45
1 files changed, 5 insertions, 40 deletions
diff --git a/classes/TidypicsImage.php b/classes/TidypicsImage.php
index 7eca2f7c3..b97a2b05e 100644
--- a/classes/TidypicsImage.php
+++ b/classes/TidypicsImage.php
@@ -338,55 +338,20 @@ class TidypicsImage extends ElggFile {
/**
* Get an array of photo tag information
*
- * @return array of json representations of the tags and the tag link text
+ * @return array
*/
public function getPhotoTags() {
$tags = array();
- $annotations = get_annotations($this->getGUID(), 'object', 'image', 'phototag');
+ $annotations = elgg_get_annotations(array(
+ 'guid' => $this->getGUID(),
+ 'annotation_name' => 'phototag',
+ ));
foreach ($annotations as $annotation) {
$tags[] = unserialize($annotation->value);
}
return $tags;
-
- /*
- $photo_tags_json = "[";
- foreach ($photo_tags as $p) {
- $photo_tag = unserialize($p->value);
-
- // create link to page with other photos tagged with same tag
- $phototag_text = $photo_tag->value;
- $phototag_link = $CONFIG->wwwroot . 'search/?tag=' . $phototag_text . '&amp;subtype=image&amp;object=object';
- if ($photo_tag->type === 'user') {
- $user = get_entity($photo_tag->value);
- if ($user) {
- $phototag_text = $user->name;
- } else {
- $phototag_text = "unknown user";
- }
-
- $phototag_link = $CONFIG->wwwroot . "pg/photos/tagged/" . $photo_tag->value;
- }
-
- if (isset($photo_tag->x1)) {
- // hack to handle format of Pedro Prez's tags - ugh
- $photo_tag->coords = "\"x1\":\"{$photo_tag->x1}\",\"y1\":\"{$photo_tag->y1}\",\"width\":\"{$photo_tag->width}\",\"height\":\"{$photo_tag->height}\"";
- $photo_tags_json .= '{' . $photo_tag->coords . ',"text":"' . $phototag_text . '","id":"' . $p->id . '"},';
- } else {
- $photo_tags_json .= '{' . $photo_tag->coords . ',"text":"' . $phototag_text . '","id":"' . $p->id . '"},';
- }
-
- // prepare variable arrays for tagging view
- $photo_tag_links[$p->id] = array('text' => $phototag_text, 'url' => $phototag_link);
- }
-
- $photo_tags_json = rtrim($photo_tags_json,',');
- $photo_tags_json .= ']';
-
- $ret_data = array('json' => $photo_tags_json, 'links' => $photo_tag_links);
- return $ret_data;
- */
}
/**