From 810879a349ffedd884f6c3f77696bb1bd105394d Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 15 Apr 2013 10:54:51 -0400 Subject: [PATCH] (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 --- RELEASE-NOTES-1.22 | 2 ++ includes/api/ApiQuerySiteinfo.php | 8 ++++++++ 2 files changed, 10 insertions(+) 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' ); -- 2.20.1