summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ec21c11)
raw | patch | inline | side by side (parent: ec21c11)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 9 Jun 2005 10:10:57 +0000 (10:10 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 9 Jun 2005 10:10:57 +0000 (10:10 +0000) |
html/helpviewer.php | patch | blob | history |
diff --git a/html/helpviewer.php b/html/helpviewer.php
index b8915104cd9567344a0250ffe7be0122f43a65f2..3f91d4b9099559a045a27df0003b3b2d02cf47a3 100644 (file)
--- a/html/helpviewer.php
+++ b/html/helpviewer.php
*/
//set_error_handler("myone");
-$helpdir = "../doc/guide/admin/en/manual_gosa_en/";
-$defaultpage = "index.html";
-$prefix = "node";
-$suffix = ".html";
-$maxresults = 10;
-$minwordlength= 3;
+$helpdir = "../doc/guide/admin/en/manual_gosa_en/"; // Folder to use for help files
+$defaultpage = "index.html"; // alternative file, shown on error, or on first call
+$prefix = "node"; // Prefix of the generated help files
+$suffix = ".html"; // Suffix of the generated helpfiles
+$maxresults = 10; // max number of results shown in result list
+$minwordlength = 3; // Word less than 3 chars will be dropped in search
+$allowed_chars_in_searchword = "'[^a-z0-9 %_-]'i"; // Remove all chars that would disturb our search like < or > ...
+$pre_mark = "<b><u><i>" ; // Sign words with this
+$suf_mark = "</i></u></b>"; // and this
// Only for testing delete this if everything works fine
function myone($par1,$par2,$par3,$par3)
/*Remove tags */
function remove_unwanted_tags($str,$replacements)
{
-#fixme This solution is ....
+#fixme This solution is ... ARRG
$str=str_replace("\n","||WasBr||",$str);
foreach($replacements['range'] as $var)
{
/* Search content */
function search($arr,$word)
{
- global $minwordlength;
+ global $minwordlength,$allowed_chars_in_searchword;
/* Prepare Vars */
$result =array(); // Search result, filename, + hits + hits per word + matches
$words =array(); // Temporary searchword handling
$word = trim($word);
/* Filter all unusable chars */
- $word = preg_replace("[^a-z0-9_+% ]","",$word);
+ $word = preg_replace($allowed_chars_in_searchword,"",$word);
$words = split(" ",str_replace("+"," ",$word));
/* Check all wordlengths */
}
/* appending footer message for resultlist */
- $ret.= "<br> ".count($topten)." - "._("Results for your search with the keyword")." <b>".$_SESSION['search_string']."</b>"._(" interpreted as ")."<b>".$_SESSION['parsed_search_keyword']."</b>";
+ $ret.= "<br> ".count($topten)." - "._("Results for your search with the keyword")." <b>".htmlentities($_SESSION['search_string'])."</b>"._(" interpreted as ")."<b>".$_SESSION['parsed_search_keyword']."</b>";
return($ret);
}
/* This function marks a string with the given search result for this string*/
function markup_page($arr,$res)
{
+global $pre_mark,$suf_mark;
$ret = ""; // return value
- $pre = "<b><u><i>" ;
- $suf = "</i></u></b>";
$repl = array();
$posadd = 0;
foreach($repl as $position=>$word) {
$pos1 = strlen($arr);
- $arr= markword($arr,($position+$posadd),$word,$pre,$suf);
+ $arr= markword($arr,($position+$posadd),$word,$pre_mark,$suf_mark);
$pos2 = strlen($arr);
$posadd =$posadd + ($pos2 - $pos1);
}