Code

Put "automatic language detection" in selectbox, instead of using radio buttons
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Apr 2007 05:56:29 +0000 (05:56 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Apr 2007 05:56:29 +0000 (05:56 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6017 594d385d-05f5-0310-b6e9-bd551577e9d8

contrib/gosa.conf
html/setup.php
setup/class_setupStep1.inc
setup/class_setupStep8.inc
setup/setup_step1.tpl

index 37b58a3791c9f008cc4ddd4a695bffd02384619b..bdd67a00a04b8a9122e02aebebfbc681b87a0b9e 100644 (file)
 {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}"
index b11642a6cd80a470752e70849268f9388f0eae45..37c3802116babb64b7005ecbfac7cf1ff723f25d 100644 (file)
@@ -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'];
index a940e5efad0db489fcd1039675113fe356be9fc5..2dae4b87ebecc6db450e1fe31c0719709db23760 100644 (file)
 
 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;
       }
     }
   }
index 338c72c0502a1a6b0f7d7dcedaab58c1001abf5f..44eeefcb6430202aafdb64ffbf2c304fd9d565b6 100644 (file)
@@ -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);
index e6df1b2ee71367dd8f68bc34c861fee6323e0ca3..91255b03101270cbc92d39e72d09c70c2d415c29 100644 (file)
@@ -7,19 +7,8 @@
                {t}Setup language{/t}
        </div>
        <div class='default' style=';'>
-               <select name='lang' title='{t}Please your prefered language here{/t}' size=5 style='width:300px;'>
-               {html_options options=$languages selected=$lang}
+               <select name='lang_selected' title='{t}Please your prefered language here{/t}' size=5 style='width:300px;'>
+               {html_options options=$languages selected=$lang_selected}
                </select>
        </div>
-       
-       <div  class='default' style='float:left;width:160px;padding-top:25px;'>
-               {t}GOsa language settings{/t}
-       </div>
-       <div class='default' style='float:left;padding-top:25px;'>
-               <input type='radio' value='0' name='force_global_lang' {if !$force_global_lang} checked {/if}>&nbsp;
-               {t}GOsa will automatically detect the language to use in the GOsa user interface.{/t}
-               <br>
-               <input type='radio' value='1' name='force_global_lang' {if $force_global_lang} checked {/if}>&nbsp;
-               {t}Force GOsa to use the above selected language as default language.{/t}
-       </div>
 </div>