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/blog/start.php | |
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/blog/start.php')
-rw-r--r-- | mod/blog/start.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/mod/blog/start.php b/mod/blog/start.php index 20f51937f..9829f708c 100644 --- a/mod/blog/start.php +++ b/mod/blog/start.php @@ -61,6 +61,9 @@ function blog_init() { // ecml register_plugin_hook('get_views', 'ecml', 'blog_ecml_views_hook'); + + // Register profile menu hook + register_plugin_hook('profile_menu', 'profile', 'blog_profile_menu'); } /** @@ -193,13 +196,6 @@ function blog_page_setup() { add_submenu_item(elgg_echo('blog:groups:group_blogs'), $url); } } - - if ($page_owner instanceof ElggEntity) { - elgg_add_submenu_item(array( - 'text' => elgg_echo('blog'), - 'href' => "{$CONFIG->url}pg/blog/{$page_owner->username}/read", - )); - } } /** @@ -216,4 +212,15 @@ function blog_ecml_views_hook($hook, $entity_type, $return_value, $params) { return $return_value; } +function blog_profile_menu($hook, $entity_type, $return_value, $params) { + global $CONFIG; + + $return_value[] = array( + 'text' => elgg_echo('blog'), + 'href' => "{$CONFIG->url}pg/blog/{$params['owner']->username}/read", + ); + + return $return_value; +} + register_elgg_event_handler('init', 'system', 'blog_init'); |