X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=skins%2FMonoBook.php;h=db77791260d84af917854b0d49be124ced4f81df;hb=00c399a1b0f96afe8e9fa4c15edf27301269cb89;hp=766a6f295ca92a56d9f441fa70bc17226465922d;hpb=051b1a9e1d03031516f4bdeb6ca7f5e84f8cd58f;p=lhc%2Fweb%2Fwiklou.git diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 766a6f295c..db77791260 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -6,7 +6,8 @@ * dependency on PHPTAL. * * @todo document - * @addtogroup Skins + * @file + * @ingroup Skins */ if( !defined( 'MEDIAWIKI' ) ) @@ -15,23 +16,45 @@ if( !defined( 'MEDIAWIKI' ) ) /** * Inherit main code from SkinTemplate, set the CSS and template filter. * @todo document - * @addtogroup Skins + * @ingroup Skins */ class SkinMonoBook extends SkinTemplate { /** Using monobook. */ - function initPage( &$out ) { - SkinTemplate::initPage( $out ); + function initPage( OutputPage $out ) { + parent::initPage( $out ); $this->skinname = 'monobook'; $this->stylename = 'monobook'; $this->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 document - * @addtogroup Skins + * @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 @@ -41,8 +64,9 @@ class MonoBookTemplate extends QuickTemplate { * @access private */ function execute() { - global $wgUser; - $skin = $wgUser->getSkin(); + global $wgRequest; + $this->skin = $skin = $this->data['skin']; + $action = $wgRequest->getText( 'action' ); // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); @@ -56,44 +80,36 @@ class MonoBookTemplate extends QuickTemplate { html('headlinks') ?> <?php $this->text('pagetitle') ?> - - data['printable']) ) { ?>media="print" href="text('stylepath') ?>/common/commonPrint.css?" /> - - - - - + html('csslinks') ?> + data ); ?> -data['jsvarurl' ]) { ?> - + +html('headscripts') ?> +data['jsvarurl']) { ?> + -data['pagecss' ]) { ?> - +data['pagecss']) { ?> + data['usercss' ]) { ?> - + if($this->data['usercss']) { ?> + data['userjs' ]) { ?> + if($this->data['userjs']) { ?> data['userjsprev']) { ?> data['trackbackhtml']) print $this->data['trackbackhtml']; ?> - -html('headscripts') ?> -data['body_ondblclick']) { ?>ondblclick="text('body_ondblclick') ?>" -data['body_onload' ]) { ?>onload="text('body_onload') ?>" - class="mediawiki text('nsclass') ?> text('dir') ?> text('pageclass') ?>"> +data['body_ondblclick']) { ?> ondblclick="text('body_ondblclick') ?>" +data['body_onload']) { ?> onload="text('body_onload') ?>" + class="mediawiki text('dir') ?> text('pageclass') ?> text('skinnameclass') ?>">
@@ -108,8 +124,9 @@ class MonoBookTemplate extends QuickTemplate { data['showjumplinks']) { ?> html('bodytext') ?> - data['catlinks']) { ?> + data['catlinks']) { $this->html('catlinks'); } ?> + data['dataAfterContent']) { $this->html ('dataAfterContent'); } ?>
@@ -119,12 +136,27 @@ class MonoBookTemplate extends QuickTemplate {
msg('views') ?>
@@ -149,32 +181,85 @@ class MonoBookTemplate extends QuickTemplate { echo $skin->tooltipAndAccesskey('n-mainpage') ?>> - data['sidebar'] as $bar => $cont) { ?> -
tooltip('p-'.$bar) ?>> -
-
-
    - $val) { ?> -
  • class="active" >tooltipAndAccesskey($val['id']) ?>>
  • - +data['sidebar']; + if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; + if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; + if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; + foreach ($sidebar as $boxName => $cont) { + if ( $boxName == 'SEARCH' ) { + $this->searchBox(); + } elseif ( $boxName == 'TOOLBOX' ) { + $this->toolbox(); + } elseif ( $boxName == 'LANGUAGES' ) { + $this->languageBox(); + } else { + $this->customBox( $boxName, $cont ); + } + } +?> +
+
+ -
- + +html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?> +html('reporttime') ?> +data['debug'] ): ?> + + + + +
msg('toolbox') ?>
@@ -183,23 +268,23 @@ class MonoBookTemplate extends QuickTemplate { if($this->data['notspecialpage']) { ?>
  • tooltipAndAccesskey('t-whatlinkshere') ?>>msg('whatlinkshere') ?>
  • + ?>"skin->tooltipAndAccesskey('t-whatlinkshere') ?>>msg('whatlinkshere') ?> data['nav_urls']['recentchangeslinked'] ) { ?>
  • tooltipAndAccesskey('t-recentchangeslinked') ?>>msg('recentchangeslinked') ?>
  • + ?>"skin->tooltipAndAccesskey('t-recentchangeslinked') ?>>msg('recentchangeslinked') ?> data['nav_urls']['trackbacklink'])) { ?> + ?>"skin->tooltipAndAccesskey('t-trackbacklink') ?>>msg('trackbacklink') ?> data['feeds']) { ?> data['nav_urls'][$special]) { ?>
  • tooltipAndAccesskey('t-'.$special) ?>>msg($special) ?>
  • + ?>"skin->tooltipAndAccesskey('t-'.$special) ?>>msg($special) ?> data['nav_urls']['print']['href'])) { ?>
  • tooltipAndAccesskey('t-print') ?>>msg('printableversion') ?>
  • "skin->tooltipAndAccesskey('t-print') ?>>msg('printableversion') ?>data['nav_urls']['permalink']['href'])) { ?> "skin->tooltipAndAccesskey('t-permalink') ?>>msg('permalink') ?>data['nav_urls']['permalink']['href'] === '') { ?> - skin->tooltip('t-ispermalink') ?>>msg('permalink') ?>
    data['language_urls'] ) { ?> + } + + /*************************************************************************************************/ + function languageBox() { + if( $this->data['language_urls'] ) { +?>
    msg('otherlanguages') ?>
    @@ -241,47 +332,34 @@ class MonoBookTemplate extends QuickTemplate {
    - - -
    - - - html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?> - -html('reporttime') ?> -data['debug'] ): ?> - - - + + +