From 681212c967eba019ac673d895ee1c12900b502a8 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 13 Jun 2005 07:29:00 +0000 Subject: [PATCH] added prgressbar with colors and percentag to resultpage for helpsearch git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@683 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/functions_helpviewer.inc | 45 +++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/include/functions_helpviewer.inc b/include/functions_helpviewer.inc index cc6abafc0..fe2d9eb79 100644 --- a/include/functions_helpviewer.inc +++ b/include/functions_helpviewer.inc @@ -256,8 +256,13 @@ function searchlist($arr,$res,$maxresults) } /* appending footer message for resultlist */ - $ret.= "
".sprintf(_("%s results for your search with the keyword %s interpreted as %s"), "".count($topten)."", "".htmlentities($_SESSION['search_string'])."", "".$_SESSION['parsed_search_keyword'].""); - + $ret.= "
+ ".sprintf(htmlentities(_("%s results for your search with the keyword %s interpreted as %s")), + "".count($topten)."", + "".($_SESSION['search_string'])."", + "".$_SESSION['parsed_search_keyword'].""); + $ret.="
+
"; return($ret); } @@ -301,14 +306,42 @@ function markword($string,$position,$word,$prefix,$suffix) return($first.$prefix.$word.$suffix.$last); } - /* Creates HTML output for a single search result entry */ function createResultEntry($entry,$res,$name,$max) { $percentage = (int)(($res['hits']['overall'] / $max) * 100) ; - $str = "".$entry['headline']."
"; - $str.= "".sprintf(_("%s%% hit rate in file %s"),$percentage,$name)."
" ; - $str.= substr(strip_tags($entry['content']),0,200); + $color = dechex($percentage+150); + $color2 = dechex(150 - $percentage); + if(strlen($color)==1) $color = "0".$color; + + /* the object tag is needed for W3c */ + $str = " + + + + + + + + + +
+ ".$entry['headline']." -".htmlentities( substr(strip_tags($entry['content']),0,150))."... + +
+
+ + ".$percentage."% + +
+
+
+ + ".htmlentities(sprintf(_("%s%% hit rate in file %s"),$percentage,$name))." + +
+
+ "; $str.= "
"; return($str); -- 2.30.2