aboutsummaryrefslogtreecommitdiff
path: root/views/default/friends
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/friends')
-rw-r--r--views/default/friends/collection.php110
-rw-r--r--views/default/friends/collections.php84
-rw-r--r--views/default/friends/collectiontabs.php31
-rw-r--r--views/default/friends/forms/collectionfields.php30
-rw-r--r--views/default/friends/forms/edit.php110
-rw-r--r--views/default/friends/list.php41
-rw-r--r--views/default/friends/picker.php459
-rw-r--r--views/default/friends/river/create.php36
8 files changed, 436 insertions, 465 deletions
diff --git a/views/default/friends/collection.php b/views/default/friends/collection.php
index 812623cb1..deadb2f6a 100644
--- a/views/default/friends/collection.php
+++ b/views/default/friends/collection.php
@@ -1,60 +1,56 @@
<?php
+/**
+ * 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; ?>');
- /**
- * 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>";
-
-?> \ No newline at end of file
+ </script>
+ <?php
+}
+
+// close friends_picker div and the accordian list item
+echo "</li>";
diff --git a/views/default/friends/collections.php b/views/default/friends/collections.php
index c785cd68e..a013dc1da 100644
--- a/views/default/friends/collections.php
+++ b/views/default/friends/collections.php
@@ -1,53 +1,45 @@
<?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>";
- /**
- * 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;
+ $('#friends_collections_accordian h2').click(function () {
+ $(this.parentNode).children("[class=friends_picker]").slideToggle("fast");
+ //return false;
+ });
});
-
-});
-</script> \ No newline at end of file
+</script>
diff --git a/views/default/friends/collectiontabs.php b/views/default/friends/collectiontabs.php
index a4ad59866..8f3c684a8 100644
--- a/views/default/friends/collectiontabs.php
+++ b/views/default/friends/collectiontabs.php
@@ -1,10 +1,21 @@
<?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
+ */
+
+$friendspicker = $vars['friendspicker'];
+
+$collectionid = $vars['collection']->id;
+$ownerid = $vars['owner']->getGUID();
- $friendspicker = $vars['friendspicker'];
-
- $collectionid = $vars['collection']->id;
- $ownerid = $vars['owner']->getGUID();
-
?>
<div id="elgg_horizontal_tabbed_nav">
@@ -22,14 +33,14 @@ $(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
@@ -39,9 +50,9 @@ $(document).ready(function () {
$(this).parent().parent().find("li.selected").removeClass("selected");
// add selected class to current tab
$(this).parent().addClass("selected");
-
+
return false;
- });
+ });
});
diff --git a/views/default/friends/forms/collectionfields.php b/views/default/friends/forms/collectionfields.php
index bec7212ee..f9d8ac5ff 100644
--- a/views/default/friends/forms/collectionfields.php
+++ b/views/default/friends/forms/collectionfields.php
@@ -1,23 +1,17 @@
<?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'])) {
+/**
+ * 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; ?>" />
+ <input type="hidden" name="collection_id" value="<?php echo $vars['collection']->id; ?>" />
<?php
-
- }
-
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/views/default/friends/forms/edit.php b/views/default/friends/forms/edit.php
index c35bcaba3..5751950d8 100644
--- a/views/default/friends/forms/edit.php
+++ b/views/default/friends/forms/edit.php
@@ -1,59 +1,55 @@
<?php
+/**
+ * Elgg friend collections add/edit
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ *
+ * @uses $vars['object'] Optionally, the collection edit
+ */
- /**
- * Elgg friend collections add/edit
- *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
- *
- * @uses $vars['object'] Optionally, the collection edit
- */
-
- // var_export($vars['collection'][0]->id);
-
- // Set title, form destination
- if (isset($vars['collection'])) {
- $action = "friends/editcollection";
- $title = $vars['collection'][0]->name;
- $highlight = 'default';
- } else {
- $action = "friends/addcollection";
- $title = "";
- $highlight = 'all';
- }
-
-
- $form_body = "<div class='contentWrapper'><p><label>" . elgg_echo("friends:collectionname") . "<br />" .
- elgg_view("input/text", array(
- "internalname" => "collection_name",
- "value" => $title,
- )) . "</label></p>";
-
- $form_body .= "<p>";
-
- if($vars['collection_members']){
- $form_body .= elgg_echo("friends:collectionfriends") . "<br />";
- foreach($vars['collection_members'] as $mem){
-
- $form_body .= elgg_view("profile/icon",array('entity' => $mem, 'size' => 'tiny'));
- $form_body .= $mem->name;
-
- }
- }
-
- $form_body .= "</p>";
-
- $form_body .= "<p><label>" . elgg_echo("friends:addfriends") . "</label>".
- elgg_view('friends/picker',array('entities' => $vars['friends'], 'internalname' => 'friends_collection', 'highlight' => $highlight)) . "</p>";
-
- $form_body .= "<p>";
- if (isset($vars['collection'])) {
- $form_body .= elgg_view('input/hidden', array('internalname' => 'collection_id', 'value' => "{$vars['collection'][0]->id}"));
- }
- $form_body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save')));
- $form_body .= "</p></div>";
-
- echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$vars['url']}action/$action"));
-?> \ No newline at end of file
+// var_export($vars['collection'][0]->id);
+
+// Set title, form destination
+if (isset($vars['collection'])) {
+ $action = "friends/editcollection";
+ $title = $vars['collection'][0]->name;
+ $highlight = 'default';
+} else {
+ $action = "friends/addcollection";
+ $title = "";
+ $highlight = 'all';
+}
+
+
+$form_body = "<div class='contentWrapper'><p><label>" . elgg_echo("friends:collectionname") . "<br />" .
+ elgg_view("input/text", array(
+ "internalname" => "collection_name",
+ "value" => $title,
+ )) . "</label></p>";
+
+$form_body .= "<p>";
+
+if($vars['collection_members']){
+ $form_body .= elgg_echo("friends:collectionfriends") . "<br />";
+ foreach($vars['collection_members'] as $mem){
+ $form_body .= elgg_view("profile/icon",array('entity' => $mem, 'size' => 'tiny'));
+ $form_body .= $mem->name;
+ }
+}
+
+$form_body .= "</p>";
+
+$form_body .= "<p><label>" . elgg_echo("friends:addfriends") . "</label>".
+ elgg_view('friends/picker',array('entities' => $vars['friends'], 'internalname' => 'friends_collection', 'highlight' => $highlight)) . "</p>";
+
+$form_body .= "<p>";
+if (isset($vars['collection'])) {
+ $form_body .= elgg_view('input/hidden', array('internalname' => 'collection_id', 'value' => "{$vars['collection'][0]->id}"));
+}
+$form_body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save')));
+$form_body .= "</p></div>";
+
+echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$vars['url']}action/$action")); \ No newline at end of file
diff --git a/views/default/friends/list.php b/views/default/friends/list.php
index 3907479bd..7bc42a015 100644
--- a/views/default/friends/list.php
+++ b/views/default/friends/list.php
@@ -1,27 +1,18 @@
<?php
+/**
+ * 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
+ */
- /**
- * 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);
-
- }
-
- }
-
-?> \ No newline at end of file
+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 319088601..1ac8b23af 100644
--- a/views/default/friends/picker.php
+++ b/views/default/friends/picker.php
@@ -1,115 +1,110 @@
<?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";
+/**
+ * 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 {
- $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']);
- }
+ $letter = strtoupper(substr($user->name,0,1));
}
- // Initialise whether we're calling back or not
- if (isset($vars['callback'])) {
- $callback = $vars['callback'];
- } else {
- $callback = false;
+ if (!substr_count($chararray,$letter)) {
+ $letter = "*";
}
-
- // 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'];
+ if (!isset($users[$letter])) {
+ $users[$letter] = array();
}
+ $users[$letter][$user->name] = $user;
+ }
+}
- $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">
+if (!$callback) {
+ ?>
-<?php
+ <div class="friends_picker">
- if (isset($vars['content'])) echo $vars['content'];
+ <?php
-
-?>
+ if (isset($vars['content'])) {
+ echo $vars['content'];
+ }
+ ?>
<div id="friends_picker_placeholder<?php echo $friendspicker; ?>">
-<?php
-
- }
-
- if (!isset($vars['replacement'])) {
-
- if ($formtarget) {
+ <?php
+}
+
+if (!isset($vars['replacement'])) {
+ if ($formtarget) {
?>
- <script language="text/javascript">
+<script language="text/javascript">
$(function() { // onload...do
$('#collectionMembersForm<?php echo $friendspicker; ?>').submit(function() {
var inputs = [];
@@ -123,205 +118,197 @@
data: inputs.join('&'),
url: this.action,
success: function(){
- $('a.collectionmembers<?php echo $friendspicker; ?>').click();
- }
+ $('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=""> -->
+<!-- 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">
+<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 = "";
- }
+// 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();
- <td>
-
- <input type="checkbox" <?php echo $checked; ?> name="<?php echo $internalname; ?>[]" value="<?php echo $options[$label]; ?>" />
-
- </td>
+ if ($vars['highlight'] == 'all'
+ && !in_array($letter,$activeletters)) {
- <td >
-
- <div style="width: 25px; margin-bottom: 15px;">
-<?php
+ $activeletters[] = $letter;
+ }
- 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 (in_array($friend->getGUID(),$vars['value'])) {
+ $checked = "checked = \"checked\"";
+ if (!in_array($letter,$activeletters) && $vars['highlight'] == 'default') {
+ $activeletters[] = $letter;
}
+ } else {
+ $checked = "";
}
- if ($col < 3) echo "</tr>";
-
- echo "</table>";
-
+ ?>
+
+ <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
+ </div>
+<?php
//if ($letter == 'Z') break;
-
- if (is_callable('mb_substr'))
+
+ if (is_callable('mb_substr')) {
$substr = mb_substr($chararray,strlen($chararray) - 1,1);
- else
+ } else {
$substr = substr($chararray,strlen($chararray) - 1,1);
- if ($letter == $substr) break;
+ }
+ if ($letter == $substr) {
+ break;
+ }
//$letter++;
$letpos++;
- if (is_callable('mb_substr'))
+ if (is_callable('mb_substr')) {
$letter = mb_substr($chararray,$letpos,1);
- else
+ } else {
$letter = substr($chararray,$letpos,1);
+ }
}
-
+
?>
- </div>
-
+ </div>
+
<?php
- if ($formtarget) {
+if ($formtarget) {
+
+ if (isset($vars['formcontents']))
+ echo $vars['formcontents'];
- 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>
-
+ <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>
-
+
+</div>
+</div>
+
<?php
- } else {
- echo $vars['replacement'];
- }
- if (!$callback) {
+} else {
+ echo $vars['replacement'];
+}
+if (!$callback) {
?>
-
- </div>
+
+</div>
</div>
<?php
- }
+}
- if (!isset($vars['replacement'])) {
+if (!isset($vars['replacement'])) {
?>
<script type="text/javascript">
- // initialise picker
- $("div#friendsPicker<?php echo $friendspicker; ?>").friendsPicker(<?php echo $friendspicker; ?>);
+ // 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
+$(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;
+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");
+$("div#friendsPickerNavigation<?php echo $friendspicker; ?> li.tab<?php echo $tab; ?> a").addClass("tabHasContent");
<?php
- }
+ }
?>
- });
+});
</script>
<?php
- }
-
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/views/default/friends/river/create.php b/views/default/friends/river/create.php
index 04947568b..e577ba721 100644
--- a/views/default/friends/river/create.php
+++ b/views/default/friends/river/create.php
@@ -1,19 +1,23 @@
<?php
+/**
+ * Elgg create river item
+ *
+ * @package Elgg
+ * @author Curverider Ltd <info@elgg.com>
+ * @link http://elgg.com/
+ *
+ * @uses $vars['entity']
+ */
+$performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
+$performed_on = get_entity($vars['item']->object_guid);
+$url = $performed_on->getURL();
- $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>";
- $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
+echo $string; \ No newline at end of file