diff options
-rw-r--r-- | mod/bookmarks/actions/bookmarks/delete.php | 21 |
1 files changed, 14 insertions, 7 deletions
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); |