aboutsummaryrefslogtreecommitdiff
path: root/mod/pages/actions
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2013-04-19 20:28:51 -0400
committercash <cash.costello@gmail.com>2013-04-19 20:28:51 -0400
commit863d45bb76d5bce2dabe32acc6f7d1f5400d568d (patch)
treebe52131c535c5b84897b79f49dfce59041450995 /mod/pages/actions
parentaa409144fcac454c8f6e2566606e0fb206d933d7 (diff)
parent7b002adf2fd383e6a0e7e4b93890720d99750282 (diff)
downloadelgg-863d45bb76d5bce2dabe32acc6f7d1f5400d568d.tar.gz
elgg-863d45bb76d5bce2dabe32acc6f7d1f5400d568d.tar.bz2
Merge pull request #5325 into 1.8 branch
Diffstat (limited to 'mod/pages/actions')
-rw-r--r--mod/pages/actions/annotations/page/delete.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/mod/pages/actions/annotations/page/delete.php b/mod/pages/actions/annotations/page/delete.php
new file mode 100644
index 000000000..156b516d2
--- /dev/null
+++ b/mod/pages/actions/annotations/page/delete.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Remove a page (revision) annotation
+ *
+ * @package ElggPages
+ */
+
+// Make sure we can get the annotations and entity in question
+$annotation_id = (int) get_input('annotation_id');
+$annotation = elgg_get_annotation_from_id($annotation_id);
+$entity = get_entity($annotation->entity_guid);
+
+if ($annotation && $entity->canEdit() && $annotation->canEdit()) {
+ $annotation->delete();
+ system_message(elgg_echo("pages:revision:delete:success"));
+} else {
+ register_error(elgg_echo("pages:revision:delete:failure"));
+}
+
+forward("pages/history/{$annotation->entity_guid}"); \ No newline at end of file