diff options
author | Jonas Sulzer <jonas@violoncello.ch> | 2018-12-25 20:54:01 +0100 |
---|---|---|
committer | Jonas Sulzer <jonas@violoncello.ch> | 2019-01-31 22:38:31 +0100 |
commit | 30d4024d9d7b9ea1887e8fd270584c77bf43cca7 (patch) | |
tree | 8130fbd03eef4f9cad98b8f9f1b224ed75a6b742 /apps | |
parent | 61ee72a89d65de50609d4335e21f64f810e98d9a (diff) | |
download | nextcloud-server-30d4024d9d7b9ea1887e8fd270584c77bf43cca7.tar.gz nextcloud-server-30d4024d9d7b9ea1887e8fd270584c77bf43cca7.zip |
only show "Add to your Nextcloud" on share link if federation is activated
Signed-off-by: Jonas Sulzer <jonas@violoncello.ch>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareController.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index f3ad6223511..caddeb26b62 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -455,14 +455,26 @@ class ShareController extends AuthPublicShareController { if ($isNoneFileDropFolder && !$share->getHideDownload()) { \OCP\Util::addScript('files_sharing', 'public_note'); - if ($shareIsFolder) { + if ($shareIsFolder && $this->federatedShareProvider->isOutgoingServer2serverShareEnabled()) { $response->setHeaderActions([ new SimpleMenuAction('download', $this->l10n->t('Download all files'), 'icon-download-white', $shareTmpl['downloadURL'], 0), new SimpleMenuAction('download', $this->l10n->t('Download all files'), 'icon-download', $shareTmpl['downloadURL'], 10, $shareTmpl['fileSize']), new LinkMenuAction($this->l10n->t('Direct link'), 'icon-public', $shareTmpl['previewURL']), new ExternalShareMenuAction($this->l10n->t('Add to your Nextcloud'), 'icon-external', $shareTmpl['owner'], $shareTmpl['displayName'], $shareTmpl['filename']), ]); - } else { + } elseif ($shareIsFolder && !$this->federatedShareProvider->isOutgoingServer2serverShareEnabled()) { + $response->setHeaderActions([ + new SimpleMenuAction('download', $this->l10n->t('Download all files'), 'icon-download-white', $shareTmpl['downloadURL'], 0), + new SimpleMenuAction('download', $this->l10n->t('Download all files'), 'icon-download', $shareTmpl['downloadURL'], 10, $shareTmpl['fileSize']), + new LinkMenuAction($this->l10n->t('Direct link'), 'icon-public', $shareTmpl['previewURL']), + ]); + } elseif (!$this->federatedShareProvider->isOutgoingServer2serverShareEnabled()) { + $response->setHeaderActions([ + new SimpleMenuAction('download', $this->l10n->t('Download'), 'icon-download-white', $shareTmpl['downloadURL'], 0), + new SimpleMenuAction('download', $this->l10n->t('Download'), 'icon-download', $shareTmpl['downloadURL'], 10, $shareTmpl['fileSize']), + new LinkMenuAction($this->l10n->t('Direct link'), 'icon-public', $shareTmpl['previewURL']), + ]); + } else { $response->setHeaderActions([ new SimpleMenuAction('download', $this->l10n->t('Download'), 'icon-download-white', $shareTmpl['downloadURL'], 0), new SimpleMenuAction('download', $this->l10n->t('Download'), 'icon-download', $shareTmpl['downloadURL'], 10, $shareTmpl['fileSize']), |