diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-02-27 13:33:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-27 13:33:19 +0100 |
commit | 01f420c7ac38128c03975d7de7dd20190c4afcc1 (patch) | |
tree | ca9c599c93d8bd7c90237b9b90fe2fcb80808eae /apps/files_sharing/lib/Controller | |
parent | 017e1325f14d3cdbf8d16326f47d1aefa7eac4ea (diff) | |
parent | 36563d4a4b98cbd491b3832c29fee77e9f8b7118 (diff) | |
download | nextcloud-server-01f420c7ac38128c03975d7de7dd20190c4afcc1.tar.gz nextcloud-server-01f420c7ac38128c03975d7de7dd20190c4afcc1.zip |
Merge pull request #8051 from nextcloud/public-template
Public page template response
Diffstat (limited to 'apps/files_sharing/lib/Controller')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareController.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index 795d069c1b8..1f8864fc5f3 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -38,6 +38,10 @@ namespace OCA\Files_Sharing\Controller; use OC_Files; use OC_Util; use OCA\FederatedFileSharing\FederatedShareProvider; +use OCA\Files_Sharing\Template\ExternalShareMenuAction; +use OCA\Files_Sharing\Template\LinkMenuAction; +use OCP\AppFramework\Http\Template\SimpleMenuAction; +use OCP\AppFramework\Http\Template\PublicTemplateResponse; use OCP\Defaults; use OCP\IL10N; use OCP\Template; @@ -435,7 +439,17 @@ class ShareController extends Controller { $csp = new \OCP\AppFramework\Http\ContentSecurityPolicy(); $csp->addAllowedFrameDomain('\'self\''); - $response = new TemplateResponse($this->appName, 'public', $shareTmpl, 'base'); + + $response = new PublicTemplateResponse($this->appName, 'public', $shareTmpl); + $response->setHeaderTitle($shareTmpl['filename']); + $response->setHeaderDetails($this->l10n->t('shared by %s', [$shareTmpl['displayName']])); + $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']), + new ExternalShareMenuAction($this->l10n->t('Add to your Nextcloud'), 'icon-external', $shareTmpl['owner'], $shareTmpl['displayName'], $shareTmpl['filename']), + ]); + $response->setContentSecurityPolicy($csp); $this->emitAccessShareHook($share); |