Index: trunk/extensions/FlaggedRevs/api/ApiQueryReviewedpages.php |
— | — | @@ -50,6 +50,8 @@ |
51 | 51 | $this->addWhereFld( 'page_is_redirect', 1 );
|
52 | 52 | if( $params['filterredir'] == 'nonredirects' )
|
53 | 53 | $this->addWhereFld( 'page_is_redirect', 0 );
|
| 54 | + if( $params['filterlevel'] !== null )
|
| 55 | + $this->addWhereFld( 'fp_quality', $params['filterlevel'] );
|
54 | 56 | $this->addWhereRange(
|
55 | 57 | 'fp_page_id',
|
56 | 58 | $params['dir'],
|
— | — | @@ -149,11 +151,17 @@ |
150 | 152 | 'all'
|
151 | 153 | )
|
152 | 154 | ),
|
| 155 | + 'filterlevel' => array (
|
| 156 | + ApiBase::PARAM_DFLT => null,
|
| 157 | + ApiBase::PARAM_TYPE => 'integer',
|
| 158 | + ApiBase::PARAM_MIN => 0,
|
| 159 | + ApiBase::PARAM_MAX => 2,
|
| 160 | + ),
|
153 | 161 | 'limit' => array (
|
154 | 162 | ApiBase::PARAM_DFLT => 10,
|
155 | 163 | 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,
|
158 | 166 | ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2
|
159 | 167 | )
|
160 | 168 | );
|
— | — | @@ -165,6 +173,7 @@ |
166 | 174 | 'end' => 'Stop listing at this page id.',
|
167 | 175 | 'namespace' => 'The namespaces to enumerate.',
|
168 | 176 | 'filterredir' => 'How to filter for redirects',
|
| 177 | + 'filterlevel' => 'How to filter by quality (0=sighted,1=quality)',
|
169 | 178 | 'limit' => 'How many total pages to return.',
|
170 | 179 | 'dir' => array(
|
171 | 180 | 'In which direction to list.',
|
— | — | @@ -184,7 +193,7 @@ |
185 | 194 | protected function getExamples() {
|
186 | 195 | return array (
|
187 | 196 | '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',
|
189 | 198 | 'Show info about some reviewed pages',
|
190 | 199 | ' api.php?action=query&generator=reviewedpages&grplimit=4&prop=info',
|
191 | 200 | );
|