summaryrefslogtreecommitdiff
path: root/modules/user/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-03-16 09:08:12 +0000
committerBharat Mediratta <bharat@menalto.com>2009-03-16 09:08:12 +0000
commit8458eba279356bf8a00741a0c7e9a9edcaed1fd0 (patch)
treed9871b117a2b5557f84c7c3bd86144bb21902057 /modules/user/helpers
parent6aadb0bc77702bdfd37356d398fe2d9444835b3b (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.php8
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("&laquo; none &raquo;");
- $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("&laquo; none &raquo;")), $locales);
+ $selected_locale = ($user && $user->locale) ? $user->locale : "";
$form->dropdown("locale")
->label(t("Language Preference"))
->options($locales)