From 8458eba279356bf8a00741a0c7e9a9edcaed1fd0 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 16 Mar 2009 09:08:12 +0000 Subject: 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. --- modules/user/helpers/user.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/user/helpers/user.php') 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) -- cgit v1.2.3