summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/templates
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-03-16 11:18:25 +0100
committerJoas Schilling <nickvergessen@owncloud.com>2015-03-16 12:45:18 +0100
commit47af533183c8b8bf3ed05083e9e48723e1e7e9e5 (patch)
treeca383b61adeb03e4e6d63ccdb87d39b663201da1 /apps/files_sharing/templates
parent8ed27d2ce0477f40a27cdc335361b0d5654a7e09 (diff)
downloadnextcloud-server-47af533183c8b8bf3ed05083e9e48723e1e7e9e5.tar.gz
nextcloud-server-47af533183c8b8bf3ed05083e9e48723e1e7e9e5.zip
Move mimetype check from template to controller
Diffstat (limited to 'apps/files_sharing/templates')
-rw-r--r--apps/files_sharing/templates/public.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index 26fee0b8694..fa349f29811 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -19,11 +19,10 @@ OCP\Util::addScript('files', 'files');
OCP\Util::addScript('files', 'filelist');
OCP\Util::addscript('files', 'keyboardshortcuts');
-$thumbSize=1024;
-$previewSupported = \OC::$server->getPreviewManager()->isMimeSupported($_['mimetype']) ? 'true' : 'false';
+$thumbSize = 1024;
?>
-<?php if ($previewSupported === 'true'): /* This enables preview images for links (e.g. on Facebook, Google+, ...)*/?>
+<?php if ($_['previewSupported']): /* This enables preview images for links (e.g. on Facebook, Google+, ...)*/?>
<link rel="image_src" href="<?php p(OCP\Util::linkToRoute( 'core_ajax_public_preview', array('x' => $thumbSize, 'y' => $thumbSize, 'file' => $_['directory_path'], 't' => $_['dirToken']))); ?>" />
<?php endif; ?>
@@ -38,7 +37,7 @@ $previewSupported = \OC::$server->getPreviewManager()->isMimeSupported($_['mimet
<input type="hidden" name="sharingToken" value="<?php p($_['sharingToken']) ?>" id="sharingToken">
<input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">
<input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype">
-<input type="hidden" name="previewSupported" value="<?php p($previewSupported); ?>" id="previewSupported">
+<input type="hidden" name="previewSupported" value="<?php p($_['previewSupported'] ? 'true' : 'false'); ?>" id="previewSupported">
<input type="hidden" name="mimetypeIcon" value="<?php p(OC_Helper::mimetypeIcon($_['mimetype'])); ?>" id="mimetypeIcon">
<input type="hidden" name="filesize" value="<?php p($_['nonHumanFileSize']); ?>" id="filesize">
<input type="hidden" name="maxSizeAnimateGif" value="<?php p($_['maxSizeAnimateGif']); ?>" id="maxSizeAnimateGif">