summaryrefslogtreecommitdiffstats
path: root/apps/files/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-06-08 16:42:43 +0200
committerLukas Reschke <lukas@statuscode.ch>2017-06-13 11:17:42 +0200
commit0554dba69eeb7caff308caf914331e80ed14380c (patch)
tree363ba815db5daea25fa396e204d798cafd8711f2 /apps/files/lib
parentc46422b780621d5ac700e7ca2f6ddf7b1386482f (diff)
downloadnextcloud-server-0554dba69eeb7caff308caf914331e80ed14380c.tar.gz
nextcloud-server-0554dba69eeb7caff308caf914331e80ed14380c.zip
Add quota to the files view
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files/lib')
-rw-r--r--apps/files/lib/Controller/ViewController.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php
index f7a4318e595..fc59622af89 100644
--- a/apps/files/lib/Controller/ViewController.php
+++ b/apps/files/lib/Controller/ViewController.php
@@ -174,6 +174,17 @@ class ViewController extends Controller {
});
$nav->assign('navigationItems', $navItems);
+
+ $nav->assign('usage', \OC_Helper::humanFileSize($storageInfo['used']));
+ if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
+ $totalSpace = $this->l10n->t('Unlimited');
+ } else {
+ $totalSpace = \OC_Helper::humanFileSize($storageInfo['total']);
+ }
+ $nav->assign('total_space', $totalSpace);
+ $nav->assign('quota', $storageInfo['quota']);
+ $nav->assign('usage_relative', $storageInfo['relative']);
+
$contentItems = [];
// render the container content for every navigation item