aboutsummaryrefslogtreecommitdiff
path: root/views/default/annotation/likes.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-29 18:16:54 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-29 18:16:54 +0000
commit3c083f6c4ff4d354a546e03477e7a4acbb16d4a9 (patch)
tree961ad1135905070b95a51bc0c6bdbd948754b562 /views/default/annotation/likes.php
parent298114995174acf451cc1477fdeec34a42ef608b (diff)
downloadelgg-3c083f6c4ff4d354a546e03477e7a4acbb16d4a9.tar.gz
elgg-3c083f6c4ff4d354a546e03477e7a4acbb16d4a9.tar.bz2
rewrote the display of likes
git-svn-id: http://code.elgg.org/elgg/trunk@7748 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/annotation/likes.php')
-rw-r--r--views/default/annotation/likes.php76
1 files changed, 42 insertions, 34 deletions
diff --git a/views/default/annotation/likes.php b/views/default/annotation/likes.php
index 3fdf2349b..20965f456 100644
--- a/views/default/annotation/likes.php
+++ b/views/default/annotation/likes.php
@@ -1,40 +1,48 @@
<?php
/**
- * Elgg show the user who liked the object
+ * Elgg show the users who liked the object
+ *
+ * @uses $vars['annotation']
*/
-$owner = get_user($vars['annotation']->owner_guid);
+if (!isset($vars['annotation'])) {
+ return true;
+}
-?>
-<div class="elgg-likes-user clearfix">
- <div class="entity-listing-icon">
- <?php
- echo elgg_view("profile/icon", array(
- 'entity' => $owner,
- 'size' => 'tiny'
- ));
- ?>
- </div>
-
- <div class="entity-listing-info">
- <?php
- // if the user looking at the like listing can edit, show the delete link
- if ($vars['annotation']->canEdit()) {
- ?>
- <div class="entity-metadata"><span class="delete-button">
- <?php echo elgg_view("output/confirmlink",array(
- 'href' => "action/likes/delete?annotation_id=" . $vars['annotation']->id,
- 'text' => elgg_echo('remove'),
+$like = $vars['annotation'];
+
+$user = $like->getOwnerEntity();
+if (!$user) {
+ return true;
+}
+
+$user_icon = elgg_view("profile/icon", array('entity' => $user, 'size' => 'tiny'));
+$user_link = elgg_view('output/url', array(
+ 'href' => $user->getURL(),
+ 'text' => $user->name,
+));
+
+$likes_string = elgg_echo('likes:this');
+
+$friendlytime = elgg_view_friendly_time($like->time_created);
+
+if ($like->canEdit()) {
+ $delete_button = elgg_view("output/confirmlink",array(
+ 'href' => "action/likes/delete?annotation_id={$like->id}",
+ 'text' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm')
- ));
- ?>
- </span></div>
- <?php
- } //end of can edit if statement
- ?>
- <p class="elgg-likes-owner">
- <a href="<?php echo $owner->getURL(); ?>"><?php echo $owner->name; ?></a> <?php echo elgg_echo('likes:this') .
- " <span class=\"entity-subtext\">" . elgg_view_friendly_time($vars['annotation']->time_created) . "</span>"; ?>
- </p>
- </div>
-</div> \ No newline at end of file
+ ));
+ $delete_button = "<span class=\"delete-button\">$delete_button</span>";
+}
+
+$body = <<<HTML
+<p class="mbn">
+ $delete_button
+ $user_link $likes_string
+ <span class="elgg-list-subtitle">
+ $friendlytime
+ </span>
+</p>
+HTML;
+
+echo elgg_view_image_block($user_icon, $body);