summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/public.php
diff options
context:
space:
mode:
authorRoman Geber <rgeber@owncloudapps.com>2013-06-25 12:24:14 +0200
committerRoman Geber <rgeber@owncloudapps.com>2013-06-25 12:24:14 +0200
commitddb0ff346d3d8063f88fdba8749e098a81b92d54 (patch)
tree69004e69ed8ca2537d1029d9729d112feb6b5c20 /apps/files_sharing/public.php
parentc3b8f2bf64ef7b6cbdabb382b1c0a721bddb4041 (diff)
downloadnextcloud-server-ddb0ff346d3d8063f88fdba8749e098a81b92d54.tar.gz
nextcloud-server-ddb0ff346d3d8063f88fdba8749e098a81b92d54.zip
Public upload feature
Diffstat (limited to 'apps/files_sharing/public.php')
-rw-r--r--apps/files_sharing/public.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 98d2a84fb66..fa8c25fc98d 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -132,15 +132,25 @@ if (isset($path)) {
}
exit();
} else {
+ OCP\Util::addScript('files', 'file-upload');
OCP\Util::addStyle('files_sharing', 'public');
OCP\Util::addScript('files_sharing', 'public');
OCP\Util::addScript('files', 'fileactions');
+ OCP\Util::addScript('files', 'jquery.iframe-transport');
+ OCP\Util::addScript('files', 'jquery.fileupload');
+ $maxUploadFilesize=OCP\Util::maxUploadFilesize($path);
$tmpl = new OCP\Template('files_sharing', 'public', 'base');
$tmpl->assign('uidOwner', $shareOwner);
$tmpl->assign('displayName', \OCP\User::getDisplayName($shareOwner));
$tmpl->assign('filename', $file);
+ $tmpl->assign('directory_path', $linkItem['file_target']);
$tmpl->assign('mimetype', \OC\Files\Filesystem::getMimeType($path));
$tmpl->assign('fileTarget', basename($linkItem['file_target']));
+ $tmpl->assign('dirToken', $linkItem['token']);
+ $tmpl->assign('allowPublicUploadEnabled', (($linkItem['permissions'] & OCP\PERMISSION_CREATE) ? true : false ));
+ $tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
+ $tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
+
$urlLinkIdentifiers= (isset($token)?'&t='.$token:'')
.(isset($_GET['dir'])?'&dir='.$_GET['dir']:'')
.(isset($_GET['file'])?'&file='.$_GET['file']:'');
@@ -191,15 +201,17 @@ if (isset($path)) {
$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');
$breadcrumbNav->assign('breadcrumb', $breadcrumb);
$breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=');
+ $maxUploadFilesize=OCP\Util::maxUploadFilesize($path);
$folder = new OCP\Template('files', 'index', '');
$folder->assign('fileList', $list->fetchPage());
$folder->assign('breadcrumb', $breadcrumbNav->fetchPage());
$folder->assign('dir', $getPath);
$folder->assign('isCreatable', false);
- $folder->assign('permissions', 0);
+ $folder->assign('permissions', OCP\PERMISSION_READ);
+ $folder->assign('isPublic',true);
$folder->assign('files', $files);
- $folder->assign('uploadMaxFilesize', 0);
- $folder->assign('uploadMaxHumanFilesize', 0);
+ $folder->assign('uploadMaxFilesize', $maxUploadFilesize);
+ $folder->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
$folder->assign('usedSpacePercent', 0);
$tmpl->assign('folder', $folder->fetchPage());