From 8bd1dc65fa1d1f055dcefb3057526d9fd98f92c6 Mon Sep 17 00:00:00 2001 From: cajus Date: Sun, 14 Mar 2010 15:54:17 +0000 Subject: [PATCH] Replace progress.php git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16504 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/html/progress.php | 102 -------------------------------- gosa-core/include/functions.inc | 4 +- 2 files changed, 3 insertions(+), 103 deletions(-) delete mode 100644 gosa-core/html/progress.php diff --git a/gosa-core/html/progress.php b/gosa-core/html/progress.php deleted file mode 100644 index 017270568..000000000 --- a/gosa-core/html/progress.php +++ /dev/null @@ -1,102 +0,0 @@ - 100){ - $p= 100; -} -$p= intval ($p); - -/* Check dimensions */ -if ($x < 3 || $x > 1000){ - $x= 180; -} -if ($y < 3 || $y > 700){ - $y= 20; -} - -if(!function_exists("imagecreate")){ - syslog(LOG_ERR, "GOsa is missing the gd library, please install php5-gd to be able to see progress images."); - echo "Please install the php5-gd library, GOsa can't create images without it."; - exit(); -}else{ - - $x_matches= FALSE; - $y_matches= FALSE; - foreach (array(7,6,5,4,3,2,1,0) as $font){ - $fx= ImageFontWidth($font) * strlen("$p%"); - $fy= ImageFontHeight($font); - - /* Look if font size matches image size */ - if ($fx < ($x-2)){ - $x_matches= TRUE; - } - if ($fy < ($y-2)){ - $y_matches= TRUE; - } - if ($x_matches && $y_matches){ - break; - } - } - - /* Draw image in GD image stream */ - $im = imagecreate ($x, $y) - or die ("Cannot Initialize new GD image stream"); - - /* Set colors */ - $bg_color= imagecolorallocate ($im, 255, 255, 255); - $br_color= imagecolorallocate ($im, 0,0,0); - $fi_color= imagecolorallocate ($im, 0,0,180); - $tx_color= imagecolorallocate ($im, 240, 10, 90); - - /* Draw progress bar */ - imagerectangle ($im, 0, 0, $x-1, $y-1, $br_color); - imagefilledrectangle ($im, 1, 1, (($x - 2) * $p / 100), - $y - 2, $fi_color); - - /* Is font to big for progress bar? */ - if ($font != 0){ - imagestring ($im, $font, ($x - $fx) / 2, ($y - $fy) / 2, "$p%", $tx_color); - } - - /* Finally draw the image and remove context */ - header ("Content-type: image/png"); - imagepng ($im); - imagedestroy ($im); -} -?> diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index e0d4f8a35..3ce9c19af 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -2483,7 +2483,8 @@ function progressbar($percentage, $width= 200, $height= 14, $showText= false, $c // Apply gradients $hoffset= floor($height / 2) + 4; $woffset= floor(($width+5) * (100-$percentage) / 100); - $style.="-moz-box-shadow: + foreach (array("-moz-box-shadow", "-webkit-box-shadow", "box-shadow") as $type) { + $style.="$type: 0 0 2px rgba(255, 255, 255, 0.4) inset, 0 4px 6px rgba(255, 255, 255, 0.4) inset, 0 ".$hoffset."px 0 -2px rgba(255, 255, 255, 0.2) inset, @@ -2491,6 +2492,7 @@ function progressbar($percentage, $width= 200, $height= 14, $showText= false, $c -".($woffset+1)."px 0 0 -2px rgba(0, 0, 0, 0.6) inset, 0pt ".($hoffset+1)."px 8px rgba(0, 0, 0, 0.3) inset, 0pt 1px 0px rgba(0, 0, 0, 0.2);"; + } // Set ID if ($id != ""){ -- 2.30.2