diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-06 01:39:23 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-06 01:39:23 +0000 |
commit | 1d59e5fc4bcc10151831456436019aef90de2bd3 (patch) | |
tree | 096ab8fc2387d57b49a9c8bd65ac2581da068d7c /mod/groups/start.php | |
parent | 8ca2f72d09e99c372ea21a4fe4112da6c4a1312c (diff) | |
download | elgg-1d59e5fc4bcc10151831456436019aef90de2bd3.tar.gz elgg-1d59e5fc4bcc10151831456436019aef90de2bd3.tar.bz2 |
Refs #2679 can comment on discussion forums in river now
git-svn-id: http://code.elgg.org/elgg/trunk@8610 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/start.php')
-rw-r--r-- | mod/groups/start.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/mod/groups/start.php b/mod/groups/start.php index d83ff467e..08c0d1966 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -543,6 +543,9 @@ function discussion_init() { // Register for search. elgg_register_entity_type('object', 'groupforumtopic'); + // because replies are not comments, need of our menu item + elgg_register_plugin_hook_handler('register', 'menu:river', 'discussion_add_to_river_menu'); + // add the forum tool option add_group_tool_option('forum', elgg_echo('groups:enableforum'), true); elgg_extend_view('groups/tool_latest', 'discussion/group_module'); @@ -625,6 +628,33 @@ function discussion_owner_block_menu($hook, $type, $return, $params) { } /** + * Add the reply button for the river + */ +function discussion_add_to_river_menu($hook, $type, $return, $params) { + if (elgg_is_logged_in()) { + $item = $params['item']; + $object = $item->getObjectEntity(); + if (elgg_instanceof($object, 'object', 'groupforumtopic')) { + if ($item->annotation_id == 0) { + $group = $object->getContainerEntity(); + if ($group->isMember() || elgg_is_admin_logged_in()) { + $options = array( + 'name' => 'reply', + 'href' => "#groups-reply-$object->guid", + 'text' => elgg_echo('reply'), + 'class' => "elgg-toggler", + 'priority' => 50, + ); + $return[] = ElggMenuItem::factory($options); + } + } + } + } + + return $return; +} + +/** * Event handler for group forum posts * */ |