aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-31 16:15:37 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-31 16:15:37 +0000
commitc08bca02bd982e0ad8255b4ba1836e10125a1783 (patch)
tree0171756953bf414b46553a712fc9719bc4526d11 /views/default
parent1ad49aaf2f1cb23a81909576437997fffa3951d2 (diff)
downloadelgg-c08bca02bd982e0ad8255b4ba1836e10125a1783.tar.gz
elgg-c08bca02bd982e0ad8255b4ba1836e10125a1783.tar.bz2
Counts now update when you save a friends collection
git-svn-id: https://code.elgg.org/elgg/trunk@1638 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default')
-rw-r--r--views/default/friends/collection.php6
-rw-r--r--views/default/friends/collectiontabs.php2
-rw-r--r--views/default/friends/tablelist.php2
-rw-r--r--views/default/friends/tablelistcountupdate.php22
4 files changed, 28 insertions, 4 deletions
diff --git a/views/default/friends/collection.php b/views/default/friends/collection.php
index 438d82e8c..09a684fac 100644
--- a/views/default/friends/collection.php
+++ b/views/default/friends/collection.php
@@ -17,8 +17,8 @@
*/
$coll = $vars['collection'];
-
- if (is_array($vars['collection']->entities)) {
+
+ if (is_array($vars['collection']->members)) {
$count = sizeof($vars['collection']->members);
} else {
$count = 0;
@@ -32,7 +32,7 @@
echo "</div>";
echo $coll->name;
- echo " ({$count}) </h2>";
+ echo " (<span id=\"friends_membership_count{$vars['friendspicker']}\">{$count}</span>) </h2>";
// individual collection panels
if($friends = $vars['collection']->entities){
diff --git a/views/default/friends/collectiontabs.php b/views/default/friends/collectiontabs.php
index cdeb6b798..61970af4a 100644
--- a/views/default/friends/collectiontabs.php
+++ b/views/default/friends/collectiontabs.php
@@ -21,7 +21,7 @@ $(document).ready(function () {
$('a.collectionmembers<?php echo $friendspicker; ?>').click(function () {
// load collection members pane
- $('#friends_picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo $_SESSION['user']->username; ?>&type=list&collection=<?php echo $collectionid; ?>');
+ $('#friends_picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo $_SESSION['user']->username; ?>&type=list&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
// remove selected state from previous tab
$(this).parent().parent().find("li.selected").removeClass("selected");
diff --git a/views/default/friends/tablelist.php b/views/default/friends/tablelist.php
index a5f791f46..c0c481e00 100644
--- a/views/default/friends/tablelist.php
+++ b/views/default/friends/tablelist.php
@@ -59,5 +59,7 @@
if ($column < 3 && $column != 0) echo "</tr>";
echo "</table>";
}
+
+ if (isset($vars['content'])) echo $vars['content'];
?> \ No newline at end of file
diff --git a/views/default/friends/tablelistcountupdate.php b/views/default/friends/tablelistcountupdate.php
new file mode 100644
index 000000000..64f793a07
--- /dev/null
+++ b/views/default/friends/tablelistcountupdate.php
@@ -0,0 +1,22 @@
+<?php
+
+ /**
+ * Elgg friends picker count updater
+ * Updates the friends count on a collection
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ * @uses $vars['count'] The count
+ * @uses $vars['friendspicker'] The friendspicker counter number
+ */
+
+?>
+
+<script language="text/javascript">
+ $("#friends_membership_count<?php echo $vars['friendspicker']; ?>").html("<?php echo $vars['count']; ?>");
+</script> \ No newline at end of file