Merge "Revert "SECURITY: Do not show log action if revdeleted" and fix UI message"
[lhc/web/wiklou.git] / includes / api / ApiTokens.php
index 9287fe6..f7290af 100644 (file)
@@ -34,6 +34,7 @@ class ApiTokens extends ApiBase {
                $this->setWarning(
                        "action=tokens has been deprecated. Please use action=query&meta=tokens instead."
                );
+               $this->logFeatureUsage( "action=tokens" );
 
                $params = $this->extractRequestParams();
                $res = array();
@@ -69,13 +70,17 @@ class ApiTokens extends ApiBase {
                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 isDeprecated() {
+               return true;
+       }
+
        public function getAllowedParams() {
                return array(
                        'type' => array(
@@ -86,23 +91,12 @@ class ApiTokens extends ApiBase {
                );
        }
 
-       public function getParamDescription() {
-               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() {
+       protected function getExamplesMessages() {
                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',
                );
        }
 }