Switch the locale::$locales data structure to be an array instead of a

stdClass because we're not allowed to asort() stdClass objects in PHP
5.2.6.
This commit is contained in:
Bharat Mediratta
2009-03-16 09:08:12 +00:00
parent 6aadb0bc77
commit 8458eba279
2 changed files with 49 additions and 49 deletions
+4 -4
View File
@@ -80,10 +80,10 @@ class user_Core {
private static function _add_locale_dropdown(&$form, $user=null) {
$locales = locale::installed();
$locales_array = (array) $locales;
if (count($locales_array) > 1) {
$locales->none = t("« none »");
$selected_locale = ($user && $user->locale) ? $user->locale : "none";
if (count($locales) > 1) {
// Put "none" at the first position in the array
$locales = array_merge(array("" => t("« none »")), $locales);
$selected_locale = ($user && $user->locale) ? $user->locale : "";
$form->dropdown("locale")
->label(t("Language Preference"))
->options($locales)