diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-20 12:38:25 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-20 12:38:25 +0000 |
commit | 45809013256e8c5eb87fa90a6feee66ec632cb03 (patch) | |
tree | dcecf3c13dea698febc0d00c49ba90260abce79d /views/default/forms/likes | |
parent | 14a131e73eca92bb216ffad468a18c4a28ee35c2 (diff) | |
download | elgg-45809013256e8c5eb87fa90a6feee66ec632cb03.tar.gz elgg-45809013256e8c5eb87fa90a6feee66ec632cb03.tar.bz2 |
added elgg-icon-delete and elgg-icon-likes
git-svn-id: http://code.elgg.org/elgg/trunk@7698 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/forms/likes')
-rw-r--r-- | views/default/forms/likes/edit.php | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/views/default/forms/likes/edit.php b/views/default/forms/likes/edit.php index 33527b53a..93c4ce983 100644 --- a/views/default/forms/likes/edit.php +++ b/views/default/forms/likes/edit.php @@ -8,18 +8,25 @@ */ if (isset($vars['entity']) && isloggedin()) { - $guid = $vars['entity']->getGuid(); - $url = elgg_add_action_tokens_to_url(elgg_get_site_url() . "action/likes/add?guid={$guid}"); + $guid = $vars['entity']->getGUID(); + $url = elgg_get_site_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 "<a class='user-like link' title='".elgg_echo('likes:likethis')."' href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a>"; - $likes_classname = "not-liked"; + $params = array( + 'href' => $url, + 'text' => '<span class="elgg-icon elgg-icon-likes"></span>', + 'title' => elgg_echo('likes:likethis'), + 'is_action' => true, + ); + echo elgg_view('output/url', $params); + $likes_classname = 'elgg-icon-likes'; $likes_titletag = ""; } else { - $likes_titletag = "title='".elgg_echo('likes:remove')."'"; + $likes_classname = 'elgg-icon-liked'; + $likes_titletag = elgg_echo('likes:remove'); } + //display the number of likes $numoflikes = elgg_count_likes($vars['entity']); if ($numoflikes != 0) { @@ -29,14 +36,19 @@ if (isset($vars['entity']) && isloggedin()) { $user_string = elgg_echo('likes:userslikedthis'); } - echo "<a class='likes-list-button link {$likes_classname}' {$likes_titletag}>" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>"; + $params = array( + 'href' => $url, + 'text' => "<span class=\"elgg-icon $likes_classname\"></span>" . elgg_count_likes($vars['entity']) . " " . $user_string, + 'title' => $likes_titletag, + 'is_action' => true, + ); + echo elgg_view('output/url', $params); //show the users who liked the object echo "<div class='likes-list hidden clearfix'>"; echo list_annotations($vars['entity']->getGUID(), 'likes', 99); echo "</div>"; } - echo "</span>"; } |