Revert r78023 and its follow-up r78802: change seems to have been made for somewhat...
authorRoan Kattouw <catrope@users.mediawiki.org>
Thu, 23 Dec 2010 23:26:10 +0000 (23:26 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Thu, 23 Dec 2010 23:26:10 +0000 (23:26 +0000)
includes/OutputPage.php

index b9653b1..247e0f0 100644 (file)
@@ -2213,8 +2213,8 @@ class OutputPage {
                $ret .= Html::element( 'title', null, $this->getHTMLTitle() ) . "\n";
 
                $ret .= implode( "\n", array(
-                       $this->getHeadLinks(),
-                       $this->buildCssLinks( $sk ),
+                       $this->getHeadLinks( $sk ),
+                       $this->buildCssLinks(),
                        $this->getHeadItems(),
                ) );
                if ( $sk->usercss ) {
@@ -2499,7 +2499,7 @@ class OutputPage {
        /**
         * @return string HTML tag links to be put in the header.
         */
-       public function getHeadLinks() {
+       public function getHeadLinks( Skin $sk ) {
                global $wgFeed;
 
                // Ideally this should happen earlier, somewhere. :P
@@ -2570,6 +2570,19 @@ class OutputPage {
                        }
                }
 
+               // Split the styles into three groups
+               $styles = array( 'other' => array(), 'user' => array(), 'site' => array() );
+               $resourceLoader = $this->getResourceLoader();
+               foreach ( $this->getModuleStyles() as $name ) {
+                       $group = $resourceLoader->getModule( $name )->getGroup();
+                       // Modules in groups named "other" or anything different than "user" or "site" will
+                       // be placed in the "other" group
+                       $styles[isset( $style[$group] ) ? $group : 'other'][] = $name;
+               }
+               // Add styles to tags, user modules last
+               $tags[] = $this->makeResourceLoaderLink(
+                       $sk, array_merge( $styles['other'], $styles['site'], $styles['user'] ), 'styles'
+               );
                return implode( "\n", $tags );
        }
 
@@ -2627,23 +2640,8 @@ class OutputPage {
         * Build a set of <link>s for the stylesheets specified in the $this->styles array.
         * These will be applied to various media & IE conditionals.
         */
-       public function buildCssLinks( $sk ) {
-               // Split the styles into three groups
-               $styles = array( 'other' => array(), 'user' => array(), 'site' => array() );
-               $resourceLoader = $this->getResourceLoader();
-               foreach ( $this->getModuleStyles() as $name ) {
-                       $group = $resourceLoader->getModule( $name )->getGroup();
-                       // Modules in groups named "other" or anything different than "user" or "site" will
-                       // be placed in the "other" group
-                       $styles[isset( $styles[$group] ) ? $group : 'other'][] = $name;
-               }
-               // Add tags created using legacy methods
-               $tags = $this->buildCssLinksArray();
-               // Add ResourceLoader module style tags
-               $tags[] = $this->makeResourceLoaderLink(
-                       $sk, array_merge( $styles['other'], $styles['site'], $styles['user'] ), 'styles'
-               );
-               return implode( "\n", $tags );
+       public function buildCssLinks() {
+               return implode( "\n", $this->buildCssLinksArray() );
        }
 
        public function buildCssLinksArray() {