X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiParamInfo.php;h=067b2f596867eb703b52cb49f4d4a851db2f0276;hb=50dee21f7a852e2cb4865b9ec83e272a25ab90c3;hp=935d5ae275ff040837899936b301d337260222f3;hpb=a15fe7dd93cfcd9510b54b8481b4c3aa891ac380;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php index 935d5ae275..067b2f5968 100644 --- a/includes/api/ApiParamInfo.php +++ b/includes/api/ApiParamInfo.php @@ -198,6 +198,10 @@ class ApiParamInfo extends ApiBase { $a['required'] = ''; } + if ( $n === 'token' && $obj->needsToken() ) { + $a['tokentype'] = $obj->needsToken(); + } + if ( isset( $p[ApiBase::PARAM_DFLT] ) ) { $type = $p[ApiBase::PARAM_TYPE]; if ( $type === 'boolean' ) { @@ -224,7 +228,13 @@ class ApiParamInfo extends ApiBase { } if ( isset( $p[ApiBase::PARAM_TYPE] ) ) { - $a['type'] = $p[ApiBase::PARAM_TYPE]; + if ( $p[ApiBase::PARAM_TYPE] === 'submodule' ) { + $a['type'] = $obj->getModuleManager()->getNames( $n ); + sort( $a['type'] ); + $a['submodules'] = ''; + } else { + $a['type'] = $p[ApiBase::PARAM_TYPE]; + } if ( is_array( $a['type'] ) ) { // To prevent sparse arrays from being serialized to JSON as objects $a['type'] = array_values( $a['type'] );