From d682de9e1865f1e273c02ce63ca4f55d3f46077b Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 19 Feb 2011 04:20:53 +0000 Subject: fixed forward url when deleting a bookmark git-svn-id: http://code.elgg.org/elgg/trunk@8315 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/bookmarks/actions/bookmarks/delete.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'mod') diff --git a/mod/bookmarks/actions/bookmarks/delete.php b/mod/bookmarks/actions/bookmarks/delete.php index d28d84660..ba89ec228 100644 --- a/mod/bookmarks/actions/bookmarks/delete.php +++ b/mod/bookmarks/actions/bookmarks/delete.php @@ -8,10 +8,17 @@ $guid = get_input('guid'); $bookmark = get_entity($guid); -if (elgg_instanceof($bookmark, 'object', 'bookmarks') && $bookmark->canEdit() && $bookmark->delete()) { - system_message(elgg_echo("bookmarks:delete:success")); - forward(REFERER); -} else { - register_error(elgg_echo("bookmarks:delete:failed")); - forward(REFERER); -} \ No newline at end of file +if (elgg_instanceof($bookmark, 'object', 'bookmarks') && $bookmark->canEdit()) { + $container = $bookmark->getContainerEntity(); + if ($bookmark->delete()) { + system_message(elgg_echo("bookmarks:delete:success")); + if (elgg_instanceof($container, 'group')) { + forward("pg/bookmarks/group/$container->guid/owner"); + } else { + forward("pg/bookmarks/owner/$container->username/"); + } + } +} + +register_error(elgg_echo("bookmarks:delete:failed")); +forward(REFERER); -- cgit v1.2.3