From 86ff9e4f3b63913479526568fffc184f375febd4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcin=20Cie=C5=9Blak?= Date: Sun, 13 Mar 2011 23:12:59 +0000 Subject: [PATCH] Bug 2557: Sidebar items missing from classic, cologne blue, simple skins * Simple skin support multiple sidebar items * Standard (a.k.a. Classic) likes to add "my watchlist" and "my contributions" links at the bottom of the first sidebar box. It also has no titles for boxes. * Cologne blue supports multiple sidebar boxes with titles. --- skins/CologneBlue.php | 22 +++++++++++++++++----- skins/Standard.php | 38 +++++++++++++++++++++++--------------- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index e157ed44a5..6dd3137255 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -213,13 +213,25 @@ class CologneBlueTemplate extends LegacyTemplate { unset( $bar['SEARCH'] ); unset( $bar['LANGUAGES'] ); unset( $bar['TOOLBOX'] ); - $browseLinks = reset( $bar ); - foreach ( $browseLinks as $link ) { - if ( $link['text'] != '-' ) { - $s .= "" . - htmlspecialchars( $link['text'] ) . '' . $sep; + $barnumber = 1; + foreach ( $bar as $heading => $browseLinks ) { + $heading_text = wfMsg ( $heading ); + if ( $barnumber > 1 ) { + if ( wfEmptyMsg( $heading, $heading_text ) ) { + $h = $heading; + } else { + $h = $heading_text; + } + $s .= "\n
" . htmlspecialchars( $h ) . "
"; + } + foreach ( $browseLinks as $link ) { + if ( $link['text'] != '-' ) { + $s .= "" . + htmlspecialchars( $link['text'] ) . '' . $sep; + } } + $barnumber = $barnumber + 1; } if ( $wgOut->isArticle() ) { diff --git a/skins/Standard.php b/skins/Standard.php index 38ed860b47..a8f304f5a5 100644 --- a/skins/Standard.php +++ b/skins/Standard.php @@ -118,25 +118,33 @@ class StandardTemplate extends LegacyTemplate { unset( $bar['SEARCH'] ); unset( $bar['LANGUAGES'] ); unset( $bar['TOOLBOX'] ); - $browseLinks = reset( $bar ); - foreach ( $browseLinks as $link ) { - if ( $link['text'] != '-' ) { - $s .= "" . - htmlspecialchars( $link['text'] ) . '' . $sep; + $barnumber = 1; + foreach ( $bar as $heading => $browseLinks ) { + if ( $barnumber > 1 ) { + $s .= "\n
"; + } + foreach ( $browseLinks as $link ) { + if ( $link['text'] != '-' ) { + $s .= "" . + htmlspecialchars( $link['text'] ) . '' . $sep; + } } + if ( $barnumber == 1 ) { + // only show watchlist link if logged in + if( $wgUser->isLoggedIn() ) { + $s.= $this->getSkin()->specialLink( 'Watchlist' ) ; + $s .= $sep . $this->getSkin()->linkKnown( + SpecialPage::getTitleFor( 'Contributions' ), + wfMsg( 'mycontris' ), + array(), + array( 'target' => $wgUser->getName() ) + ); + } + } + $barnumber = $barnumber + 1; } - if( $wgUser->isLoggedIn() ) { - $s.= $this->getSkin()->specialLink( 'Watchlist' ) ; - $s .= $sep . $this->getSkin()->linkKnown( - SpecialPage::getTitleFor( 'Contributions' ), - wfMsg( 'mycontris' ), - array(), - array( 'target' => $wgUser->getName() ) - ); - } - // only show watchlist link if logged in $s .= "\n
"; $articleExists = $this->getSkin()->getTitle()->getArticleId(); if ( $wgOut->isArticle() || $action == 'edit' || $action == 'history' || $wpPreview ) { -- 2.20.1