From 6aee12a64fb3fca901c16436e68f64876394088c Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 20 Feb 2009 11:53:49 +0000 Subject: The friends picker can now be internationalized, also allows you to view users whose usernames don't begin with a letter in the char array. git-svn-id: https://code.elgg.org/elgg/trunk@2851 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/friends/picker.php | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'views') 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 @@
-
+

@@ -213,8 +218,11 @@
@@ -271,8 +279,8 @@ $(document).ready(function () { // manually add class to corresponding tab for panels that have content 0) - $chararray = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + if (sizeof($activeletters) > 0) + //$chararray = elgg_echo('friendspicker:chararray'); foreach($activeletters as $letter) { $tab = strpos($chararray, $letter) + 1; ?> -- cgit v1.2.3