aboutsummaryrefslogtreecommitdiff
path: root/views/default/input/friendspicker.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-07-11 21:19:14 +0200
committerSem <sembrestels@riseup.net>2012-07-11 21:19:14 +0200
commitb83574ae1b8ada2bb9c2247492806473df920259 (patch)
tree30f9010da3cab12bda4921f079cfe86fcef2e7a4 /views/default/input/friendspicker.php
parent46bd104bd523c08ff2f6bc0342be9ae1251259e8 (diff)
parent4d42fd0263948eee4a7c7a26ceca0647c01cce32 (diff)
downloadelgg-b83574ae1b8ada2bb9c2247492806473df920259.tar.gz
elgg-b83574ae1b8ada2bb9c2247492806473df920259.tar.bz2
Merge tag '1.8.8' of git://github.com/Elgg/Elgg into lorea-preprod
Elgg 1.8.8 release Conflicts: js/lib/languages.js
Diffstat (limited to 'views/default/input/friendspicker.php')
-rw-r--r--views/default/input/friendspicker.php37
1 files changed, 11 insertions, 26 deletions
diff --git a/views/default/input/friendspicker.php b/views/default/input/friendspicker.php
index b41449fbf..40708c890 100644
--- a/views/default/input/friendspicker.php
+++ b/views/default/input/friendspicker.php
@@ -9,6 +9,10 @@
* @subpackage Core
*
* @uses $vars['entities'] The array of ElggUser objects
+ * @uses $vars['name']
+ * @uses $vars['value']
+ * @uses $vars['highlight']
+ * @uses $vars['callback']
*/
elgg_load_js('elgg.friendspicker');
@@ -74,13 +78,9 @@ if (isset($vars['formtarget'])) {
// 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));
- }
+ $letter = elgg_strtoupper(elgg_substr($user->name, 0, 1));
- if (!substr_count($chararray,$letter)) {
+ if (!elgg_substr_count($chararray, $letter)) {
$letter = "*";
}
if (!isset($users[$letter])) {
@@ -162,11 +162,7 @@ if (!isset($vars['replacement'])) {
// Initialise letters
$chararray .= "*";
- if (is_callable('mb_substr')) {
- $letter = mb_substr($chararray,0,1);
- } else {
- $letter = substr($chararray,0,1);
- }
+ $letter = elgg_substr($chararray, 0, 1);
$letpos = 0;
while (1 == 1) {
?>
@@ -190,9 +186,7 @@ if (!isset($vars['replacement'])) {
$label = elgg_view_entity_icon($friend, 'tiny', array('use_hover' => false));
$options[$label] = $friend->getGUID();
- if ($vars['highlight'] == 'all'
- && !in_array($letter,$activeletters)) {
-
+ if ($vars['highlight'] == 'all' && !in_array($letter,$activeletters)) {
$activeletters[] = $letter;
}
@@ -243,23 +237,14 @@ if (!isset($vars['replacement'])) {
</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);
- }
+ $substr = elgg_substr($chararray, elgg_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);
- }
+ $letter = elgg_substr($chararray, $letpos, 1);
}
?>
@@ -319,7 +304,7 @@ $(document).ready(function () {
if (sizeof($activeletters) > 0)
//$chararray = elgg_echo('friendspicker:chararray');
foreach($activeletters as $letter) {
- $tab = strpos($chararray, $letter) + 1;
+ $tab = elgg_strpos($chararray, $letter) + 1;
?>
$("div#friends-picker-navigation<?php echo $friendspicker; ?> li.tab<?php echo $tab; ?> a").addClass("tabHasContent");
<?php