diff options
author | Cash Costello <cash.costello@gmail.com> | 2012-06-22 07:00:10 -0400 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2012-06-22 07:00:10 -0400 |
commit | fcda1dd617d4abee068f0bfd632d5d15c024940e (patch) | |
tree | 05895b3fa291e3922db156c1f7f0911e976fd2f1 | |
parent | c4262b93dd12de7d8b04533b261c39e4ce8ccf8c (diff) | |
download | elgg-fcda1dd617d4abee068f0bfd632d5d15c024940e.tar.gz elgg-fcda1dd617d4abee068f0bfd632d5d15c024940e.tar.bz2 |
Fixes #4537, #4617 made input/friendspicker i18n compliant
-rw-r--r-- | views/default/core/friends/collection.php | 2 | ||||
-rw-r--r-- | views/default/input/friendspicker.php | 33 |
2 files changed, 8 insertions, 27 deletions
diff --git a/views/default/core/friends/collection.php b/views/default/core/friends/collection.php index b7913da5f..1a330af01 100644 --- a/views/default/core/friends/collection.php +++ b/views/default/core/friends/collection.php @@ -43,7 +43,7 @@ if ($friends) { echo elgg_view('input/friendspicker', array( 'entities' => $friends, - 'value' => $members, + 'value' => $vars['collection']->members, 'content' => $content, 'replacement' => '', 'friendspicker' => $vars['friendspicker'], diff --git a/views/default/input/friendspicker.php b/views/default/input/friendspicker.php index b41449fbf..0834910c1 100644 --- a/views/default/input/friendspicker.php +++ b/views/default/input/friendspicker.php @@ -74,13 +74,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 +158,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 +182,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 +233,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 +300,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 |