From e02a570e2b633ef6ef083b3e424c5c2d427d35dc Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 12 Aug 2005 08:10:21 +0000 Subject: [PATCH] Change navigationmenu language if browser language changed git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1117 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/main.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/html/main.php b/html/main.php index 859e8d123..ba8d8e8e2 100644 --- a/html/main.php +++ b/html/main.php @@ -66,12 +66,28 @@ if (isset ($config->data['MAIN']['COMPILE'])){ $smarty->compile_dir= '/var/spool/gosa/'; } +/* Set default */ +$reload_navigation = false; + +/* Set last initialised language to current, browser settings */ +if((!isset($_SESSION['Last_init_lang']))){ + $reload_navigation = true; + $_SESSION['Last_init_lang'] = get_browser_language(); +} + /* Language setup */ if ($config->data['MAIN']['LANG'] == ""){ + + /* If last language != current force navi reload */ + if($_SESSION['Last_init_lang'] != get_browser_language()){ + $reload_navigation = true; + } $lang= get_browser_language(); + $_SESSION['Last_init_lang'] = $lang; } else { $lang= $config->data['MAIN']['LANG']; } + $lang.=".UTF-8"; putenv("LANGUAGE="); putenv("LANG=$lang"); @@ -220,6 +236,11 @@ $smarty->assign ("go_top", get_template_path('images/go_top.png')); $smarty->assign ("go_corner", get_template_path('images/go_corner.png')); $smarty->assign ("go_left", get_template_path('images/go_left.png')); $smarty->assign ("go_help", get_template_path('images/help.png')); + +/* reload navigation if language changed*/ +if($reload_navigation){ + $plist->menu="";; +} $plist->gen_menu(); $smarty->assign ("menu", $plist->menu); $smarty->assign ("plug", "$plug"); -- 2.30.2