From: Brad Jorsch Date: Mon, 15 Apr 2013 14:54:51 +0000 (-0400) Subject: (bug 47216) API: indicate default and skipped skins in meta=siteinfo X-Git-Tag: 1.31.0-rc.0~19649 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=810879a349ffedd884f6c3f77696bb1bd105394d;p=lhc%2Fweb%2Fwiklou.git (bug 47216) API: indicate default and skipped skins in meta=siteinfo action=query&meta=siteinfo&siprop=skins can easily indicate which of the returned skins is the default and which are unusable (e.g. because they're listed in $wgSkipSkins). So we may as well do so. Bug: 47216 Change-Id: Ib4ea5fe85e1b02895dba15f3a245c7a7d8724470 --- diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index f9866f8152..168f2f7a10 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -106,6 +106,8 @@ production. * (bug 46626) xmldoublequote parameter was removed. Because of a bug, the parameter has had no effect since MediaWiki 1.16, and so its removal is unlikely to impact existing clients. +* (bug 47216) action=query&meta=siteinfo&siprop=skins will now indicate which + skin is the default and which are unusable (e.g. listed in $wgSkipSkins). * (bug 25325) Added support for wlshow filtering (bots/anon/minor/patrolled) to action=feedwatchlist. * WDDX formatted output will actually be formatted (and normal output will no diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 37b22f15b0..09a0f3d0be 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -544,9 +544,17 @@ class ApiQuerySiteinfo extends ApiQueryBase { public function appendSkins( $property ) { $data = array(); + $usable = Skin::getUsableSkins(); + $default = Skin::normalizeKey( 'default' ); foreach ( Skin::getSkinNames() as $name => $displayName ) { $skin = array( 'code' => $name ); ApiResult::setContent( $skin, $displayName ); + if ( !isset( $usable[$name] ) ) { + $skin['unusable'] = ''; + } + if ( $name === $default ) { + $skin['default'] = ''; + } $data[] = $skin; } $this->getResult()->setIndexedTagName( $data, 'skin' );