From 26d7812f09bdbaf9a0b59c2547f8b98e57e1b986 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 12 Apr 2007 05:56:29 +0000 Subject: [PATCH] Put "automatic language detection" in selectbox, instead of using radio buttons git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6017 594d385d-05f5-0310-b6e9-bd551577e9d8 --- contrib/gosa.conf | 6 +----- html/setup.php | 8 ++++++-- setup/class_setupStep1.inc | 40 +++++++++++++++++--------------------- setup/class_setupStep8.inc | 1 - setup/setup_step1.tpl | 15 ++------------ 5 files changed, 27 insertions(+), 43 deletions(-) diff --git a/contrib/gosa.conf b/contrib/gosa.conf index 37b58a379..bdd67a00a 100644 --- a/contrib/gosa.conf +++ b/contrib/gosa.conf @@ -300,11 +300,7 @@ {if $cv.optional.auto_network_hook_active} auto_network_hook="{$cv.optional.auto_network_hook} " {/if} -{if $cv.force_global_lang} - lang="{$cv.lang}" -{else} - lang="" -{/if} + lang="{$cv.lang_selected}" theme="{$cv.theme}" session_lifetime="{$cv.optional.session_lifetime}" compile="{$cv.optional.compile}" diff --git a/html/setup.php b/html/setup.php index b11642a6c..37c380211 100644 --- a/html/setup.php +++ b/html/setup.php @@ -79,8 +79,12 @@ if (isset ($config->data['MAIN']['COMPILE'])){ if(!isset($_SESSION['lang'])){ $_SESSION['lang'] = get_browser_language(); } -if(isset($_POST['lang'])){ - $_SESSION['lang'] = $_POST['lang']; +if(isset($_POST['lang_selected'])){ + if($_POST['lang_selected'] != ""){ + $_SESSION['lang'] = $_POST['lang_selected']; + }else{ + $_SESSION['lang'] = get_browser_language(); + } } $lang = $_SESSION['lang']; diff --git a/setup/class_setupStep1.inc b/setup/class_setupStep1.inc index a940e5efa..2dae4b87e 100644 --- a/setup/class_setupStep1.inc +++ b/setup/class_setupStep1.inc @@ -22,18 +22,17 @@ class setup_step_1 extends setup_step { - var $lang = ""; - var $languages = array(); - var $attributes = array("lang","force_global_lang"); - var $force_global_lang = FALSE; + var $lang_selected = ""; /* Language selected from select box */ + var $lang = "en_EN"; /* Detected language */ + var $languages = array(); + var $attributes = array("lang","lang_selected"); function setup_step_1() { - $this->lang = get_browser_language(); - - $this->is_enabled = TRUE; - $this->is_active = TRUE; - + $this->lang = get_browser_language(); + $this->lang_selected = ""; + $this->is_enabled = TRUE; + $this->is_active = TRUE; $this->update_strings(); } @@ -46,32 +45,29 @@ class setup_step_1 extends setup_step function execute() { - $this->languages = array("" => _("Automatic detection"), + $this->languages = array("" => _("Automatic"), "de_DE" => _("German"), "fr_FR" => _("French"), "en_EN" => _("English"), "ru_RU" => _("Russian")); $smarty = get_smarty(); - $smarty->assign("languages", $this->languages); - $smarty->assign("lang", $this->lang); - $smarty->assign("force_global_lang", $this->force_global_lang); + $smarty->assign("languages", $this->languages); + $smarty->assign("lang", $this->lang); + $smarty->assign("lang_selected",$this->lang_selected); return($smarty->fetch(get_template_path("setup_step1.tpl",TRUE,dirname(__FILE__)))); } function save_object() { - if((isset($_POST['lang'])) && isset($this->languages[$_POST['lang']])) { - $this->lang = $_POST['lang']; + if((isset($_POST['lang_selected'])) && isset($this->languages[$_POST['lang_selected']])) { + $this->lang_selected = $_POST['lang_selected']; $this->is_completed = TRUE; - $_SESSION['lang'] = $this->lang; - if(isset($_POST['force_global_lang'])){ - if($_POST['force_global_lang'] == 1 ){ - $this->force_global_lang = TRUE; - }else{ - $this->force_global_lang = FALSE; - } + if($this->lang_selected != ""){ + $_SESSION['lang'] = $this->lang_selected; + }else{ + $_SESSION['lang'] = $this->lang; } } } diff --git a/setup/class_setupStep8.inc b/setup/class_setupStep8.inc index 338c72c05..44eeefcb6 100644 --- a/setup/class_setupStep8.inc +++ b/setup/class_setupStep8.inc @@ -140,7 +140,6 @@ class setup_step_8 extends setup_step $err_msg = _("Your configuration file is currently world readable. This is a big security risk. Please updated the file permissions as shown in the manual configuration part below."); } - $smarty = get_smarty(); $smarty->assign("save_requested", isset($_POST['saveconf'])); $smarty->assign("err_msg",$err_msg); diff --git a/setup/setup_step1.tpl b/setup/setup_step1.tpl index e6df1b2ee..91255b031 100644 --- a/setup/setup_step1.tpl +++ b/setup/setup_step1.tpl @@ -7,19 +7,8 @@ {t}Setup language{/t}
- + {html_options options=$languages selected=$lang_selected}
- -
- {t}GOsa language settings{/t} -
-
-   - {t}GOsa will automatically detect the language to use in the GOsa user interface.{/t} -
-   - {t}Force GOsa to use the above selected language as default language.{/t} -
-- 2.30.2