storage information is path specific

This commit is contained in:
Thomas Müller 2013-08-27 00:59:58 +02:00
parent 1e4ebf47e2
commit 8cf9336bcb
4 changed files with 8 additions and 5 deletions

View File

@ -119,7 +119,7 @@ if ($needUpgrade) {
$tmpl->printPage(); $tmpl->printPage();
} else { } else {
// information about storage capacities // information about storage capacities
$storageInfo=OC_Helper::getStorageInfo(); $storageInfo=OC_Helper::getStorageInfo($dir);
$maxUploadFilesize=OCP\Util::maxUploadFilesize($dir); $maxUploadFilesize=OCP\Util::maxUploadFilesize($dir);
$publicUploadEnabled = \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes'); $publicUploadEnabled = \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes');
if (OC_App::isEnabled('files_encryption')) { if (OC_App::isEnabled('files_encryption')) {

View File

@ -11,7 +11,7 @@ class Helper
$maxHumanFilesize = $l->t('Upload') . ' max. ' . $maxHumanFilesize; $maxHumanFilesize = $l->t('Upload') . ' max. ' . $maxHumanFilesize;
// information about storage capacities // information about storage capacities
$storageInfo = \OC_Helper::getStorageInfo(); $storageInfo = \OC_Helper::getStorageInfo($dir);
return array('uploadMaxFilesize' => $maxUploadFilesize, return array('uploadMaxFilesize' => $maxUploadFilesize,
'maxHumanFilesize' => $maxHumanFilesize, 'maxHumanFilesize' => $maxHumanFilesize,

View File

@ -841,9 +841,12 @@ class OC_Helper {
} }
/** /**
* Calculate the disc space * Calculate the disc space for the given path
*
* @param string $path
* @return array
*/ */
public static function getStorageInfo($path = '/') { public static function getStorageInfo($path) {
$rootInfo = \OC\Files\Filesystem::getFileInfo($path); $rootInfo = \OC\Files\Filesystem::getFileInfo($path);
$used = $rootInfo['size']; $used = $rootInfo['size'];
if ($used < 0) { if ($used < 0) {

View File

@ -17,7 +17,7 @@ OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' );
OC_Util::addStyle( '3rdparty', 'chosen' ); OC_Util::addStyle( '3rdparty', 'chosen' );
OC_App::setActiveNavigationEntry( 'personal' ); OC_App::setActiveNavigationEntry( 'personal' );
$storageInfo=OC_Helper::getStorageInfo(); $storageInfo=OC_Helper::getStorageInfo('/');
$email=OC_Preferences::getValue(OC_User::getUser(), 'settings', 'email', ''); $email=OC_Preferences::getValue(OC_User::getUser(), 'settings', 'email', '');