summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2008-01-02 12:04:17 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2008-01-02 12:04:17 +0000
commitf96a1c769094228d0ff3fb84a01e6c368d79a2f3 (patch)
treefca24ff9270a4b3638f577fd5538e87874efab5a
parent5f635b95857efc7da3dc6ce9f9abbdb1f8e208e8 (diff)
downloadbrdo-f96a1c769094228d0ff3fb84a01e6c368d79a2f3.tar.gz
brdo-f96a1c769094228d0ff3fb84a01e6c368d79a2f3.tar.bz2
#205334 by hass: if more then 5 languages are available, use a dropdown not a radio button list (usability)
-rw-r--r--includes/locale.inc3
-rw-r--r--modules/locale/locale.module2
2 files changed, 3 insertions, 2 deletions
diff --git a/includes/locale.inc b/includes/locale.inc
index 5cf2a9894..aeb114878 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -550,7 +550,8 @@ function locale_translate_seek_form() {
'#default_value' => @$query['string'],
'#description' => t('Leave blank to show all strings. The search is case sensitive.'),
);
- $form['search']['language'] = array('#type' => 'radios',
+ $form['search']['language'] = array(
+ '#type' => (count($languages) <= 5 ? 'radios' : 'select'),
'#title' => t('Language'),
'#default_value' => (!empty($query['language']) ? $query['language'] : 'all'),
'#options' => array_merge(array('all' => t('All languages'), 'en' => t('English (provided by Drupal)')), $languages),
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index fd7c24953..1d9a9a985 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -226,7 +226,7 @@ function locale_user($type, $edit, &$user, $category = NULL) {
);
$form['locale']['language'] = array(
- '#type' => 'radios',
+ '#type' => (count($names) <= 5 ? 'radios' : 'select'),
'#title' => t('Language'),
'#default_value' => $user_preferred_language->language,
'#options' => $names,