Merge "Rename Skin::getUsableSkins() to Skin::getAllowedSkins()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 13 Apr 2014 00:30:53 +0000 (00:30 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 13 Apr 2014 00:30:53 +0000 (00:30 +0000)
includes/Preferences.php
includes/Skin.php
includes/api/ApiQuerySiteinfo.php

index d026b97..1825cce 100644 (file)
@@ -1065,9 +1065,8 @@ class Preferences {
                $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).
index 9ec7c31..0f89dd2 100644 (file)
@@ -92,9 +92,9 @@ abstract class Skin extends ContextSource {
         * 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();
@@ -106,6 +106,15 @@ abstract class Skin extends ContextSource {
                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
index 1cd8d98..b7796ee 100644 (file)
@@ -656,12 +656,12 @@ class ApiQuerySiteinfo extends ApiQueryBase {
 
        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 ) {