]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixed delete tags bug
authorCash Costello <cash.costello@gmail.com>
Fri, 2 Oct 2009 11:37:03 +0000 (11:37 +0000)
committerCash Costello <cash.costello@gmail.com>
Fri, 2 Oct 2009 11:37:03 +0000 (11:37 +0000)
actions/deletetag.php
views/default/tidypics/tagging.php

index 748d00380ab63cf1aab9e1d40b6ea51435da34c8..3a76f6e9970f3a106dff4fa4f23781adcb0b1747 100644 (file)
                forward($_SERVER['HTTP_REFERER']);\r
        }\r
        \r
-       foreach ($tags as $id => $value) {\r
+       foreach ($tags as $id => $value) {              \r
                // delete normal tag if it exists\r
                if (is_array($image->tags)) {\r
-                       $index = array_search($value[0], $image->tags);\r
+                       $index = array_search($value, $image->tags);\r
                        if ($index !== false) {\r
                                $tagarray = $image->tags;\r
                                unset($tagarray[$index]);\r
@@ -34,7 +34,7 @@
                                $image->tags = $tagarray;\r
                        }\r
                } else {\r
-                       if ($value[0] === $image->tags) {\r
+                       if ($value === $image->tags) {\r
                                $image->clearMetadata('tags');\r
                        }\r
                }\r
index ed33c4702beb32990339eaac4f8b24eefa616989..ebaf0dc9438a7a963ace05a2d866cd347e4c6d61 100644 (file)
@@ -70,8 +70,8 @@
        if ($tag_info) {\r
                $content = "<input type='hidden' name='image_guid' value='{$image->guid}' />";\r
                foreach ($tag_info['links'] as $id => $link) {\r
-                       $name = "tags[{$id}]";\r
-                       $content .= elgg_view("input/checkboxes", array('options' => array($link['text'] => $link['text']), 'internalname' => $name, 'value' => '' ));\r
+                       $text = htmlentities($link['text'], ENT_QUOTES, 'UTF-8');\r
+                       $content .= "<label><input type=\"checkbox\" class=\"input-checkboxes\" name=\"tags[{$id}]\" value=\"{$text}\" />{$text}</label><br />";\r
                }\r
 \r
                $content .= "<input type='submit' value='" . elgg_echo('tidypics:actiondelete') . "' class='submit_button' />";\r