From eb306be905c9fd78600841070d0796bd99ae7f73 Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 6 Dec 2010 01:48:53 +0000 Subject: comments use the media view now git-svn-id: http://code.elgg.org/elgg/trunk@7544 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/annotation/generic_comment.php | 79 ++++++++++------------------ views/default/annotation/list.php | 46 ++++++++++++++++ 2 files changed, 74 insertions(+), 51 deletions(-) create mode 100644 views/default/annotation/list.php (limited to 'views/default/annotation') diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php index bb0127bfe..63633d3b5 100644 --- a/views/default/annotation/generic_comment.php +++ b/views/default/annotation/generic_comment.php @@ -20,7 +20,6 @@ if (!$entity || !$commenter) { return true; } - $friendlytime = elgg_view_friendly_time($comment->time_created); $commenter_icon = elgg_view("profile/icon", array('entity' => $commenter, 'size' => 'tiny')); @@ -31,6 +30,31 @@ $entity_link = "getURL()}\">$entity_title"; 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 = "$delete_button"; + } + + $comment_text = elgg_view("output/longtext", array("value" => $comment->value)); + + $body = << + $delete_button + $commenter_link + + $friendlytime + + $comment_text +

+HTML; + + echo elgg_view_media($commenter_icon, $body, array('id' => "comment-$comment->id")); + } else { // brief view @@ -39,57 +63,10 @@ if ($full_view) { $on = elgg_echo('on'); $body = <<$commenter_link $on $entity_link ($friendlytime) + + $commenter_link $on $entity_link ($friendlytime) + HTML; echo elgg_view_media($commenter_icon, $body); - - // @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); - -?> - -
-
- $owner, - 'size' => 'tiny' - )); - ?> -
- -
- canEdit()) { - ?> - - "action/comments/delete?annotation_id=" . $vars['annotation']->id, - 'text' => elgg_echo('delete'), - 'confirm' => elgg_echo('deleteconfirm') - )); - ?> - - -

- name; ?> - - time_created); ?> - -

- -
- $vars['annotation']->value)); ?> -
-
-
\ No newline at end of file diff --git a/views/default/annotation/list.php b/views/default/annotation/list.php new file mode 100644 index 000000000..f432ad640 --- /dev/null +++ b/views/default/annotation/list.php @@ -0,0 +1,46 @@ + $_SERVER['REQUEST_URI'], + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + 'word' => 'annoff', + 'nonefound' => false, + )); +} + +if (is_array($annotations) && count($annotations) > 0) { + $html .= ''; +} + +if ($count) { + $html .= $nav; +} + +echo $html; -- cgit v1.2.3