From f0b47f3f4539d39cbde6a1ecc8e583ae81801b40 Mon Sep 17 00:00:00 2001 From: Nick Jenkins Date: Fri, 3 Nov 2006 06:08:08 +0000 Subject: [PATCH] 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. --- RELEASE-NOTES | 1 + includes/SpecialPreferences.php | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2ce4a28839..f377502bb1 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -130,6 +130,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 1133) Special:Emailuser: add an option to send yourself a copy your mail. * (bug 461) Allow "Categories:" link at bottom of pages to be customized via pagecategorieslink message. +* Sort the list of skins in "My Preferences" -> Skins by alphabetical order. == Languages updated == diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index d1a469a598..ec1a957e4f 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -732,12 +732,19 @@ class PreferencesForm { # Only show members of Skin::getSkinNames() rather than # $skinNames (skins is all skin names from Language.php) $validSkinNames = Skin::getSkinNames(); - foreach ($validSkinNames as $skinkey => $skinname ) { + # Sort by UI skin name. First though need to update validSkinNames as sometimes + # the skinkey & UI skinname differ (e.g. "standard" skinkey is "Classic" in the UI). + foreach ($validSkinNames as $skinkey => & $skinname ) { + if ( isset( $skinNames[$skinkey] ) ) { + $skinname = $skinNames[$skinkey]; + } + } + asort($validSkinNames); + foreach ($validSkinNames as $skinkey => $sn ) { if ( in_array( $skinkey, $wgSkipSkins ) ) { continue; } $checked = $skinkey == $this->mSkin ? ' checked="checked"' : ''; - $sn = isset( $skinNames[$skinkey] ) ? $skinNames[$skinkey] : $skinname; $mplink = htmlspecialchars($mptitle->getLocalURL("useskin=$skinkey")); $previewlink = "$previewtext"; -- 2.20.1