* Expose list of skins in meta=siteinfo
This commit is contained in:
parent
93763f9759
commit
a52f1eef80
2 changed files with 17 additions and 0 deletions
|
|
@ -129,6 +129,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
|
|||
* (bug 26480) add a pppageprops param to prop=pageprops
|
||||
* (bug 26650) Remove $wgAPICacheHelp in favour of $wgAPICacheHelpTimeout
|
||||
* (bug 24650) Fix API to work with categorylinks changes
|
||||
* Expose list of skins in meta=siteinfo
|
||||
|
||||
=== Languages updated in 1.18 ===
|
||||
|
||||
|
|
|
|||
|
|
@ -85,6 +85,9 @@ class ApiQuerySiteinfo extends ApiQueryBase {
|
|||
case 'languages':
|
||||
$fit = $this->appendLanguages( $p );
|
||||
break;
|
||||
case 'skins':
|
||||
$fit = $this->appendSkins( $p );
|
||||
break;
|
||||
default:
|
||||
ApiBase::dieDebug( __METHOD__, "Unknown prop=$p" );
|
||||
}
|
||||
|
|
@ -452,6 +455,17 @@ class ApiQuerySiteinfo extends ApiQueryBase {
|
|||
return $this->getResult()->addValue( 'query', $property, $data );
|
||||
}
|
||||
|
||||
public function appendSkins( $property ) {
|
||||
$data = array();
|
||||
foreach ( Skin::getSkinNames() as $name => $displayName ) {
|
||||
$skin = array( 'code' => $name );
|
||||
ApiResult::setContent( $skin, $displayName );
|
||||
$data[] = $skin;
|
||||
}
|
||||
$this->getResult()->setIndexedTagName( $data, 'skin' );
|
||||
return $this->getResult()->addValue( 'query', $property, $data );
|
||||
}
|
||||
|
||||
public function getCacheMode( $params ) {
|
||||
return 'public';
|
||||
}
|
||||
|
|
@ -475,6 +489,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
|
|||
'fileextensions',
|
||||
'rightsinfo',
|
||||
'languages',
|
||||
'skins',
|
||||
)
|
||||
),
|
||||
'filteriw' => array(
|
||||
|
|
@ -505,6 +520,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
|
|||
' fileextensions - Returns list of file extensions allowed to be uploaded',
|
||||
' rightsinfo - Returns wiki rights (license) information if available',
|
||||
' languages - Returns a list of languages MediaWiki supports',
|
||||
' skins - Returns a list of all enabled skins',
|
||||
),
|
||||
'filteriw' => 'Return only local or only nonlocal entries of the interwiki map',
|
||||
'showalldb' => 'List all database servers, not just the one lagging the most',
|
||||
|
|
|
|||
Loading…
Reference in a new issue