aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/start.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-11 20:29:38 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-11 20:29:38 +0000
commitab4679de45c9608f9a87f90a1093ae3a2ae6559d (patch)
tree18b1e42fd58661a47d0c277cbb29f598b0f9010a /mod/bookmarks/start.php
parent77cd2c85d946eb6bc15612e6c415ca866ead2b8a (diff)
downloadelgg-ab4679de45c9608f9a87f90a1093ae3a2ae6559d.tar.gz
elgg-ab4679de45c9608f9a87f90a1093ae3a2ae6559d.tar.bz2
Small code cleanup on bookmarks.
Added better logic for determining the username to use when adding a bookmark via the bookmarklet. git-svn-id: http://code.elgg.org/elgg/trunk@6461 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/bookmarks/start.php')
-rw-r--r--mod/bookmarks/start.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php
index cab118063..7d05ae0d1 100644
--- a/mod/bookmarks/start.php
+++ b/mod/bookmarks/start.php
@@ -45,7 +45,7 @@ function bookmarks_init() {
// Extend Groups profile page
elgg_extend_view('groups/tool_latest','bookmarks/group_bookmarks');
-
+
// Register profile menu hook
register_plugin_hook('profile_menu', 'profile', 'bookmarks_profile_menu');
}
@@ -90,6 +90,8 @@ function bookmarks_page_handler($page) {
// grab the page owner here so the group magic works.
$owner = page_owner_entity();
+ } else {
+ set_page_owner(get_loggedin_userid());
}
// owner name passed but invalid.
@@ -110,7 +112,7 @@ function bookmarks_page_handler($page) {
if(page_owner() != 0){
elgg_push_breadcrumb(elgg_echo('bookmarks:all'), $CONFIG->wwwroot . 'pg/bookmarks/');
}
-
+
if ($owner) {
switch($section) {
case 'friends':
@@ -185,7 +187,7 @@ function bookmarks_page_handler($page) {
gatekeeper();
$content = elgg_view_title(elgg_echo('bookmarks:bookmarklet'));
- $content .= elgg_view('bookmarks/bookmarklet', array('pg_owner' => $owner));
+ $content .= elgg_view('bookmarks/bookmarklet');
break;
}
@@ -246,6 +248,7 @@ function bookmarks_page_handler($page) {
return TRUE;
}
+
/**
* Populates the ->getUrl() method for bookmarked objects
*
@@ -318,12 +321,12 @@ function create_wire_url_code(){
function bookmarks_profile_menu($hook, $entity_type, $return_value, $params) {
global $CONFIG;
-
+
$return_value[] = array(
'text' => elgg_echo('bookmarks'),
'href' => "{$CONFIG->url}pg/bookmarks/{$params['owner']->username}",
);
-
+
return $return_value;
}