Only have direct preview urls for image files
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
05c37526a7
commit
4077f684e1
1 changed files with 5 additions and 2 deletions
|
@ -372,13 +372,16 @@ class ShareController extends Controller {
|
||||||
$shareTmpl['previewMaxX'] = $this->config->getSystemValue('preview_max_x', 1024);
|
$shareTmpl['previewMaxX'] = $this->config->getSystemValue('preview_max_x', 1024);
|
||||||
$shareTmpl['previewMaxY'] = $this->config->getSystemValue('preview_max_y', 1024);
|
$shareTmpl['previewMaxY'] = $this->config->getSystemValue('preview_max_y', 1024);
|
||||||
$shareTmpl['disclaimer'] = $this->config->getAppValue('core', 'shareapi_public_link_disclaimertext', null);
|
$shareTmpl['disclaimer'] = $this->config->getAppValue('core', 'shareapi_public_link_disclaimertext', null);
|
||||||
|
$shareTmpl['previewURL'] = $shareTmpl['downloadURL'];
|
||||||
if ($shareTmpl['previewSupported']) {
|
if ($shareTmpl['previewSupported']) {
|
||||||
$shareTmpl['previewImage'] = $this->urlGenerator->linkToRouteAbsolute( 'files_sharing.PublicPreview.getPreview',
|
$shareTmpl['previewImage'] = $this->urlGenerator->linkToRouteAbsolute( 'files_sharing.PublicPreview.getPreview',
|
||||||
['x' => 200, 'y' => 200, 'file' => $shareTmpl['directory_path'], 't' => $shareTmpl['dirToken']]);
|
['x' => 200, 'y' => 200, 'file' => $shareTmpl['directory_path'], 't' => $shareTmpl['dirToken']]);
|
||||||
$shareTmpl['previewURL'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.publicpreview.directLink', ['token' => $token]);
|
// 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 {
|
} else {
|
||||||
$shareTmpl['previewImage'] = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'favicon-fb.png'));
|
$shareTmpl['previewImage'] = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'favicon-fb.png'));
|
||||||
$shareTmpl['previewURL'] = $shareTmpl['downloadURL'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load files we need
|
// Load files we need
|
||||||
|
|
Loading…
Reference in a new issue