diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-30 16:59:43 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-30 16:59:43 +0000 |
commit | 3921f1eaa710f5b76d2ca222b0b16bef215b0f3a (patch) | |
tree | 5d42af1e55b53c40bf0400f0244ca06b12887cb2 | |
parent | 0b56fd406382b703833c673976c94dc5a87ab7e6 (diff) | |
download | elgg-3921f1eaa710f5b76d2ca222b0b16bef215b0f3a.tar.gz elgg-3921f1eaa710f5b76d2ca222b0b16bef215b0f3a.tar.bz2 |
AJAX improvements to picker
git-svn-id: https://code.elgg.org/elgg/trunk@1610 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | views/default/friends/collection.php | 2 | ||||
-rw-r--r-- | views/default/friends/collectiontabs.php | 21 | ||||
-rw-r--r-- | views/default/friends/picker.php | 2 |
3 files changed, 21 insertions, 4 deletions
diff --git a/views/default/friends/collection.php b/views/default/friends/collection.php index b4f015f16..0d6f2b059 100644 --- a/views/default/friends/collection.php +++ b/views/default/friends/collection.php @@ -38,7 +38,7 @@ if($friends = $vars['collection']->entities){
$members = $vars['collection']->members;
$content = elgg_view('friends/tablelist',array('entities' => $members));
- $content .= elgg_view('friends/collectiontabs');
+ $content .= elgg_view('friends/collectiontabs', array('members' => $members, 'friends' => $friends, 'collection' => $vars['collection']));
echo elgg_view('friends/picker',array('entities' => $friends, 'value' => $members, 'content' => $content));
}
diff --git a/views/default/friends/collectiontabs.php b/views/default/friends/collectiontabs.php index fabd9857b..1e417017f 100644 --- a/views/default/friends/collectiontabs.php +++ b/views/default/friends/collectiontabs.php @@ -1,10 +1,27 @@ <?php
+ global $friendspicker;
+ if (!isset($friendspicker)) $friendspicker = 0;
+
+ if (isset($vars['members'])) {
+ $members = implode(',',$vars['members']);
+ } else {
+ $members = "";
+ }
+
+ $friends = "";
+ if (isset($vars['friends'])) {
+ foreach($friends as $friend) {
+ if (!empty($friends)) $friends .= ",";
+ $friends .= $friend->getGUID();
+ }
+ }
+
?>
<div id="friendsPickerNavigationTabs">
<ul>
-<li class="selected"><a href="#">Collection members</a></li>
-<li><a href="#">Edit collection</a></li>
+<li class="selected"><a href='#' onclick='$("#friends_picker_placeholder<?php echo $friendspicker + 1; ?>").load("<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo $_SESSION['user']->username; ?>&type=list&members=<?php echo $members; ?>"); return false;'>Collection members</a></li>
+<li><a href="#" onclick='$("#friends_picker_placeholder<?php echo $friendspicker + 1; ?>").load("<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo $_SESSION['user']->username; ?>&type=picker&members=<?php echo $members; ?>&friends=<?php echo $friends; ?>"); return false;'>Edit collection</a></li>
</ul>
</div>
\ No newline at end of file diff --git a/views/default/friends/picker.php b/views/default/friends/picker.php index ca95c22bd..329264f13 100644 --- a/views/default/friends/picker.php +++ b/views/default/friends/picker.php @@ -74,7 +74,7 @@ ?>
- <div class="friends_picker_placeholder<?php echo $friendspicker; ?>">
+ <div id="friends_picker_placeholder<?php echo $friendspicker; ?>">
<?php
|