Skip to content

Commit 79681ef

Browse files
authored
Merge pull request #12398 from nextcloud/fix/12378
change "Download" to "Download all files" for shared folders
2 parents 3c5e438 + 1f237c7 commit 79681ef

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

apps/files_sharing/lib/Controller/ShareController.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -455,12 +455,21 @@ public function showShare($path = ''): TemplateResponse {
455455

456456
if ($isNoneFileDropFolder && !$share->getHideDownload()) {
457457
\OCP\Util::addScript('files_sharing', 'public_note');
458-
$response->setHeaderActions([
459-
new SimpleMenuAction('download', $this->l10n->t('Download'), 'icon-download-white', $shareTmpl['downloadURL'], 0),
460-
new SimpleMenuAction('download', $this->l10n->t('Download'), 'icon-download', $shareTmpl['downloadURL'], 10, $shareTmpl['fileSize']),
461-
new LinkMenuAction($this->l10n->t('Direct link'), 'icon-public', $shareTmpl['previewURL']),
462-
new ExternalShareMenuAction($this->l10n->t('Add to your Nextcloud'), 'icon-external', $shareTmpl['owner'], $shareTmpl['displayName'], $shareTmpl['filename']),
463-
]);
458+
if ($shareIsFolder) {
459+
$response->setHeaderActions([
460+
new SimpleMenuAction('download', $this->l10n->t('Download all files'), 'icon-download-white', $shareTmpl['downloadURL'], 0),
461+
new SimpleMenuAction('download', $this->l10n->t('Download all files'), 'icon-download', $shareTmpl['downloadURL'], 10, $shareTmpl['fileSize']),
462+
new LinkMenuAction($this->l10n->t('Direct link'), 'icon-public', $shareTmpl['previewURL']),
463+
new ExternalShareMenuAction($this->l10n->t('Add to your Nextcloud'), 'icon-external', $shareTmpl['owner'], $shareTmpl['displayName'], $shareTmpl['filename']),
464+
]);
465+
} else {
466+
$response->setHeaderActions([
467+
new SimpleMenuAction('download', $this->l10n->t('Download'), 'icon-download-white', $shareTmpl['downloadURL'], 0),
468+
new SimpleMenuAction('download', $this->l10n->t('Download'), 'icon-download', $shareTmpl['downloadURL'], 10, $shareTmpl['fileSize']),
469+
new LinkMenuAction($this->l10n->t('Direct link'), 'icon-public', $shareTmpl['previewURL']),
470+
new ExternalShareMenuAction($this->l10n->t('Add to your Nextcloud'), 'icon-external', $shareTmpl['owner'], $shareTmpl['displayName'], $shareTmpl['filename']),
471+
]);
472+
}
464473
}
465474

466475
$response->setContentSecurityPolicy($csp);

0 commit comments

Comments
 (0)