aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/photos/image/untag.php24
1 files changed, 24 insertions, 0 deletions
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 @@
+<?php
+/**
+ * Remove photo tag action
+ */
+
+$annotation = get_annotation(get_input('annotation_id'));
+
+if (!$annotation instanceof ElggAnnotation || $annotation->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);