[evolvis-commits] r18371: mask out all unsupported languages (those we don't ship or are English¹)

mirabilos at evolvis.org mirabilos at evolvis.org
Tue Apr 24 16:34:54 CEST 2012


Author: mirabilos
Date: 2012-04-24 16:34:54 +0200 (Tue, 24 Apr 2012)
New Revision: 18371

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/www/account/utils.php
Log:
mask out all unsupported languages (those we don't ship or are English¹)

① for English is, in reality, “untranslated”, as we also ship no en.po

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/account/utils.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/account/utils.php	2012-04-24 14:34:50 UTC (rev 18370)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/account/utils.php	2012-04-24 14:34:54 UTC (rev 18371)
@@ -33,7 +33,19 @@
  * @return	string	The html select box.
  */
 function html_get_language_popup ($title='language_id',$selected='xzxz') {
-	$res = db_query_params ('SELECT * FROM supported_languages ORDER BY name ASC',
-			array ());	
-	return html_build_select_box ($res,$title,$selected,false);
+	$res = db_query_params('SELECT language_id, name
+		FROM supported_languages ORDER BY name ASC', array());
+	$keys = util_result_column_to_array($res, 0);
+	$values = util_result_column_to_array($res, 1);
+	for ($i = 0; $i < count($values); ++$i) {
+		/* mask out all unsupported languages */
+		if (!in_array($values[$i], array(
+			'English',
+			'German',
+		    ))) {
+			$values[$i] = '(' . $values[$i] . ')';
+		}
+	}
+	return html_build_select_box_from_arrays($keys, $values, $title,
+	    $selected, false);
 }



More information about the evolvis-commits mailing list