diff options
Diffstat (limited to 'views/default/annotation/likes.php')
-rw-r--r-- | views/default/annotation/likes.php | 76 |
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); |