diff options
Diffstat (limited to 'mod/bookmarks/start.php')
-rw-r--r-- | mod/bookmarks/start.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index 205069197..ef8a4e011 100644 --- a/mod/bookmarks/start.php +++ b/mod/bookmarks/start.php @@ -45,6 +45,9 @@ 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'); } /** @@ -63,13 +66,6 @@ function bookmarks_pagesetup() { add_submenu_item(sprintf(elgg_echo("bookmarks:group"),$page_owner->name), $CONFIG->wwwroot . "pg/bookmarks/" . $page_owner->username . '/items'); } } - - if ($page_owner instanceof ElggEntity) { - elgg_add_submenu_item(array( - 'text' => elgg_echo('bookmarks'), - 'href' => "{$CONFIG->url}pg/bookmarks/{$page_owner->username}", - )); - } } } @@ -301,6 +297,17 @@ function create_wire_url_code(){ return $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; +} + // Make sure the initialisation function is called on initialisation register_elgg_event_handler('init','system','bookmarks_init'); register_elgg_event_handler('pagesetup','system','bookmarks_pagesetup'); |