diff options
-rw-r--r-- | lib/image.php | 19 | ||||
-rw-r--r-- | views/default/tidypics/image_menu.php | 2 | ||||
-rw-r--r-- | views/default/tidypics/tagging.php | 8 |
3 files changed, 18 insertions, 11 deletions
diff --git a/lib/image.php b/lib/image.php index 0c4049183..183d03c1c 100644 --- a/lib/image.php +++ b/lib/image.php @@ -27,10 +27,11 @@ public function isPhotoTagged() { $num_tags = count_annotations($this->getGUID(), 'object', 'image', 'phototag'); - if ($num_tags > 0) + if ($num_tags > 0) { return true; - else + } else { return false; + } } /** @@ -61,10 +62,11 @@ if ($photo_tag->type === 'user') { $user = get_entity($photo_tag->value); - if ($user) + if ($user) { $phototag_text = $user->name; - else + } else { $phototag_text = "unknown user"; + } $phototag_link = $CONFIG->wwwroot . "pg/photos/tagged/" . $photo_tag->value; } @@ -73,8 +75,9 @@ // 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 + } 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); @@ -115,8 +118,9 @@ $my_views = 0; foreach ($views as $view) { - if ($view->owner_guid == $viewer_guid) + if ($view->owner_guid == $viewer_guid) { $my_views++; + } } } @@ -138,8 +142,9 @@ */ public function addView($viewer_guid) { - if ($viewer_guid != $this->owner_guid && tp_is_person()) + if ($viewer_guid != $this->owner_guid && tp_is_person()) { create_annotation($this->getGUID(), "tp_view", "1", "integer", $viewer_guid, ACCESS_PUBLIC); + } } } diff --git a/views/default/tidypics/image_menu.php b/views/default/tidypics/image_menu.php index 983f900b4..498cfe724 100644 --- a/views/default/tidypics/image_menu.php +++ b/views/default/tidypics/image_menu.php @@ -37,7 +37,7 @@ // only owner can delete tags if ($anytags && $viewer && $viewer->guid == $owner->guid) { ?> -<li id="delete_tags"><a href="javascript:void(0)" onclick="deleteTags()"><?php elgg_echo('tidypics:deletetag'); ?></a></li> +<li id="delete_tags"><a href="javascript:void(0)" onclick="deleteTags()"><?php echo elgg_echo('tidypics:deletetag'); ?></a></li> <?php } } diff --git a/views/default/tidypics/tagging.php b/views/default/tidypics/tagging.php index ae3fa2b27..536bf6b20 100644 --- a/views/default/tidypics/tagging.php +++ b/views/default/tidypics/tagging.php @@ -66,7 +66,8 @@ <div class="clearfloat"></div> </div> <div id="tidypics_delete_tag_menu" class="tidypics_popup"> -<div class='tidypics_popup_header'><h3><?php echo elgg_echo('tidypics:deltag_title'); ?></h3></div> + <div class='tidypics_popup_header'><h3><?php echo elgg_echo('tidypics:deltag_title'); ?></h3></div> + <?php if ($tag_info) { $content = "<input type='hidden' name='image_guid' value='{$image->guid}' />"; @@ -81,7 +82,8 @@ echo elgg_view('input/form', array('internalname' => 'phototag_deletetag_form', 'action' => "{$vars['url']}action/tidypics/deletetag", 'method' => 'post', 'body' => $content)); } - echo '</div>'; // tidypics_delete_tag_menu - +?> +</div> +<?php echo elgg_view('js/tagging', array('photo_tags_json' => $photo_tags_json,) ); ?>
\ No newline at end of file |