if ( $types ) {
return $types;
}
- wfProfileIn( __METHOD__ );
$types = array( 'patrol' => array( 'ApiQueryRecentChanges', 'getPatrolToken' ) );
$names = array( 'edit', 'delete', 'protect', 'move', 'block', 'unblock',
'email', 'import', 'watch', 'options' );
foreach ( $names as $name ) {
$types[$name] = array( 'ApiQueryInfo', 'get' . ucfirst( $name ) . 'Token' );
}
- wfRunHooks( 'ApiTokensGetTokenTypes', array( &$types ) );
+ Hooks::run( 'ApiTokensGetTokenTypes', array( &$types ) );
ksort( $types );
- wfProfileOut( __METHOD__ );
return $types;
}
);
}
- public function getParamDescription() {
+ protected function getExamplesMessages() {
return array(
- 'type' => 'Type of token(s) to request'
- );
- }
-
- public function getDescription() {
- return array(
- 'This module is deprecated in favor of action=query&meta=tokens.',
- 'Gets tokens for data-modifying actions.'
- );
- }
-
- protected function getExamples() {
- return array(
- 'api.php?action=tokens' => 'Retrieve an edit token (the default)',
- 'api.php?action=tokens&type=email|move' => 'Retrieve an email token and a move token'
+ 'action=tokens'
+ => 'apihelp-tokens-example-edit',
+ 'action=tokens&type=email|move'
+ => 'apihelp-tokens-example-emailmove',
);
}
}