diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-25 22:18:16 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-25 22:18:16 +0000 |
commit | a201a5bba863a6d0dfa3b68d73a227cfcc7f66b6 (patch) | |
tree | af382c4f81d43b63c4afe60ace1824c298390d47 /mod/blog/start.php | |
parent | 58bd19d7cf35e6159124716d0da48d91354d3a2f (diff) | |
download | elgg-a201a5bba863a6d0dfa3b68d73a227cfcc7f66b6.tar.gz elgg-a201a5bba863a6d0dfa3b68d73a227cfcc7f66b6.tar.bz2 |
updated owner blocks for users and groups
git-svn-id: http://code.elgg.org/elgg/trunk@7721 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/blog/start.php')
-rw-r--r-- | mod/blog/start.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/mod/blog/start.php b/mod/blog/start.php index 8dc3737f8..f3cd31770 100644 --- a/mod/blog/start.php +++ b/mod/blog/start.php @@ -38,7 +38,7 @@ function blog_init() { register_notification_object('object', 'blog', elgg_echo('blog:newpost')); elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'blog_notify_message'); - elgg_register_plugin_hook_handler('register', 'menu:user_ownerblock', 'blog_user_ownerblock_menu'); + elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'blog_owner_block_menu'); // pingbacks //elgg_register_event_handler('create', 'object', 'blog_incoming_ping'); @@ -223,11 +223,20 @@ function blog_url_handler($entity) { } /** - * Add a menu item to the user ownerblock + * Add a menu item to an ownerblock */ -function blog_user_ownerblock_menu($hook, $type, $return, $params) { - $item = new ElggMenuItem('blog', elgg_echo('blog'), "pg/blog/owner/{$params['user']->username}"); - elgg_register_menu_item('user_ownerblock', $item); +function blog_owner_block_menu($hook, $type, $return, $params) { + if (elgg_instanceof($params['entity'], 'user')) { + $url = "pg/blog/owner/{$params['entity']->username}"; + $item = new ElggMenuItem('blog', elgg_echo('blog'), $url); + elgg_register_menu_item('owner_block', $item); + } else { + if ($params['entity']->blog_enable != "no") { + $url = "pg/blog/group/{$params['entity']->guid}/owner"; + $item = new ElggMenuItem('blog', elgg_echo('blog:group'), $url); + elgg_register_menu_item('owner_block', $item); + } + } } /** |