diff options
author | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-21 21:53:49 +0000 |
---|---|---|
committer | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-21 21:53:49 +0000 |
commit | 33d589650db886fa580aa5bd47672a71bb4fc4c0 (patch) | |
tree | e60b2121cd9f93fe58fd83eb8f452b7a87cd5c5c /mod/bookmarks | |
parent | d67eacb232fdb8c9c68deb35c0dad3007c877718 (diff) | |
download | elgg-33d589650db886fa580aa5bd47672a71bb4fc4c0.tar.gz elgg-33d589650db886fa580aa5bd47672a71bb4fc4c0.tar.bz2 |
Registering new plugin hooks to extend the owner block profile menu.
git-svn-id: http://code.elgg.org/elgg/trunk@6130 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/bookmarks')
-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'); |