From: MatmaRex Date: Sat, 29 Sep 2012 19:18:56 +0000 (+0200) Subject: CologneBlue rewrite: fix variantLinks() X-Git-Tag: 1.31.0-rc.0~22150 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=4bea49b98cc0308ad10c867aa132a74a792b5417;p=lhc%2Fweb%2Fwiklou.git CologneBlue rewrite: fix variantLinks() They used to use some weird ifs to determine whether to display this list, and broken implementation caused an additional separator to appear at the beginning. Change-Id: I71eb97e09af9ac1bcf88da2aaeba97322e8be252 --- diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 12bd85a13b..a22bab6927 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -62,33 +62,19 @@ class CologneBlueTemplate extends BaseTemplate { /** * Language/charset variant links for classic-style skins * @return string + * + * @fixed */ function variantLinks() { - $s = ''; - - /* show links to different language variants */ - global $wgDisableLangConversion; - - $title = $this->getSkin()->getTitle(); - $lang = $title->getPageLanguage(); - $variants = $lang->getVariants(); + $s = array(); - if ( !$wgDisableLangConversion && sizeof( $variants ) > 1 - && !$title->isSpecialPage() ) { - foreach ( $variants as $code ) { - $varname = $lang->getVariantname( $code ); + $variants = $this->data['content_navigation']['variants']; - if ( $varname == 'disable' ) { - continue; - } - $s = $this->getSkin()->getLanguage()->pipeList( array( - $s, - '' . htmlspecialchars( $varname ) . '' - ) ); - } + foreach ( $variants as $key => $link ) { + $s[] = $this->makeListItem( $key, $link, array( 'tag' => 'span' ) ); } - return $s; + return $this->getSkin()->getLanguage()->pipeList( $s ); } function otherLanguages() {