Follow-up to change 65426 (commit
a3c7a8b8f)
Also, rewrite the documentation for this function call in Preferences.php
To remove the "(skins is all skin names from Language.php)"
which I couldn't make sense of.
Change-Id: I0b0fdfb5615c22aa876882c3ca344ebb1f10c4bd
$mptitle = Title::newMainPage();
$previewtext = $context->msg( 'skin-preview' )->text();
- # Only show members of Skin::getSkinNames() rather than
- # $skinNames (skins is all skin names from Language.php)
- $validSkinNames = Skin::getUsableSkins();
+ # Only show skins that aren't disabled in $wgSkipSkins
+ $validSkinNames = Skin::getAllowedSkins();
# 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).
* Fetch the list of user-selectable skins in regards to $wgSkipSkins.
* Useful for Special:Preferences and other places where you
* only want to show skins users _can_ use.
- * @return array of strings
+ * @return string[]
*/
- public static function getUsableSkins() {
+ public static function getAllowedSkins() {
global $wgSkipSkins;
$allowedSkins = self::getSkinNames();
return $allowedSkins;
}
+ /**
+ * @deprecated since 1.22, use getAllowedSkins
+ * @return string[]
+ */
+ public static function getUsableSkins() {
+ wfDeprecated( __METHOD__, '1.22' );
+ return self::getAllowedSkins();
+ }
+
/**
* Normalize a skin preference value to a form that can be loaded.
* If a skin can't be found, it will fall back to the configured
public function appendSkins( $property ) {
$data = array();
- $usable = Skin::getUsableSkins();
+ $allowed = Skin::getAllowedSkins();
$default = Skin::normalizeKey( 'default' );
foreach ( Skin::getSkinNames() as $name => $displayName ) {
$skin = array( 'code' => $name );
ApiResult::setContent( $skin, $displayName );
- if ( !isset( $usable[$name] ) ) {
+ if ( !isset( $allowed[$name] ) ) {
$skin['unusable'] = '';
}
if ( $name === $default ) {