diff options
-rw-r--r-- | apps/files/index.php | 2 | ||||
-rw-r--r-- | apps/files/lib/helper.php | 2 | ||||
-rw-r--r-- | core/ajax/update.php | 25 | ||||
-rw-r--r-- | lib/connector/sabre/directory.php | 6 | ||||
-rw-r--r-- | lib/helper.php | 11 | ||||
-rw-r--r-- | settings/personal.php | 2 |
6 files changed, 26 insertions, 22 deletions
diff --git a/apps/files/index.php b/apps/files/index.php index 94c792303da..e4d8e353858 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -119,7 +119,7 @@ if ($needUpgrade) { $tmpl->printPage(); } else { // information about storage capacities - $storageInfo=OC_Helper::getStorageInfo(); + $storageInfo=OC_Helper::getStorageInfo($dir); $maxUploadFilesize=OCP\Util::maxUploadFilesize($dir); $publicUploadEnabled = \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes'); if (OC_App::isEnabled('files_encryption')) { diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php index f2b1f142e9b..7135ef9f656 100644 --- a/apps/files/lib/helper.php +++ b/apps/files/lib/helper.php @@ -11,7 +11,7 @@ class Helper $maxHumanFilesize = $l->t('Upload') . ' max. ' . $maxHumanFilesize; // information about storage capacities - $storageInfo = \OC_Helper::getStorageInfo(); + $storageInfo = \OC_Helper::getStorageInfo($dir); return array('uploadMaxFilesize' => $maxUploadFilesize, 'maxHumanFilesize' => $maxHumanFilesize, diff --git a/core/ajax/update.php b/core/ajax/update.php index 43ed75b07f1..d6af84e95b1 100644 --- a/core/ajax/update.php +++ b/core/ajax/update.php @@ -4,25 +4,26 @@ $RUNTIME_NOAPPS = true; require_once '../../lib/base.php'; if (OC::checkUpgrade(false)) { + $l = new \OC_L10N('core'); $eventSource = new OC_EventSource(); $updater = new \OC\Updater(\OC_Log::$object); - $updater->listen('\OC\Updater', 'maintenanceStart', function () use ($eventSource) { - $eventSource->send('success', 'Turned on maintenance mode'); + $updater->listen('\OC\Updater', 'maintenanceStart', function () use ($eventSource, $l) { + $eventSource->send('success', (string)$l->t('Turned on maintenance mode')); }); - $updater->listen('\OC\Updater', 'maintenanceEnd', function () use ($eventSource) { - $eventSource->send('success', 'Turned off maintenance mode'); + $updater->listen('\OC\Updater', 'maintenanceEnd', function () use ($eventSource, $l) { + $eventSource->send('success', (string)$l->t('Turned off maintenance mode')); }); - $updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource) { - $eventSource->send('success', 'Updated database'); + $updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource, $l) { + $eventSource->send('success', (string)$l->t('Updated database')); }); - $updater->listen('\OC\Updater', 'filecacheStart', function () use ($eventSource) { - $eventSource->send('success', 'Updating filecache, this may take really long...'); + $updater->listen('\OC\Updater', 'filecacheStart', function () use ($eventSource, $l) { + $eventSource->send('success', (string)$l->t('Updating filecache, this may take really long...')); }); - $updater->listen('\OC\Updater', 'filecacheDone', function () use ($eventSource) { - $eventSource->send('success', 'Updated filecache'); + $updater->listen('\OC\Updater', 'filecacheDone', function () use ($eventSource, $l) { + $eventSource->send('success', (string)$l->t('Updated filecache')); }); - $updater->listen('\OC\Updater', 'filecacheProgress', function ($out) use ($eventSource) { - $eventSource->send('success', '... ' . $out . '% done ...'); + $updater->listen('\OC\Updater', 'filecacheProgress', function ($out) use ($eventSource, $l) { + $eventSource->send('success', (string)$l->t('... %d%% done ...', array('percent' => $out))); }); $updater->listen('\OC\Updater', 'failure', function ($message) use ($eventSource) { $eventSource->send('failure', $message); diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php index ed8d085462d..66cd2fcd4e3 100644 --- a/lib/connector/sabre/directory.php +++ b/lib/connector/sabre/directory.php @@ -233,10 +233,10 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa * @return array */ public function getQuotaInfo() { - $rootInfo=\OC\Files\Filesystem::getFileInfo(''); + $storageInfo = OC_Helper::getStorageInfo($this->path); return array( - $rootInfo['size'], - \OC\Files\Filesystem::free_space() + $storageInfo['used'], + $storageInfo['total'] ); } diff --git a/lib/helper.php b/lib/helper.php index c7687d431e1..dd2476eda5c 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -841,15 +841,18 @@ class OC_Helper { } /** - * Calculate the disc space + * Calculate the disc space for the given path + * + * @param string $path + * @return array */ - public static function getStorageInfo() { - $rootInfo = \OC\Files\Filesystem::getFileInfo('/'); + public static function getStorageInfo($path) { + $rootInfo = \OC\Files\Filesystem::getFileInfo($path); $used = $rootInfo['size']; if ($used < 0) { $used = 0; } - $free = \OC\Files\Filesystem::free_space(); + $free = \OC\Files\Filesystem::free_space($path); if ($free >= 0) { $total = $free + $used; } else { diff --git a/settings/personal.php b/settings/personal.php index e69898f6f8f..112eaa3c748 100644 --- a/settings/personal.php +++ b/settings/personal.php @@ -17,7 +17,7 @@ OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' ); OC_Util::addStyle( '3rdparty', 'chosen' ); OC_App::setActiveNavigationEntry( 'personal' ); -$storageInfo=OC_Helper::getStorageInfo(); +$storageInfo=OC_Helper::getStorageInfo('/'); $email=OC_Preferences::getValue(OC_User::getUser(), 'settings', 'email', ''); |