aboutsummaryrefslogtreecommitdiff
path: root/views/default/annotation/generic_comment.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/annotation/generic_comment.php')
-rw-r--r--views/default/annotation/generic_comment.php54
1 files changed, 53 insertions, 1 deletions
diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php
index 26fd468b7..ac603e978 100644
--- a/views/default/annotation/generic_comment.php
+++ b/views/default/annotation/generic_comment.php
@@ -1,8 +1,60 @@
<?php
/**
- * Elgg generic comment
+ * Elgg generic comment view
+ *
+ * @uses $vars['annotation'] ElggAnnotation object
+ * @uses $vars['full_view'] Display fill view or brief view
*/
+if (!isset($vars['annotation'])) {
+ return true;
+}
+
+$full_view = elgg_get_array_value('full_view', $vars, true);
+
+$comment = $vars['annotation'];
+
+$entity = get_entity($comment->entity_guid);
+$commenter = get_user($comment->owner_guid);
+if (!$entity || !$commenter) {
+ return true;
+}
+
+
+$friendlytime = elgg_view_friendly_time($comment->time_created);
+
+$commenter_icon = elgg_view("profile/icon", array('entity' => $commenter, 'size' => 'tiny'));
+$commenter_link = "<a href=\"{$commenter->getURL()}\">$commenter->name</a>";
+
+$entity_title = $entity->title ? $entity->title : elgg_echo('untitled');
+$entity_link = "<a href=\"{$entity->getURL()}\">$entity_title</a>";
+
+if ($full_view) {
+
+} else {
+ // brief view
+
+ //@todo need link to actual comment!
+
+ $on = elgg_echo('on');
+
+ $body = <<<HTML
+<span class="entity-subtext">$commenter_link $on <span class='entity-title'>$entity_link</span> ($friendlytime)</span>
+HTML;
+
+ $params = array(
+ 'img' => $commenter_icon,
+ 'body' => $body,
+ );
+ echo elgg_view('layout_elements/media', $params);
+
+ // @todo remove this once the full view has been rewritten
+ return true;
+}
+
+
+// @todo - below needs to be rewritten like the brief view
+
$owner = get_user($vars['annotation']->owner_guid);
?>