diff options
Diffstat (limited to 'apps/files/lib/helper.php')
-rw-r--r-- | apps/files/lib/helper.php | 20 |
1 files changed, 20 insertions, 0 deletions
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 @@ +<?php + +namespace OCA\files\lib; + +class Helper +{ + public static function buildFileStorageStatistics($dir) { + $l = new \OC_L10N('files'); + $maxUploadFilesize = \OCP\Util::maxUploadFilesize($dir); + $maxHumanFilesize = \OCP\Util::humanFileSize($maxUploadFilesize); + $maxHumanFilesize = $l->t('Upload') . ' max. ' . $maxHumanFilesize; + + // information about storage capacities + $storageInfo = \OC_Helper::getStorageInfo(); + + return array('uploadMaxFilesize' => $maxUploadFilesize, + 'maxHumanFilesize' => $maxHumanFilesize, + 'usedSpacePercent' => (int)$storageInfo['relative']); + } +} |