aboutsummaryrefslogtreecommitdiff
path: root/views/default/layout/elements/comments.php
blob: 6dbe514833a371932cf2b032ff1cfc095592ebb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
/**
 * List comments with optional add form
 *
 * @uses $vars['entity']        ElggEntity
 * @uses $vars['show_add_form'] Display add form or not
 */

$show_add_form = elgg_get_array_value('show_add_form', $vars, true);

echo '<div class="elgg-comments">';

echo list_annotations($vars['entity']->getGUID(), 'generic_comment');

if ($show_add_form) {
	$form_vars = array('name' => 'elgg_add_comment');
	echo elgg_view_form('comments/add', $form_vars, $vars);
}

echo '</div>';