aboutsummaryrefslogtreecommitdiff
path: root/views/default/friends
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/friends')
-rw-r--r--views/default/friends/collection.php114
-rw-r--r--views/default/friends/collections.php104
-rw-r--r--views/default/friends/collectiontabs.php96
-rw-r--r--views/default/friends/forms/collectionfields.php44
-rw-r--r--views/default/friends/forms/edit.php4
-rw-r--r--views/default/friends/list.php48
-rw-r--r--views/default/friends/picker.php652
-rw-r--r--views/default/friends/river/create.php36
-rw-r--r--views/default/friends/tablelistcountupdate.php38
9 files changed, 568 insertions, 568 deletions
diff --git a/views/default/friends/collection.php b/views/default/friends/collection.php
index 501283fc3..812623cb1 100644
--- a/views/default/friends/collection.php
+++ b/views/default/friends/collection.php
@@ -1,60 +1,60 @@
-<?php
-
- /**
- * Elgg friends collection
- * Lists one of a user's friends collections
- *
- * @package Elgg
- * @subpackage Core
+<?php
- * @author Curverider Ltd
+ /**
+ * Elgg friends collection
+ * Lists one of a user's friends collections
+ *
+ * @package Elgg
+ * @subpackage Core
+
+ * @author Curverider Ltd
+
+ * @link http://elgg.org/
+ *
+ * @see collections.php
+ *
+ * @uses $vars['collection'] The individual friends collection
+ */
+
+ $coll = $vars['collection'];
+
+ if (is_array($vars['collection']->members)) {
+ $count = sizeof($vars['collection']->members);
+ } else {
+ $count = 0;
+ }
+
+ echo "<li><h2>";
+
+ //as collections are private, check that the logged in user is the owner
+ if($coll->owner_guid == $_SESSION['user']->getGUID()) {
+ echo "<div class=\"friends_collections_controls\">";
+ echo elgg_view('output/confirmlink', array(
+ 'href' => $vars['url'] . 'action/friends/deletecollection?collection=' . $coll->id,
+ 'class' => 'delete_collection'
+ ));
+ echo "</div>";
+ }
+ echo $coll->name;
+ echo " (<span id=\"friends_membership_count{$vars['friendspicker']}\">{$count}</span>) </h2>";
+
+ // individual collection panels
+ if($friends = $vars['collection']->entities){
+ $content = elgg_view('friends/collectiontabs', array('owner' => $_SESSION['user'], 'collection' => $vars['collection'], 'friendspicker' => $vars['friendspicker']));
+ echo elgg_view('friends/picker',array('entities' => $friends, 'value' => $members, 'content' => $content, 'replacement' => '', 'friendspicker' => $vars['friendspicker']));
+ ?>
+
+<script type="text/javascript">
+$(document).ready(function () {
+
+ $('#friends_picker_placeholder<?php echo $vars['friendspicker']; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo $_SESSION['user']->username; ?>&type=list&collection=<?php echo $vars['collection']->id; ?>');
+
+ });
+</script>
+ <?php
+ }
+
+ // close friends_picker div and the accordian list item
+ echo "</li>";
- * @link http://elgg.org/
- *
- * @see collections.php
- *
- * @uses $vars['collection'] The individual friends collection
- */
-
- $coll = $vars['collection'];
-
- if (is_array($vars['collection']->members)) {
- $count = sizeof($vars['collection']->members);
- } else {
- $count = 0;
- }
-
- echo "<li><h2>";
-
- //as collections are private, check that the logged in user is the owner
- if($coll->owner_guid == $_SESSION['user']->getGUID()) {
- echo "<div class=\"friends_collections_controls\">";
- echo elgg_view('output/confirmlink', array(
- 'href' => $vars['url'] . 'action/friends/deletecollection?collection=' . $coll->id,
- 'class' => 'delete_collection'
- ));
- echo "</div>";
- }
- echo $coll->name;
- echo " (<span id=\"friends_membership_count{$vars['friendspicker']}\">{$count}</span>) </h2>";
-
- // individual collection panels
- if($friends = $vars['collection']->entities){
- $content = elgg_view('friends/collectiontabs', array('owner' => $_SESSION['user'], 'collection' => $vars['collection'], 'friendspicker' => $vars['friendspicker']));
- echo elgg_view('friends/picker',array('entities' => $friends, 'value' => $members, 'content' => $content, 'replacement' => '', 'friendspicker' => $vars['friendspicker']));
- ?>
-
-<script type="text/javascript">
-$(document).ready(function () {
-
- $('#friends_picker_placeholder<?php echo $vars['friendspicker']; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo $_SESSION['user']->username; ?>&type=list&collection=<?php echo $vars['collection']->id; ?>');
-
- });
-</script>
- <?php
- }
-
- // close friends_picker div and the accordian list item
- echo "</li>";
-
?> \ No newline at end of file
diff --git a/views/default/friends/collections.php b/views/default/friends/collections.php
index 63446ec89..c785cd68e 100644
--- a/views/default/friends/collections.php
+++ b/views/default/friends/collections.php
@@ -1,53 +1,53 @@
-<?php
-
- /**
- * Elgg friends collections
- * Lists a user's friends collections
- *
- * @package Elgg
- * @subpackage Core
-
- * @author Curverider Ltd
-
- * @link http://elgg.org/
- *
- * @uses $vars['collections'] The array of friends collections
- */
-
- if (!isset($friendspicker)) $friendspicker = 0;
-
- echo "<div class=\"contentWrapper\">";
-
- if (is_array($vars['collections']) && sizeof($vars['collections'])) {
-
- echo "<ul id=\"friends_collections_accordian\">";
-
- foreach($vars['collections'] as $collection) {
-
- $friendspicker++;
- echo elgg_view('friends/collection',array('collection' => $collection, 'friendspicker' => $friendspicker));
-
- }
-
- echo "</ul>";
-
- } else {
-
- echo elgg_echo("friends:nocollections");
-
- }
-
- echo "</div>";
-
-?>
-
-<script>
-$(document).ready(function(){
-
-$('#friends_collections_accordian h2').click(function () {
- $(this.parentNode).children("[class=friends_picker]").slideToggle("fast");
- //return false;
-});
-
-});
+<?php
+
+ /**
+ * Elgg friends collections
+ * Lists a user's friends collections
+ *
+ * @package Elgg
+ * @subpackage Core
+
+ * @author Curverider Ltd
+
+ * @link http://elgg.org/
+ *
+ * @uses $vars['collections'] The array of friends collections
+ */
+
+ if (!isset($friendspicker)) $friendspicker = 0;
+
+ echo "<div class=\"contentWrapper\">";
+
+ if (is_array($vars['collections']) && sizeof($vars['collections'])) {
+
+ echo "<ul id=\"friends_collections_accordian\">";
+
+ foreach($vars['collections'] as $collection) {
+
+ $friendspicker++;
+ echo elgg_view('friends/collection',array('collection' => $collection, 'friendspicker' => $friendspicker));
+
+ }
+
+ echo "</ul>";
+
+ } else {
+
+ echo elgg_echo("friends:nocollections");
+
+ }
+
+ echo "</div>";
+
+?>
+
+<script>
+$(document).ready(function(){
+
+$('#friends_collections_accordian h2').click(function () {
+ $(this.parentNode).children("[class=friends_picker]").slideToggle("fast");
+ //return false;
+});
+
+});
</script> \ No newline at end of file
diff --git a/views/default/friends/collectiontabs.php b/views/default/friends/collectiontabs.php
index 31ae0eacd..a4ad59866 100644
--- a/views/default/friends/collectiontabs.php
+++ b/views/default/friends/collectiontabs.php
@@ -1,48 +1,48 @@
-<?php
-
- $friendspicker = $vars['friendspicker'];
-
- $collectionid = $vars['collection']->id;
- $ownerid = $vars['owner']->getGUID();
-
-?>
-
-<div id="elgg_horizontal_tabbed_nav">
-<ul>
-<li class="selected"><a href="#" class="collectionmembers<?php echo $friendspicker . "\">" . elgg_echo('friends:collections:members'); ?></a></li>
-
-<li><a href="#" class="editmembers<?php echo $friendspicker . "\">" . elgg_echo('friends:collections:edit'); ?></a></li>
-
-</ul>
-</div>
-
-<script type="text/javascript">
-$(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; ?>&friendspicker=<?php echo $friendspicker; ?>');
-
- // remove selected state from previous tab
- $(this).parent().parent().find("li.selected").removeClass("selected");
- // add selected class to current tab
- $(this).parent().addClass("selected");
-
- return false;
- });
-
- $('a.editmembers<?php echo $friendspicker; ?>').click(function () {
- // load friends picker pane
- $('#friends_picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo $_SESSION['user']->username; ?>&type=picker&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
-
- // remove selected state from previous tab
- $(this).parent().parent().find("li.selected").removeClass("selected");
- // add selected class to current tab
- $(this).parent().addClass("selected");
-
- return false;
- });
-
-
-});
-</script>
+<?php
+
+ $friendspicker = $vars['friendspicker'];
+
+ $collectionid = $vars['collection']->id;
+ $ownerid = $vars['owner']->getGUID();
+
+?>
+
+<div id="elgg_horizontal_tabbed_nav">
+<ul>
+<li class="selected"><a href="#" class="collectionmembers<?php echo $friendspicker . "\">" . elgg_echo('friends:collections:members'); ?></a></li>
+
+<li><a href="#" class="editmembers<?php echo $friendspicker . "\">" . elgg_echo('friends:collections:edit'); ?></a></li>
+
+</ul>
+</div>
+
+<script type="text/javascript">
+$(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; ?>&friendspicker=<?php echo $friendspicker; ?>');
+
+ // remove selected state from previous tab
+ $(this).parent().parent().find("li.selected").removeClass("selected");
+ // add selected class to current tab
+ $(this).parent().addClass("selected");
+
+ return false;
+ });
+
+ $('a.editmembers<?php echo $friendspicker; ?>').click(function () {
+ // load friends picker pane
+ $('#friends_picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo $_SESSION['user']->username; ?>&type=picker&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
+
+ // remove selected state from previous tab
+ $(this).parent().parent().find("li.selected").removeClass("selected");
+ // add selected class to current tab
+ $(this).parent().addClass("selected");
+
+ return false;
+ });
+
+
+});
+</script>
diff --git a/views/default/friends/forms/collectionfields.php b/views/default/friends/forms/collectionfields.php
index 0b387f830..bec7212ee 100644
--- a/views/default/friends/forms/collectionfields.php
+++ b/views/default/friends/forms/collectionfields.php
@@ -1,23 +1,23 @@
-<?php
-
- /**
- * Elgg friend collections required hidden fields for js friends picker form
- *
- * @package Elgg
- * @subpackage Core
-
- * @author Curverider Ltd
-
- * @link http://elgg.org/
- */
-
- if (isset($vars['collection'])) {
-?>
-
- <input type="hidden" name="collection_id" value="<?php echo $vars['collection']->id; ?>" />
-
-<?php
-
- }
-
+<?php
+
+ /**
+ * Elgg friend collections required hidden fields for js friends picker form
+ *
+ * @package Elgg
+ * @subpackage Core
+
+ * @author Curverider Ltd
+
+ * @link http://elgg.org/
+ */
+
+ if (isset($vars['collection'])) {
+?>
+
+ <input type="hidden" name="collection_id" value="<?php echo $vars['collection']->id; ?>" />
+
+<?php
+
+ }
+
?> \ No newline at end of file
diff --git a/views/default/friends/forms/edit.php b/views/default/friends/forms/edit.php
index d9434f10b..c35bcaba3 100644
--- a/views/default/friends/forms/edit.php
+++ b/views/default/friends/forms/edit.php
@@ -16,11 +16,11 @@
// Set title, form destination
if (isset($vars['collection'])) {
$action = "friends/editcollection";
- $title = $vars['collection'][0]->name;
+ $title = $vars['collection'][0]->name;
$highlight = 'default';
} else {
$action = "friends/addcollection";
- $title = "";
+ $title = "";
$highlight = 'all';
}
diff --git a/views/default/friends/list.php b/views/default/friends/list.php
index c6709a2c1..3907479bd 100644
--- a/views/default/friends/list.php
+++ b/views/default/friends/list.php
@@ -1,27 +1,27 @@
-<?php
-
- /**
- * Elgg friends list
- * Lists a user's friends
- *
- * @package Elgg
- * @subpackage Core
+<?php
- * @author Curverider Ltd
+ /**
+ * Elgg friends list
+ * Lists a user's friends
+ *
+ * @package Elgg
+ * @subpackage Core
+
+ * @author Curverider Ltd
+
+ * @link http://elgg.org/
+ *
+ * @uses $vars['friends'] The array of ElggUser objects
+ */
+
+ if (is_array($vars['friends']) && sizeof($vars['friends']) > 0) {
+
+ foreach($vars['friends'] as $friend) {
+
+ echo elgg_view_entity($friend);
+
+ }
+
+ }
- * @link http://elgg.org/
- *
- * @uses $vars['friends'] The array of ElggUser objects
- */
-
- if (is_array($vars['friends']) && sizeof($vars['friends']) > 0) {
-
- foreach($vars['friends'] as $friend) {
-
- echo elgg_view_entity($friend);
-
- }
-
- }
-
?> \ No newline at end of file
diff --git a/views/default/friends/picker.php b/views/default/friends/picker.php
index 0dcb208aa..319088601 100644
--- a/views/default/friends/picker.php
+++ b/views/default/friends/picker.php
@@ -1,327 +1,327 @@
-<?php
-
- /**
- * Elgg friends picker
- * Lists the friends picker
- *
- * @package Elgg
- * @subpackage Core
-
- * @author Curverider Ltd
-
- * @link http://elgg.org/
- *
- * @uses $vars['entities'] The array of ElggUser objects
- */
-
- // Let the system know that the friends picker is in use
- global $pickerinuse;
- $pickerinuse = true;
- $chararray = elgg_echo('friendspicker:chararray');
-
- // Initialise internalname
- if (!isset($vars['internalname'])) {
- $internalname = "friend";
- } else {
- $internalname = $vars['internalname'];
- }
-
- // Are we highlighting default or all?
- if (empty($vars['highlight'])) $vars['highlight'] = 'default';
- if ($vars['highlight'] != 'all') $vars['highlight'] = 'default';
-
- // Initialise values
- if (!isset($vars['value'])) {
- $vars['value'] = array();
- } else {
- if (!is_array($vars['value'])) {
- $vars['value'] = (int) $vars['value'];
- $vars['value'] = array($vars['value']);
- }
- }
-
- // Initialise whether we're calling back or not
- if (isset($vars['callback'])) {
- $callback = $vars['callback'];
- } else {
- $callback = false;
- }
-
- // We need to count the number of friends pickers on the page.
- if (!isset($vars['friendspicker'])) {
- global $friendspicker;
- if (!isset($friendspicker)) $friendspicker = 0;
- $friendspicker++;
- } else {
- $friendspicker = $vars['friendspicker'];
- }
-
- $users = array();
- $activeletters = array();
-
- // Are we displaying form tags and submit buttons?
- // (If we've been given a target, then yes! Otherwise, no.)
- if (isset($vars['formtarget'])) {
- $formtarget = $vars['formtarget'];
- } else {
- $formtarget = false;
- }
-
- // Sort users by letter
- if (is_array($vars['entities']) && sizeof($vars['entities']))
- foreach($vars['entities'] as $user) {
-
- if (is_callable('mb_substr'))
- $letter = strtoupper(mb_substr($user->name,0,1));
- else
- $letter = strtoupper(substr($user->name,0,1));
- if (!substr_count($chararray,$letter)) {
- $letter = "*";
- }
- if (!isset($users[$letter])) {
- $users[$letter] = array();
- }
- $users[$letter][$user->name] = $user;
-
- }
-
- if (!$callback) {
-
-?>
-
-<div class="friends_picker">
-
-<?php
-
- if (isset($vars['content'])) echo $vars['content'];
-
-
-?>
-
- <div id="friends_picker_placeholder<?php echo $friendspicker; ?>">
-
-<?php
-
- }
-
- if (!isset($vars['replacement'])) {
-
- if ($formtarget) {
-?>
-
- <script language="text/javascript">
- $(function() { // onload...do
- $('#collectionMembersForm<?php echo $friendspicker; ?>').submit(function() {
- var inputs = [];
- $(':input', this).each(function() {
- if (this.type != 'checkbox' || (this.type == 'checkbox' && this.checked != false)) {
- inputs.push(this.name + '=' + escape(this.value));
- }
- });
- jQuery.ajax({
- type: "POST",
- data: inputs.join('&'),
- url: this.action,
- success: function(){
- $('a.collectionmembers<?php echo $friendspicker; ?>').click();
- }
-
- });
- return false;
- })
- })
-
- </script>
-
- <!-- Collection members form -->
- <form id="collectionMembersForm<?php echo $friendspicker; ?>" action="<?php echo $formtarget; ?>" method="post"> <!-- action="" method=""> -->
-
-<?php
-
- }
-
-?>
-
- <div class="friendsPicker_wrapper">
- <div id="friendsPicker<?php echo $friendspicker; ?>">
- <div class="friendsPicker_container">
-<?php
-
- // Initialise letters
- $chararray .= "*";
- if (is_callable('mb_substr'))
- $letter = mb_substr($chararray,0,1);
- else
- $letter = substr($chararray,0,1);
- $letpos = 0;
- while (1 == 1) {
-?>
- <div class="panel" title="<?php
- echo $letter;
- ?>">
- <div class="wrapper">
- <h3><?php echo $letter; ?></h3>
-
-<?php
-
- if (isset($users[$letter])) {
- ksort($users[$letter]);
-
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
- $col = 0;
-
- foreach($users[$letter] as $friend) {
- if ($col == 0) echo "<tr>";
-
- //echo "<p>" . $user->name . "</p>";
- $label = elgg_view("profile/icon",array('entity' => $friend, 'size' => 'tiny', 'override' => true));
- $options[$label] = $friend->getGUID();
-
- if ($vars['highlight'] == 'all'
- && !in_array($letter,$activeletters)) {
- $activeletters[] = $letter;
- }
-
-
- if (in_array($friend->getGUID(),$vars['value'])) {
- $checked = "checked = \"checked\"";
- if (
- !in_array($letter,$activeletters)
- && $vars['highlight'] == 'default'
- )
- $activeletters[] = $letter;
- } else {
- $checked = "";
- }
-
-?>
-
- <td>
-
- <input type="checkbox" <?php echo $checked; ?> name="<?php echo $internalname; ?>[]" value="<?php echo $options[$label]; ?>" />
-
- </td>
-
- <td >
-
- <div style="width: 25px; margin-bottom: 15px;">
-<?php
-
- echo $label;
-
-?>
- </div>
- </td>
- <td style="width: 200px; padding: 5px;">
-<?php
-
- echo $friend->name;
-
-?>
- </td>
-<?php
-
- $col++;
- if ($col == 3){
- echo "</tr>";
- $col = 0;
- }
- }
- if ($col < 3) echo "</tr>";
-
- echo "</table>";
-
- }
-
-?>
-
- </div>
- </div>
-<?php
- //if ($letter == 'Z') break;
-
- if (is_callable('mb_substr'))
- $substr = mb_substr($chararray,strlen($chararray) - 1,1);
- else
- $substr = substr($chararray,strlen($chararray) - 1,1);
- if ($letter == $substr) break;
- //$letter++;
- $letpos++;
- if (is_callable('mb_substr'))
- $letter = mb_substr($chararray,$letpos,1);
- else
- $letter = substr($chararray,$letpos,1);
- }
-
-?>
- </div>
-
-<?php
-
- if ($formtarget) {
-
- if (isset($vars['formcontents']))
- echo $vars['formcontents'];
-
-?>
- <div class="clearfloat"></div>
- <div class="friendspicker_savebuttons">
- <input type="submit" class="submit_button" value="<?php echo elgg_echo('save'); ?>" />
- <input type="button" class="cancel_button" value="<?php echo elgg_echo('cancel'); ?>" onclick="$('a.collectionmembers<?php echo $friendspicker; ?>').click();" />
- <br /></div>
- </form>
-
-<?php
-
- }
-
-?>
-
- </div>
- </div>
-
-<?php
- } else {
- echo $vars['replacement'];
- }
- if (!$callback) {
-
-?>
-
- </div>
-</div>
-
-
-<?php
-
- }
-
- if (!isset($vars['replacement'])) {
-?>
-
-<script type="text/javascript">
- // initialise picker
- $("div#friendsPicker<?php echo $friendspicker; ?>").friendsPicker(<?php echo $friendspicker; ?>);
-</script>
-<script>
- $(document).ready(function () {
- // manually add class to corresponding tab for panels that have content
-<?php
- if (sizeof($activeletters) > 0)
- //$chararray = elgg_echo('friendspicker:chararray');
- foreach($activeletters as $letter) {
- $tab = strpos($chararray, $letter) + 1;
-?>
- $("div#friendsPickerNavigation<?php echo $friendspicker; ?> li.tab<?php echo $tab; ?> a").addClass("tabHasContent");
-<?php
- }
-
-?>
- });
-</script>
-
-<?php
-
- }
-
+<?php
+
+ /**
+ * Elgg friends picker
+ * Lists the friends picker
+ *
+ * @package Elgg
+ * @subpackage Core
+
+ * @author Curverider Ltd
+
+ * @link http://elgg.org/
+ *
+ * @uses $vars['entities'] The array of ElggUser objects
+ */
+
+ // Let the system know that the friends picker is in use
+ global $pickerinuse;
+ $pickerinuse = true;
+ $chararray = elgg_echo('friendspicker:chararray');
+
+ // Initialise internalname
+ if (!isset($vars['internalname'])) {
+ $internalname = "friend";
+ } else {
+ $internalname = $vars['internalname'];
+ }
+
+ // Are we highlighting default or all?
+ if (empty($vars['highlight'])) $vars['highlight'] = 'default';
+ if ($vars['highlight'] != 'all') $vars['highlight'] = 'default';
+
+ // Initialise values
+ if (!isset($vars['value'])) {
+ $vars['value'] = array();
+ } else {
+ if (!is_array($vars['value'])) {
+ $vars['value'] = (int) $vars['value'];
+ $vars['value'] = array($vars['value']);
+ }
+ }
+
+ // Initialise whether we're calling back or not
+ if (isset($vars['callback'])) {
+ $callback = $vars['callback'];
+ } else {
+ $callback = false;
+ }
+
+ // We need to count the number of friends pickers on the page.
+ if (!isset($vars['friendspicker'])) {
+ global $friendspicker;
+ if (!isset($friendspicker)) $friendspicker = 0;
+ $friendspicker++;
+ } else {
+ $friendspicker = $vars['friendspicker'];
+ }
+
+ $users = array();
+ $activeletters = array();
+
+ // Are we displaying form tags and submit buttons?
+ // (If we've been given a target, then yes! Otherwise, no.)
+ if (isset($vars['formtarget'])) {
+ $formtarget = $vars['formtarget'];
+ } else {
+ $formtarget = false;
+ }
+
+ // Sort users by letter
+ if (is_array($vars['entities']) && sizeof($vars['entities']))
+ foreach($vars['entities'] as $user) {
+
+ if (is_callable('mb_substr'))
+ $letter = strtoupper(mb_substr($user->name,0,1));
+ else
+ $letter = strtoupper(substr($user->name,0,1));
+ if (!substr_count($chararray,$letter)) {
+ $letter = "*";
+ }
+ if (!isset($users[$letter])) {
+ $users[$letter] = array();
+ }
+ $users[$letter][$user->name] = $user;
+
+ }
+
+ if (!$callback) {
+
+?>
+
+<div class="friends_picker">
+
+<?php
+
+ if (isset($vars['content'])) echo $vars['content'];
+
+
+?>
+
+ <div id="friends_picker_placeholder<?php echo $friendspicker; ?>">
+
+<?php
+
+ }
+
+ if (!isset($vars['replacement'])) {
+
+ if ($formtarget) {
+?>
+
+ <script language="text/javascript">
+ $(function() { // onload...do
+ $('#collectionMembersForm<?php echo $friendspicker; ?>').submit(function() {
+ var inputs = [];
+ $(':input', this).each(function() {
+ if (this.type != 'checkbox' || (this.type == 'checkbox' && this.checked != false)) {
+ inputs.push(this.name + '=' + escape(this.value));
+ }
+ });
+ jQuery.ajax({
+ type: "POST",
+ data: inputs.join('&'),
+ url: this.action,
+ success: function(){
+ $('a.collectionmembers<?php echo $friendspicker; ?>').click();
+ }
+
+ });
+ return false;
+ })
+ })
+
+ </script>
+
+ <!-- Collection members form -->
+ <form id="collectionMembersForm<?php echo $friendspicker; ?>" action="<?php echo $formtarget; ?>" method="post"> <!-- action="" method=""> -->
+
+<?php
+
+ }
+
+?>
+
+ <div class="friendsPicker_wrapper">
+ <div id="friendsPicker<?php echo $friendspicker; ?>">
+ <div class="friendsPicker_container">
+<?php
+
+ // Initialise letters
+ $chararray .= "*";
+ if (is_callable('mb_substr'))
+ $letter = mb_substr($chararray,0,1);
+ else
+ $letter = substr($chararray,0,1);
+ $letpos = 0;
+ while (1 == 1) {
+?>
+ <div class="panel" title="<?php
+ echo $letter;
+ ?>">
+ <div class="wrapper">
+ <h3><?php echo $letter; ?></h3>
+
+<?php
+
+ if (isset($users[$letter])) {
+ ksort($users[$letter]);
+
+ echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
+ $col = 0;
+
+ foreach($users[$letter] as $friend) {
+ if ($col == 0) echo "<tr>";
+
+ //echo "<p>" . $user->name . "</p>";
+ $label = elgg_view("profile/icon",array('entity' => $friend, 'size' => 'tiny', 'override' => true));
+ $options[$label] = $friend->getGUID();
+
+ if ($vars['highlight'] == 'all'
+ && !in_array($letter,$activeletters)) {
+ $activeletters[] = $letter;
+ }
+
+
+ if (in_array($friend->getGUID(),$vars['value'])) {
+ $checked = "checked = \"checked\"";
+ if (
+ !in_array($letter,$activeletters)
+ && $vars['highlight'] == 'default'
+ )
+ $activeletters[] = $letter;
+ } else {
+ $checked = "";
+ }
+
+?>
+
+ <td>
+
+ <input type="checkbox" <?php echo $checked; ?> name="<?php echo $internalname; ?>[]" value="<?php echo $options[$label]; ?>" />
+
+ </td>
+
+ <td >
+
+ <div style="width: 25px; margin-bottom: 15px;">
+<?php
+
+ echo $label;
+
+?>
+ </div>
+ </td>
+ <td style="width: 200px; padding: 5px;">
+<?php
+
+ echo $friend->name;
+
+?>
+ </td>
+<?php
+
+ $col++;
+ if ($col == 3){
+ echo "</tr>";
+ $col = 0;
+ }
+ }
+ if ($col < 3) echo "</tr>";
+
+ echo "</table>";
+
+ }
+
+?>
+
+ </div>
+ </div>
+<?php
+ //if ($letter == 'Z') break;
+
+ if (is_callable('mb_substr'))
+ $substr = mb_substr($chararray,strlen($chararray) - 1,1);
+ else
+ $substr = substr($chararray,strlen($chararray) - 1,1);
+ if ($letter == $substr) break;
+ //$letter++;
+ $letpos++;
+ if (is_callable('mb_substr'))
+ $letter = mb_substr($chararray,$letpos,1);
+ else
+ $letter = substr($chararray,$letpos,1);
+ }
+
+?>
+ </div>
+
+<?php
+
+ if ($formtarget) {
+
+ if (isset($vars['formcontents']))
+ echo $vars['formcontents'];
+
+?>
+ <div class="clearfloat"></div>
+ <div class="friendspicker_savebuttons">
+ <input type="submit" class="submit_button" value="<?php echo elgg_echo('save'); ?>" />
+ <input type="button" class="cancel_button" value="<?php echo elgg_echo('cancel'); ?>" onclick="$('a.collectionmembers<?php echo $friendspicker; ?>').click();" />
+ <br /></div>
+ </form>
+
+<?php
+
+ }
+
+?>
+
+ </div>
+ </div>
+
+<?php
+ } else {
+ echo $vars['replacement'];
+ }
+ if (!$callback) {
+
+?>
+
+ </div>
+</div>
+
+
+<?php
+
+ }
+
+ if (!isset($vars['replacement'])) {
+?>
+
+<script type="text/javascript">
+ // initialise picker
+ $("div#friendsPicker<?php echo $friendspicker; ?>").friendsPicker(<?php echo $friendspicker; ?>);
+</script>
+<script>
+ $(document).ready(function () {
+ // manually add class to corresponding tab for panels that have content
+<?php
+ if (sizeof($activeletters) > 0)
+ //$chararray = elgg_echo('friendspicker:chararray');
+ foreach($activeletters as $letter) {
+ $tab = strpos($chararray, $letter) + 1;
+?>
+ $("div#friendsPickerNavigation<?php echo $friendspicker; ?> li.tab<?php echo $tab; ?> a").addClass("tabHasContent");
+<?php
+ }
+
+?>
+ });
+</script>
+
+<?php
+
+ }
+
?> \ No newline at end of file
diff --git a/views/default/friends/river/create.php b/views/default/friends/river/create.php
index df5d2418b..04947568b 100644
--- a/views/default/friends/river/create.php
+++ b/views/default/friends/river/create.php
@@ -1,19 +1,19 @@
-<?php
-
- $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
- $performed_on = get_entity($vars['item']->object_guid);
- $url = $performed_on->getURL();
-
- $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("friends:river:add"),$url) . " ";
- $string .= "<a href=\"{$performed_on->getURL()}\">{$performed_on->name}</a>";
- $string .= "<div class=\"river_content_display\">";
- $string .= "<table><tr><td>" . elgg_view("profile/icon",array('entity' => $performed_by, 'size' => 'small')) . "</td>";
- $string .= "<td><div class=\"following_icon\"></div></td><td>" . elgg_view("profile/icon",array('entity' => $performed_on, 'size' => 'small')) . "</td></tr></table>";
- $string .= "</div>";
-
-?>
-
-<?php
- echo $string;
+<?php
+
+ $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
+ $performed_on = get_entity($vars['item']->object_guid);
+ $url = $performed_on->getURL();
+
+ $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+ $string = sprintf(elgg_echo("friends:river:add"),$url) . " ";
+ $string .= "<a href=\"{$performed_on->getURL()}\">{$performed_on->name}</a>";
+ $string .= "<div class=\"river_content_display\">";
+ $string .= "<table><tr><td>" . elgg_view("profile/icon",array('entity' => $performed_by, 'size' => 'small')) . "</td>";
+ $string .= "<td><div class=\"following_icon\"></div></td><td>" . elgg_view("profile/icon",array('entity' => $performed_on, 'size' => 'small')) . "</td></tr></table>";
+ $string .= "</div>";
+
+?>
+
+<?php
+ echo $string;
?> \ No newline at end of file
diff --git a/views/default/friends/tablelistcountupdate.php b/views/default/friends/tablelistcountupdate.php
index 14728d16a..4c4e26c80 100644
--- a/views/default/friends/tablelistcountupdate.php
+++ b/views/default/friends/tablelistcountupdate.php
@@ -1,22 +1,22 @@
-<?php
-
- /**
- * Elgg friends picker count updater
- * Updates the friends count on a collection
- *
- * @package Elgg
- * @subpackage Core
+<?php
- * @author Curverider Ltd
+ /**
+ * Elgg friends picker count updater
+ * Updates the friends count on a collection
+ *
+ * @package Elgg
+ * @subpackage Core
- * @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']; ?>");
+ * @author Curverider Ltd
+
+ * @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