diff options
Diffstat (limited to 'mod/groups/views/default/discussion')
-rw-r--r-- | mod/groups/views/default/discussion/closed.php | 6 | ||||
-rw-r--r-- | mod/groups/views/default/discussion/group_module.php | 48 | ||||
-rw-r--r-- | mod/groups/views/default/discussion/replies.php | 28 |
3 files changed, 82 insertions, 0 deletions
diff --git a/mod/groups/views/default/discussion/closed.php b/mod/groups/views/default/discussion/closed.php new file mode 100644 index 000000000..78bca108b --- /dev/null +++ b/mod/groups/views/default/discussion/closed.php @@ -0,0 +1,6 @@ +<?php +/** + * Topic is closed + */ +echo "<h3>" . elgg_echo("groups:topicisclosed") . "</h3>"; +echo "<p>" . elgg_echo("groups:topiccloseddesc") . "</p>";
\ No newline at end of file diff --git a/mod/groups/views/default/discussion/group_module.php b/mod/groups/views/default/discussion/group_module.php new file mode 100644 index 000000000..e0bcd55d6 --- /dev/null +++ b/mod/groups/views/default/discussion/group_module.php @@ -0,0 +1,48 @@ +<?php +/** + * Latest forum posts + * + * @uses $vars['entity'] + */ + +if ($vars['entity']->forum_enable == 'no') { + return true; +} + +$group = $vars['entity']; + + +$all_link = elgg_view('output/url', array( + 'href' => "discussion/owner/$group->guid", + 'text' => elgg_echo('link:view:all'), + 'is_trusted' => true, +)); + +elgg_push_context('widgets'); +$options = array( + 'type' => 'object', + 'subtype' => 'groupforumtopic', + 'container_guid' => $group->getGUID(), + 'limit' => 6, + 'full_view' => false, + 'pagination' => false, +); +$content = elgg_list_entities($options); +elgg_pop_context(); + +if (!$content) { + $content = '<p>' . elgg_echo('discussion:none') . '</p>'; +} + +$new_link = elgg_view('output/url', array( + 'href' => "discussion/add/" . $group->getGUID(), + 'text' => elgg_echo('groups:addtopic'), + 'is_trusted' => true, +)); + +echo elgg_view('groups/profile/module', array( + 'title' => elgg_echo('discussion:group'), + 'content' => $content, + 'all_link' => $all_link, + 'add_link' => $new_link, +));
\ No newline at end of file diff --git a/mod/groups/views/default/discussion/replies.php b/mod/groups/views/default/discussion/replies.php new file mode 100644 index 000000000..2bfb6f0cd --- /dev/null +++ b/mod/groups/views/default/discussion/replies.php @@ -0,0 +1,28 @@ +<?php +/** + * List replies with optional add form + * + * @uses $vars['entity'] ElggEntity + * @uses $vars['show_add_form'] Display add form or not + */ + +$show_add_form = elgg_extract('show_add_form', $vars, true); + +echo '<div id="group-replies" class="mtl">'; + +$options = array( + 'guid' => $vars['entity']->getGUID(), + 'annotation_name' => 'group_topic_post', +); +$html = elgg_list_annotations($options); +if ($html) { + echo '<h3>' . elgg_echo('group:replies') . '</h3>'; + echo $html; +} + +if ($show_add_form) { + $form_vars = array('class' => 'mtm'); + echo elgg_view_form('discussion/reply/save', $form_vars, $vars); +} + +echo '</div>'; |