replies.php 688 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * List replies with optional add form
  4. *
  5. * @uses $vars['entity'] ElggEntity the group discission
  6. * @uses $vars['show_add_form'] Display add form or not
  7. */
  8. $show_add_form = elgg_extract('show_add_form', $vars, true);
  9. echo '<div id="group-replies" class="elgg-comments">';
  10. $replies = elgg_list_entities(array(
  11. 'type' => 'object',
  12. 'subtype' => 'discussion_reply',
  13. 'container_guid' => $vars['topic']->getGUID(),
  14. 'reverse_order_by' => true,
  15. 'distinct' => false,
  16. 'url_fragment' => 'group-replies',
  17. ));
  18. echo $replies;
  19. if ($show_add_form) {
  20. $form_vars = array('class' => 'mtm');
  21. echo elgg_view_form('discussion/reply/save', $form_vars, $vars);
  22. }
  23. echo '</div>';