* (bug 7663) Include language variant switcher links on Nostalgia skin
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 24 Oct 2006 12:00:51 +0000 (12:00 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 24 Oct 2006 12:00:51 +0000 (12:00 +0000)
Refactor out common variant list code from Skin.php and CologneBlue.php into Skin::variantLinks, and add it to Nostalgia's topLinks()

RELEASE-NOTES
includes/Skin.php
skins/CologneBlue.php
skins/Nostalgia.php

index d293933..e0e4bc4 100644 (file)
@@ -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 ==
index f349c39..245776c 100644 (file)
@@ -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 .= ' | <a href="' . $wgTitle->getLocalUrl( 'variant=' . $code ) . '">' . $varname . '</a>';
+                               $s .= ' | <a href="' . $wgTitle->escapeLocalUrl( 'variant=' . $code ) . '">' . htmlspecialchars( $varname ) . '</a>';
                        }
                }
-
                return $s;
        }
 
index 5a3f910..63fe963 100644 (file)
@@ -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 .= ' | <a href="' . $wgTitle->getLocalUrl( 'variant=' . $code ) . '">' . $varname . '</a>';
-                       }
-               }
+               $s .= $this->variantLinks();
 
                return $s;
        }
index 0d67599..1d76a95 100644 (file)
@@ -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;