Index: trunk/extensions/FlaggedRevs/api/reports/ApiQueryUnreviewedpages.php |
— | — | @@ -54,9 +54,10 @@ |
55 | 55 | $this->addWhereFld( 'page_is_redirect', 0 ); |
56 | 56 | } |
57 | 57 | |
| 58 | + $dir = ( $params['dir'] == 'descending' ? 'older' : 'newer' ); |
58 | 59 | $this->addWhereRange( |
59 | 60 | 'page_title', |
60 | | - 'newer', |
| 61 | + $dir, |
61 | 62 | $params['start'], |
62 | 63 | $params['end'] |
63 | 64 | ); |
— | — | @@ -99,10 +100,10 @@ |
100 | 101 | if ( is_null( $resultPageSet ) ) { |
101 | 102 | $title = Title::newFromRow( $row ); |
102 | 103 | $data[] = array( |
103 | | - 'pageid' => intval( $row->page_id ), |
104 | | - 'ns' => intval( $title->getNamespace() ), |
105 | | - 'title' => $title->getPrefixedText(), |
106 | | - 'revid' => intval( $row->page_latest ), |
| 104 | + 'pageid' => intval( $row->page_id ), |
| 105 | + 'ns' => intval( $title->getNamespace() ), |
| 106 | + 'title' => $title->getPrefixedText(), |
| 107 | + 'revid' => intval( $row->page_latest ), |
107 | 108 | 'under_review' => FRUserActivity::pageIsUnderReview( $row->page_id ) |
108 | 109 | ); |
109 | 110 | } else { |
— | — | @@ -130,6 +131,10 @@ |
131 | 132 | 'end' => array ( |
132 | 133 | ApiBase::PARAM_TYPE => 'string' |
133 | 134 | ), |
| 135 | + 'dir' => array( |
| 136 | + ApiBase::PARAM_DFLT => 'ascending', |
| 137 | + ApiBase::PARAM_TYPE => array( 'ascending', 'descending' ), |
| 138 | + ), |
134 | 139 | 'namespace' => array ( |
135 | 140 | ApiBase::PARAM_DFLT => !$namespaces ? NS_MAIN : $namespaces[0], |
136 | 141 | ApiBase::PARAM_TYPE => 'namespace', |
— | — | @@ -161,12 +166,13 @@ |
162 | 167 | |
163 | 168 | public function getParamDescription() { |
164 | 169 | return array ( |
165 | | - 'start' => 'Start listing at this page title.', |
166 | | - 'end' => 'Stop listing at this page title.', |
167 | | - 'namespace' => 'The namespaces to enumerate.', |
168 | | - 'filterredir' => 'How to filter for redirects', |
169 | | - 'filterlevel' => 'How to filter by quality (0=checked,1=quality)', |
170 | | - 'limit' => 'How many total pages to return.', |
| 170 | + 'start' => 'Start listing at this page title.', |
| 171 | + 'end' => 'Stop listing at this page title.', |
| 172 | + 'dir' => 'Direction to sort in', |
| 173 | + 'namespace' => 'The namespaces to enumerate.', |
| 174 | + 'filterredir' => 'How to filter for redirects', |
| 175 | + 'filterlevel' => 'How to filter by quality (0=checked,1=quality)', |
| 176 | + 'limit' => 'How many total pages to return.', |
171 | 177 | ); |
172 | 178 | } |
173 | 179 | |