]> source.dussan.org Git - nextcloud-server.git/commitdiff
make it possible to disable previews
authorGeorg Ehrke <developer@georgehrke.com>
Fri, 23 Aug 2013 21:05:44 +0000 (23:05 +0200)
committerGeorg Ehrke <developer@georgehrke.com>
Fri, 23 Aug 2013 21:05:44 +0000 (23:05 +0200)
config/config.sample.php
lib/preview.php

index 5c40078c7d7d117908c7800cc8d7d619bbf70b51..76de97818d5ab6b63970a1e434296f8a9d14278c 100644 (file)
@@ -191,6 +191,7 @@ $CONFIG = array(
 'customclient_ios' => '', //https://itunes.apple.com/us/app/owncloud/id543672169?mt=8
 
 // PREVIEW
+'disable_previews' => false,
 /* the max width of a generated preview, if value is null, there is no limit */
 'preview_max_x' => null,
 /* the max height of a generated preview, if value is null, there is no limit */
index 9fed7f1b58fb5a2441292e64fdd5b82834db6095..0497ec95bc5fb8fd8d53f4f456d5dead1a426e79 100755 (executable)
@@ -568,6 +568,12 @@ class Preview {
         * @return void
         */
        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) {
                        return;
                }
@@ -599,6 +605,10 @@ class Preview {
        }
 
        public static function isMimeSupported($mimetype) {
+               if(\OC_Config::getValue('disable_previews', false)) {
+                       return false;
+               }
+
                //check if there are preview backends
                if(empty(self::$providers)) {
                        self::initProviders();