http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100527

Revision: 100527
Author:   ialex
Date:     2011-10-23 07:55:45 +0000 (Sun, 23 Oct 2011)
Log Message:
-----------
Check first that $wgDisableLangConversion is false and we are not in a special 
page before doing the language variant check

Modified Paths:
--------------
    trunk/phase3/includes/SkinTemplate.php

Modified: trunk/phase3/includes/SkinTemplate.php
===================================================================
--- trunk/phase3/includes/SkinTemplate.php      2011-10-23 06:23:31 UTC (rev 
100526)
+++ trunk/phase3/includes/SkinTemplate.php      2011-10-23 07:55:45 UTC (rev 
100527)
@@ -1011,32 +1011,32 @@
                                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 )
-                               );
                        }
                }
 


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to