X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=skins%2FModern.php;h=c5bddc63bcff606664bd81f0c94532d0a7e2b269;hb=851b89a76671f0728517b41d7b4100dbf01d26ab;hp=3f4fd44af1e41dd9d2119224708dbc5533f2fae5;hpb=91c778a0bc0b537f9c7f57bfc9023043de92bb32;p=lhc%2Fweb%2Fwiklou.git diff --git a/skins/Modern.php b/skins/Modern.php index 3f4fd44af1..c5bddc63bc 100644 --- a/skins/Modern.php +++ b/skins/Modern.php @@ -3,31 +3,50 @@ * Modern skin, derived from monobook template. * * @todo document - * @addtogroup Skins + * @file + * @ingroup Skins */ if( !defined( 'MEDIAWIKI' ) ) die( -1 ); +require( dirname(__FILE__) . '/MonoBook.php' ); + /** * Inherit main code from SkinTemplate, set the CSS and template filter. * @todo document - * @addtogroup Skins + * @ingroup Skins */ class SkinModern extends SkinTemplate { - function initPage( &$out ) { - SkinTemplate::initPage( $out ); - $this->skinname = 'modern'; - $this->stylename = 'modern'; - $this->template = 'ModernTemplate'; + var $skinname = 'modern', $stylename = 'modern', + $template = 'ModernTemplate', $useHeadElement = true; + + /* + * We don't like the default getPoweredBy, the icon clashes with the + * skin L&F. + */ + function getPoweredBy() { + global $wgVersion; + $text = "
Powered by MediaWiki $wgVersion
"; + wfRunHooks( 'SkinGetPoweredBy', array( &$text, $this ) ); + return $text; + } + + function setupSkinUserCss( OutputPage $out ){ + // Do not call parent::setupSkinUserCss(), we have our own print style + $out->addStyle( 'common/shared.css', 'screen' ); + $out->addStyle( 'modern/main.css', 'screen' ); + $out->addStyle( 'modern/print.css', 'print' ); + $out->addStyle( 'modern/rtl.css', 'screen', '', 'rtl' ); } } /** * @todo document - * @addtogroup Skins + * @ingroup Skins */ -class ModernTemplate extends QuickTemplate { +class ModernTemplate extends MonoBookTemplate { + var $skin; /** * Template filter callback for Modern skin. * Takes an associative array of data set from a SkinTemplate-based @@ -37,58 +56,18 @@ class ModernTemplate 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(); -?> -data['xhtmlnamespaces'] as $tag => $ns) { - ?>xmlns:xml:lang="text('lang') ?>" lang="text('lang') ?>" dir="text('dir') ?>"> - - - html('headlinks') ?> - <?php $this->text('pagetitle') ?> - - data['printable']) ) { ?>media="print" href="text('stylepath') ?>/text('stylename') ?>/print.css?" /> - - - data ); ?> - - - -html('headscripts') ?> -data['jsvarurl' ]) { ?> - - -data['pagecss' ]) { ?> - -data['usercss' ]) { ?> - -data['userjs' ]) { ?> - -data['userjsprev']) { ?> - -data['trackbackhtml']) print $this->data['trackbackhtml']; ?> - -data['body_ondblclick']) { ?> ondblclick="text('body_ondblclick') ?>" -data['body_onload' ]) { ?> onload="text('body_onload') ?>" - class="mediawiki text('nsclass') ?> text('dir') ?> text('pageclass') ?>"> + $this->html( 'headelement' ); +?> -
-

data['displaytitle']!=""?$this->html('title'):$this->text('title') ?>

-
+

html('title') ?>

@@ -97,12 +76,27 @@ class ModernTemplate extends QuickTemplate {
msg('views') ?>
@@ -112,8 +106,9 @@ class ModernTemplate extends QuickTemplate { -
+
html("specialpageattributes") ?>>
+
msg('tagline') ?>
data['newtalk'] ) { ?>
html('newtalk') ?>
@@ -123,118 +118,40 @@ class ModernTemplate extends QuickTemplate {
-
html('subtitle') ?>
+
html('userlangattributes') ?>>html('subtitle') ?>
data['undelete']) { ?>
html('undelete') ?>
- data['showjumplinks']) { ?> + data['showjumplinks']) { ?> html('bodytext') ?>
- data['catlinks']) { ?>html('catlinks') ?> + data['catlinks']) { $this->html('catlinks'); } ?> + html ('dataAfterContent') ?>
-
- - - data['sidebar'] as $bar => $cont) { ?> -
tooltip('p-'.$bar) ?>> -
-
- -
-
- - - - - - -
-
msg('toolbox') ?>
-
- -
-
- - -data['language_urls'] ) { ?> -
-
msg('otherlanguages') ?>
-
-
    -data['language_urls'] as $langlink) { ?> -
  • - -
-
-
- + ?>
@@ -249,7 +166,7 @@ class ModernTemplate extends QuickTemplate {