From 5103c706857719615102eda7cfd823b0723a1476 Mon Sep 17 00:00:00 2001 From: Jeff Tilson Date: Fri, 5 Apr 2013 13:35:13 -0400 Subject: Allow pages revisions to be reverted or deleted --- mod/pages/actions/annotations/page/delete.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 mod/pages/actions/annotations/page/delete.php (limited to 'mod/pages/actions/annotations/page/delete.php') diff --git a/mod/pages/actions/annotations/page/delete.php b/mod/pages/actions/annotations/page/delete.php new file mode 100644 index 000000000..792b7c0bc --- /dev/null +++ b/mod/pages/actions/annotations/page/delete.php @@ -0,0 +1,25 @@ +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 -- cgit v1.2.3 From 7b002adf2fd383e6a0e7e4b93890720d99750282 Mon Sep 17 00:00:00 2001 From: Jeff Tilson Date: Tue, 9 Apr 2013 11:19:49 -0400 Subject: Removing redundant logged in user check from pages annotation delete action (also from the comments delete core action) --- actions/comments/delete.php | 5 ----- mod/pages/actions/annotations/page/delete.php | 5 ----- 2 files changed, 10 deletions(-) (limited to 'mod/pages/actions/annotations/page/delete.php') diff --git a/actions/comments/delete.php b/actions/comments/delete.php index f2c058ff4..c6b481da4 100644 --- a/actions/comments/delete.php +++ b/actions/comments/delete.php @@ -5,11 +5,6 @@ * @package Elgg */ -// Ensure we're logged in -if (!elgg_is_logged_in()) { - forward(); -} - // Make sure we can get the comment in question $annotation_id = (int) get_input('annotation_id'); $comment = elgg_get_annotation_from_id($annotation_id); diff --git a/mod/pages/actions/annotations/page/delete.php b/mod/pages/actions/annotations/page/delete.php index 792b7c0bc..156b516d2 100644 --- a/mod/pages/actions/annotations/page/delete.php +++ b/mod/pages/actions/annotations/page/delete.php @@ -5,11 +5,6 @@ * @package ElggPages */ -// Ensure we're logged in -if (!elgg_is_logged_in()) { - forward(); -} - // 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); -- cgit v1.2.3