aboutsummaryrefslogtreecommitdiff
path: root/views/default/layout/elements/comments.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/layout/elements/comments.php')
-rw-r--r--views/default/layout/elements/comments.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/views/default/layout/elements/comments.php b/views/default/layout/elements/comments.php
new file mode 100644
index 000000000..6dbe51483
--- /dev/null
+++ b/views/default/layout/elements/comments.php
@@ -0,0 +1,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>';