diff options
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'); |