aboutsummaryrefslogtreecommitdiff
path: root/mod/likes
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-12 21:32:19 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-12 21:32:19 +0000
commitc57e5a3ac701e4f33f205f23b30ad872b67c7656 (patch)
tree8428321eb08d7f0fb4293483e816af1e212309db /mod/likes
parentba88a1c96ab89b4afcc574e3fc8a71df640a9fd8 (diff)
downloadelgg-c57e5a3ac701e4f33f205f23b30ad872b67c7656.tar.gz
elgg-c57e5a3ac701e4f33f205f23b30ad872b67c7656.tar.bz2
Fixes #3521 removed unecessary anchor tags - thanks to blacktooth
git-svn-id: http://code.elgg.org/elgg/trunk@9193 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/likes')
-rw-r--r--mod/likes/start.php37
1 files changed, 9 insertions, 28 deletions
diff --git a/mod/likes/start.php b/mod/likes/start.php
index 638f2028c..b2aa83260 100644
--- a/mod/likes/start.php
+++ b/mod/likes/start.php
@@ -1,7 +1,7 @@
<?php
/**
* Likes plugin
- *
+ *
*/
elgg_register_event_handler('init', 'system', 'likes_init');
@@ -50,32 +50,13 @@ function likes_river_menu_setup($hook, $type, $return, $params) {
$object = $item->getObjectEntity();
if (!elgg_in_context('widgets') && $item->annotation_id == 0) {
if ($object->canAnnotate(0, 'likes')) {
- if (!elgg_annotation_exists($object->getGUID(), 'likes')) {
- // user has not liked this yet
- $url = "action/likes/add?guid={$object->getGUID()}";
- $options = array(
- 'name' => 'likes',
- 'href' => $url,
- 'text' => elgg_view('likes/display', array('entity' => $object)),
- 'is_action' => true,
- 'priority' => 100,
- );
- } else {
- // user has liked this
- $likes = elgg_get_annotations(array(
- 'guid' => $object->getGUID(),
- 'annotation_name' => 'likes',
- 'annotation_owner_guid' => elgg_get_logged_in_user_guid()
- ));
- $url = elgg_get_site_url() . "action/likes/delete?annotation_id={$likes[0]->id}";
- $options = array(
- 'name' => 'likes',
- 'href' => $url,
- 'text' => elgg_view('likes/display', array('entity' => $object)),
- 'is_action' => true,
- 'priority' => 100,
- );
- }
+ $options = array(
+ 'name' => 'likes',
+ 'href' => false,
+ 'text' => elgg_view('likes/display', array('entity' => $object)),
+ 'is_action' => true,
+ 'priority' => 100,
+ );
$return[] = ElggMenuItem::factory($options);
}
}
@@ -87,7 +68,7 @@ function likes_river_menu_setup($hook, $type, $return, $params) {
/**
* Count how many people have liked an entity.
*
- * @param ElggEntity $entity
+ * @param ElggEntity $entity
*
* @return int Number of likes
*/