X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryUserContributions.php;h=41f7ee7ed65a08595d63f38026b1affeca929b98;hb=42a95b7a93e814b159907372ee108e4da0da6aa4;hp=29d03001c75f96e9e929b94b17c4f5e0d89b4f10;hpb=d55b1505b0e21116b995808c20cbbd2004959add;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 29d03001c7..41f7ee7ed6 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -224,6 +224,7 @@ class ApiQueryContributions extends ApiQueryBase { $show = $this->params['show']; if ( $this->params['toponly'] ) { // deprecated/old param + $this->logFeatureUsage( 'list=usercontribs&uctoponly' ); $show[] = 'top'; } if ( !is_null( $show ) ) { @@ -463,7 +464,9 @@ class ApiQueryContributions extends ApiQueryBase { 'end' => array( ApiBase::PARAM_TYPE => 'timestamp' ), - 'continue' => null, + 'continue' => array( + ApiBase::PARAM_HELP_MSG => 'api-help-param-continue', + ), 'user' => array( ApiBase::PARAM_ISMULTI => true ), @@ -473,7 +476,8 @@ class ApiQueryContributions extends ApiQueryBase { ApiBase::PARAM_TYPE => array( 'newer', 'older' - ) + ), + ApiBase::PARAM_HELP_MSG => 'api-help-param-direction', ), 'namespace' => array( ApiBase::PARAM_ISMULTI => true, @@ -506,7 +510,11 @@ class ApiQueryContributions extends ApiQueryBase { '!top', 'new', '!new', - ) + ), + ApiBase::PARAM_HELP_MSG => array( + 'apihelp-query+usercontribs-param-show', + $this->getConfig()->get( 'RCMaxAge' ) + ), ), 'tag' => null, 'toponly' => array( @@ -516,124 +524,12 @@ class ApiQueryContributions extends ApiQueryBase { ); } - public function getParamDescription() { - $p = $this->getModulePrefix(); - $RCMaxAge = $this->getConfig()->get( 'RCMaxAge' ); - - return array( - 'limit' => 'The maximum number of contributions to return', - 'start' => 'The start timestamp to return from', - 'end' => 'The end timestamp to return to', - 'continue' => 'When more results are available, use this to continue', - 'user' => 'The users to retrieve contributions for', - 'userprefix' => array( - "Retrieve contributions for all users whose names begin with this value.", - "Overrides {$p}user", - ), - 'dir' => $this->getDirectionDescription( $p ), - 'namespace' => 'Only list contributions in these namespaces', - 'prop' => array( - 'Include additional pieces of information', - ' ids - Adds the page ID and revision ID', - ' title - Adds the title and namespace ID of the page', - ' timestamp - Adds the timestamp of the edit', - ' comment - Adds the comment of the edit', - ' parsedcomment - Adds the parsed comment of the edit', - ' size - Adds the new size of the edit', - ' sizediff - Adds the size delta of the edit against its parent', - ' flags - Adds flags of the edit', - ' patrolled - Tags patrolled edits', - ' tags - Lists tags for the edit', - ), - 'show' => array( - "Show only items that meet thse criteria, e.g. non minor edits only: {$p}show=!minor", - "NOTE: If {$p}show=patrolled or {$p}show=!patrolled is set, revisions older than", - "\$wgRCMaxAge ($RCMaxAge) won't be shown", - ), - 'tag' => 'Only list revisions tagged with this tag', - 'toponly' => 'Only list changes which are the latest revision', - ); - } - - public function getResultProperties() { - return array( - '' => array( - 'userid' => 'integer', - 'user' => 'string', - 'userhidden' => 'boolean' - ), - 'ids' => array( - 'pageid' => 'integer', - 'revid' => 'integer', - 'parentid' => array( - ApiBase::PROP_TYPE => 'integer', - ApiBase::PROP_NULLABLE => true - ) - ), - 'title' => array( - 'ns' => 'namespace', - 'title' => 'string' - ), - 'timestamp' => array( - 'timestamp' => 'timestamp' - ), - 'flags' => array( - 'new' => 'boolean', - 'minor' => 'boolean', - 'top' => 'boolean' - ), - 'comment' => array( - 'commenthidden' => 'boolean', - 'comment' => array( - ApiBase::PROP_TYPE => 'string', - ApiBase::PROP_NULLABLE => true - ) - ), - 'parsedcomment' => array( - 'commenthidden' => 'boolean', - 'parsedcomment' => array( - ApiBase::PROP_TYPE => 'string', - ApiBase::PROP_NULLABLE => true - ) - ), - 'patrolled' => array( - 'patrolled' => 'boolean' - ), - 'size' => array( - 'size' => array( - ApiBase::PROP_TYPE => 'integer', - ApiBase::PROP_NULLABLE => true - ) - ), - 'sizediff' => array( - 'sizediff' => array( - ApiBase::PROP_TYPE => 'integer', - ApiBase::PROP_NULLABLE => true - ) - ) - ); - } - - public function getDescription() { - return 'Get all edits by a user.'; - } - - public function getPossibleErrors() { - return array_merge( parent::getPossibleErrors(), array( - array( 'code' => 'param_user', 'info' => 'User parameter may not be empty.' ), - array( 'code' => 'param_user', 'info' => 'User name user is not valid' ), - array( 'show' ), - array( - 'code' => 'permissiondenied', - 'info' => 'You need the patrol right to request the patrolled flag' - ), - ) ); - } - - public function getExamples() { + protected function getExamplesMessages() { return array( - 'api.php?action=query&list=usercontribs&ucuser=YurikBot', - 'api.php?action=query&list=usercontribs&ucuserprefix=217.121.114.', + 'action=query&list=usercontribs&ucuser=Example' + => 'apihelp-query+usercontribs-example-user', + 'action=query&list=usercontribs&ucuserprefix=192.0.2.' + => 'apihelp-query+usercontribs-example-ipprefix', ); }