* Use Html::linkedStyle() to load styles

* Simplify a bit the code to detect Special:Preferences
This commit is contained in:
Alexandre Emsenhuber 2010-04-06 20:05:16 +00:00
parent ae96fedb4a
commit dc06d8be5d

View file

@ -162,9 +162,8 @@ function wfGadgetsBeforePageDisplay( &$out ) {
if ( !$wgUser->isLoggedIn() ) return true; if ( !$wgUser->isLoggedIn() ) return true;
//disable all gadgets on Special:Preferences //disable all gadgets on Special:Preferences
if ( $out->getTitle()->getNamespace() == NS_SPECIAL ) { if ( $out->getTitle()->isSpecial( 'Preferences' ) ) {
$name = SpecialPage::resolveAlias( $out->getTitle()->getText() ); return true;
if ( $name == "Preferences" ) return true;
} }
$gadgets = wfLoadGadgets(); $gadgets = wfLoadGadgets();
@ -202,7 +201,7 @@ function wfApplyGadgetCode( $code, &$out, &$done ) {
} }
else if ( preg_match( '/\.css/', $codePage ) ) { else if ( preg_match( '/\.css/', $codePage ) ) {
$u = $t->getLocalURL( 'action=raw&ctype=text/css' ); $u = $t->getLocalURL( 'action=raw&ctype=text/css' );
$out->addScript( '<style type="text/css">/*<![CDATA[*/ @import "' . $u . '"; /*]]>*/</style>' . "\n" ); $out->addScript( Html::linkedStyle( $u ) );
} }
} }
} }