Index: trunk/extensions/Configure/Configure.api.php |
— | — | @@ -16,8 +16,9 @@ |
17 | 17 | $this->dieUsage( 'You need to call efConfigureSetup() to use this module', 'noconf' ); |
18 | 18 | } |
19 | 19 | |
| 20 | + $prop = array_flip( $params['prop'] ); |
20 | 21 | // Version list |
21 | | - if ( in_array( 'versionlist', $params['prop'] ) ) { |
| 22 | + if ( isset( $prop['versionlist'] ) ) { |
22 | 23 | if ( !$wgUser->isAllowed( 'viewconfig' ) ) |
23 | 24 | $this->dieUsage( 'viewconfig right required', 'noright' ); |
24 | 25 | $versions = $wgConf->listArchiveVersions(); |
— | — | @@ -33,11 +34,11 @@ |
34 | 35 | } |
35 | 36 | } |
36 | 37 | $result->setIndexedTagName( $versions, 'version' ); |
37 | | - $result->addValue( 'configure', 'versions', $versions ); |
| 38 | + $result->addValue( $this->getModuleName(), 'versions', $versions ); |
38 | 39 | } |
39 | 40 | |
40 | 41 | // Wiki list |
41 | | - if ( in_array( 'wikilist', $params['prop'] ) ) { |
| 42 | + if ( isset( $prop['wikilist'] ) ) { |
42 | 43 | if ( !$wgUser->isAllowed( 'viewconfig-interwiki' ) ) |
43 | 44 | $this->dieUsage( 'viewconfig-interwiki right required', 'noright' ); |
44 | 45 | if ( $wgConfigureWikis === false ) |
— | — | @@ -47,12 +48,12 @@ |
48 | 49 | if ( is_array( $wgConfigureWikis ) ) { |
49 | 50 | $wikis = $wgConfigureWikis; |
50 | 51 | $result->setIndexedTagName( $wikis, 'wiki' ); |
51 | | - $result->addValue( 'configure', 'wikis', $wikis ); |
| 52 | + $result->addValue( $this->getModuleName(), 'wikis', $wikis ); |
52 | 53 | } |
53 | 54 | } |
54 | 55 | |
55 | 56 | // Settings |
56 | | - if ( in_array( 'settings', $params['prop'] ) ) { |
| 57 | + if ( isset( $prop['settings'] ) ) { |
57 | 58 | if ( !$wgUser->isAllowed( 'viewconfig' ) ) |
58 | 59 | $this->dieUsage( 'viewconfig right required', 'noright' ); |
59 | 60 | $version = $params['version']; |
— | — | @@ -93,11 +94,11 @@ |
94 | 95 | } |
95 | 96 | $result->setIndexedTagName( $ret, 'setting' ); |
96 | 97 | } |
97 | | - $result->addValue( 'configure', 'settings', $ret ); |
| 98 | + $result->addValue( $this->getModuleName(), 'settings', $ret ); |
98 | 99 | } |
99 | 100 | |
100 | 101 | // Extensions |
101 | | - if ( in_array( 'extensions', $params['prop'] ) ) { |
| 102 | + if ( isset( $prop['extensions'] ) ) { |
102 | 103 | if ( !$wgUser->isAllowed( 'extensions' ) ) |
103 | 104 | $this->dieUsage( 'extensions right required', 'noright' ); |
104 | 105 | $conf = ConfigurationSettings::singleton( CONF_SETTINGS_EXT ); |
— | — | @@ -115,7 +116,7 @@ |
116 | 117 | $ret[] = $extArr; |
117 | 118 | } |
118 | 119 | $result->setIndexedTagName( $ret, 'extension' ); |
119 | | - $result->addValue( 'configure', 'extension', $ret ); |
| 120 | + $result->addValue( $this->getModuleName(), 'extension', $ret ); |
120 | 121 | } |
121 | 122 | } |
122 | 123 | |
— | — | @@ -318,15 +319,15 @@ |
319 | 320 | protected function getAllowedParams() { |
320 | 321 | return array( |
321 | 322 | 'prop' => array( |
322 | | - ApiBase::PARAM_ISMULTI => true, |
323 | | - ApiBase::PARAM_TYPE => array( |
324 | | - 'versionlist', |
325 | | - 'wikilist', |
326 | | - 'settings', |
327 | | - 'extensions', |
| 323 | + ApiBase::PARAM_ISMULTI => true, |
| 324 | + ApiBase::PARAM_TYPE => array( |
| 325 | + 'versionlist', |
| 326 | + 'wikilist', |
| 327 | + 'settings', |
| 328 | + 'extensions', |
| 329 | + ), |
| 330 | + ApiBase::PARAM_DFLT => 'versionlist|wikilist', |
328 | 331 | ), |
329 | | - ApiBase::PARAM_DFLT => 'versionlist|wikilist', |
330 | | - ), |
331 | 332 | 'version' => null, |
332 | 333 | 'wiki' => null, |
333 | 334 | 'group' => false, |