aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2012-02-17 17:26:45 -0800
committerBrett Profitt <brett.profitt@gmail.com>2012-02-17 17:26:45 -0800
commitee6da62511660cf5849fea1a39a3e94c1f2867c7 (patch)
tree95f9803c1ae0888f0633b1a9dae7d94aa8cb695c /actions
parentb09db0ec2a35590cb13cda6ed053edc10e671035 (diff)
downloadelgg-ee6da62511660cf5849fea1a39a3e94c1f2867c7.tar.gz
elgg-ee6da62511660cf5849fea1a39a3e94c1f2867c7.tar.bz2
Fixes #15. Added untagging.
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);