From: Roan Kattouw Date: Sat, 14 Feb 2009 14:56:20 +0000 (+0000) Subject: API: Make information about the main module (ApiMain) and the pageset module (ApiPage... X-Git-Tag: 1.31.0-rc.0~42893 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=e0542e1cf97a1f8fd7876397520d8a805b68d056;p=lhc%2Fweb%2Fwiklou.git API: Make information about the main module (ApiMain) and the pageset module (ApiPageSet) available through action=paraminfo --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7d0c7407de..9059596ce1 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -200,6 +200,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 17357) Added movesubpages parameter to action=move * (bug 17433) Added bot flag to list=watchlist&wlprop=flags output * (bug 16740) Added list=protectedtitles +* Added mainmodule and pagesetmodule parameters to action=paraminfo === Languages updated in 1.15 === diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php index 75c2c2d0a4..7bc73b9cc6 100644 --- a/includes/api/ApiParamInfo.php +++ b/includes/api/ApiParamInfo.php @@ -41,6 +41,7 @@ class ApiParamInfo extends ApiBase { // Get parameters $params = $this->extractRequestParams(); $result = $this->getResult(); + $queryObj = new ApiQuery($this->getMain(), 'query'); $r = array(); if(is_array($params['modules'])) { @@ -61,7 +62,6 @@ class ApiParamInfo extends ApiBase { } if(is_array($params['querymodules'])) { - $queryObj = new ApiQuery($this->getMain(), 'query'); $qmodArr = $queryObj->getModules(); foreach($params['querymodules'] as $qm) { @@ -77,6 +77,13 @@ class ApiParamInfo extends ApiBase { } $result->setIndexedTagName($r['querymodules'], 'module'); } + if($params['mainmodule']) + $r['mainmodule'] = $this->getClassInfo($this->getMain()); + if($params['pagesetmodule']) + { + $pageSet = new ApiPageSet($queryObj); + $r['pagesetmodule'] = $this->getClassInfo($pageSet); + } $result->addValue(null, $this->getModuleName(), $r); } @@ -147,7 +154,9 @@ class ApiParamInfo extends ApiBase { ), 'querymodules' => array( ApiBase :: PARAM_ISMULTI => true - ) + ), + 'mainmodule' => false, + 'pagesetmodule' => false, ); } @@ -155,6 +164,8 @@ class ApiParamInfo extends ApiBase { return array ( 'modules' => 'List of module names (value of the action= parameter)', 'querymodules' => 'List of query module names (value of prop=, meta= or list= parameter)', + 'mainmodule' => 'Get information about the main (top-level) module as well', + 'pagesetmodule' => 'Get information about the pageset module (providing titles= and friends) as well', ); }