X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=skins%2FMonoBook.php;h=6acce0fe03c116e63aa2ea47eadd1edc52c36f62;hb=f99f87832c67d9ddf45c5529e25cbc38c18a3541;hp=4c232441dffe8a8e98e9ad817e93096391b51979;hpb=0df8b0afcdc25401fae99e252299018ea9d6e143;p=lhc%2Fweb%2Fwiklou.git diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 4c232441df..6acce0fe03 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -20,59 +20,44 @@ if( !defined( 'MEDIAWIKI' ) ) */ class SkinMonoBook extends SkinTemplate { /** Using monobook. */ - var $skinname = $stylename = 'monobook', - $template = 'MonoBookTemplate'; + var $skinname = 'monobook', $stylename = 'monobook', + $template = 'MonoBookTemplate', $useHeadElement = true; function setupSkinUserCss( OutputPage $out ) { global $wgHandheldStyle; - parent::setupSkinUserCss( $out ); - // Append to the default screen common & print styles... - $out->addStyle( 'monobook/main.css', 'screen' ); + $out->addModuleStyles( 'skins.monobook' ); + + // Ugh. Can't do this properly because $wgHandheldStyle may be a URL if( $wgHandheldStyle ) { // Currently in testing... try 'chick/main.css' $out->addStyle( $wgHandheldStyle, 'handheld' ); } + + // TODO: Migrate all of these + //$out->addStyle( 'monobook/IE50Fixes.css', 'screen', 'lt IE 5.5000' ); + //$out->addStyle( 'monobook/IE55Fixes.css', 'screen', 'IE 5.5000' ); + //$out->addStyle( 'monobook/IE60Fixes.css', 'screen', 'IE 6' ); + //$out->addStyle( 'monobook/IE70Fixes.css', 'screen', 'IE 7' ); - $out->addStyle( 'monobook/IE50Fixes.css', 'screen', 'lt IE 5.5000' ); - $out->addStyle( 'monobook/IE55Fixes.css', 'screen', 'IE 5.5000' ); - $out->addStyle( 'monobook/IE60Fixes.css', 'screen', 'IE 6' ); - $out->addStyle( 'monobook/IE70Fixes.css', 'screen', 'IE 7' ); - - $out->addStyle( 'monobook/rtl.css', 'screen', '', 'rtl' ); - - - //@@todo we can move this to the parent once we update all skins - if( isset( $this->pagecss ) && $this->pagecss) - $out->addInlineStyle( $this->pagecss ); - - if( isset( $this->usercss ) && $this->usercss) - $out->addInlineStyle( $this->usercss ); + // TODO: migrate + //$out->addStyle( 'monobook/rtl.css', 'screen', '', 'rtl' ); } - function setupSkinUserJs( OutputPage $out ) { - parent::setupSkinUserJs( $out ); - $out->addScriptFile( 'wikibits.js' ); - - //@@todo can move to parent once we update all skins (to not include things twice - if( isset( $this->jsvarurl ) && $this->jsvarurl) - $out->addScriptFile( $this->jsvarurl ); - - if( isset( $this->userjs ) && $this->userjs) - $out->addScriptFile( $this->userjs ); - - if( isset( $this->userjsprev ) && $this->userjsprev) - $out->addInlineScript( $this->userjsprev ); - } } /** * @todo document * @ingroup Skins */ -class MonoBookTemplate extends QuickTemplate { +class MonoBookTemplate extends BaseTemplate { + + /** + * @var Skin + */ var $skin; + /** * Template filter callback for MonoBook skin. * Takes an associative array of data set from a SkinTemplate-based @@ -82,94 +67,59 @@ class MonoBookTemplate extends QuickTemplate { * @access private */ function execute() { - global $wgRequest, $wgOut, $wgStyleVersion, $wgJsMimeType, $wgStylePath; $this->skin = $skin = $this->data['skin']; - $action = $wgRequest->getText( 'action' ); // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); - # FIXME: What is this? Should it apply to all skins? - $path = htmlspecialchars( $wgStylePath ); - $wgOut->addScript( << - -HTML - ); - echo $wgOut->headElement( $this->skin ); - -?>
data['body_ondblclick']) { ?> ondblclick="text('body_ondblclick') ?>" -data['body_onload']) { ?> onload="text('body_onload') ?>" - class="mediawiki text('dir'); $this->text('capitalizeallnouns') ?> text('pageclass') ?> text('skinnameclass') ?>"> -