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.php43
1 files changed, 20 insertions, 23 deletions
diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php
index 63633d3b5..22a8d9211 100644
--- a/views/default/annotation/generic_comment.php
+++ b/views/default/annotation/generic_comment.php
@@ -3,14 +3,14 @@
* Elgg generic comment view
*
* @uses $vars['annotation'] ElggAnnotation object
- * @uses $vars['full'] Display fill view or brief view
+ * @uses $vars['full_view'] Display fill view or brief view
*/
if (!isset($vars['annotation'])) {
return true;
}
-$full_view = elgg_get_array_value('full', $vars, true);
+$full_view = elgg_extract('full_view', $vars, true);
$comment = $vars['annotation'];
@@ -22,51 +22,48 @@ if (!$entity || !$commenter) {
$friendlytime = elgg_view_friendly_time($comment->time_created);
-$commenter_icon = elgg_view("profile/icon", array('entity' => $commenter, 'size' => 'tiny'));
+$commenter_icon = elgg_view_entity_icon($commenter, '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) {
-
- $delete_button = '';
- if ($comment->canEdit()) {
- $delete_button = elgg_view("output/confirmlink",array(
- 'href' => "action/comments/delete?annotation_id={$comment->id}",
- 'text' => elgg_echo('delete'),
- 'confirm' => elgg_echo('deleteconfirm')
- ));
- $delete_button = "<span class=\"delete-button\">$delete_button</span>";
- }
+ $menu = elgg_view_menu('annotation', array(
+ 'annotation' => $comment,
+ 'sort_by' => 'priority',
+ 'class' => 'elgg-menu-hz float-alt',
+ ));
$comment_text = elgg_view("output/longtext", array("value" => $comment->value));
$body = <<<HTML
-<p class="mbn">
- $delete_button
+<div class="mbn">
+ $menu
$commenter_link
- <span class="entity-subtext">
+ <span class="elgg-subtext">
$friendlytime
</span>
$comment_text
-</p>
+</div>
HTML;
- echo elgg_view_media($commenter_icon, $body, array('id' => "comment-$comment->id"));
+ echo elgg_view_image_block($commenter_icon, $body);
} else {
// brief view
//@todo need link to actual comment!
-
- $on = elgg_echo('on');
+
+ $commented_on = elgg_echo('generic_comment:on', array($commenter_link, $entity_link));
+
+ $excerpt = elgg_get_excerpt($comment->value, 80);
$body = <<<HTML
-<span class="entity-subtext">
- $commenter_link $on <span class='entity-title'>$entity_link</span> ($friendlytime)
+<span class="elgg-subtext">
+ $commented_on ($friendlytime): $excerpt
</span>
HTML;
- echo elgg_view_media($commenter_icon, $body);
+ echo elgg_view_image_block($commenter_icon, $body);
}