From cdd07b33392897b1b6c7f5707b83874ba06ec363 Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Sat, 19 Jan 2013 00:31:09 +0100 Subject: introducing class OCA/files/lib/Helper with new function to build an array with storage stats DRYing the code by using \OCA\files\lib\Helper::buildFileStorageStatistics() now returning used space percent on each ajax call --- apps/files/lib/helper.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 apps/files/lib/helper.php (limited to 'apps/files/lib') diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php new file mode 100644 index 00000000000..f2b1f142e9b --- /dev/null +++ b/apps/files/lib/helper.php @@ -0,0 +1,20 @@ +t('Upload') . ' max. ' . $maxHumanFilesize; + + // information about storage capacities + $storageInfo = \OC_Helper::getStorageInfo(); + + return array('uploadMaxFilesize' => $maxUploadFilesize, + 'maxHumanFilesize' => $maxHumanFilesize, + 'usedSpacePercent' => (int)$storageInfo['relative']); + } +} -- cgit v1.2.3