resourceloader: Track state of page-style modules
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderFileModule.php
index b06553a..6b755d7 100644 (file)
@@ -922,6 +922,28 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                return $this->targets;
        }
 
+       /**
+        * Get the module's load type.
+        *
+        * @since 1.28
+        * @return string
+        */
+       public function getType() {
+               $canBeStylesOnly = !(
+                       // All options except 'styles', 'skinStyles' and 'debugRaw'
+                       $this->scripts
+                       || $this->debugScripts
+                       || $this->templates
+                       || $this->languageScripts
+                       || $this->skinScripts
+                       || $this->dependencies
+                       || $this->messages
+                       || $this->skipFunction
+                       || $this->raw
+               );
+               return $canBeStylesOnly ? self::LOAD_STYLES : self::LOAD_GENERAL;
+       }
+
        /**
         * Compile a LESS file into CSS.
         *