X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=skins%2FMonoBook.php;h=857db0f28af198212ec1282c7958fae3edf3d156;hb=b2a3c87792431c9246c5c6b1d549db3b994d7c33;hp=bfe9b413372135fcadb40c1d2b6b325b7cd8bf01;hpb=74a21f3bd1692dac958ddf3e09226a72b7bc65b7;p=lhc%2Fweb%2Fwiklou.git diff --git a/skins/MonoBook.php b/skins/MonoBook.php index bfe9b41337..857db0f28a 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -23,25 +23,25 @@ class SkinMonoBook extends SkinTemplate { var $skinname = 'monobook', $stylename = 'monobook', $template = 'MonoBookTemplate', $useHeadElement = true; + /** + * @param $out OutputPage + */ 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' ); } - $out->addStyle( 'monobook/IE50Fixes.css', 'screen', 'lt IE 5.5000' ); - $out->addStyle( 'monobook/IE55Fixes.css', 'screen', 'IE 5.5000' ); + // TODO: Migrate all of these $out->addStyle( 'monobook/IE60Fixes.css', 'screen', 'IE 6' ); $out->addStyle( 'monobook/IE70Fixes.css', 'screen', 'IE 7' ); - $out->addStyle( 'monobook/rtl.css', 'screen', '', 'rtl' ); - } } @@ -49,8 +49,8 @@ class SkinMonoBook extends SkinTemplate { * @todo document * @ingroup Skins */ -class MonoBookTemplate extends QuickTemplate { - var $skin; +class MonoBookTemplate extends BaseTemplate { + /** * Template filter callback for MonoBook skin. * Takes an associative array of data set from a SkinTemplate-based @@ -60,30 +60,25 @@ class MonoBookTemplate extends QuickTemplate { * @access private */ function execute() { - global $wgRequest; - - $this->skin = $skin = $this->data['skin']; - $action = $wgRequest->getText( 'action' ); - // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); $this->html( 'headelement' ); ?>
-
html("specialpageattributes") ?>> +
data['sitenotice']) { ?>
html('sitenotice') ?>
-

html('title') ?>

-
-

msg('tagline') ?>

+

html('title') ?>

+
+
msg('tagline') ?>
html('userlangattributes') ?>>html('subtitle') ?>
data['undelete']) { ?>
html('undelete') ?>
data['newtalk'] ) { ?>
html('newtalk') ?>
data['showjumplinks']) { ?> - + html('bodytext') ?> @@ -94,124 +89,99 @@ class MonoBookTemplate extends QuickTemplate {
html('userlangattributes') ?>> -
-
msg('views') ?>
- -
+cactions(); ?>
msg('personaltools') ?>
html('userlangattributes') ?>> -data['personal_urls'] as $key => $item) { ?> -
  • " class="active">tooltipAndAccesskey('pt-'.$key) ?> class="">
  • - +getPersonalTools() as $key => $item) { ?> + makeListItem($key, $item); ?> + +
    - 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 ); - } - } + $this->renderPortals( $this->data['sidebar'] ); ?>
    +getFooterIcons( "icononly" ); + $validFooterLinks = $this->getFooterLinks( "flat" ); // Additional footer links + + if ( count( $validFooterIcons ) + count( $validFooterLinks ) > 0 ) { ?> '; + } else { + $footerEnd = ''; + } + foreach ( $validFooterIcons as $blockName => $footerIcons ) { ?> +
    + + getSkin()->makeFooterIcon( $icon ); ?> + data['copyrightico']) { ?> -
    html('copyrightico') ?>
    +?> +
    data[$aLink] ) && $this->data[$aLink] ) { - $validFooterLinks[] = $aLink; - } - } if ( count( $validFooterLinks ) > 0 ) { ?>
      data[$aLink] ) && $this->data[$aLink] ) { -?> - + +
    -
    -
    -html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?> -html('reporttime') ?> -data['debug'] ): ?> - - +printTrail(); echo Html::closeElement( 'body' ); echo Html::closeElement( 'html' ); wfRestoreWarnings(); } // end of execute() method /*************************************************************************************************/ + + /** + * @param $sidebar array + */ + protected function renderPortals( $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 => $content ) { + if ( $content === false ) + continue; + + if ( $boxName == 'SEARCH' ) { + $this->searchBox(); + } elseif ( $boxName == 'TOOLBOX' ) { + $this->toolbox(); + } elseif ( $boxName == 'LANGUAGES' ) { + $this->languageBox(); + } else { + $this->customBox( $boxName, $content ); + } + } + } + function searchBox() { global $wgUseTwoButtonsSearchForm; ?> @@ -220,19 +190,15 @@ if($this->data['copyrightico']) { ?>
    - data['search'] ) ? $this->data['search'] : '', 'search', - array( - 'id' => 'searchInput', - 'title' => $this->skin->titleAttrib( 'search' ), - 'accesskey' => $this->skin->accesskey( 'search' ) - ) ); ?> + makeSearchInput(array( "id" => "searchInput" )); ?> - skin->tooltipAndAccesskey( 'search-go' ); ?> />  - skin->tooltipAndAccesskey( 'search-fulltext' ); ?> /> + makeSearchButton("go", array( "id" => "searchGoButton", "class" => "searchButton" )); + if ($wgUseTwoButtonsSearchForm): ?>  + makeSearchButton("fulltext", array( "id" => "mw-searchButton", "class" => "searchButton" )); + else: ?> -
    +
    @@ -240,6 +206,26 @@ if($this->data['copyrightico']) { ?> +
    +
    msg('views') ?>
    +
    +
      data['content_actions'] as $key => $tab) { + echo ' + ' . $this->makeListItem( $key, $tab ); + } ?> + +
    +
    +
    + @@ -248,51 +234,13 @@ if($this->data['copyrightico']) { ?>
    @@ -308,9 +256,9 @@ if($this->data['copyrightico']) { ?> html('userlangattributes') ?>>msg('otherlanguages') ?>
      -data['language_urls'] as $langlink) { ?> -
    • +data['language_urls'] as $key => $langlink) { ?> + makeListItem($key, $langlink); ?> +
    @@ -320,17 +268,26 @@ if($this->data['copyrightico']) { ?> } /*************************************************************************************************/ + /** + * @param $bar string + * @param $cont array|string + */ function customBox( $bar, $cont ) { + $portletAttribs = array( 'class' => 'generated-sidebar portlet', 'id' => Sanitizer::escapeId( "p-$bar" ) ); + $tooltip = Linker::titleAttrib( "p-$bar" ); + if ( $tooltip !== false ) { + $portletAttribs['title'] = $tooltip; + } + echo ' ' . Html::openElement( 'div', $portletAttribs ); ?> -
    skin->tooltip('p-'.$bar) ?>> -
    + +
    exists() ? $msg->text() : $bar ); ?>