Merge "Fix RequestContextTest screwing up $wgUser"
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderSiteModule.php
index 1cc5c1a..d28f40f 100644 (file)
@@ -32,25 +32,24 @@ class ResourceLoaderSiteModule extends ResourceLoaderWikiModule {
        /**
         * Gets list of pages used by this module
         *
-        * @param $context ResourceLoaderContext
+        * @param ResourceLoaderContext $context
         *
-        * @return Array: List of pages
+        * @return array List of pages
         */
        protected function getPages( ResourceLoaderContext $context ) {
-               global $wgHandheldStyle;
+               global $wgUseSiteJs, $wgUseSiteCss;
 
-               $pages = array(
-                       'MediaWiki:Common.js' => array( 'type' => 'script' ),
-                       'MediaWiki:Common.css' => array( 'type' => 'style' ),
-                       'MediaWiki:' . ucfirst( $context->getSkin() ) . '.js' => array( 'type' => 'script' ),
-                       'MediaWiki:' . ucfirst( $context->getSkin() ) . '.css' => array( 'type' => 'style' ),
-                       'MediaWiki:Print.css' => array( 'type' => 'style', 'media' => 'print' ),
-               );
-               if ( $wgHandheldStyle ) {
-                       $pages['MediaWiki:Handheld.css'] = array(
-                               'type' => 'style',
-                               'media' => 'handheld' );
+               $pages = array();
+               if ( $wgUseSiteJs ) {
+                       $pages['MediaWiki:Common.js'] = array( 'type' => 'script' );
+                       $pages['MediaWiki:' . ucfirst( $context->getSkin() ) . '.js'] = array( 'type' => 'script' );
                }
+               if ( $wgUseSiteCss ) {
+                       $pages['MediaWiki:Common.css'] = array( 'type' => 'style' );
+                       $pages['MediaWiki:' . ucfirst( $context->getSkin() ) . '.css'] = array( 'type' => 'style' );
+
+               }
+               $pages['MediaWiki:Print.css'] = array( 'type' => 'style', 'media' => 'print' );
                return $pages;
        }
 
@@ -59,7 +58,7 @@ class ResourceLoaderSiteModule extends ResourceLoaderWikiModule {
        /**
         * Gets group name
         *
-        * @return String: Name of group
+        * @return string Name of group
         */
        public function getGroup() {
                return 'site';