aboutsummaryrefslogtreecommitdiffstats
path: root/settings/personal.php
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2013-01-28 19:36:21 +0100
committerJan-Christoph Borchardt <hey@jancborchardt.net>2013-01-28 19:36:21 +0100
commit3bafa87a1223d18e7f772c9551f17aaf7bcc7abb (patch)
tree30c0b4ee3ba330ebed4effa332b946c61e6d418e /settings/personal.php
parentfeb65c89f2780220bb560a8f63c7dc6ac94602b0 (diff)
parent06c1c35ac90f7920afa637ab0b628529b4135d40 (diff)
downloadnextcloud-server-3bafa87a1223d18e7f772c9551f17aaf7bcc7abb.tar.gz
nextcloud-server-3bafa87a1223d18e7f772c9551f17aaf7bcc7abb.zip
merge styles
Diffstat (limited to 'settings/personal.php')
-rw-r--r--settings/personal.php16
1 files changed, 4 insertions, 12 deletions
diff --git a/settings/personal.php b/settings/personal.php
index 47dbcc53ebc..4624bda8397 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -15,15 +15,7 @@ OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' );
OC_Util::addStyle( '3rdparty', 'chosen' );
OC_App::setActiveNavigationEntry( 'personal' );
-// calculate the disc space
-$rootInfo=OC_FileCache::get('');
-$sharedInfo=OC_FileCache::get('/Shared');
-$used=$rootInfo['size'];
-if($used<0) $used=0;
-$free=OC_Filesystem::free_space();
-$total=$free+$used;
-if($total==0) $total=1; // prevent division by zero
-$relative=round(($used/$total)*10000)/100;
+$storageInfo=OC_Helper::getStorageInfo();
$email=OC_Preferences::getValue(OC_User::getUser(), 'settings', 'email', '');
@@ -50,9 +42,9 @@ foreach($languageCodes as $lang) {
// Return template
$tmpl = new OC_Template( 'settings', 'personal', 'user');
-$tmpl->assign('usage', OC_Helper::humanFileSize($used));
-$tmpl->assign('total_space', OC_Helper::humanFileSize($total));
-$tmpl->assign('usage_relative', $relative);
+$tmpl->assign('usage', OC_Helper::humanFileSize($storageInfo['used']));
+$tmpl->assign('total_space', OC_Helper::humanFileSize($storageInfo['total']));
+$tmpl->assign('usage_relative', $storageInfo['relative']);
$tmpl->assign('email', $email);
$tmpl->assign('languages', $languages);