From ee6da62511660cf5849fea1a39a3e94c1f2867c7 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Fri, 17 Feb 2012 17:26:45 -0800 Subject: Fixes #15. Added untagging. --- actions/photos/image/untag.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 actions/photos/image/untag.php (limited to 'actions') diff --git a/actions/photos/image/untag.php b/actions/photos/image/untag.php new file mode 100644 index 000000000..012f98930 --- /dev/null +++ b/actions/photos/image/untag.php @@ -0,0 +1,24 @@ +name != 'phototag') { + register_error(elgg_echo("tidypics:phototagging:delete:error")); + forward(REFERER); +} + +if (!$annotation->canEdit()) { + register_error(elgg_echo("tidypics:phototagging:delete:error")); + forward(REFERER); +} + +if ($annotation->delete()) { + system_message(elgg_echo("tidypics:phototagging:delete:success")); +} else { + system_message(elgg_echo("tidypics:phototagging:delete:error")); +} + +forward(REFERER); -- cgit v1.2.3 From 0ec5f4f4f8d9011e460d17156ddf20d96483600d Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Fri, 17 Feb 2012 18:01:50 -0800 Subject: Refs #15. Removing old delete action. --- actions/deletetag.php | 54 --------------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 actions/deletetag.php (limited to 'actions') diff --git a/actions/deletetag.php b/actions/deletetag.php deleted file mode 100644 index 97c1081f8..000000000 --- a/actions/deletetag.php +++ /dev/null @@ -1,54 +0,0 @@ - $value) { - // delete normal tag if it exists - if (is_array($image->tags)) { - $index = array_search($value, $image->tags); - if ($index !== false) { - $tagarray = $image->tags; - unset($tagarray[$index]); - $image->clearMetadata('tags'); - $image->tags = $tagarray; - } - } else { - if ($value === $image->tags) { - $image->clearMetadata('tags'); - } - } - - // delete relationship if this tag is a user - $annotation = get_annotation($id); - $photo_tag = unserialize($annotation->value); - if ($photo_tag->type == 'user') { - remove_entity_relationship($photo_tag->value, 'phototag', $image_guid); - } - - // delete the photo tag annotation - delete_annotation($id); -} - -system_message(elgg_echo("tidypics:deletetag:success")); - -forward($_SERVER['HTTP_REFERER']); -- cgit v1.2.3