aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-09 03:07:40 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-09 03:07:40 +0000
commitbdb5d2b95792782ebc379e3348cad1812c1980b4 (patch)
treec923d740327b3aeb62a24246f3725ced8677a5f7 /views
parent9ea30ea494cea4c950894a0ac1131eefda10868b (diff)
downloadelgg-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 'views')
-rw-r--r--views/default/annotation/likes.php48
-rw-r--r--views/default/core/likes/display.php67
-rw-r--r--views/default/css/admin.php6
-rw-r--r--views/default/css/elements/components.php8
-rw-r--r--views/default/css/elements/icons.php6
-rw-r--r--views/default/css/ie.php4
-rw-r--r--views/default/river/annotation/likes/create.php23
7 files changed, 6 insertions, 156 deletions
diff --git a/views/default/annotation/likes.php b/views/default/annotation/likes.php
deleted file mode 100644
index e1ae20818..000000000
--- a/views/default/annotation/likes.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?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);
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 @@
-<?php
-/**
- * Elgg likes display
- *
- * @package Elgg
- *
- * @uses $vars['entity']
- */
-
-if (!isset($vars['entity'])) {
- return true;
-}
-
-$guid = $vars['entity']->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 .= "<div class='elgg-module elgg-module-popup elgg-likes-list hidden clearfix' id='$guid-likes'>";
- $list .= elgg_list_annotations(array('guid' => $guid, 'annotation_name' => 'likes', 'limit' => 99));
- $list .= "</div>";
-}
-
-echo elgg_view_image_block($likes_button, $list); \ No newline at end of file
diff --git a/views/default/css/admin.php b/views/default/css/admin.php
index 0da86967b..5d921021a 100644
--- a/views/default/css/admin.php
+++ b/views/default/css/admin.php
@@ -1169,15 +1169,15 @@ ul.admin_plugins {
.elgg-icon-delete:hover {
background-position: -199px -15px;
}
-.elgg-icon-likes {
+.elgg-icon-thumbs-up {
background-position: 0px -101px;
width: 20px;
height: 20px;
}
-.elgg-icon-likes:hover {
+.elgg-icon-thumbs-up:hover {
background-position: 0px -131px;
}
-.elgg-icon-liked {
+.elgg-icon-thumbs-up-alt {
background-position: 0px -131px;
width: 20px;
height: 20px;
diff --git a/views/default/css/elements/components.php b/views/default/css/elements/components.php
index 5818c4bf9..f44d1ce7d 100644
--- a/views/default/css/elements/components.php
+++ b/views/default/css/elements/components.php
@@ -252,14 +252,6 @@
}
/* ***************************************
- Likes
-*************************************** */
-.elgg-likes-list {
- width: 345px;
- position: absolute;
-}
-
-/* ***************************************
Tags
*************************************** */
.elgg-tags {
diff --git a/views/default/css/elements/icons.php b/views/default/css/elements/icons.php
index 68a38ed9a..64a1d78ca 100644
--- a/views/default/css/elements/icons.php
+++ b/views/default/css/elements/icons.php
@@ -38,15 +38,15 @@
.elgg-icon-delete:hover {
background-position: -199px -15px;
}
-.elgg-icon-likes {
+.elgg-icon-thumbs-up {
background-position: 0px -101px;
width: 20px;
height: 20px;
}
-.elgg-icon-likes:hover {
+.elgg-icon-thumbs-up:hover {
background-position: 0px -131px;
}
-.elgg-icon-liked {
+.elgg-icon-thumbs-up-alt {
background-position: 0px -131px;
width: 20px;
height: 20px;
diff --git a/views/default/css/ie.php b/views/default/css/ie.php
index 32e7a77aa..6760d3886 100644
--- a/views/default/css/ie.php
+++ b/views/default/css/ie.php
@@ -24,10 +24,6 @@
text-align: right;
}
-.likes-list {display:none;}
-.likes-list-holder .likes-list {top:20px !important;} /* position likes list below link in IE to prevent clipping */
-.elgg-likes-user .entity-metadata .elgg-button-delete {float:none;}
-
/* profile */
.elgg-tabs.profile .profile_name {margin-left: -260px;}
#profile_content .river_comment_form.hidden .input-text { width:510px; }
diff --git a/views/default/river/annotation/likes/create.php b/views/default/river/annotation/likes/create.php
deleted file mode 100644
index 374f4a381..000000000
--- a/views/default/river/annotation/likes/create.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-/**
- * Likes river view
- */
-$object = $vars['item']->getObjectEntity();
-$comment = $vars['item']->getAnnotation();
-
-$url = $object->getURL();
-$title = $object->title;
-if (!$title) {
- $title = elgg_echo('untitled');
-}
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $title,
-);
-$object_link = elgg_view('output/url', $params);
-
-$type = $object->getType();
-$subtype = $object->getSubtype();
-
-$type_string = elgg_echo("river:commented:$type:$subtype");
-echo elgg_echo('river:likes', array($type_string, $object_link));