Index: trunk/extensions/FlaggedRevs/api/ApiQueryOldreviewedpages.php |
— | — | @@ -55,6 +55,10 @@ |
56 | 56 | // Construct SQL Query |
57 | 57 | $this->addTables( array( 'page', 'flaggedpages' ) ); |
58 | 58 | $this->addWhereFld( 'page_namespace', $params['namespace'] ); |
| 59 | + if( $params['filterredir'] == 'redirects' ) |
| 60 | + $this->addWhereFld( 'page_is_redirect', 1 ); |
| 61 | + if( $params['filterredir'] == 'nonredirects' ) |
| 62 | + $this->addWhereFld( 'page_is_redirect', 0 ); |
59 | 63 | $this->addWhereRange( |
60 | 64 | 'fp_pending_since', |
61 | 65 | $params['dir'], |
— | — | @@ -152,9 +156,17 @@ |
153 | 157 | !$wgFlaggedRevsNamespaces ? |
154 | 158 | NS_MAIN : |
155 | 159 | $wgFlaggedRevsNamespaces[0], |
156 | | - ApiBase :: PARAM_TYPE => 'namespace', |
157 | | - ApiBase :: PARAM_ISMULTI => true, |
| 160 | + ApiBase::PARAM_TYPE => 'namespace', |
| 161 | + ApiBase::PARAM_ISMULTI => true, |
158 | 162 | ), |
| 163 | + 'filterredir' => array ( |
| 164 | + ApiBase::PARAM_DFLT => 'all', |
| 165 | + ApiBase::PARAM_TYPE => array ( |
| 166 | + 'redirects', |
| 167 | + 'nonredirects', |
| 168 | + 'all' |
| 169 | + ) |
| 170 | + ), |
159 | 171 | 'limit' => array ( |
160 | 172 | ApiBase::PARAM_DFLT => 10, |
161 | 173 | ApiBase::PARAM_TYPE => 'limit', |
— | — | @@ -170,6 +182,7 @@ |
171 | 183 | 'start' => 'Start listing at this timestamp.', |
172 | 184 | 'end' => 'Stop listing at this timestamp.', |
173 | 185 | 'namespace' => 'The namespaces to enumerate.', |
| 186 | + 'filterredir' => 'How to filter for redirects', |
174 | 187 | 'limit' => 'How many total pages to return.', |
175 | 188 | 'dir' => array( |
176 | 189 | 'In which direction to list.', |