blob: 410a67bb766e979ada3a962dbb4593f029b6abb3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<?php
/**
* Delete a bookmark
*
* @package Bookmarks
*/
$guid = get_input('guid');
$bookmark = get_entity($guid);
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("bookmarks/group/$container->guid/owner");
} else {
forward("bookmarks/owner/$container->username");
}
}
}
register_error(elgg_echo("bookmarks:delete:failed"));
forward(REFERER);
|