From a4a4eaa93959dacf601b940d6988e5e995611777 Mon Sep 17 00:00:00 2001
From: Falko Timme <ft@falkotimme.com>
Date: Thu, 27 Nov 2014 11:29:59 -0500
Subject: [PATCH] - Added translations. - Added HHVM to "Default PHP Handler" field (server configuration). - Fixed "Unable to load the server configuration from database." error when running server.sh. - Fixed Javascript (accordions weren't working anymore, directive snippets and other placeholders couldn't be added anymore).

---
 server/lib/classes/functions.inc.php |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/server/lib/classes/functions.inc.php b/server/lib/classes/functions.inc.php
index a4b217a..be55503 100644
--- a/server/lib/classes/functions.inc.php
+++ b/server/lib/classes/functions.inc.php
@@ -129,6 +129,18 @@
 		return number_format((double)$number, $number_format_decimals, $number_format_dec_point, $number_format_thousands_sep);
 	}
 
+	/**
+	* Function to change bytes to kB, MB, GB or TB
+	* @param int $size - size in bytes
+	* @param int precicion - after-comma-numbers (default: 2)
+	* @return string - formated bytes
+	*/
+	public function formatBytes($size, $precision = 2) {
+		$base=log($size)/log(1024);
+		$suffixes=array('', ' kB', ' MB', ' GB', ' TB');
+		return round(pow(1024, $base-floor($base)), $precision).$suffixes[floor($base)];
+	}
+
 	public function get_ispconfig_url() {
 		global $app;
 

--
Gitblit v1.9.1