X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiParamInfo.php;h=b8a32ae4305782a394b19a84ce93dae9bb4fee8f;hb=78d1b8ebba6e992c59c7f7c02fd621bc6f12547c;hp=93fc51a7c692349c6645596d18adcec26a831681;hpb=a88aff710b197533e388943306d7af5f9706f1be;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php index 93fc51a7c6..b8a32ae430 100644 --- a/includes/api/ApiParamInfo.php +++ b/includes/api/ApiParamInfo.php @@ -1,9 +1,5 @@ .@gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -309,16 +305,25 @@ class ApiParamInfo extends ApiBase { } $ret['parameters'] = []; + $ret['templatedparameters'] = []; $params = $module->getFinalParams( ApiBase::GET_VALUES_FOR_HELP ); $paramDesc = $module->getFinalParamDescription(); + $index = 0; foreach ( $params as $name => $settings ) { if ( !is_array( $settings ) ) { $settings = [ ApiBase::PARAM_DFLT => $settings ]; } $item = [ - 'name' => $name + 'index' => ++$index, + 'name' => $name, ]; + + if ( !empty( $settings[ApiBase::PARAM_TEMPLATE_VARS] ) ) { + $item['templatevars'] = $settings[ApiBase::PARAM_TEMPLATE_VARS]; + ApiResult::setIndexedTagName( $item['templatevars'], 'var' ); + } + if ( isset( $paramDesc[$name] ) ) { $this->formatHelpMessages( $item, 'description', $paramDesc[$name], true ); } @@ -511,9 +516,11 @@ class ApiParamInfo extends ApiBase { ApiResult::setIndexedTagName( $item['info'], 'i' ); } - $ret['parameters'][] = $item; + $key = empty( $settings[ApiBase::PARAM_TEMPLATE_VARS] ) ? 'parameters' : 'templatedparameters'; + $ret[$key][] = $item; } ApiResult::setIndexedTagName( $ret['parameters'], 'param' ); + ApiResult::setIndexedTagName( $ret['templatedparameters'], 'param' ); $dynamicParams = $module->dynamicParameterDocumentation(); if ( $dynamicParams !== null ) {