Code

Excluded encodings in a seperated file
[gosa.git] / html / helpviewer.php
index f307564c3ff83cbcc8b61da77af286df522a0762..d515328546dc2d6156f9bf35b8506f45daffc8af 100644 (file)
@@ -26,6 +26,7 @@
 error_reporting(0);
 header("Content-type: text/html; charset=UTF-8");
 session_start();
+$config= $_SESSION['config'];
 
 /* If no config object is found in the session, abort help */
 if (!isset($_SESSION['config'])){
@@ -41,6 +42,10 @@ if ($config->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.
@@ -186,7 +189,7 @@ if(isset($_POST['search'])){
   $header= "<!-- headers.tpl-->".$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 */