r103444 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103443‎ | r103444 | r103445 >
Date:05:29, 17 November 2011
Author:aaron
Status:ok
Tags:
Comment:
(bug 32405) - Allow descending order for list=unreviewedpages
Modified paths:
  • /trunk/extensions/FlaggedRevs/api/reports/ApiQueryUnreviewedpages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/api/reports/ApiQueryUnreviewedpages.php
@@ -54,9 +54,10 @@
5555 $this->addWhereFld( 'page_is_redirect', 0 );
5656 }
5757
 58+ $dir = ( $params['dir'] == 'descending' ? 'older' : 'newer' );
5859 $this->addWhereRange(
5960 'page_title',
60 - 'newer',
 61+ $dir,
6162 $params['start'],
6263 $params['end']
6364 );
@@ -99,10 +100,10 @@
100101 if ( is_null( $resultPageSet ) ) {
101102 $title = Title::newFromRow( $row );
102103 $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 ),
107108 'under_review' => FRUserActivity::pageIsUnderReview( $row->page_id )
108109 );
109110 } else {
@@ -130,6 +131,10 @@
131132 'end' => array (
132133 ApiBase::PARAM_TYPE => 'string'
133134 ),
 135+ 'dir' => array(
 136+ ApiBase::PARAM_DFLT => 'ascending',
 137+ ApiBase::PARAM_TYPE => array( 'ascending', 'descending' ),
 138+ ),
134139 'namespace' => array (
135140 ApiBase::PARAM_DFLT => !$namespaces ? NS_MAIN : $namespaces[0],
136141 ApiBase::PARAM_TYPE => 'namespace',
@@ -161,12 +166,13 @@
162167
163168 public function getParamDescription() {
164169 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.',
171177 );
172178 }
173179

Status & tagging log