Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php |
— | — | @@ -85,6 +85,9 @@ |
86 | 86 | case 'languages': |
87 | 87 | $fit = $this->appendLanguages( $p ); |
88 | 88 | break; |
| 89 | + case 'skins': |
| 90 | + $fit = $this->appendSkins( $p ); |
| 91 | + break; |
89 | 92 | default: |
90 | 93 | ApiBase::dieDebug( __METHOD__, "Unknown prop=$p" ); |
91 | 94 | } |
— | — | @@ -452,6 +455,17 @@ |
453 | 456 | return $this->getResult()->addValue( 'query', $property, $data ); |
454 | 457 | } |
455 | 458 | |
| 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 | + |
456 | 470 | public function getCacheMode( $params ) { |
457 | 471 | return 'public'; |
458 | 472 | } |
— | — | @@ -475,6 +489,7 @@ |
476 | 490 | 'fileextensions', |
477 | 491 | 'rightsinfo', |
478 | 492 | 'languages', |
| 493 | + 'skins', |
479 | 494 | ) |
480 | 495 | ), |
481 | 496 | 'filteriw' => array( |
— | — | @@ -505,6 +520,7 @@ |
506 | 521 | ' fileextensions - Returns list of file extensions allowed to be uploaded', |
507 | 522 | ' rightsinfo - Returns wiki rights (license) information if available', |
508 | 523 | ' languages - Returns a list of languages MediaWiki supports', |
| 524 | + ' skins - Returns a list of all enabled skins', |
509 | 525 | ), |
510 | 526 | 'filteriw' => 'Return only local or only nonlocal entries of the interwiki map', |
511 | 527 | 'showalldb' => 'List all database servers, not just the one lagging the most', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -129,6 +129,7 @@ |
130 | 130 | * (bug 26480) add a pppageprops param to prop=pageprops |
131 | 131 | * (bug 26650) Remove $wgAPICacheHelp in favour of $wgAPICacheHelpTimeout |
132 | 132 | * (bug 24650) Fix API to work with categorylinks changes |
| 133 | +* Expose list of skins in meta=siteinfo |
133 | 134 | |
134 | 135 | === Languages updated in 1.18 === |
135 | 136 | |