Move template variable assignment to correct place

This commit is contained in:
Pellaeon Lin 2014-02-06 12:06:16 +08:00
parent e2a28e5d1d
commit 8c56e21ced
1 changed files with 5 additions and 4 deletions

View File

@ -143,8 +143,6 @@ if (isset($path)) {
OCP\Util::addScript('files', 'jquery.iframe-transport');
OCP\Util::addScript('files', 'jquery.fileupload');
$maxUploadFilesize=OCP\Util::maxUploadFilesize($path);
$freeSpace=OCP\Util::freeSpace($dir);
$uploadLimit=OCP\Util::uploadLimit();
$tmpl = new OCP\Template('files_sharing', 'public', 'base');
$tmpl->assign('uidOwner', $shareOwner);
$tmpl->assign('displayName', \OCP\User::getDisplayName($shareOwner));
@ -164,8 +162,6 @@ if (isset($path)) {
}
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$tmpl->assign('freeSpace', $freeSpace);
$tmpl->assign('uploadLimit', $uploadLimit); // PHP upload limit
$urlLinkIdentifiers= (isset($token)?'&t='.$token:'')
.(isset($_GET['dir'])?'&dir='.$_GET['dir']:'')
@ -226,6 +222,9 @@ if (isset($path)) {
$maxUploadFilesize=OCP\Util::maxUploadFilesize($path);
$fileHeader = (!isset($files) or count($files) > 0);
$emptyContent = ($allowPublicUploadEnabled and !$fileHeader);
$freeSpace=OCP\Util::freeSpace($path);
$uploadLimit=OCP\Util::uploadLimit();
$folder = new OCP\Template('files', 'index', '');
$folder->assign('fileList', $list->fetchPage());
$folder->assign('breadcrumb', $breadcrumbNav->fetchPage());
@ -238,6 +237,8 @@ if (isset($path)) {
$folder->assign('files', $files);
$folder->assign('uploadMaxFilesize', $maxUploadFilesize);
$folder->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$folder->assign('freeSpace', $freeSpace);
$folder->assign('uploadLimit', $uploadLimit); // PHP upload limit
$folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
$folder->assign('usedSpacePercent', 0);
$folder->assign('fileHeader', $fileHeader);