aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-19 04:20:53 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-19 04:20:53 +0000
commitd682de9e1865f1e273c02ce63ca4f55d3f46077b (patch)
tree69fab75402e4c7930e1883ba9b0bb7a8f92fcd1a
parent43532fd31404b685b8d337f7c653c52fd0b26860 (diff)
downloadelgg-d682de9e1865f1e273c02ce63ca4f55d3f46077b.tar.gz
elgg-d682de9e1865f1e273c02ce63ca4f55d3f46077b.tar.bz2
fixed forward url when deleting a bookmark
git-svn-id: http://code.elgg.org/elgg/trunk@8315 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--mod/bookmarks/actions/bookmarks/delete.php21
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);