* @{
*/
+ /**
+ * Indicate if the module supports dynamically-determined parameters that
+ * cannot be included in self::getAllowedParams().
+ * @return string|array|Message|null Return null if the module does not
+ * support additional dynamic parameters, otherwise return a message
+ * describing them.
+ */
+ public function dynamicParameterDocumentation() {
+ return null;
+ }
+
/**
* This method mangles parameter name based on the prefix supplied to the constructor.
* Override this method to change parameter name during runtime
}
$params = $module->getFinalParams( ApiBase::GET_VALUES_FOR_HELP );
+ $dynamicParams = $module->dynamicParameterDocumentation();
$groups = array();
- if ( $params ) {
+ if ( $params || $dynamicParams !== null ) {
$help['parameters'] .= Html::openElement( 'div',
array( 'class' => 'apihelp-block apihelp-parameters' )
);
}
}
+ if ( $dynamicParams !== null ) {
+ $dynamicParams = ApiBase::makeMessage( $dynamicParams, $context, array(
+ $module->getModulePrefix(),
+ $module->getModuleName(),
+ $module->getModulePath()
+ ) );
+ $help['parameters'] .= Html::element( 'dt', null, '*' );
+ $help['parameters'] .= Html::rawElement( 'dd',
+ array( 'class' => 'description' ), $dynamicParams->parse() );
+ }
+
$help['parameters'] .= Html::closeElement( 'dl' );
$help['parameters'] .= Html::closeElement( 'div' );
}
}
ApiResult::setIndexedTagName( $ret['parameters'], 'param' );
+ $dynamicParams = $module->dynamicParameterDocumentation();
+ if ( $dynamicParams !== null ) {
+ if ( $this->helpFormat === 'none' ) {
+ $ret['dynamicparameters'] = true;
+ } else {
+ $dynamicParams = ApiBase::makeMessage( $dynamicParams, $this->context, array(
+ $module->getModulePrefix(),
+ $module->getModuleName(),
+ $module->getModulePath()
+ ) );
+ $this->formatHelpMessages( $ret, 'dynamicparameters', array( $dynamicParams ) );
+ }
+ }
+
return $ret;
}