aboutsummaryrefslogtreecommitdiff
path: root/views/default/annotation/generic_comment.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-06 01:48:53 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-06 01:48:53 +0000
commiteb306be905c9fd78600841070d0796bd99ae7f73 (patch)
tree4ad84690c3500dbcc9b7ca9feaddc0a2c9cd3f8c /views/default/annotation/generic_comment.php
parent835c5685e386216e016212f589cdef047b027ac4 (diff)
downloadelgg-eb306be905c9fd78600841070d0796bd99ae7f73.tar.gz
elgg-eb306be905c9fd78600841070d0796bd99ae7f73.tar.bz2
comments use the media view now
git-svn-id: http://code.elgg.org/elgg/trunk@7544 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/annotation/generic_comment.php')
-rw-r--r--views/default/annotation/generic_comment.php79
1 files changed, 28 insertions, 51 deletions
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 = "<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>";
+ }
+
+ $comment_text = elgg_view("output/longtext", array("value" => $comment->value));
+
+ $body = <<<HTML
+<p class="mbn">
+ $delete_button
+ $commenter_link
+ <span class="entity-subtext">
+ $friendlytime
+ </span>
+ $comment_text
+</p>
+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 = <<<HTML
-<span class="entity-subtext">$commenter_link $on <span class='entity-title'>$entity_link</span> ($friendlytime)</span>
+<span class="entity-subtext">
+ $commenter_link $on <span class='entity-title'>$entity_link</span> ($friendlytime)
+</span>
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);
-
-?>
-<a class="anchor_link" name="comment_<?php echo $vars['annotation']->id; ?>"></a>
-<div class="generic-comment clearfix">
- <div class="generic-comment-icon">
- <?php
- echo elgg_view("profile/icon", array(
- 'entity' => $owner,
- 'size' => 'tiny'
- ));
- ?>
- </div>
-
- <div class="generic-comment-details">
- <?php
- // if the user looking at the comment can edit, show the delete link
- if ($vars['annotation']->canEdit()) {
- ?>
- <span class="delete-button">
- <?php echo elgg_view("output/confirmlink",array(
- 'href' => "action/comments/delete?annotation_id=" . $vars['annotation']->id,
- 'text' => elgg_echo('delete'),
- 'confirm' => elgg_echo('deleteconfirm')
- ));
- ?>
- </span>
- <?php
- } //end of can edit if statement
- ?>
- <p class="generic-comment-owner">
- <a href="<?php echo $owner->getURL(); ?>"><?php echo $owner->name; ?></a>
- <span class="entity-subtext">
- <?php echo elgg_view_friendly_time($vars['annotation']->time_created); ?>
- </span>
- </p>
- <!-- output the actual comment -->
- <div class="generic-comment-body">
- <?php echo elgg_view("output/longtext",array("value" => $vars['annotation']->value)); ?>
- </div>
- </div>
-</div> \ No newline at end of file