diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-03-16 09:08:12 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-03-16 09:08:12 +0000 |
commit | 8458eba279356bf8a00741a0c7e9a9edcaed1fd0 (patch) | |
tree | d9871b117a2b5557f84c7c3bd86144bb21902057 /modules/user/helpers | |
parent | 6aadb0bc77702bdfd37356d398fe2d9444835b3b (diff) |
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.
Diffstat (limited to 'modules/user/helpers')
-rw-r--r-- | modules/user/helpers/user.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index 93f07629..6dc2567b 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -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) |