aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/Controller
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-02-27 13:33:19 +0100
committerGitHub <noreply@github.com>2018-02-27 13:33:19 +0100
commit01f420c7ac38128c03975d7de7dd20190c4afcc1 (patch)
treeca9c599c93d8bd7c90237b9b90fe2fcb80808eae /apps/files_sharing/lib/Controller
parent017e1325f14d3cdbf8d16326f47d1aefa7eac4ea (diff)
parent36563d4a4b98cbd491b3832c29fee77e9f8b7118 (diff)
downloadnextcloud-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.php16
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);