From: hickert Date: Mon, 13 Jun 2005 10:56:35 +0000 (+0000) Subject: new progressbar function X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bdeed4dd8fb6e7f141a9c625709b8423591391df;p=gosa.git new progressbar function git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@691 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/functions.inc b/include/functions.inc index ecf5bd2db..4fc438f06 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -1718,5 +1718,47 @@ function compare_revision($revision_file, $revision) return $result; } +function progressbar($percentage,$width=100,$height=15,$showvalue=false) + { + $str = ""; // Our return value will be saved in this var + + $color = dechex($percentage+150); + $color2 = dechex(150 - $percentage); + + $progress = (int)(($percentage /100)*$width); + + /* Abort printing out percentage, if divs are to small */ + + + /* If theres a better solution for this, use it... */ + $str = " +
+ +
+ +
"; + + + if($height >10){ + $str.= " + ".$percentage."% + "; + } + + $str.= "
"; + + return($str); + } + + // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/include/functions_helpviewer.inc b/include/functions_helpviewer.inc index 9c122f8b1..d1a3f69e8 100644 --- a/include/functions_helpviewer.inc +++ b/include/functions_helpviewer.inc @@ -327,12 +327,7 @@ function createResultEntry($entry,$res,$name,$max) ".$entry['headline']." -".htmlentities( substr(strip_tags($entry['content']),0,120))."... - -
-
-
-
- + ".progressbar($percentage,50,8)."