aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks
diff options
context:
space:
mode:
Diffstat (limited to 'mod/bookmarks')
-rw-r--r--mod/bookmarks/pages/add.php13
-rw-r--r--mod/bookmarks/pages/all.php6
-rw-r--r--mod/bookmarks/pages/edit.php6
-rw-r--r--mod/bookmarks/pages/friends.php2
-rw-r--r--mod/bookmarks/pages/owner.php3
-rw-r--r--mod/bookmarks/pages/view.php11
-rw-r--r--mod/bookmarks/start.php4
7 files changed, 8 insertions, 37 deletions
diff --git a/mod/bookmarks/pages/add.php b/mod/bookmarks/pages/add.php
index c748daca5..c7fd3cf79 100644
--- a/mod/bookmarks/pages/add.php
+++ b/mod/bookmarks/pages/add.php
@@ -5,18 +5,7 @@
* @package Bookmarks
*/
-$bookmark_guid = get_input('guid');
-$bookmark = get_entity($bookmark_guid);
-$container_guid = (int) get_input('container_guid');
-$container = get_entity($container_guid);
-
-// for groups.
-$page_owner = $container;
-if (elgg_instanceof($container, 'object')) {
- $page_owner = $container->getContainerEntity();
-}
-
-elgg_set_page_owner_guid($page_owner->getGUID());
+$page_owner = elgg_get_page_owner_entity();
$title = elgg_echo('bookmarks:add');
elgg_push_breadcrumb($title);
diff --git a/mod/bookmarks/pages/all.php b/mod/bookmarks/pages/all.php
index 5a01b6f34..f31464aca 100644
--- a/mod/bookmarks/pages/all.php
+++ b/mod/bookmarks/pages/all.php
@@ -5,11 +5,7 @@
* @package ElggBookmarks
*/
-$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_set_page_owner_guid(elgg_get_logged_in_user_guid());
$offset = (int)get_input('offset', 0);
$content .= elgg_list_entities(array(
diff --git a/mod/bookmarks/pages/edit.php b/mod/bookmarks/pages/edit.php
index 7b055e699..24513a960 100644
--- a/mod/bookmarks/pages/edit.php
+++ b/mod/bookmarks/pages/edit.php
@@ -7,17 +7,13 @@
$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') || !$bookmark->canEdit()) {
register_error(elgg_echo('bookmarks:unknown_bookmark'));
forward(REFERRER);
}
-// for groups.
-$container = $bookmark->getContainerEntity();
-elgg_set_page_owner_guid($container->getGUID());
+$page_owner = elgg_get_page_owner_entity();
$title = elgg_echo('bookmarks:edit');
elgg_push_breadcrumb($title);
diff --git a/mod/bookmarks/pages/friends.php b/mod/bookmarks/pages/friends.php
index 3c55317eb..dedeeb5e9 100644
--- a/mod/bookmarks/pages/friends.php
+++ b/mod/bookmarks/pages/friends.php
@@ -4,9 +4,7 @@
*
* @package ElggBookmarks
*/
-$guid = get_input('guid');
-elgg_set_page_owner_guid($guid);
$owner = elgg_get_page_owner_entity();
elgg_push_breadcrumb($owner->name, "pg/bookmarks/owner/$owner->username");
diff --git a/mod/bookmarks/pages/owner.php b/mod/bookmarks/pages/owner.php
index 72843f9f0..d1564f751 100644
--- a/mod/bookmarks/pages/owner.php
+++ b/mod/bookmarks/pages/owner.php
@@ -5,9 +5,6 @@
* @package Bookmarks
*/
-$guid = get_input('guid');
-
-elgg_set_page_owner_guid($guid);
$page_owner = elgg_get_page_owner_entity();
elgg_push_breadcrumb($page_owner->name);
diff --git a/mod/bookmarks/pages/view.php b/mod/bookmarks/pages/view.php
index 131a0b52b..b5a857857 100644
--- a/mod/bookmarks/pages/view.php
+++ b/mod/bookmarks/pages/view.php
@@ -7,15 +7,14 @@
$bookmark = get_entity(get_input('guid'));
-elgg_set_page_owner_guid($bookmark->getContainerGUID());
-$owner = elgg_get_page_owner_entity();
+$page_owner = elgg_get_page_owner_entity();
-$crumbs_title = $owner->name;
+$crumbs_title = $page_owner->name;
-if (elgg_instanceof($owner, 'group')) {
- elgg_push_breadcrumb($crumbs_title, "pg/bookmarks/group/$owner->guid/owner");
+if (elgg_instanceof($page_owner, 'group')) {
+ elgg_push_breadcrumb($crumbs_title, "pg/bookmarks/group/$page_owner->guid/owner");
} else {
- elgg_push_breadcrumb($crumbs_title, "pg/bookmarks/owner/$owner->username");
+ elgg_push_breadcrumb($crumbs_title, "pg/bookmarks/owner/$page_owner->username");
}
$title = $bookmark->title;
diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php
index 31c414741..3585999b3 100644
--- a/mod/bookmarks/start.php
+++ b/mod/bookmarks/start.php
@@ -104,12 +104,10 @@ function bookmarks_page_handler($page) {
break;
case "owner":
- set_input('username', $page[1]);
include "$pages/owner.php";
break;
case "friends":
- set_input('username', $page[1]);
include "$pages/friends.php";
break;
@@ -121,7 +119,6 @@ function bookmarks_page_handler($page) {
case "add":
gatekeeper();
- set_input('container_guid', $page[1]);
include "$pages/add.php";
break;
@@ -133,7 +130,6 @@ function bookmarks_page_handler($page) {
case 'group':
group_gatekeeper();
- set_input('guid', $page[1]);
include "$pages/owner.php";
break;