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.php34
1 files changed, 13 insertions, 21 deletions
diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php
index 04efc6388..22a8d9211 100644
--- a/views/default/annotation/generic_comment.php
+++ b/views/default/annotation/generic_comment.php
@@ -2,19 +2,15 @@
/**
* Elgg generic comment view
*
- * @uses $vars['annotation'] ElggAnnotation object
- * @uses $vars['full'] Display fill view or brief view
- * @uses $vars['delete_action'] A custom action for the delete button. Defaults to
- * action/comments/delete The annotation ID is passed
- * as 'annotation_id'.
+ * @uses $vars['annotation'] ElggAnnotation object
+ * @uses $vars['full_view'] Display fill view or brief view
*/
if (!isset($vars['annotation'])) {
return true;
}
-$full_view = elgg_extract('full', $vars, true);
-$delete_action = elgg_extract('delete_action', $vars, 'action/comments/delete');
+$full_view = elgg_extract('full_view', $vars, true);
$comment = $vars['annotation'];
@@ -33,23 +29,17 @@ $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()) {
- $url = elgg_http_add_url_query_elements($delete_action, array('annotation_id' => $comment->id));
- $delete_button = elgg_view("output/confirmlink", array(
- 'href' => $url,
- 'text' => elgg_echo('delete'),
- 'confirm' => elgg_echo('deleteconfirm')
- ));
- $delete_button = "<span class=\"elgg-button elgg-button-delete\">$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
<div class="mbn">
- $delete_button
+ $menu
$commenter_link
<span class="elgg-subtext">
$friendlytime
@@ -65,11 +55,13 @@ HTML;
//@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="elgg-subtext">
- $commenter_link $on $entity_link ($friendlytime)
+ $commented_on ($friendlytime): $excerpt
</span>
HTML;