diff options
author | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-07 14:10:51 +0000 |
---|---|---|
committer | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-07 14:10:51 +0000 |
commit | 538a22b85384008533aeef2ac356ff668766e0cb (patch) | |
tree | 0070a18c9d09241a15df94fcbeeeda16feed4138 /views/default/likes/forms | |
parent | 90cb880ec6b629376df97c89bc4a0b3e2db32c8e (diff) | |
download | elgg-538a22b85384008533aeef2ac356ff668766e0cb.tar.gz elgg-538a22b85384008533aeef2ac356ff668766e0cb.tar.bz2 |
Riverdashboard refreshed, and updated display of comments and likes (the loading of these needs to be moved to ajax callbacks)
git-svn-id: http://code.elgg.org/elgg/trunk@5643 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/likes/forms')
-rw-r--r-- | views/default/likes/forms/display.php | 25 | ||||
-rw-r--r-- | views/default/likes/forms/edit.php | 13 | ||||
-rw-r--r-- | views/default/likes/forms/link.php | 19 |
3 files changed, 51 insertions, 6 deletions
diff --git a/views/default/likes/forms/display.php b/views/default/likes/forms/display.php new file mode 100644 index 000000000..f8fc661fd --- /dev/null +++ b/views/default/likes/forms/display.php @@ -0,0 +1,25 @@ +<?php +/** + * Elgg likes - display users liked link/text + * + * @package Elgg + * @author Curverider Ltd <info@elgg.com> + * @link http://elgg.com/ + * + * @uses $vars['entity'] + */ + +if (isset($vars['entity']) && isloggedin()) { + + //display the number of likes + $numoflikes = elgg_count_likes($vars['entity']); + if ($numoflikes != 0) { + if ($numoflikes == 1) { + $user_string = elgg_echo('likes:userlikedthis'); + } else { + $user_string = elgg_echo('likes:userslikedthis'); + } + + echo "<a class='river_more_comments off likes_user_list_button link'>" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>"; + } +}
\ No newline at end of file diff --git a/views/default/likes/forms/edit.php b/views/default/likes/forms/edit.php index 97497eca5..be019d749 100644 --- a/views/default/likes/forms/edit.php +++ b/views/default/likes/forms/edit.php @@ -13,8 +13,8 @@ if (isset($vars['entity']) && isloggedin()) { $guid = $vars['entity']->getGuid(); $url = elgg_add_action_tokens_to_url($vars['url'] . "action/likes/add?guid={$guid}"); //check to see if the user has already liked - if (!elgg_annotation_exists($guid, 'likes')) { - echo "<a href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a><br />"; + if (!elgg_annotation_exists($guid, 'likes') ) { + echo "<a class='user_like link' href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a>"; } //display the number of likes $numoflikes = elgg_count_likes($vars['entity']); @@ -26,9 +26,10 @@ if (isset($vars['entity']) && isloggedin()) { } echo "<a class='likes_list_button link'>" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>"; + + //show the users who liked the object + echo "<div class='likes_list hidden'>"; + echo list_annotations($vars['entity']->getGUID(), 'likes', 99); + echo "</div>"; } - //show the users who liked the object - echo "<div class='likes_list hidden'>"; - echo list_annotations($vars['entity']->getGUID(), 'likes', 99); - echo "</div>"; }
\ No newline at end of file diff --git a/views/default/likes/forms/link.php b/views/default/likes/forms/link.php new file mode 100644 index 000000000..6f5d41829 --- /dev/null +++ b/views/default/likes/forms/link.php @@ -0,0 +1,19 @@ +<?php +/** + * Elgg likes link form - used on riverdashboard where we want the likes link separate from the list of users that liked the object + * + * @package Elgg + * @author Curverider Ltd <info@elgg.com> + * @link http://elgg.com/ + * + * @uses $vars['entity'] + */ + +if (isset($vars['entity']) && isloggedin()) { + $guid = $vars['entity']->getGuid(); + $url = elgg_add_action_tokens_to_url($vars['url'] . "action/likes/add?guid={$guid}"); + //check to see if the user has already liked + if (!elgg_annotation_exists($guid, 'likes') ) { + echo "<span class='river_link_divider'> | </span><a class='river_user_like_button link' href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a>"; + } +}
\ No newline at end of file |