Merge pull request #7105 from NCTU-NBA/pr-7098

Fix #7098
This commit is contained in:
Morris Jobke 2014-02-06 11:02:06 +01:00
commit 8f7b99d2e5
1 changed files with 5 additions and 9 deletions

View File

@ -143,18 +143,13 @@ if (isset($path)) {
OCP\Util::addScript('files', 'jquery.iframe-transport'); OCP\Util::addScript('files', 'jquery.iframe-transport');
OCP\Util::addScript('files', 'jquery.fileupload'); OCP\Util::addScript('files', 'jquery.fileupload');
$maxUploadFilesize=OCP\Util::maxUploadFilesize($path); $maxUploadFilesize=OCP\Util::maxUploadFilesize($path);
$freeSpace=OCP\Util::freeSpace($dir);
$uploadLimit=OCP\Util::uploadLimit();
$tmpl = new OCP\Template('files_sharing', 'public', 'base'); $tmpl = new OCP\Template('files_sharing', 'public', 'base');
$tmpl->assign('uidOwner', $shareOwner);
$tmpl->assign('displayName', \OCP\User::getDisplayName($shareOwner)); $tmpl->assign('displayName', \OCP\User::getDisplayName($shareOwner));
$tmpl->assign('filename', $file); $tmpl->assign('filename', $file);
$tmpl->assign('directory_path', $linkItem['file_target']); $tmpl->assign('directory_path', $linkItem['file_target']);
$tmpl->assign('mimetype', \OC\Files\Filesystem::getMimeType($path)); $tmpl->assign('mimetype', \OC\Files\Filesystem::getMimeType($path));
$tmpl->assign('fileTarget', basename($linkItem['file_target']));
$tmpl->assign('dirToken', $linkItem['token']); $tmpl->assign('dirToken', $linkItem['token']);
$tmpl->assign('sharingToken', $token); $tmpl->assign('sharingToken', $token);
$tmpl->assign('disableSharing', true);
$allowPublicUploadEnabled = (bool) ($linkItem['permissions'] & OCP\PERMISSION_CREATE); $allowPublicUploadEnabled = (bool) ($linkItem['permissions'] & OCP\PERMISSION_CREATE);
if (OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes') === 'no') { if (OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes') === 'no') {
$allowPublicUploadEnabled = false; $allowPublicUploadEnabled = false;
@ -162,10 +157,6 @@ if (isset($path)) {
if ($linkItem['item_type'] !== 'folder') { if ($linkItem['item_type'] !== 'folder') {
$allowPublicUploadEnabled = false; $allowPublicUploadEnabled = false;
} }
$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:'') $urlLinkIdentifiers= (isset($token)?'&t='.$token:'')
.(isset($_GET['dir'])?'&dir='.$_GET['dir']:'') .(isset($_GET['dir'])?'&dir='.$_GET['dir']:'')
@ -226,6 +217,9 @@ if (isset($path)) {
$maxUploadFilesize=OCP\Util::maxUploadFilesize($path); $maxUploadFilesize=OCP\Util::maxUploadFilesize($path);
$fileHeader = (!isset($files) or count($files) > 0); $fileHeader = (!isset($files) or count($files) > 0);
$emptyContent = ($allowPublicUploadEnabled and !$fileHeader); $emptyContent = ($allowPublicUploadEnabled and !$fileHeader);
$freeSpace=OCP\Util::freeSpace($path);
$uploadLimit=OCP\Util::uploadLimit();
$folder = new OCP\Template('files', 'index', ''); $folder = new OCP\Template('files', 'index', '');
$folder->assign('fileList', $list->fetchPage()); $folder->assign('fileList', $list->fetchPage());
$folder->assign('breadcrumb', $breadcrumbNav->fetchPage()); $folder->assign('breadcrumb', $breadcrumbNav->fetchPage());
@ -238,6 +232,8 @@ if (isset($path)) {
$folder->assign('files', $files); $folder->assign('files', $files);
$folder->assign('uploadMaxFilesize', $maxUploadFilesize); $folder->assign('uploadMaxFilesize', $maxUploadFilesize);
$folder->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($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('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
$folder->assign('usedSpacePercent', 0); $folder->assign('usedSpacePercent', 0);
$folder->assign('fileHeader', $fileHeader); $folder->assign('fileHeader', $fileHeader);