r17237 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17236‎ | r17237 | r17238 >
Date:12:00, 24 October 2006
Author:brion
Status:old
Tags:
Comment:
* (bug 7663) Include language variant switcher links on Nostalgia skin
Refactor out common variant list code from Skin.php and CologneBlue.php into Skin::variantLinks, and add it to Nostalgia's topLinks()
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/skins/CologneBlue.php (modified) (history)
  • /trunk/phase3/skins/Nostalgia.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/CologneBlue.php
@@ -155,17 +155,7 @@
156156 }
157157
158158 /* show links to different language variants */
159 - global $wgDisableLangConversion;
160 - $variants = $wgContLang->getVariants();
161 - if( !$wgDisableLangConversion && sizeof( $variants ) > 1 ) {
162 - $actstr = '';
163 - foreach( $variants as $code ) {
164 - $varname = $wgContLang->getVariantname( $code );
165 - if( $varname == 'disable' )
166 - continue;
167 - $s .= ' | <a href="' . $wgTitle->getLocalUrl( 'variant=' . $code ) . '">' . $varname . '</a>';
168 - }
169 - }
 159+ $s .= $this->variantLinks();
170160
171161 return $s;
172162 }
Index: trunk/phase3/skins/Nostalgia.php
@@ -68,6 +68,10 @@
6969 } else {
7070 $s .= $sep . $this->specialLink( "userlogout" );
7171 }
 72+
 73+ /* show links to different language variants */
 74+ $s .= $this->variantLinks();
 75+
7276 $s .= $sep . $this->specialPagesList();
7377
7478 return $s;
Index: trunk/phase3/includes/Skin.php
@@ -894,7 +894,18 @@
895895 }
896896 # Many people don't like this dropdown box
897897 #$s .= $sep . $this->specialPagesList();
 898+
 899+ $s .= $this->variantLinks();
898900
 901+ return $s;
 902+ }
 903+
 904+ /**
 905+ * Language/charset variant links for classic-style skins
 906+ * @return string
 907+ */
 908+ function variantLinks() {
 909+ $s = '';
899910 /* show links to different language variants */
900911 global $wgDisableLangConversion, $wgContLang, $wgTitle;
901912 $variants = $wgContLang->getVariants();
@@ -903,10 +914,9 @@
904915 $varname = $wgContLang->getVariantname( $code );
905916 if( $varname == 'disable' )
906917 continue;
907 - $s .= ' | <a href="' . $wgTitle->getLocalUrl( 'variant=' . $code ) . '">' . $varname . '</a>';
 918+ $s .= ' | <a href="' . $wgTitle->escapeLocalUrl( 'variant=' . $code ) . '">' . htmlspecialchars( $varname ) . '</a>';
908919 }
909920 }
910 -
911921 return $s;
912922 }
913923
Index: trunk/phase3/RELEASE-NOTES
@@ -82,6 +82,7 @@
8383 messages as optional for localisation.
8484 * Fix user_newpass upgrade for prefixed tables (reported by Fyren)
8585 * (bug 7636) Fix typo in Firefox 2 check (tested by Werdna)
 86+* (bug 7663) Include language variant switcher links on Nostalgia skin
8687
8788
8889 == Languages updated ==