Code

Added base check
[gosa.git] / gosa-core / include / functions_helpviewer.inc
index b363e305e3c75d680422d306d4b0fefd3e736b2c..8bb1dcdd6c4bf3cd4f9e2dee39090a98a3ceca6c 100644 (file)
@@ -1,21 +1,23 @@
 <?php
 /*
-   This code is part of GOsa (https://gosa.gonicus.de)
-   Copyright (C) 2005, Fabian Hickert
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id$$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /* Simple class to parse the xml help file */
@@ -61,14 +63,14 @@ function genIndex()
 {
   global $helpobject;
   $str = "";
-  $config = session::get('config');
-  $helpobject = session::get('helpobject');
-  $test = new pluglist($config,get_userinfo());
+  $helpobject = session::global_get('helpobject');
+  $ui= get_userinfo();
+  $test = new pluglist(session::global_get('config'), $ui);
   $current_hl = "";
   foreach($helpobject['helpconf'] as $id => $attrs){
     $path = $test -> get_path($id);
     $exists = true;
-    $helpdir = "../doc/guide/user/".$helpobject['lang']."/html/".preg_replace("/^.*\//i","",$path)."/";
+    $helpdir = "../doc/core/".$helpobject['lang']."/html/".preg_replace("/^.*\//i","",$path)."/";
     if(!is_dir($helpdir)){
       $exists = false;
     }
@@ -256,8 +258,7 @@ function remove_unwanted_tags($str,$replacements)
 function linkwrapper($str,$link)
 {
   $str = preg_replace("/HREF=\"http/i","target=\"_blank\" href=\"http",$str);
-  $str = preg_replace("/HREF=\"/","href=\"".$link."?pg=",$str);
-  $str=str_replace("HREF=\"","href=\"".$link."?pg=",$str);  
+  $str = str_replace("HREF=\"","href=\"".$link."?pg=",$str);  
   return($str);
 }
 
@@ -283,7 +284,7 @@ function search($arr,$word)
 
   /* Filter all unusable chars */
   $word   = preg_replace($allowed_chars_in_searchword,"",$word);
-  $words  = split(" ",str_replace("+"," ",$word));
+  $words  = explode(" ",str_replace("+"," ",$word));
 
   /* Check all wordlengths */
   foreach($words as $tryword){
@@ -375,7 +376,7 @@ function searchlist($arr,$res,$maxresults)
   /* Foreach */  
   foreach($topten as $key => $hits)  {
 
-    $ks = split("\/",$key);
+    $ks = explode("/",$key);
     $k1 = $ks[0];
     $k2 = $ks[1];
     
@@ -493,7 +494,7 @@ function getheader_from_content($str)
 {
   $str = strip_tags($str);
   $pos = 0;
-  $arr = split("\n",$str);
+  $arr = preg_split("/\n/",$str);
   foreach($arr as $possibleheadline){
     if(strlen($possibleheadline)>=3){
       return $possibleheadline;