r80788 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80787‎ | r80788 | r80789 >
Date:02:05, 23 January 2011
Author:reedy
Status:ok
Tags:
Comment:
* Expose list of skins in meta=siteinfo
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQuerySiteinfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php
@@ -85,6 +85,9 @@
8686 case 'languages':
8787 $fit = $this->appendLanguages( $p );
8888 break;
 89+ case 'skins':
 90+ $fit = $this->appendSkins( $p );
 91+ break;
8992 default:
9093 ApiBase::dieDebug( __METHOD__, "Unknown prop=$p" );
9194 }
@@ -452,6 +455,17 @@
453456 return $this->getResult()->addValue( 'query', $property, $data );
454457 }
455458
 459+ public function appendSkins( $property ) {
 460+ $data = array();
 461+ foreach ( Skin::getSkinNames() as $name => $displayName ) {
 462+ $skin = array( 'code' => $name );
 463+ ApiResult::setContent( $skin, $displayName );
 464+ $data[] = $skin;
 465+ }
 466+ $this->getResult()->setIndexedTagName( $data, 'skin' );
 467+ return $this->getResult()->addValue( 'query', $property, $data );
 468+ }
 469+
456470 public function getCacheMode( $params ) {
457471 return 'public';
458472 }
@@ -475,6 +489,7 @@
476490 'fileextensions',
477491 'rightsinfo',
478492 'languages',
 493+ 'skins',
479494 )
480495 ),
481496 'filteriw' => array(
@@ -505,6 +520,7 @@
506521 ' fileextensions - Returns list of file extensions allowed to be uploaded',
507522 ' rightsinfo - Returns wiki rights (license) information if available',
508523 ' languages - Returns a list of languages MediaWiki supports',
 524+ ' skins - Returns a list of all enabled skins',
509525 ),
510526 'filteriw' => 'Return only local or only nonlocal entries of the interwiki map',
511527 'showalldb' => 'List all database servers, not just the one lagging the most',
Index: trunk/phase3/RELEASE-NOTES
@@ -129,6 +129,7 @@
130130 * (bug 26480) add a pppageprops param to prop=pageprops
131131 * (bug 26650) Remove $wgAPICacheHelp in favour of $wgAPICacheHelpTimeout
132132 * (bug 24650) Fix API to work with categorylinks changes
 133+* Expose list of skins in meta=siteinfo
133134
134135 === Languages updated in 1.18 ===
135136

Status & tagging log