diff options
| author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-20 11:53:49 +0000 | 
|---|---|---|
| committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-20 11:53:49 +0000 | 
| commit | 6aee12a64fb3fca901c16436e68f64876394088c (patch) | |
| tree | 7fdc9e75bad978990391174d326e5ac8676e8e9a /views | |
| parent | ccd1ad27601d3053afd05aefc237e72d966cfdb0 (diff) | |
| download | elgg-6aee12a64fb3fca901c16436e68f64876394088c.tar.gz elgg-6aee12a64fb3fca901c16436e68f64876394088c.tar.bz2  | |
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
Diffstat (limited to 'views')
| -rw-r--r-- | views/default/friends/picker.php | 28 | 
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;  ?>  | 
