X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=html%2Fhelpviewer.php;h=d515328546dc2d6156f9bf35b8506f45daffc8af;hb=4e98627c646b70788cd5a28343f57fa7aefc1c37;hp=05f31f494e70b5f15bd3735983daa8f05b370c13;hpb=07afe650cb5ee56dc8c7b2666647c2b3692099a0;p=gosa.git diff --git a/html/helpviewer.php b/html/helpviewer.php index 05f31f494..d51532854 100644 --- a/html/helpviewer.php +++ b/html/helpviewer.php @@ -1,5 +1,4 @@ data['MAIN']['LANG'] == ""){ $lang= $config->data['MAIN']['LANG']; } +if(isset($_SESSION['ui']->language)){ + $lang = $_SESSION['ui']->language; +} + $lang.=".UTF-8"; putenv("LANGUAGE="); putenv("LANG=$lang"); @@ -67,14 +72,13 @@ if (isset ($config->data['MAIN']['COMPILE'])){ if(isset($_SESSION['helpobject'])){ $helpobject = $_SESSION['helpobject']; }else{ - $helpobject['lang'] = "en"; + $helpobject['lang'] = $lang; $helpobject['helpconf'] = array(); $helpobject['currentplug'] = ""; $helpobject['file'] = "index.html"; $helpobject['helpconf'] = $_SESSION['plist']->gen_headlines(); } -$lang = get_browser_language(); $lang = $lang[0].$lang[1]; $helpobject['lang'] = $lang; @@ -90,7 +94,6 @@ $backward =$defaultpage; $index =$defaultpage; $forward ="node1.html"; - /* Every class which is called within a tab, stores its name in the Session. * If $_SESSION['current_class_for_help'] isset, * get the helpfile specified in the xml file and display it. @@ -103,7 +106,7 @@ if(isset($_SESSION['current_class_for_help'])){ /* Generate help array */ $str = $xml->parse(); - + /* __LANG__ is used as placeholder for the used language*/ $helpdir= preg_replace("/__LANG__/i",$lang,$str[($_SESSION['current_class_for_help'])]['PATH']); @@ -112,12 +115,12 @@ if(isset($_SESSION['current_class_for_help'])){ $smarty->assign("help_contents","

"._("There is no helpfile specified for this class."))."

"; $header= "".$smarty->fetch(get_template_path('headers.tpl')); - $display= utf8_encode( $header.$smarty->fetch(get_template_path('help.tpl'))); + $display= ( $header.$smarty->fetch(get_template_path('help.tpl'))); echo $display; unset($_SESSION['current_class_for_help']); exit(); } - + /* Save filename */ $helpobject['file']= $str[($_SESSION['current_class_for_help'])]['FILE']; @@ -125,7 +128,9 @@ if(isset($_SESSION['current_class_for_help'])){ $helpobject['currentplug'] = $helpdir; /* Avoid displaying the same help every time */ - unset($_SESSION['current_class_for_help']); + if(isset($_GET['pg'])){ + unset($_SESSION['current_class_for_help']); + } }elseif(isset($_GET['plug'])){ /* This displays helpfiles depending on the current $_GET[plug] */ @@ -184,7 +189,7 @@ if(isset($_POST['search'])){ $header= "".$smarty->fetch(get_template_path('headers.tpl')); /* I don't know why, but we must use utf8_encode to avoid dispplay errors */ - $display= utf8_encode( $header.$smarty->fetch(get_template_path('help.tpl'))); + $display= ( $header.$smarty->fetch(get_template_path('help.tpl'))); echo $display; }elseif(((empty($helpdir)))||($helpdir=="/")){ /* Generate Index and display it */ @@ -220,7 +225,7 @@ if(isset($_POST['search'])){ /* There was a file requested which actually doesn't exists */ $smarty->assign("help_contents","

".sprintf(_("Helpdir '%s' is not accessible, can't read any helpfiles."),$helpdir))."


"; $header= "".$smarty->fetch(get_template_path('headers.tpl')); - $display= utf8_encode( $header.$smarty->fetch(get_template_path('help.tpl'))); + $display= ( $header.$smarty->fetch(get_template_path('help.tpl'))); echo $display; } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: