From: Alexandre Emsenhuber Date: Sun, 23 Oct 2011 07:55:45 +0000 (+0000) Subject: Check first that $wgDisableLangConversion is false and we are not in a special page... X-Git-Tag: 1.31.0-rc.0~26958 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=a9432cfd8b43d036c71b56da95d816f06c5862bd;p=lhc%2Fweb%2Fwiklou.git Check first that $wgDisableLangConversion is false and we are not in a special page before doing the language variant check --- diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 027db05e14..56adcffbe5 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -1011,32 +1011,32 @@ class SkinTemplate extends Skin { array( &$this, &$content_navigation ) ); } - $pageLang = $title->getPageLanguage(); - - // Gets list of language variants - $variants = $pageLang->getVariants(); - // Checks that language conversion is enabled and variants exist - // And if it is not in the special namespace - if( !$wgDisableLangConversion && count( $variants ) > 1 - && $title->getNamespace() != NS_SPECIAL ) { - // Gets preferred variant (note that user preference is - // only possible for wiki content language variant) - $preferred = $pageLang->getPreferredVariant(); - // Loops over each variant - foreach( $variants as $code ) { - // Gets variant name from language code - $varname = $pageLang->getVariantname( $code ); - // Checks if the variant is marked as disabled - if( $varname == 'disable' ) { - // Skips this variant - continue; + if ( !$wgDisableLangConversion && $title->getNamespace() != NS_SPECIAL ) { + $pageLang = $title->getPageLanguage(); + // Gets list of language variants + $variants = $pageLang->getVariants(); + // Checks that language conversion is enabled and variants exist + // And if it is not in the special namespace + if( count( $variants ) > 1 ) { + // Gets preferred variant (note that user preference is + // only possible for wiki content language variant) + $preferred = $pageLang->getPreferredVariant(); + // Loops over each variant + foreach( $variants as $code ) { + // Gets variant name from language code + $varname = $pageLang->getVariantname( $code ); + // Checks if the variant is marked as disabled + if( $varname == 'disable' ) { + // Skips this variant + continue; + } + // Appends variant link + $content_navigation['variants'][] = array( + 'class' => ( $code == $preferred ) ? 'selected' : false, + 'text' => $varname, + 'href' => $title->getLocalURL( '', $code ) + ); } - // Appends variant link - $content_navigation['variants'][] = array( - 'class' => ( $code == $preferred ) ? 'selected' : false, - 'text' => $varname, - 'href' => $title->getLocalURL( '', $code ) - ); } }