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/bookmarks | |
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/bookmarks')
-rw-r--r-- | mod/bookmarks/languages/en.php | 2 | ||||
-rw-r--r-- | mod/bookmarks/start.php | 19 |
2 files changed, 15 insertions, 6 deletions
diff --git a/mod/bookmarks/languages/en.php b/mod/bookmarks/languages/en.php index 24a77a645..6e0ebc8f1 100644 --- a/mod/bookmarks/languages/en.php +++ b/mod/bookmarks/languages/en.php @@ -12,7 +12,7 @@ $english = array( 'bookmarks:friends' => "Friends' bookmarks", 'bookmarks:all' => "All site bookmarks", 'bookmarks:user' => "%s's bookmarks", - 'bookmarks:group' => "Bookmarks", + 'bookmarks:group' => "Group bookmarks", 'bookmarks:this' => "Bookmark this", 'bookmarks:ingroup' => "in the group", 'bookmarks:this:group' => "Bookmark in %s", diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index ee9d4be2d..062193517 100644 --- a/mod/bookmarks/start.php +++ b/mod/bookmarks/start.php @@ -40,7 +40,7 @@ function bookmarks_init() { // Add group menu option add_group_tool_option('bookmarks',elgg_echo('bookmarks:enablebookmarks'),true); - elgg_register_plugin_hook_handler('register', 'menu:user_ownerblock', 'bookmarks_user_ownerblock_menu'); + elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'bookmarks_owner_block_menu'); // Extend Groups profile page elgg_extend_view('groups/tool_latest','bookmarks/group_bookmarks'); @@ -315,11 +315,20 @@ function bookmark_url($entity) { } /** - * Add a menu item to the user ownerblock + * Add a menu item to an ownerblock */ -function bookmarks_user_ownerblock_menu($hook, $type, $return, $params) { - $item = new ElggMenuItem('bookmarks', elgg_echo('bookmarks'), "pg/bookmarks/owner/{$params['user']->username}"); - elgg_register_menu_item('user_ownerblock', $item); +function bookmarks_owner_block_menu($hook, $type, $return, $params) { + if (elgg_instanceof($params['entity'], 'user')) { + $url = "pg/bookmarks/owner/{$params['user']->username}"; + $item = new ElggMenuItem('bookmarks', elgg_echo('bookmarks'), $url); + elgg_register_menu_item('owner_block', $item); + } else { + if ($params['entity']->bookmarks_enable != "no") { + $url = "pg/bookmarks/owner/{$params['entity']->username}"; + $item = new ElggMenuItem('bookmarks', elgg_echo('bookmarks:group'), $url); + elgg_register_menu_item('owner_block', $item); + } + } } /** |