diff options
Diffstat (limited to 'mod/likes/views/default/annotation')
-rw-r--r-- | mod/likes/views/default/annotation/likes.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/mod/likes/views/default/annotation/likes.php b/mod/likes/views/default/annotation/likes.php new file mode 100644 index 000000000..2b5acc520 --- /dev/null +++ b/mod/likes/views/default/annotation/likes.php @@ -0,0 +1,49 @@ +<?php +/** + * Elgg show the users who liked the object + * + * @uses $vars['annotation'] + */ + +if (!isset($vars['annotation'])) { + return true; +} + +$like = $vars['annotation']; + +$user = $like->getOwnerEntity(); +if (!$user) { + return true; +} + +$user_icon = elgg_view_entity_icon($user, 'tiny'); +$user_link = elgg_view('output/url', array( + 'href' => $user->getURL(), + 'text' => $user->name, + 'is_trusted' => true, +)); + +$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?id={$like->id}", + 'text' => "<span class=\"elgg-icon elgg-icon-delete float-alt\"></span>", + 'confirm' => elgg_echo('likes:delete:confirm'), + 'encode_text' => false, + )); +} + +$body = <<<HTML +<p class="mbn"> + $delete_button + $user_link $likes_string + <span class="elgg-subtext"> + $friendlytime + </span> +</p> +HTML; + +echo elgg_view_image_block($user_icon, $body); |