r71663 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71662‎ | r71663 | r71664 >
Date:21:52, 25 August 2010
Author:tparscal
Status:ok
Tags:
Comment:
Moved css link tag generation to getHeadLinks where it will always be in the head
Modified paths:
  • /branches/resourceloader/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: branches/resourceloader/phase3/includes/OutputPage.php
@@ -2218,7 +2218,7 @@
22192219 $ret .= Html::element( 'title', null, $this->getHTMLTitle() ) . "\n";
22202220
22212221 $ret .= implode( "\n", array(
2222 - $this->getHeadLinks(),
 2222+ $this->getHeadLinks( $sk ),
22232223 $this->buildCssLinks(),
22242224 $this->getHeadItems(),
22252225 ) );
@@ -2408,7 +2408,7 @@
24092409 * @return string HTML tag links to be put in the header.
24102410 */
24112411 public function getHeadLinks() {
2412 - global $wgFeed;
 2412+ global $wgFeed, $wgRequest;
24132413
24142414 // Ideally this should happen earlier, somewhere. :P
24152415 $this->addDefaultMeta();
@@ -2478,6 +2478,17 @@
24792479 }
24802480 }
24812481
 2482+ // Support individual script requests in debug mode
 2483+ if ( $wgRequest->getBool( 'debug' ) && $wgRequest->getVal( 'debug' ) !== 'false' ) {
 2484+ foreach ( $this->getModuleStyles() as $name ) {
 2485+ $tags .= self::makeResourceLoaderLink( $sk, $name, 'styles' );
 2486+ }
 2487+ } else {
 2488+ if ( count( $this->getModuleStyles() ) ) {
 2489+ $tags .= self::makeResourceLoaderLink( $sk, $this->getModuleStyles(), 'styles' );
 2490+ }
 2491+ }
 2492+
24822493 return implode( "\n", $tags );
24832494 }
24842495

Status & tagging log