aboutsummaryrefslogtreecommitdiff
path: root/views/default/tasks/page/elements
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-17 12:00:58 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-17 12:00:58 -0300
commit228d3697bcd0218605be2e28131574cc85293a2e (patch)
tree6a59c627f6226bd2b3056b959acc9cc871eb1f8f /views/default/tasks/page/elements
downloadelgg-228d3697bcd0218605be2e28131574cc85293a2e.tar.gz
elgg-228d3697bcd0218605be2e28131574cc85293a2e.tar.bz2
Squashed 'mod/tasks/' content from commit c9b1097
git-subtree-dir: mod/tasks git-subtree-split: c9b1097ce081d6893f9c939146208559c089dc15
Diffstat (limited to 'views/default/tasks/page/elements')
-rw-r--r--views/default/tasks/page/elements/comments.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/views/default/tasks/page/elements/comments.php b/views/default/tasks/page/elements/comments.php
new file mode 100644
index 000000000..ef1737a63
--- /dev/null
+++ b/views/default/tasks/page/elements/comments.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * List comments with optional add form
+ *
+ * @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']}\"";
+}
+
+$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_names' => array('generic_comment', 'task_state_changed'),
+);
+$html = elgg_list_annotations($options);
+if ($html) {
+ echo '<h3>' . elgg_echo('tasks:changehistory') . '</h3>';
+ echo $html;
+}
+
+if ($show_add_form) {
+ $form_vars = array('name' => 'elgg_add_comment');
+ echo elgg_view_form('tasks/comments/add', $form_vars, $vars);
+}
+
+echo '</div>';