Luis Felipe Schenone has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/65319


Change subject: MonoBook module declarations moved from Resources.php to 
MonoBook.php
......................................................................

MonoBook module declarations moved from Resources.php to MonoBook.php

The module declarations for a skin should be done from within that
skin. So far, however, all the default skins have their module
declarations done from within the resource loader itself. This patch
fixes this for the MonoBook skin. In order for it to work, the skin
files had to be removed from AutoLoader.php and added instead from
the DefaultSettings.php

If this patch ends up merged, I'll do the same with the other default
skins.

Change-Id: I2a05114c573d7cc21d50bd81d1feed885fa4b6f7
---
M includes/AutoLoader.php
M includes/DefaultSettings.php
M resources/Resources.php
M skins/MonoBook.php
4 files changed, 27 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/19/65319/1

diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php
index 3e08e74..a09ea2b 100644
--- a/includes/AutoLoader.php
+++ b/includes/AutoLoader.php
@@ -1091,10 +1091,8 @@
        # skins
        'CologneBlueTemplate' => 'skins/CologneBlue.php',
        'ModernTemplate' => 'skins/Modern.php',
-       'MonoBookTemplate' => 'skins/MonoBook.php',
        'SkinCologneBlue' => 'skins/CologneBlue.php',
        'SkinModern' => 'skins/Modern.php',
-       'SkinMonoBook' => 'skins/MonoBook.php',
        'SkinVector' => 'skins/Vector.php',
        'VectorTemplate' => 'skins/Vector.php',
 );
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 9221784..666ca63 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -6344,3 +6344,8 @@
  * vim: foldmarker=@{,@} foldmethod=marker
  * @}
  */
+
+/*
+ * Load default skins
+ */
+require_once( "$IP/skins/MonoBook.php" );
diff --git a/resources/Resources.php b/resources/Resources.php
index ddcefda..545431a 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -76,16 +76,6 @@
                'remoteBasePath' => $GLOBALS['wgStylePath'],
                'localBasePath' => $GLOBALS['wgStyleDirectory'],
        ),
-       'skins.monobook' => array(
-               'styles' => array(
-                       'common/commonElements.css' => array( 'media' => 
'screen' ),
-                       'common/commonContent.css' => array( 'media' => 
'screen' ),
-                       'common/commonInterface.css' => array( 'media' => 
'screen' ),
-                       'monobook/main.css' => array( 'media' => 'screen' ),
-               ),
-               'remoteBasePath' => $GLOBALS['wgStylePath'],
-               'localBasePath' => $GLOBALS['wgStyleDirectory'],
-       ),
        'skins.vector' => array(
                // Keep in sync with WebInstallerOutput::getCSS()
                'styles' => array(
diff --git a/skins/MonoBook.php b/skins/MonoBook.php
index e805aca..df9d66c 100644
--- a/skins/MonoBook.php
+++ b/skins/MonoBook.php
@@ -29,6 +29,17 @@
        die( -1 );
 }
 
+$wgResourceModules['skins.monobook'] = array(
+       'styles' => array(
+               'common/commonElements.css' => array( 'media' => 'screen' ),
+               'common/commonContent.css' => array( 'media' => 'screen' ),
+               'common/commonInterface.css' => array( 'media' => 'screen' ),
+               'monobook/main.css' => array( 'media' => 'screen' ),
+       ),
+       'remoteBasePath' => & $GLOBALS['wgStylePath'],
+       'localBasePath' => & $GLOBALS['wgStyleDirectory'],
+);
+
 /**
  * Inherit main code from SkinTemplate, set the CSS and template filter.
  * @todo document
@@ -36,17 +47,24 @@
  */
 class SkinMonoBook extends SkinTemplate {
        /** Using monobook. */
-       var $skinname = 'monobook', $stylename = 'monobook',
-               $template = 'MonoBookTemplate', $useHeadElement = true;
+       var $skinname = 'monobook',
+               $stylename = 'monobook',
+               $template = 'MonoBookTemplate',
+               $useHeadElement = true;
 
        /**
         * @param $out OutputPage
         */
        function setupSkinUserCss( OutputPage $out ) {
                parent::setupSkinUserCss( $out );
-
+       
                $out->addModuleStyles( 'skins.monobook' );
-
+/*
+               $out->addStyle( 'monobook/main.css', 'screen' );
+               $out->addStyle( 'common/commonElements.css', 'screen' );
+               $out->addStyle( 'common/commonContent.css', 'screen' );
+               $out->addStyle( 'common/commonInterface.css', 'screen' );
+*/
                // TODO: Migrate all of these
                $out->addStyle( 'monobook/IE60Fixes.css', 'screen', 'IE 6' );
                $out->addStyle( 'monobook/IE70Fixes.css', 'screen', 'IE 7' );
@@ -321,5 +339,3 @@
 <?php
        }
 } // end of class
-
-

-- 
To view, visit https://gerrit.wikimedia.org/r/65319
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a05114c573d7cc21d50bd81d1feed885fa4b6f7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Luis Felipe Schenone <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to