diff options
Diffstat (limited to 'views/default/page/elements/comments.php')
| -rw-r--r-- | views/default/page/elements/comments.php | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/views/default/page/elements/comments.php b/views/default/page/elements/comments.php index c27a146ab..97cb9574e 100644 --- a/views/default/page/elements/comments.php +++ b/views/default/page/elements/comments.php @@ -5,26 +5,38 @@ * @uses $vars['entity'] ElggEntity * @uses $vars['show_add_form'] Display add form or not * @uses $vars['id'] Optional id for the div + * @uses $vars['class'] Optional additional class for the div */ $show_add_form = elgg_extract('show_add_form', $vars, true); $id = ''; if (isset($vars['id'])) { - $id = "id =\"{$vars['id']}\""; + $id = "id=\"{$vars['id']}\""; } -echo "<div $id class=\"elgg-comments\">"; +$class = 'elgg-comments'; +if (isset($vars['class'])) { + $class = "$class {$vars['class']}"; +} + +// work around for deprecation code in elgg_view() +unset($vars['internalid']); + +echo "<div $id class=\"$class\">"; $options = array( 'guid' => $vars['entity']->getGUID(), 'annotation_name' => 'generic_comment' ); -echo elgg_list_annotations($options); +$html = elgg_list_annotations($options); +if ($html) { + echo '<h3>' . elgg_echo('comments') . '</h3>'; + echo $html; +} if ($show_add_form) { - $form_vars = array('name' => 'elgg_add_comment'); - echo elgg_view_form('comments/add', $form_vars, $vars); + echo elgg_view_form('comments/add', array(), $vars); } echo '</div>'; |
