Index: trunk/extensions/PageTriage/modules/ext.pageTriage.models/ext.pageTriage.article.js |
— | — | @@ -48,7 +48,6 @@ |
49 | 49 | apiParams: { |
50 | 50 | namespace: 0, |
51 | 51 | limit: 50, |
52 | | - offset: 0, |
53 | 52 | dir: 'oldestfirst', |
54 | 53 | /* |
55 | 54 | showbots: null, |
Index: trunk/extensions/PageTriage/api/ApiPageTriageList.php |
— | — | @@ -50,8 +50,10 @@ |
51 | 51 | |
52 | 52 | if ( strtolower( $opts['dir'] ) === 'oldestfirst' ) { |
53 | 53 | $options['ORDER BY'] = 'ptrp_timestamp ASC'; |
| 54 | + $offsetOperator = ' > '; |
54 | 55 | } else { |
55 | 56 | $options['ORDER BY'] = 'ptrp_timestamp DESC'; |
| 57 | + $offsetOperator = ' < '; |
56 | 58 | } |
57 | 59 | |
58 | 60 | // Start building the massive filter which includes meta data |
— | — | @@ -73,6 +75,10 @@ |
74 | 76 | if ( array_key_exists( 'namespace', $opts ) ) { |
75 | 77 | $conds['page_namespace'] = $opts['namespace']; |
76 | 78 | } |
| 79 | + // Offset the list |
| 80 | + if ( array_key_exists( 'offset', $opts ) && is_numeric( $opts['offset'] ) ) { |
| 81 | + $conds[] = 'ptrp_timestamp' . $offsetOperator . $opts['offset']; |
| 82 | + } |
77 | 83 | |
78 | 84 | if ( $tagConds ) { |
79 | 85 | $conds[] = '(' . implode( ' OR ', $tagConds ) . ') AND ptrpt_page_id = ptrp_page_id'; |
— | — | @@ -145,6 +151,9 @@ |
146 | 152 | ApiBase::PARAM_MIN => '10', |
147 | 153 | ApiBase::PARAM_TYPE => 'integer', |
148 | 154 | ), |
| 155 | + 'offset' => array( |
| 156 | + ApiBase::PARAM_TYPE => 'integer', |
| 157 | + ), |
149 | 158 | 'dir' => array( |
150 | 159 | ApiBase::PARAM_TYPE => 'string', |
151 | 160 | ), |
— | — | @@ -174,6 +183,7 @@ |
175 | 184 | 'showredirs' => 'Whether to include redirects or not', // default is not to show redirects |
176 | 185 | 'showtriaged' => 'Whether to include triaged or not', // default is not to show triaged |
177 | 186 | 'limit' => 'The maximum number of results to return', |
| 187 | + 'offset' => 'Timestamp to start from', |
178 | 188 | 'dir' => 'The direction the list should be sorted in - oldestfirst or newestfirst', |
179 | 189 | 'namespace' => 'What namespace to pull pages from', |
180 | 190 | 'no_category' => 'Whether to show only pages with no category', |