aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/default/friends/picker.php28
1 files changed, 18 insertions, 10 deletions
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;
?>