Code

Updated Macro Bool values
[gosa.git] / html / helpviewer.php
index c463c63ed84a6b65a6e55f22c8a4363a9a90a607..f3565cce13024a99361af173ed3743cfaace42b6 100644 (file)
@@ -38,14 +38,7 @@ if (!isset($_SESSION['config'])){
   exit;
 }
 
-/* Language setup */
-if ($config->data['MAIN']['LANG'] == ""){
-  $lang= get_browser_language();
-} else {
-  $lang= $config->data['MAIN']['LANG'];
-}
-
-$lang.=".UTF-8";
+$lang= get_browser_language();
 
 putenv("LANGUAGE=");
 putenv("LANG=$lang");
@@ -64,6 +57,7 @@ if (isset ($config->data['MAIN']['COMPILE'])){
 } else {
   $smarty->compile_dir= '/var/spool/gosa/';
 }
+$smarty->assign("title", "GOsa - "._("Help browser"));
 
 /* HELP management starts here ...
  */
@@ -119,9 +113,9 @@ if(isset($_SESSION['current_class_for_help'])){
     $display= (  $header.$smarty->fetch(get_template_path('help.tpl')));
     echo $display;
     unset($_SESSION['current_class_for_help']);
-    exit();  
+    exit();
   }
+    
   /* Save filename */
   $helpobject['file']= $str[($_SESSION['current_class_for_help'])]['FILE'];
   
@@ -180,9 +174,11 @@ $_SESSION['helpobject'] = $helpobject;
  * Display management 
  */
 
+/* this raise a warning if the directory is not found */
+
 $files = array();
-$f = opendir($helpdir);
-while($file = readdir($f)){
+$f = @opendir($helpdir);
+while($file = @readdir($f)){
   $files[$file]=$file;
 }
 
@@ -225,7 +221,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= (  $header.$smarty->fetch(get_template_path('help.tpl')));
+  $display= utf8_encode(  $header.$smarty->fetch(get_template_path('help.tpl')));
   echo $display;
 }elseif(((empty($helpdir)))||($helpdir=="/")){
   /* Generate Index and display it */