diff options
Diffstat (limited to 'views/default/likes/forms/edit.php')
-rw-r--r-- | views/default/likes/forms/edit.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/views/default/likes/forms/edit.php b/views/default/likes/forms/edit.php index 1e9cbd02c..99dbe598b 100644 --- a/views/default/likes/forms/edit.php +++ b/views/default/likes/forms/edit.php @@ -12,9 +12,15 @@ if (isset($vars['entity']) && isloggedin()) { $guid = $vars['entity']->getGuid(); $url = elgg_add_action_tokens_to_url($vars['url'] . "action/likes/add?guid={$guid}"); + + echo "<span class='likes_list_holder'>"; //check to see if the user has already liked if (!elgg_annotation_exists($guid, 'likes') ) { - echo "<span class='user_like_holder'><a class='user_like link' href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a></span>"; + echo "<a class='user_like link' title='".elgg_echo('likes:likethis')."' href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a>"; + $likes_classname = "not_liked"; + $likes_titletag = ""; + } else { + $likes_titletag = "title='".elgg_echo('likes:remove')."'"; } //display the number of likes $numoflikes = elgg_count_likes($vars['entity']); @@ -25,13 +31,14 @@ if (isset($vars['entity']) && isloggedin()) { $user_string = elgg_echo('likes:userslikedthis'); } - echo "<span class='likes_list_holder'><a class='likes_list_button link'>+" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>"; + echo "<a class='likes_list_button link {$likes_classname}' {$likes_titletag}>" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>"; //show the users who liked the object echo "<div class='likes_list hidden clearfloat'>"; echo list_annotations($vars['entity']->getGUID(), 'likes', 99); - echo "</div></span>"; + echo "</div>"; } + echo "</span>"; } |