X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=skins%2FMonoBook.php;h=c12bea604c237d97efba7b0e9024eff734436a01;hb=1b70ac7ff7b1b770d39242af5cba5c04a8b641fe;hp=5fb397f95e11718cd5d12a56d7c0232a4239c991;hpb=e57e74f071b7ef1469595955fbea13b17fa5cc9b;p=lhc%2Fweb%2Fwiklou.git diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 5fb397f95e..c12bea604c 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -20,14 +20,50 @@ if( !defined( 'MEDIAWIKI' ) ) */ class SkinMonoBook extends SkinTemplate { /** Using monobook. */ - function initPage( &$out ) { - SkinTemplate::initPage( $out ); - $this->skinname = 'monobook'; - $this->stylename = 'monobook'; - $this->template = 'MonoBookTemplate'; - # Bug 14520: skins that just include this file shouldn't load nonexis- - # tent CSS fix files. - $this->cssfiles = array( 'IE', 'IE50', 'IE55', 'IE60', 'IE70', 'rtl' ); + var $skinname = 'monobook', $stylename = 'monobook', + $template = 'MonoBookTemplate'; + + function setupSkinUserCss( OutputPage $out ) { + global $wgHandheldStyle; + + parent::setupSkinUserCss( $out ); + + // Append to the default screen common & print styles... + $out->addStyle( 'monobook/main.css', 'screen' ); + if( $wgHandheldStyle ) { + // Currently in testing... try 'chick/main.css' + $out->addStyle( $wgHandheldStyle, 'handheld' ); + } + + $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 ); + + } + 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 ); } } @@ -36,6 +72,7 @@ class SkinMonoBook extends SkinTemplate { * @ingroup Skins */ class MonoBookTemplate extends QuickTemplate { + var $skin; /** * Template filter callback for MonoBook skin. * Takes an associative array of data set from a SkinTemplate-based @@ -45,64 +82,31 @@ class MonoBookTemplate extends QuickTemplate { * @access private */ function execute() { - global $wgUser; - $skin = $wgUser->getSkin(); + 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 + ); -?> -data['xhtmlnamespaces'] as $tag => $ns) { - ?>xmlns:xml:lang="text('lang') ?>" lang="text('lang') ?>" dir="text('dir') ?>"> -
- - html('headlinks') ?> -