aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--languages/en.php2
-rw-r--r--views/default/friends/picker.php28
2 files changed, 20 insertions, 10 deletions
diff --git a/languages/en.php b/languages/en.php
index 635b46dad..38e4cdafc 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -355,6 +355,8 @@ To remove a widget drag it back to the <b>Widget gallery</b>.",
'friends:river:delete' => "%s removed their friends widget.",
'friends:river:add' => "%s add someone as a friend.",
+ 'friendspicker:chararray' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+
/**
* Feeds
*/
diff --git a/views/default/friends/picker.php b/views/default/friends/picker.php
index 853b9030d..877a07782 100644
--- a/views/default/friends/picker.php
+++ b/views/default/friends/picker.php
@@ -16,7 +16,8 @@
// Let the system know that the friends picker is in use
global $pickerinuse;
- $pickerinuse = true;
+ $pickerinuse = true;
+ $chararray = elgg_echo('friendspicker:chararray');
// Initialise internalname
if (!isset($vars['internalname'])) {
@@ -67,8 +68,8 @@
foreach($vars['entities'] as $user) {
$letter = strtoupper(substr($user->name,0,1));
- if ($letter >= "0" && $letter <= "9") {
- $letter = "0";
+ if (!substr_count($chararray,$letter)) {
+ $letter = "*";
}
if (!isset($users[$letter])) {
$users[$letter] = array();
@@ -139,11 +140,15 @@
<div class="friendsPicker_container">
<?php
- // Initialise letters
- $letter = 'A';
+ // Initialise letters
+ $chararray .= "*";
+ $letter = substr($chararray,0,1);
+ $letpos = 0;
while (1 == 1) {
?>
- <div class="panel" title="<?php echo $letter; ?>">
+ <div class="panel" title="<?php
+ echo $letter;
+ ?>">
<div class="wrapper">
<h3><?php echo $letter; ?></h3>
@@ -213,8 +218,11 @@
</div>
</div>
<?php
- if ($letter == 'Z') break;
- $letter++;
+ //if ($letter == 'Z') break;
+ if ($letter == substr($chararray,strlen($chararray) - 1,1)) break;
+ //$letter++;
+ $letpos++;
+ $letter = substr($chararray,$letpos,1);
}
?>
@@ -271,8 +279,8 @@
$(document).ready(function () {
// manually add class to corresponding tab for panels that have content
<?php
- if (sizeof($activeletters) > 0)
- $chararray = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ if (sizeof($activeletters) > 0)
+ //$chararray = elgg_echo('friendspicker:chararray');
foreach($activeletters as $letter) {
$tab = strpos($chararray, $letter) + 1;
?>