[Pkg-owncloud-commits] [owncloud] 10/36: Disable video preview if previews are disabled

David Prévot taffit at moszumanska.debian.org
Tue Jun 23 23:12:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 7ca01a65dd353a06533af7bf0e8fabaa7cdbd960
Author: Morris Jobke <hey at morrisjobke.de>
Date:   Tue Jun 9 16:33:26 2015 +0200

    Disable video preview if previews are disabled
---
 apps/files_sharing/public.php           | 1 +
 apps/files_sharing/templates/public.php | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 1145b2c..9f4efa6 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -136,6 +136,7 @@ if (isset($path)) {
 		$tmpl->assign('sharingToken', $token);
 		$tmpl->assign('server2serversharing', Helper::isOutgoingServer2serverShareEnabled());
 		$tmpl->assign('protected', isset($linkItem['share_with']) ? 'true' : 'false');
+		$tmpl->assign('previewEnabled', \OC::$server->getConfig()->getSystemValue('enable_previews', true));
 
 		$urlLinkIdentifiers= (isset($token)?'&t='.$token:'')
 							.(isset($_GET['dir'])?'&dir='.$_GET['dir']:'')
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index 46bf90b..d4bb255 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -54,7 +54,7 @@ $previewSupported = OC\Preview::isMimeSupported($_['mimetype']) ? 'true' : 'fals
 		<?php if (isset($_['folder'])): ?>
 			<?php print_unescaped($_['folder']); ?>
 		<?php else: ?>
-			<?php if (substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?>
+			<?php if ($_['previewEnabled'] && substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?>
 				<div id="imgframe">
 					<video tabindex="0" controls="" preload="none">
 						<source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list