Index: trunk/phase3/includes/api/ApiParamInfo.php |
— | — | @@ -88,6 +88,21 @@ |
89 | 89 | $pageSet = new ApiPageSet( $this->queryObj ); |
90 | 90 | $r['pagesetmodule'] = $this->getClassInfo( $pageSet ); |
91 | 91 | } |
| 92 | + if ( is_array( $params['formatmodules'] ) ) { |
| 93 | + $formats = $this->getMain()->getFormats(); |
| 94 | + $r['formatmodules'] = array(); |
| 95 | + foreach ( $params['formatmodules'] as $f ) { |
| 96 | + if ( !isset( $formats[$f] ) ) { |
| 97 | + $r['formatmodules'][] = array( 'name' => $f, 'missing' => '' ); |
| 98 | + continue; |
| 99 | + } |
| 100 | + $obj = new $formats[$f]( $this, $f ); |
| 101 | + $a = $this->getClassInfo( $obj ); |
| 102 | + $a['name'] = $f; |
| 103 | + $r['formatmodules'][] = $a; |
| 104 | + } |
| 105 | + $result->setIndexedTagName( $r['formatmodules'], 'module' ); |
| 106 | + } |
92 | 107 | $result->addValue( null, $this->getModuleName(), $r ); |
93 | 108 | } |
94 | 109 | |
— | — | @@ -237,6 +252,10 @@ |
238 | 253 | ), |
239 | 254 | 'mainmodule' => false, |
240 | 255 | 'pagesetmodule' => false, |
| 256 | + 'formatmodules' => array( |
| 257 | + ApiBase::PARAM_ISMULTI => true, |
| 258 | + ApiBase::PARAM_TYPE => array_keys( $this->getMain()->getFormats() ), |
| 259 | + ) |
241 | 260 | ); |
242 | 261 | } |
243 | 262 | |
— | — | @@ -246,6 +265,7 @@ |
247 | 266 | 'querymodules' => 'List of query module names (value of prop=, meta= or list= parameter)', |
248 | 267 | 'mainmodule' => 'Get information about the main (top-level) module as well', |
249 | 268 | 'pagesetmodule' => 'Get information about the pageset module (providing titles= and friends) as well', |
| 269 | + 'formatmodules' => 'List of format module names (value of format= parameter)', |
250 | 270 | ); |
251 | 271 | } |
252 | 272 | |