]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixed bug with delete tags menu item
authorCash Costello <cash.costello@gmail.com>
Sat, 6 Mar 2010 22:35:15 +0000 (22:35 +0000)
committerCash Costello <cash.costello@gmail.com>
Sat, 6 Mar 2010 22:35:15 +0000 (22:35 +0000)
lib/image.php
views/default/tidypics/image_menu.php
views/default/tidypics/tagging.php

index 0c4049183f9190868d7a2fe0e7d69b07270bee9a..183d03c1c1daec5d2fc32ea48e5362ca62e74dad 100644 (file)
                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;
+                       }
                }
                
                /**
                                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);
                                        $my_views = 0;
                                        foreach ($views as $view)
                                        {
-                                               if ($view->owner_guid == $viewer_guid)
+                                               if ($view->owner_guid == $viewer_guid) {
                                                        $my_views++;
+                                               }
                                        }
                                }
                                
                 */
                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);
+                       }
                }
        }
        
index 983f900b491e17f8346af049de08f87cdbbb62d7..498cfe724c6c1a778dbb443f378a8cde6052d132 100644 (file)
@@ -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
                }
        }
index ae3fa2b276b67f5f2bf584241066baa08c75f358..536bf6b2059cee66d780e8fb1662ea151aa5da07 100644 (file)
@@ -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