summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/templates
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-10-22 10:54:01 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-10-30 15:18:55 +0100
commitbfb2a914d26ed05db871e961b66c3eddd5463de7 (patch)
tree9b0506e89a6d5290e597d24f21db2d897fe39da5 /apps/files_sharing/templates
parentc237a3f00340d807590f5b4df8e69738ed2fa2b9 (diff)
downloadnextcloud-server-bfb2a914d26ed05db871e961b66c3eddd5463de7.tar.gz
nextcloud-server-bfb2a914d26ed05db871e961b66c3eddd5463de7.zip
Honour "hide download" in the public share page
When the "hide download" property of a share is set the public share page will not show the download button nor the menu with the download, direct link and "Add to your Nextcloud" actions; the "downloadURL" hidden field will not be included either in the generated HTML. Despite that, note that the "downloadURL" parameter is still set and passed to the template, as this could be needed anyway to generate previews (for example, of audio files). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/files_sharing/templates')
-rw-r--r--apps/files_sharing/templates/public.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index cbcf32a8d86..4487e63f2de 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -11,7 +11,9 @@
<input type="hidden" id="filesApp" name="filesApp" value="1">
<input type="hidden" id="isPublic" name="isPublic" value="1">
<input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
-<input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL">
+<?php if (!$_['hideDownload']): ?>
+ <input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL">
+<?php endif; ?>
<input type="hidden" name="previewURL" value="<?php p($_['previewURL']) ?>" id="previewURL">
<input type="hidden" name="sharingToken" value="<?php p($_['sharingToken']) ?>" id="sharingToken">
<input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">
@@ -59,7 +61,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
<!-- Preview frame is filled via JS to support SVG images for modern browsers -->
<div id="imgframe"></div>
<?php endif; ?>
- <?php if ($_['previewURL'] === $_['downloadURL']): ?>
+ <?php if ($_['previewURL'] === $_['downloadURL'] && !$_['hideDownload']): ?>
<div class="directDownload">
<a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button">
<span class="icon icon-download"></span>