r52557 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52556‎ | r52557 | r52558 >
Date:17:26, 29 June 2009
Author:aaron
Status:ok
Tags:
Comment:
Added level filter
Modified paths:
  • /trunk/extensions/FlaggedRevs/api/ApiQueryReviewedpages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/api/ApiQueryReviewedpages.php
@@ -50,6 +50,8 @@
5151 $this->addWhereFld( 'page_is_redirect', 1 );
5252 if( $params['filterredir'] == 'nonredirects' )
5353 $this->addWhereFld( 'page_is_redirect', 0 );
 54+ if( $params['filterlevel'] !== null )
 55+ $this->addWhereFld( 'fp_quality', $params['filterlevel'] );
5456 $this->addWhereRange(
5557 'fp_page_id',
5658 $params['dir'],
@@ -149,11 +151,17 @@
150152 'all'
151153 )
152154 ),
 155+ 'filterlevel' => array (
 156+ ApiBase::PARAM_DFLT => null,
 157+ ApiBase::PARAM_TYPE => 'integer',
 158+ ApiBase::PARAM_MIN => 0,
 159+ ApiBase::PARAM_MAX => 2,
 160+ ),
153161 'limit' => array (
154162 ApiBase::PARAM_DFLT => 10,
155163 ApiBase::PARAM_TYPE => 'limit',
156 - ApiBase::PARAM_MIN => 1,
157 - ApiBase::PARAM_MAX => ApiBase::LIMIT_BIG1,
 164+ ApiBase::PARAM_MIN => 1,
 165+ ApiBase::PARAM_MAX => ApiBase::LIMIT_BIG1,
158166 ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2
159167 )
160168 );
@@ -165,6 +173,7 @@
166174 'end' => 'Stop listing at this page id.',
167175 'namespace' => 'The namespaces to enumerate.',
168176 'filterredir' => 'How to filter for redirects',
 177+ 'filterlevel' => 'How to filter by quality (0=sighted,1=quality)',
169178 'limit' => 'How many total pages to return.',
170179 'dir' => array(
171180 'In which direction to list.',
@@ -184,7 +193,7 @@
185194 protected function getExamples() {
186195 return array (
187196 'Show a list of reviewed pages',
188 - ' api.php?action=query&list=reviewedpages&rpnamespace=0',
 197+ ' api.php?action=query&list=reviewedpages&rpnamespace=0&rpfilterlevel=0',
189198 'Show info about some reviewed pages',
190199 ' api.php?action=query&generator=reviewedpages&grplimit=4&prop=info',
191200 );

Status & tagging log