From bdb5d2b95792782ebc379e3348cad1812c1980b4 Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 9 Mar 2011 03:07:40 +0000 Subject: Fixes #3058 pulls likes out as a plugin git-svn-id: http://code.elgg.org/elgg/trunk@8639 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/core/likes/display.php | 67 ------------------------------------ 1 file changed, 67 deletions(-) delete mode 100644 views/default/core/likes/display.php (limited to 'views/default/core') diff --git a/views/default/core/likes/display.php b/views/default/core/likes/display.php deleted file mode 100644 index b04630e95..000000000 --- a/views/default/core/likes/display.php +++ /dev/null @@ -1,67 +0,0 @@ -getGUID(); - -// check to see if the user has already liked this -if (elgg_is_logged_in() && $vars['entity']->canAnnotate(0, 'likes')) { - if (!elgg_annotation_exists($guid, 'likes')) { - $url = elgg_get_site_url() . "action/likes/add?guid={$guid}"; - $params = array( - 'href' => $url, - 'text' => elgg_view_icon('likes'), - 'title' => elgg_echo('likes:likethis'), - 'is_action' => true, - ); - $likes_button = elgg_view('output/url', $params); - } else { - $options = array( - 'guid' => $guid, - 'annotation_name' => 'likes', - 'owner_guid' => elgg_get_logged_in_user_guid() - ); - $likes = elgg_get_annotations($options); - $url = elgg_get_site_url() . "action/likes/delete?annotation_id={$likes[0]->id}"; - $params = array( - 'href' => $url, - 'text' => elgg_view_icon('liked'), - 'title' => elgg_echo('likes:remove'), - 'is_action' => true, - ); - $likes_button = elgg_view('output/url', $params); - } -} - -$list = ''; -$num_of_likes = $vars['entity']->countLikes(); -if ($num_of_likes) { - // display the number of likes - if ($num_of_likes == 1) { - $likes_string = elgg_echo('likes:userlikedthis'); - } else { - $likes_string = elgg_echo('likes:userslikedthis'); - } - $params = array( - 'text' => "$num_of_likes $likes_string", - 'title' => elgg_echo('likes:see'), - 'class' => 'elgg-popup-rb-at-lt', - 'rel' => 'popup', - 'href' => "#$guid-likes" - ); - $list = elgg_view('output/url', $params); - $list .= ""; -} - -echo elgg_view_image_block($likes_button, $list); \ No newline at end of file -- cgit v1.2.3