make usedSpacePercent available in the files app

This commit is contained in:
Thomas Mueller 2013-01-02 15:06:49 +01:00
parent 2d36a20a1d
commit 48c7bed59b
2 changed files with 5 additions and 0 deletions

View File

@ -98,6 +98,9 @@ if (OC_Filesystem::isSharable($dir . '/')) {
$permissions |= OCP\PERMISSION_SHARE; $permissions |= OCP\PERMISSION_SHARE;
} }
// information about storage capacities
$storageInfo=OC_Helper::getStorageInfo();
$tmpl = new OCP\Template('files', 'index', 'user'); $tmpl = new OCP\Template('files', 'index', 'user');
$tmpl->assign('fileList', $list->fetchPage(), false); $tmpl->assign('fileList', $list->fetchPage(), false);
$tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage(), false); $tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage(), false);
@ -108,4 +111,5 @@ $tmpl->assign('files', $files);
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); $tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); $tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
$tmpl->assign('usedSpacePercent', $storageInfo['relative']);
$tmpl->printPage(); $tmpl->printPage();

View File

@ -117,3 +117,4 @@
<!-- config hints for javascript --> <!-- config hints for javascript -->
<input type="hidden" name="allowZipDownload" id="allowZipDownload" value="<?php echo $_['allowZipDownload']; ?>" /> <input type="hidden" name="allowZipDownload" id="allowZipDownload" value="<?php echo $_['allowZipDownload']; ?>" />
<input type="hidden" name="usedSpacePercent" id="usedSpacePercent" value="<?php echo $_['usedSpacePercent']; ?>" />