make it possible to disable previews
This commit is contained in:
parent
224b80f906
commit
1dab076750
|
@ -191,6 +191,7 @@ $CONFIG = array(
|
||||||
'customclient_ios' => '', //https://itunes.apple.com/us/app/owncloud/id543672169?mt=8
|
'customclient_ios' => '', //https://itunes.apple.com/us/app/owncloud/id543672169?mt=8
|
||||||
|
|
||||||
// PREVIEW
|
// PREVIEW
|
||||||
|
'disable_previews' => false,
|
||||||
/* the max width of a generated preview, if value is null, there is no limit */
|
/* the max width of a generated preview, if value is null, there is no limit */
|
||||||
'preview_max_x' => null,
|
'preview_max_x' => null,
|
||||||
/* the max height of a generated preview, if value is null, there is no limit */
|
/* the max height of a generated preview, if value is null, there is no limit */
|
||||||
|
|
|
@ -568,6 +568,12 @@ class Preview {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private static function initProviders() {
|
private static function initProviders() {
|
||||||
|
if(\OC_Config::getValue('disable_previews', false)) {
|
||||||
|
$provider = new Preview\Unknown();
|
||||||
|
self::$providers = array($provider);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(count(self::$providers)>0) {
|
if(count(self::$providers)>0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -599,6 +605,10 @@ class Preview {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function isMimeSupported($mimetype) {
|
public static function isMimeSupported($mimetype) {
|
||||||
|
if(\OC_Config::getValue('disable_previews', false)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//check if there are preview backends
|
//check if there are preview backends
|
||||||
if(empty(self::$providers)) {
|
if(empty(self::$providers)) {
|
||||||
self::initProviders();
|
self::initProviders();
|
||||||
|
|
Loading…
Reference in New Issue