summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/templates
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-10-15 11:58:44 +0200
committerLukas Reschke <lukas@owncloud.com>2014-11-14 16:26:59 +0100
commit988c85d2922a03346389e3656dc71dfee514e645 (patch)
tree9be0d1674dd7e780c70c77a987c4a810145078ab /apps/files_sharing/templates
parent0f3c5d8541dcb41eebd00f22864a0a646c11124f (diff)
downloadnextcloud-server-988c85d2922a03346389e3656dc71dfee514e645.tar.gz
nextcloud-server-988c85d2922a03346389e3656dc71dfee514e645.zip
Refactor file sharing public link handling
fixes download issue introduced by #10755 Conflicts: apps/files_sharing/public.php
Diffstat (limited to 'apps/files_sharing/templates')
-rw-r--r--apps/files_sharing/templates/authenticate.php8
-rw-r--r--apps/files_sharing/templates/public.php26
2 files changed, 30 insertions, 4 deletions
diff --git a/apps/files_sharing/templates/authenticate.php b/apps/files_sharing/templates/authenticate.php
index 0c4ac6ca445..e3aa62b9ece 100644
--- a/apps/files_sharing/templates/authenticate.php
+++ b/apps/files_sharing/templates/authenticate.php
@@ -1,4 +1,9 @@
-<form action="<?php p($_['URL']); ?>" method="post">
+<?php
+ /** @var $_ array */
+ /** @var $l OC_L10N */
+ style('files_sharing', 'authenticate');
+?>
+<form method="post">
<fieldset>
<?php if (!isset($_['wrongpw'])): ?>
<div class="warning-info"><?php p($l->t('This share is password-protected')); ?></div>
@@ -8,6 +13,7 @@
<?php endif; ?>
<p>
<label for="password" class="infield"><?php p($l->t('Password')); ?></label>
+ <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
<input type="password" name="password" id="password"
placeholder="<?php p($l->t('Password')); ?>" value=""
autocomplete="off" autocapitalize="off" autocorrect="off"
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index 46bf90b1b41..6b875d3c2b7 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -1,8 +1,28 @@
-<?php /** @var $l OC_L10N */ ?>
<?php
+/** @var $l OC_L10N */
+/** @var $_ array */
+
+OCP\Util::addScript('files', 'file-upload');
+OCP\Util::addStyle('files_sharing', 'public');
+OCP\Util::addStyle('files_sharing', 'mobile');
+OCP\Util::addScript('files_sharing', 'public');
+OCP\Util::addScript('files', 'fileactions');
+OCP\Util::addScript('files', 'jquery.iframe-transport');
+OCP\Util::addScript('files', 'jquery.fileupload');
+
+// JS required for folders
+OCP\Util::addStyle('files', 'files');
+OCP\Util::addStyle('files', 'upload');
+OCP\Util::addScript('files', 'filesummary');
+OCP\Util::addScript('files', 'breadcrumb');
+OCP\Util::addScript('files', 'files');
+OCP\Util::addScript('files', 'filelist');
+OCP\Util::addscript('files', 'keyboardshortcuts');
+
$thumbSize=1024;
$previewSupported = OC\Preview::isMimeSupported($_['mimetype']) ? 'true' : 'false';
?>
+
<?php if ( \OC\Preview::isMimeSupported($_['mimetype'])): /* This enables preview images for links (e.g. on Facebook, Google+, ...)*/?>
<link rel="image_src" href="<?php p(OCP\Util::linkToRoute( 'core_ajax_public_preview', array('x' => $thumbSize, 'y' => $thumbSize, 'file' => $_['directory_path'], 't' => $_['dirToken']))); ?>" />
<?php endif; ?>
@@ -24,7 +44,7 @@ $previewSupported = OC\Preview::isMimeSupported($_['mimetype']) ? 'true' : 'fals
<header><div id="header" class="<?php p((isset($_['folder']) ? 'share-folder' : 'share-file')) ?>">
<a href="<?php print_unescaped(link_to('', 'index.php')); ?>"
- title="" id="owncloud">
+ title="" id="owncloud">
<div class="logo-wide svg"></div>
</a>
<div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div>
@@ -48,7 +68,7 @@ $previewSupported = OC\Preview::isMimeSupported($_['mimetype']) ? 'true' : 'fals
</a>
</span>
</div>
-</div></header>
+ </div></header>
<div id="content">
<div id="preview">
<?php if (isset($_['folder'])): ?>