Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -805,7 +805,6 @@ |
806 | 806 | |
807 | 807 | // parameters |
808 | 808 | $action = $request->getVal( 'action', 'view' ); |
809 | | - $section = $request->getVal( 'section' ); |
810 | 809 | |
811 | 810 | $userCanRead = $title->userCanRead(); |
812 | 811 | $skname = $this->skinname; |
— | — | @@ -870,6 +869,7 @@ |
871 | 870 | ) { |
872 | 871 | // Builds CSS class for talk page links |
873 | 872 | $isTalkClass = $isTalk ? ' istalk' : ''; |
| 873 | + $section = $request->getVal( 'section' ); |
874 | 874 | |
875 | 875 | // Determines if we're in edit mode |
876 | 876 | $selected = ( |
— | — | @@ -996,6 +996,35 @@ |
997 | 997 | } |
998 | 998 | |
999 | 999 | wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$content_navigation ) ); |
| 1000 | + |
| 1001 | + if ( !$wgDisableLangConversion ) { |
| 1002 | + $pageLang = $title->getPageLanguage(); |
| 1003 | + // Gets list of language variants |
| 1004 | + $variants = $pageLang->getVariants(); |
| 1005 | + // Checks that language conversion is enabled and variants exist |
| 1006 | + // And if it is not in the special namespace |
| 1007 | + if( count( $variants ) > 1 ) { |
| 1008 | + // Gets preferred variant (note that user preference is |
| 1009 | + // only possible for wiki content language variant) |
| 1010 | + $preferred = $pageLang->getPreferredVariant(); |
| 1011 | + // Loops over each variant |
| 1012 | + foreach( $variants as $code ) { |
| 1013 | + // Gets variant name from language code |
| 1014 | + $varname = $pageLang->getVariantname( $code ); |
| 1015 | + // Checks if the variant is marked as disabled |
| 1016 | + if( $varname == 'disable' ) { |
| 1017 | + // Skips this variant |
| 1018 | + continue; |
| 1019 | + } |
| 1020 | + // Appends variant link |
| 1021 | + $content_navigation['variants'][] = array( |
| 1022 | + 'class' => ( $code == $preferred ) ? 'selected' : false, |
| 1023 | + 'text' => $varname, |
| 1024 | + 'href' => $title->getLocalURL( '', $code ) |
| 1025 | + ); |
| 1026 | + } |
| 1027 | + } |
| 1028 | + } |
1000 | 1029 | } else { |
1001 | 1030 | // If it's not content, it's got to be a special page |
1002 | 1031 | $content_navigation['namespaces']['special'] = array( |
— | — | @@ -1009,35 +1038,6 @@ |
1010 | 1039 | array( &$this, &$content_navigation ) ); |
1011 | 1040 | } |
1012 | 1041 | |
1013 | | - if ( !$wgDisableLangConversion && !$title->isSpecialPage() ) { |
1014 | | - $pageLang = $title->getPageLanguage(); |
1015 | | - // Gets list of language variants |
1016 | | - $variants = $pageLang->getVariants(); |
1017 | | - // Checks that language conversion is enabled and variants exist |
1018 | | - // And if it is not in the special namespace |
1019 | | - if( count( $variants ) > 1 ) { |
1020 | | - // Gets preferred variant (note that user preference is |
1021 | | - // only possible for wiki content language variant) |
1022 | | - $preferred = $pageLang->getPreferredVariant(); |
1023 | | - // Loops over each variant |
1024 | | - foreach( $variants as $code ) { |
1025 | | - // Gets variant name from language code |
1026 | | - $varname = $pageLang->getVariantname( $code ); |
1027 | | - // Checks if the variant is marked as disabled |
1028 | | - if( $varname == 'disable' ) { |
1029 | | - // Skips this variant |
1030 | | - continue; |
1031 | | - } |
1032 | | - // Appends variant link |
1033 | | - $content_navigation['variants'][] = array( |
1034 | | - 'class' => ( $code == $preferred ) ? 'selected' : false, |
1035 | | - 'text' => $varname, |
1036 | | - 'href' => $title->getLocalURL( '', $code ) |
1037 | | - ); |
1038 | | - } |
1039 | | - } |
1040 | | - } |
1041 | | - |
1042 | 1042 | // Equiv to SkinTemplateContentActions |
1043 | 1043 | wfRunHooks( 'SkinTemplateNavigation::Universal', array( &$this, &$content_navigation ) ); |
1044 | 1044 | |