From 02a52af62e1579ad174b1160071b82ec11ee31e3 Mon Sep 17 00:00:00 2001 From: brettp Date: Sat, 19 Feb 2011 19:31:34 +0000 Subject: Refs #2916. More cleanup of the messageboard widget. git-svn-id: http://code.elgg.org/elgg/trunk@8344 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/messageboard/actions/delete.php | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'mod/messageboard/actions/delete.php') diff --git a/mod/messageboard/actions/delete.php b/mod/messageboard/actions/delete.php index 1cc20f285..a40329cb5 100644 --- a/mod/messageboard/actions/delete.php +++ b/mod/messageboard/actions/delete.php @@ -1,37 +1,18 @@ entity_guid); - - //check to make sure the current user can actually edit the message board - if ($message->canEdit()) { - //delete the comment - $message->delete(); - // delete river entry - remove_from_river_by_annotation($annotation_id); - //display message - system_message(elgg_echo("messageboard:deleted")); - //generate the url to forward to - $url = "pg/messageboard/" . $entity->username; - //forward the user back to their message board - forward($url); - } - +if ($message && $message->canEdit() && $message->delete()) { + remove_from_river_by_annotation($annotation_id); + system_message(elgg_echo("messageboard:deleted")); } else { - $url = ""; system_message(elgg_echo("messageboard:notdeleted")); } -forward($url); +forward(REFERER); -- cgit v1.2.3