From 08c34c839ad98fc907ca78cbb11d47618235911e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 24 Oct 2006 12:00:51 +0000 Subject: [PATCH] * (bug 7663) Include language variant switcher links on Nostalgia skin Refactor out common variant list code from Skin.php and CologneBlue.php into Skin::variantLinks, and add it to Nostalgia's topLinks() --- RELEASE-NOTES | 1 + includes/Skin.php | 14 ++++++++++++-- skins/CologneBlue.php | 12 +----------- skins/Nostalgia.php | 4 ++++ 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d29393368b..e0e4bc4728 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -82,6 +82,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN messages as optional for localisation. * Fix user_newpass upgrade for prefixed tables (reported by Fyren) * (bug 7636) Fix typo in Firefox 2 check (tested by Werdna) +* (bug 7663) Include language variant switcher links on Nostalgia skin == Languages updated == diff --git a/includes/Skin.php b/includes/Skin.php index f349c39104..245776cd10 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -894,7 +894,18 @@ END; } # Many people don't like this dropdown box #$s .= $sep . $this->specialPagesList(); + + $s .= $this->variantLinks(); + return $s; + } + + /** + * Language/charset variant links for classic-style skins + * @return string + */ + function variantLinks() { + $s = ''; /* show links to different language variants */ global $wgDisableLangConversion, $wgContLang, $wgTitle; $variants = $wgContLang->getVariants(); @@ -903,10 +914,9 @@ END; $varname = $wgContLang->getVariantname( $code ); if( $varname == 'disable' ) continue; - $s .= ' | ' . $varname . ''; + $s .= ' | ' . htmlspecialchars( $varname ) . ''; } } - return $s; } diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 5a3f910a1c..63fe96388b 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -155,17 +155,7 @@ class SkinCologneBlue extends Skin { } /* show links to different language variants */ - global $wgDisableLangConversion; - $variants = $wgContLang->getVariants(); - if( !$wgDisableLangConversion && sizeof( $variants ) > 1 ) { - $actstr = ''; - foreach( $variants as $code ) { - $varname = $wgContLang->getVariantname( $code ); - if( $varname == 'disable' ) - continue; - $s .= ' | ' . $varname . ''; - } - } + $s .= $this->variantLinks(); return $s; } diff --git a/skins/Nostalgia.php b/skins/Nostalgia.php index 0d67599d6b..1d76a951ac 100644 --- a/skins/Nostalgia.php +++ b/skins/Nostalgia.php @@ -68,6 +68,10 @@ class SkinNostalgia extends Skin { } else { $s .= $sep . $this->specialLink( "userlogout" ); } + + /* show links to different language variants */ + $s .= $this->variantLinks(); + $s .= $sep . $this->specialPagesList(); return $s; -- 2.20.1