}
}
+ Hooks::runWithoutAbort( 'ApiMaxLagInfo', [ &$lagInfo ] );
+
return $lagInfo;
}
*/
protected function executeAction() {
$params = $this->setupExecuteAction();
+
+ // Check asserts early so e.g. errors in parsing a module's parameters due to being
+ // logged out don't override the client's intended "am I logged in?" check.
+ $this->checkAsserts( $params );
+
$module = $this->setupModule();
$this->mModule = $module;
$this->setupExternalResponse( $module, $params );
}
- $this->checkAsserts( $params );
-
// Execute
$module->execute();
Hooks::run( 'APIAfterExecute', [ &$module ] );
$help[$k] = $v;
}
$help['datatypes'] = '';
+ $help['templatedparams'] = '';
$help['credits'] = '';
// Fill 'permissions'
$help['permissions'] .= Html::closeElement( 'dl' );
$help['permissions'] .= Html::closeElement( 'div' );
- // Fill 'datatypes' and 'credits', if applicable
+ // Fill 'datatypes', 'templatedparams', and 'credits', if applicable
if ( empty( $options['nolead'] ) ) {
$level = $options['headerlevel'];
$tocnumber = &$options['tocnumber'];
];
}
+ $header = $this->msg( 'api-help-templatedparams-header' )->parse();
+
+ $id = Sanitizer::escapeIdForAttribute( 'main/templatedparams', Sanitizer::ID_PRIMARY );
+ $idFallback = Sanitizer::escapeIdForAttribute( 'main/templatedparams', Sanitizer::ID_FALLBACK );
+ $headline = Linker::makeHeadline( min( 6, $level ),
+ ' class="apihelp-header">',
+ $id,
+ $header,
+ '',
+ $idFallback
+ );
+ // Ensure we have a sane anchor
+ if ( $id !== 'main/templatedparams' && $idFallback !== 'main/templatedparams' ) {
+ $headline = '<div id="main/templatedparams"></div>' . $headline;
+ }
+ $help['templatedparams'] .= $headline;
+ $help['templatedparams'] .= $this->msg( 'api-help-templatedparams' )->parseAsBlock();
+ if ( !isset( $tocData['main/templatedparams'] ) ) {
+ $tocnumber[$level]++;
+ $tocData['main/templatedparams'] = [
+ 'toclevel' => count( $tocnumber ),
+ 'level' => $level,
+ 'anchor' => 'main/templatedparams',
+ 'line' => $header,
+ 'number' => implode( '.', $tocnumber ),
+ 'index' => false,
+ ];
+ }
+
$header = $this->msg( 'api-credits-header' )->parse();
$id = Sanitizer::escapeIdForAttribute( 'main/credits', Sanitizer::ID_PRIMARY );
$idFallback = Sanitizer::escapeIdForAttribute( 'main/credits', Sanitizer::ID_FALLBACK );