Index: trunk/phase3/includes/specials/SpecialPreferences.php |
— | — | @@ -517,7 +517,7 @@ |
518 | 518 | global $wgEnotifWatchlist, $wgEnotifUserTalk,$wgEnotifMinorEdits; |
519 | 519 | global $wgRCShowWatchingUsers, $wgEnotifRevealEditorAddress; |
520 | 520 | global $wgEnableEmail, $wgEnableUserEmail, $wgEmailAuthentication; |
521 | | - global $wgContLanguageCode, $wgDefaultSkin, $wgSkipSkins, $wgAuth; |
| 521 | + global $wgContLanguageCode, $wgDefaultSkin, $wgAuth; |
522 | 522 | global $wgEmailConfirmToEdit, $wgAjaxSearch, $wgEnableMWSuggest; |
523 | 523 | |
524 | 524 | $wgOut->setPageTitle( wfMsg( 'preferences' ) ); |
— | — | @@ -819,7 +819,7 @@ |
820 | 820 | $previewtext = wfMsg('skin-preview'); |
821 | 821 | # Only show members of Skin::getSkinNames() rather than |
822 | 822 | # $skinNames (skins is all skin names from Language.php) |
823 | | - $validSkinNames = Skin::getSkinNames(); |
| 823 | + $validSkinNames = Skin::getUsableSkins(); |
824 | 824 | # Sort by UI skin name. First though need to update validSkinNames as sometimes |
825 | 825 | # the skinkey & UI skinname differ (e.g. "standard" skinkey is "Classic" in the UI). |
826 | 826 | foreach ($validSkinNames as $skinkey => & $skinname ) { |
— | — | @@ -829,9 +829,6 @@ |
830 | 830 | } |
831 | 831 | asort($validSkinNames); |
832 | 832 | foreach ($validSkinNames as $skinkey => $sn ) { |
833 | | - if ( in_array( $skinkey, $wgSkipSkins ) ) { |
834 | | - continue; |
835 | | - } |
836 | 833 | $checked = $skinkey == $this->mSkin ? ' checked="checked"' : ''; |
837 | 834 | |
838 | 835 | $mplink = htmlspecialchars($mptitle->getLocalURL("useskin=$skinkey")); |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -60,6 +60,21 @@ |
61 | 61 | } |
62 | 62 | return $wgValidSkinNames; |
63 | 63 | } |
| 64 | + |
| 65 | + /** |
| 66 | + * Fetch the list of usable skins in regards to $wgSkipSkins. |
| 67 | + * Useful for Special:Preferences and other places where you |
| 68 | + * only want to show skins users _can_ use. |
| 69 | + * @return array of strings |
| 70 | + */ |
| 71 | + public static function getUsableSkins() { |
| 72 | + global $wgSkipSkins; |
| 73 | + $usableSkins = self::getSkinNames(); |
| 74 | + foreach ( $wgSkipSkins as $skip ) { |
| 75 | + unset( $usableSkins[$skip] ); |
| 76 | + } |
| 77 | + return $usableSkins; |
| 78 | + } |
64 | 79 | |
65 | 80 | /** |
66 | 81 | * Normalize a skin preference value to a form that can be loaded. |