From d018001f3b770274a3e7cb1023e886be52418d0e Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Tue, 6 Sep 2011 15:27:42 +0000 Subject: [PATCH] Small MonoBook cleanup: * Eliminate the unnecessary ->skin and $skin, $this->skin is only used in one spot and we have getSkin() * Linker::tooltipAndAccesskeyAttribs isn't &, don't + it to an empty array(), just use a short inline array instead of this var * Elimiate all this unnecessary code in cactions and just use makeListItem. It's shorter, outputs everything this code does, AND it outputs rel="archive" on history which was missing from MonoBook. --- skins/MonoBook.php | 41 ++++++++--------------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/skins/MonoBook.php b/skins/MonoBook.php index c696418ba4..055c4c2b13 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -53,11 +53,6 @@ class SkinMonoBook extends SkinTemplate { */ 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 @@ -67,8 +62,6 @@ class MonoBookTemplate extends BaseTemplate { * @access private */ function execute() { - $this->skin = $this->data['skin']; - // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); @@ -111,12 +104,11 @@ class MonoBookTemplate extends BaseTemplate { @@ -139,7 +131,7 @@ class MonoBookTemplate extends BaseTemplate { foreach ( $validFooterIcons as $blockName => $footerIcons ) { ?>
- skin->makeFooterIcon( $icon ); ?> + getSkin()->makeFooterIcon( $icon ); ?> @@ -227,25 +219,8 @@ echo $footerEnd;
    data['content_actions'] as $key => $tab) { - $linkAttribs = array( 'href' => $tab['href'] ); - - if( isset( $tab["tooltiponly"] ) && $tab["tooltiponly"] ) { - $title = Linker::titleAttrib( "ca-$key" ); - if ( $title !== false ) { - $linkAttribs['title'] = $title; - } - } else { - $linkAttribs += Linker::tooltipAndAccesskeyAttribs( "ca-$key" ); - } - $linkHtml = Html::element( 'a', $linkAttribs, $tab['text'] ); - - /* Surround with a
  • */ - $liAttribs = array( 'id' => Sanitizer::escapeId( "ca-$key" ) ); - if( $tab['class'] ) { - $liAttribs['class'] = $tab['class']; - } - echo ' - ' . Html::rawElement( 'li', $liAttribs, $linkHtml ); + echo ' + ' . $this->makeListItem( $key, $tab ); } ?>
-- 2.20.1