summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e83f99a)
raw | patch | inline | side by side (parent: e83f99a)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sun, 14 Mar 2010 12:01:25 +0000 (12:01 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sun, 14 Mar 2010 12:01:25 +0000 (12:01 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16502 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/html/themes/modern/style.css | patch | blob | history | |
gosa-core/include/functions.inc | patch | blob | history |
index 5db9f79a7e542ac8c34ebc7d1fb69b6951c76ef1..23ef115d720ccbc9e9918dd230d5d80ec44ec949 100644 (file)
div.progress {
text-align:center;
+ display: block;
color: rgba(255,255,255,0.9);
padding:1px;
border: 1px solid rgba(0,0,0,0.6);
index cbcc4a46e321f3bbf949392ad2557c98279cbba8..e0d4f8a35a71f64639ca35b7476ffffda68a613c 100644 (file)
* \param int 'percentage' Value to display
* \param int 'width' width of the resulting output
* \param int 'height' height of the resulting output
- * \param boolean 'showvalue' weither to show the percentage in the progressbar or not
+ * \param boolean 'showtext' weither to show the percentage in the progressbar or not
* */
-function progressbar($percentage,$width=100,$height=15,$showvalue=false)
+function progressbar($percentage, $width= 200, $height= 14, $showText= false, $colorize= true, $id= "")
{
- return("<img src='progress.php?x=$width&y=$height&p=$percentage'>");
+ $text= "";
+ $class= "";
+ $style= "width:${width}px;height:${height}px;";
+
+ // Fix percentage range
+ $percentage= floor($percentage);
+ if ($percentage > 100) {
+ $percentage= 100;
+ }
+ if ($percentage < 0) {
+ $percentage= 0;
+ }
+
+ // Only show text if we're above 10px height
+ if ($showText && $height>10){
+ $text= $percentage."%";
+ }
+
+ // Set font size
+ $style.= "font-size:".($height-3)."px;";
+
+ // Set color
+ if ($colorize){
+ if ($percentage < 70) {
+ $class= " progress-low";
+ } elseif ($percentage < 80) {
+ $class= " progress-mid";
+ } elseif ($percentage < 90) {
+ $class= " progress-high";
+ } else {
+ $class= " progress-full";
+ }
+ }
+
+ // Apply gradients
+ $hoffset= floor($height / 2) + 4;
+ $woffset= floor(($width+5) * (100-$percentage) / 100);
+ $style.="-moz-box-shadow:
+ 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,
+ -".$woffset."px 0 0 -2px rgba(255, 255, 255, 0.2) inset,
+ -".($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 != ""){
+ $id= "id='$id'";
+ }
+
+ return "<div class='progress$class' $id style='$style'>$text</div>";
}
}
-function progress($progress, $width= 200, $height= 14)
-{
- $text= "";
- $class= "";
- $style= "width:${width};height:${height}px;";
-
- // Fix progress range
- $progress= floor($progress);
- if ($progress > 100) {
- $progress= 100;
- }
- if ($progress < 0) {
- $progress= 0;
- }
-
- // Only show text if we're above 10px height
- if ($height>10){
- $text= $progress."%";
- }
-
- // Set font size
- $style.= "font-size:".($height-3)."px;";
-
- // Set color
- if ($progress < 70) {
- $class= " progress-low";
- } elseif ($progress < 80) {
- $class= " progress-mid";
- } elseif ($progress < 90) {
- $class= " progress-high";
- } else {
- $class= " progress-full";
- }
-
- // Apply gradients
- $hoffset= floor($height / 2) + 4;
- $woffset= floor($width * (100-$progress) / 100);
- $style.="-moz-box-shadow:
- 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,
- -".$woffset."px 0 0 -2px rgba(255, 255, 255, 0.2) inset,
- -".($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);";
-
- echo "<div class='progress$class' style='$style'>$text</div>";
-}
-
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>