diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-09 03:07:40 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-09 03:07:40 +0000 |
commit | bdb5d2b95792782ebc379e3348cad1812c1980b4 (patch) | |
tree | c923d740327b3aeb62a24246f3725ced8677a5f7 /mod/likes/views/default/annotation | |
parent | 9ea30ea494cea4c950894a0ac1131eefda10868b (diff) | |
download | elgg-bdb5d2b95792782ebc379e3348cad1812c1980b4.tar.gz elgg-bdb5d2b95792782ebc379e3348cad1812c1980b4.tar.bz2 |
Fixes #3058 pulls likes out as a plugin
git-svn-id: http://code.elgg.org/elgg/trunk@8639 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/likes/views/default/annotation')
-rw-r--r-- | mod/likes/views/default/annotation/likes.php | 48 |
1 files changed, 48 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..e1ae20818 --- /dev/null +++ b/mod/likes/views/default/annotation/likes.php @@ -0,0 +1,48 @@ +<?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, +)); + +$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' => "<span class=\"elgg-icon elgg-icon-delete right\"></span>", + 'confirm' => elgg_echo('deleteconfirm'), + 'text_encode' => 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); |