Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2213,8 +2213,8 @@ |
2214 | 2214 | $ret .= Html::element( 'title', null, $this->getHTMLTitle() ) . "\n"; |
2215 | 2215 | |
2216 | 2216 | $ret .= implode( "\n", array( |
2217 | | - $this->getHeadLinks(), |
2218 | | - $this->buildCssLinks( $sk ), |
| 2217 | + $this->getHeadLinks( $sk ), |
| 2218 | + $this->buildCssLinks(), |
2219 | 2219 | $this->getHeadItems(), |
2220 | 2220 | ) ); |
2221 | 2221 | if ( $sk->usercss ) { |
— | — | @@ -2499,7 +2499,7 @@ |
2500 | 2500 | /** |
2501 | 2501 | * @return string HTML tag links to be put in the header. |
2502 | 2502 | */ |
2503 | | - public function getHeadLinks() { |
| 2503 | + public function getHeadLinks( Skin $sk ) { |
2504 | 2504 | global $wgFeed; |
2505 | 2505 | |
2506 | 2506 | // Ideally this should happen earlier, somewhere. :P |
— | — | @@ -2570,6 +2570,19 @@ |
2571 | 2571 | } |
2572 | 2572 | } |
2573 | 2573 | |
| 2574 | + // Split the styles into three groups |
| 2575 | + $styles = array( 'other' => array(), 'user' => array(), 'site' => array() ); |
| 2576 | + $resourceLoader = $this->getResourceLoader(); |
| 2577 | + foreach ( $this->getModuleStyles() as $name ) { |
| 2578 | + $group = $resourceLoader->getModule( $name )->getGroup(); |
| 2579 | + // Modules in groups named "other" or anything different than "user" or "site" will |
| 2580 | + // be placed in the "other" group |
| 2581 | + $styles[isset( $style[$group] ) ? $group : 'other'][] = $name; |
| 2582 | + } |
| 2583 | + // Add styles to tags, user modules last |
| 2584 | + $tags[] = $this->makeResourceLoaderLink( |
| 2585 | + $sk, array_merge( $styles['other'], $styles['site'], $styles['user'] ), 'styles' |
| 2586 | + ); |
2574 | 2587 | return implode( "\n", $tags ); |
2575 | 2588 | } |
2576 | 2589 | |
— | — | @@ -2627,23 +2640,8 @@ |
2628 | 2641 | * Build a set of <link>s for the stylesheets specified in the $this->styles array. |
2629 | 2642 | * These will be applied to various media & IE conditionals. |
2630 | 2643 | */ |
2631 | | - public function buildCssLinks( $sk ) { |
2632 | | - // Split the styles into three groups |
2633 | | - $styles = array( 'other' => array(), 'user' => array(), 'site' => array() ); |
2634 | | - $resourceLoader = $this->getResourceLoader(); |
2635 | | - foreach ( $this->getModuleStyles() as $name ) { |
2636 | | - $group = $resourceLoader->getModule( $name )->getGroup(); |
2637 | | - // Modules in groups named "other" or anything different than "user" or "site" will |
2638 | | - // be placed in the "other" group |
2639 | | - $styles[isset( $styles[$group] ) ? $group : 'other'][] = $name; |
2640 | | - } |
2641 | | - // Add tags created using legacy methods |
2642 | | - $tags = $this->buildCssLinksArray(); |
2643 | | - // Add ResourceLoader module style tags |
2644 | | - $tags[] = $this->makeResourceLoaderLink( |
2645 | | - $sk, array_merge( $styles['other'], $styles['site'], $styles['user'] ), 'styles' |
2646 | | - ); |
2647 | | - return implode( "\n", $tags ); |
| 2644 | + public function buildCssLinks() { |
| 2645 | + return implode( "\n", $this->buildCssLinksArray() ); |
2648 | 2646 | } |
2649 | 2647 | |
2650 | 2648 | public function buildCssLinksArray() { |