From 05901debc071d2d6ef99717f7cf67a5dec287d1d Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Mon, 13 Jun 2011 20:09:44 +0200 Subject: [PATCH] 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 --- gui/bacula-web/includes/utils/utils.class.php | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 gui/bacula-web/includes/utils/utils.class.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 -- 2.39.5