aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/pages
diff options
context:
space:
mode:
Diffstat (limited to 'mod/bookmarks/pages')
-rw-r--r--mod/bookmarks/pages/add.php2
-rw-r--r--mod/bookmarks/pages/edit.php3
-rw-r--r--mod/bookmarks/pages/owner.php20
3 files changed, 15 insertions, 10 deletions
diff --git a/mod/bookmarks/pages/add.php b/mod/bookmarks/pages/add.php
index 77b9a0bd0..c748daca5 100644
--- a/mod/bookmarks/pages/add.php
+++ b/mod/bookmarks/pages/add.php
@@ -5,8 +5,6 @@
* @package Bookmarks
*/
-gatekeeper();
-
$bookmark_guid = get_input('guid');
$bookmark = get_entity($bookmark_guid);
$container_guid = (int) get_input('container_guid');
diff --git a/mod/bookmarks/pages/edit.php b/mod/bookmarks/pages/edit.php
index 1c74a592a..7b055e699 100644
--- a/mod/bookmarks/pages/edit.php
+++ b/mod/bookmarks/pages/edit.php
@@ -5,13 +5,12 @@
* @package ElggBookmarks
*/
-gatekeeper();
$bookmark_guid = get_input('guid');
$bookmark = get_entity($bookmark_guid);
$container_guid = (int) get_input('container_guid');
$container = get_entity($container_guid);
-if (!elgg_instanceof($bookmark, 'object', 'bookmarks')) {
+if (!elgg_instanceof($bookmark, 'object', 'bookmarks') || !$bookmark->canEdit()) {
register_error(elgg_echo('bookmarks:unknown_bookmark'));
forward(REFERRER);
}
diff --git a/mod/bookmarks/pages/owner.php b/mod/bookmarks/pages/owner.php
index 2216b593f..c11d6628e 100644
--- a/mod/bookmarks/pages/owner.php
+++ b/mod/bookmarks/pages/owner.php
@@ -5,11 +5,10 @@
* @package Bookmarks
*/
+$guid = get_input('guid');
+
+elgg_set_page_owner_guid($guid);
$page_owner = elgg_get_page_owner_entity();
-if (!$page_owner) {
- $page_owner = elgg_get_logged_in_user_guid();
- elgg_set_page_owner_guid($page_owner);
-}
elgg_push_breadcrumb($page_owner->name);
@@ -17,17 +16,26 @@ $offset = (int)get_input('offset', 0);
$content .= elgg_list_entities(array(
'type' => 'object',
'subtype' => 'bookmarks',
- 'owner_guid' => $page_owner->guid,
+ 'container_guid' => $page_owner->guid,
'limit' => 10,
'offset' => $offset,
'full_view' => false,
'view_toggle_type' => false
));
+if (!$content) {
+ $content = elgg_echo('bookmarks:none');
+}
+
$title = elgg_echo('bookmarks:owner', array($page_owner->name));
+$filter_context = '';
+if ($page_owner->getGUID() == elgg_get_logged_in_user_guid()) {
+ $filter_context = 'mine';
+}
+
$body = elgg_view_layout('content', array(
- 'filter_context' => 'mine',
+ 'filter_context' => $filter_context,
'content' => $content,
'title' => $title
));