From: Davide Franco Date: Mon, 13 Jun 2011 18:09:44 +0000 (+0200) Subject: bacula-web: New php classe utils.class.php in includes/utils X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0c6ef88082d3e33123a04aef0b56df93edd6ec71;p=bacula%2Fbacula bacula-web: New php classe utils.class.php in includes/utils - This classe contain a new function Get_Human_Size which will replace function in bweb.inc.php --- diff --git a/gui/bacula-web/includes/utils/utils.class.php b/gui/bacula-web/includes/utils/utils.class.php new file mode 100644 index 0000000000..7bdeca73f6 --- /dev/null +++ b/gui/bacula-web/includes/utils/utils.class.php @@ -0,0 +1,49 @@ += 1024 ) { + $hsize = $hsize / 1024; + $unit_id += 1; + } + else + $lisible = true; + } // end while + break; + + default: + $p = array_search( $unit, $units); + $hsize = $hsize / pow(1024,$p); + break; + } // end switch + + $hsize = sprintf("%." . $decimal . "f", $hsize); + $hsize = $hsize . ' ' . $units[$unit_id]; + return $hsize; + } +} +?> \ No newline at end of file