From b4b85ecc55a6787726627150a2ee93fd960ff2c6 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 16 Jun 2009 01:39:32 +0000 Subject: added delete phototags capability --- actions/deletetag.php | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 actions/deletetag.php (limited to 'actions/deletetag.php') diff --git a/actions/deletetag.php b/actions/deletetag.php new file mode 100644 index 000000000..cd76b0a1d --- /dev/null +++ b/actions/deletetag.php @@ -0,0 +1,51 @@ + $value) { + // delete normal tag if it exists + if (is_array($image->tags)) { + $index = array_search($value[0], $image->tags); + if ($index !== false) { + $tagarray = $image->tags; + unset($tagarray[$index]); + $image->clearMetadata('tags'); + $image->tags = $tagarray; + } + } else { + if ($value[0] === $image->tags) { + $image->clearMetadata('tags'); + } + } + + // delete the photo tag annotation + delete_annotation($id); + } + + system_message(elgg_echo("tidypics:deletetag:success")); + + forward($_SERVER['HTTP_REFERER']); + +?> -- cgit v1.2.3