r17372 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17371‎ | r17372 | r17373 >
Date:06:08, 3 November 2006
Author:nickj
Status:old
Tags:
Comment:
Sort the list of skins in My Preferences --> Skins by alphabetical order using asort(). At the moment it appears to just be in random order.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialPreferences.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialPreferences.php
@@ -732,12 +732,19 @@
733733 # Only show members of Skin::getSkinNames() rather than
734734 # $skinNames (skins is all skin names from Language.php)
735735 $validSkinNames = Skin::getSkinNames();
736 - foreach ($validSkinNames as $skinkey => $skinname ) {
 736+ # Sort by UI skin name. First though need to update validSkinNames as sometimes
 737+ # the skinkey & UI skinname differ (e.g. "standard" skinkey is "Classic" in the UI).
 738+ foreach ($validSkinNames as $skinkey => & $skinname ) {
 739+ if ( isset( $skinNames[$skinkey] ) ) {
 740+ $skinname = $skinNames[$skinkey];
 741+ }
 742+ }
 743+ asort($validSkinNames);
 744+ foreach ($validSkinNames as $skinkey => $sn ) {
737745 if ( in_array( $skinkey, $wgSkipSkins ) ) {
738746 continue;
739747 }
740748 $checked = $skinkey == $this->mSkin ? ' checked="checked"' : '';
741 - $sn = isset( $skinNames[$skinkey] ) ? $skinNames[$skinkey] : $skinname;
742749
743750 $mplink = htmlspecialchars($mptitle->getLocalURL("useskin=$skinkey"));
744751 $previewlink = "<a target='_blank' href=\"$mplink\">$previewtext</a>";
Index: trunk/phase3/RELEASE-NOTES
@@ -130,6 +130,7 @@
131131 * (bug 1133) Special:Emailuser: add an option to send yourself a copy your mail.
132132 * (bug 461) Allow "Categories:" link at bottom of pages to be customized via
133133 pagecategorieslink message.
 134+* Sort the list of skins in "My Preferences" -> Skins by alphabetical order.
134135
135136 == Languages updated ==
136137