Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-05-02 17:51:41 +0400
committerVincent Petry <pvince81@owncloud.com>2014-07-08 12:44:35 +0400
commitfca5af206f49789a22e5c6ec68942a9e3574070d (patch)
tree034f120a45dac3fec1a110ce5051712041392021 /apps/files_sharing
parentbfe76fa9e29b12ab25240bf19e93fdf8b3e55b74 (diff)
disable download button if zip download is disabled
Backport of 6e75b37
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/public.php2
-rw-r--r--apps/files_sharing/templates/public.php2
2 files changed, 4 insertions, 0 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 23e147eecbe..e98c9502888 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -244,9 +244,11 @@ if (isset($path)) {
$allowZip = OCP\Config::getSystemValue('allowZipDownload', true)
&& ( $maxInputFileSize === 0 || $totalSize <= $maxInputFileSize);
$tmpl->assign('allowZipDownload', intval($allowZip));
+ $tmpl->assign('showDownloadButton', intval($allowZip));
$tmpl->assign('downloadURL',
OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=' . urlencode($getPath));
} else {
+ $tmpl->assign('showDownloadButton', true);
$tmpl->assign('dir', $dir);
// Show file preview if viewer is available
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index e6c5f408bf7..0eb4301b46c 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -15,10 +15,12 @@
src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="<?php p($theme->getName()); ?>" /></a>
<div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div>
<div class="header-right">
+ <?php if ($_['showDownloadButton']): ?>
<a href="<?php p($_['downloadURL']); ?>" id="download" class="button">
<img class="svg" alt="" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"/>
<?php p($l->t('Download'))?>
</a>
+ <?php endif ?>
</div>
</div></header>
<div id="content">