diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-09-27 23:27:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-27 23:27:54 +0200 |
commit | 5f25dd7095fadccb7458dbe09c048fbf6645552d (patch) | |
tree | 914341bb1e74a13e0ebaa113192982e4bbe162d9 /apps/files_sharing/lib/Controller/ShareController.php | |
parent | 72889e57ca64f058f7cf206ac95cf6c0907ed771 (diff) | |
parent | 4077f684e137774f48cb1f575bc8a7bfd862c78b (diff) | |
download | nextcloud-server-5f25dd7095fadccb7458dbe09c048fbf6645552d.tar.gz nextcloud-server-5f25dd7095fadccb7458dbe09c048fbf6645552d.zip |
Merge pull request #6599 from nextcloud/fix_2523
Add direct preview link
Diffstat (limited to 'apps/files_sharing/lib/Controller/ShareController.php')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareController.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index 14fc8d63381..a7cf1a78971 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -372,9 +372,14 @@ class ShareController extends Controller { $shareTmpl['previewMaxX'] = $this->config->getSystemValue('preview_max_x', 1024); $shareTmpl['previewMaxY'] = $this->config->getSystemValue('preview_max_y', 1024); $shareTmpl['disclaimer'] = $this->config->getAppValue('core', 'shareapi_public_link_disclaimertext', null); + $shareTmpl['previewURL'] = $shareTmpl['downloadURL']; if ($shareTmpl['previewSupported']) { $shareTmpl['previewImage'] = $this->urlGenerator->linkToRouteAbsolute( 'files_sharing.PublicPreview.getPreview', ['x' => 200, 'y' => 200, 'file' => $shareTmpl['directory_path'], 't' => $shareTmpl['dirToken']]); + // We just have direct previews for image files + if ($share->getNode()->getMimePart() === 'image') { + $shareTmpl['previewURL'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.publicpreview.directLink', ['token' => $token]); + } } else { $shareTmpl['previewImage'] = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'favicon-fb.png')); } |