Index: trunk/extensions/FlaggedRevs/language/OldReviewedPages.i18n.php |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | |
11 | 11 | $messages['en'] = array( |
12 | 12 | 'oldreviewedpages' => 'Outdated reviewed pages', |
13 | | - 'oldreviewedpages-legend' => 'List reviewed pages with unreviewed revisions', |
| 13 | + 'oldreviewedpages-legend' => 'List reviewed pages with revisions pending review', |
14 | 14 | 'oldreviewedpages-list' => 'This page lists reviewed pages that have pending edits.', |
15 | 15 | 'oldreviewedpages-none' => 'There are currently no pages meeting these criteria', |
16 | 16 | 'oldreviewedpages-stable' => 'sighted', |
— | — | @@ -18,6 +18,7 @@ |
19 | 19 | 'oldreviewedpages-days' => '($1 {{PLURAL:$1|day|days}})', |
20 | 20 | 'oldreviewedpages-recent' => '(less than 1 hour)', |
21 | 21 | 'oldreviewed-category' => 'Category:', |
| 22 | + 'oldreviewed-watched' => 'On my watchlist', |
22 | 23 | 'oldreviewed-diff' => 'review', |
23 | 24 | 'oldreviewed-size' => 'Max change (bytes):', |
24 | 25 | 'oldreviewedpages-unwatched' => '(unwatched)', |
Index: trunk/extensions/FlaggedRevs/specialpages/OldReviewedPages_body.php |
— | — | @@ -24,6 +24,7 @@ |
25 | 25 | $this->namespace = $wgRequest->getIntOrNull( 'namespace' ); |
26 | 26 | $this->category = trim( $wgRequest->getVal( 'category' ) ); |
27 | 27 | $this->size = $wgRequest->getIntOrNull( 'size' ); |
| 28 | + $this->watched = $wgRequest->getCheck( 'watched' ); |
28 | 29 | $feedType = $wgRequest->getVal( 'feed' ); |
29 | 30 | if( $feedType ) { |
30 | 31 | return $this->feed( $feedType ); |
— | — | @@ -45,25 +46,31 @@ |
46 | 47 | function showList( $par ) { |
47 | 48 | global $wgOut, $wgScript, $wgTitle, $wgFlaggedRevsNamespaces; |
48 | 49 | $limit = $this->parseParams( $par ); |
49 | | - $pager = new OldReviewedPagesPager( $this, $this->namespace, $this->category, $this->size ); |
50 | | - if( $limit ) |
51 | | - $pager->mLimit = $limit; |
| 50 | + $pager = new OldReviewedPagesPager( $this, $this->namespace, $this->category, |
| 51 | + $this->size, $this->watched ); |
| 52 | + $pager->mLimit = $limit ? $limit : $pager->mLimit; |
52 | 53 | // Viewing the page normally... |
53 | 54 | if( !$this->including() ) { |
54 | 55 | $action = htmlspecialchars( $wgScript ); |
55 | | - $wgOut->addHTML( "<form action=\"$action\" method=\"get\">\n" . |
| 56 | + $wgOut->addHTML( |
| 57 | + "<form action=\"$action\" method=\"get\">\n" . |
56 | 58 | '<fieldset><legend>' . wfMsg('oldreviewedpages-legend') . '</legend>' . |
57 | | - Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() ) ); |
| 59 | + Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() ) |
| 60 | + ); |
58 | 61 | # Display dropdown as needed |
59 | 62 | if( count($wgFlaggedRevsNamespaces) > 1 ) { |
60 | 63 | $wgOut->addHTML( FlaggedRevsXML::getNamespaceMenu( $this->namespace ) . ' ' ); |
61 | 64 | } |
62 | | - $wgOut->addHTML( Xml::label( wfMsg("oldreviewed-category"), 'category' ) . ' ' . |
63 | | - Xml::input( 'category', 35, $this->category, array('id' => 'category') ) . '<br/>' . |
64 | | - Xml::label( wfMsg('oldreviewed-size'), 'size' ) . ' ' . |
65 | | - Xml::input( 'size', 6, $this->size, array( 'id' => 'wpSize' ) ) . |
| 65 | + $wgOut->addHTML( |
| 66 | + Xml::label( wfMsg("oldreviewed-category"), 'wpCategory' ) . ' ' . |
| 67 | + Xml::input( 'category', 35, $this->category, array('id' => 'wpCategory') ) . '<br/>' . |
| 68 | + Xml::label( wfMsg('oldreviewed-size'), 'wpSize' ) . ' ' . |
| 69 | + Xml::input( 'size', 5, $this->size, array( 'id' => 'wpSize' ) ) . ' ' . |
| 70 | + Xml::label( wfMsg('oldreviewed-watched'), 'wpWatched' ) . ' ' . |
| 71 | + Xml::check( 'watched', $this->watched, array( 'id' => 'wpWatched' ) ) . |
66 | 72 | ' ' . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" . |
67 | | - "</fieldset></form>" ); |
| 73 | + "</fieldset></form>" |
| 74 | + ); |
68 | 75 | $wgOut->addHTML( wfMsgExt('oldreviewedpages-list', array('parse') ) ); |
69 | 76 | if( $pager->getNumRows() ) { |
70 | 77 | $wgOut->addHTML( $pager->getNavigationBar() ); |
— | — | @@ -239,9 +246,8 @@ |
240 | 247 | public $mForm, $mConds; |
241 | 248 | private $category, $namespace; |
242 | 249 | |
243 | | - function __construct( $form, $namespace, $category=NULL, $size=NULL, $conds = array() ) { |
| 250 | + function __construct( $form, $namespace, $category='', $size=NULL, $watched=false ) { |
244 | 251 | $this->mForm = $form; |
245 | | - $this->mConds = $conds; |
246 | 252 | # Must be a content page... |
247 | 253 | global $wgFlaggedRevsNamespaces; |
248 | 254 | if( !is_null($namespace) ) { |
— | — | @@ -253,7 +259,7 @@ |
254 | 260 | $this->namespace = $namespace; |
255 | 261 | $this->category = $category ? str_replace(' ','_',$category) : NULL; |
256 | 262 | $this->size = $size ? $size : NULL; |
257 | | - |
| 263 | + $this->watched = (bool)$watched; |
258 | 264 | parent::__construct(); |
259 | 265 | } |
260 | 266 | |
— | — | @@ -266,6 +272,7 @@ |
267 | 273 | } |
268 | 274 | |
269 | 275 | function getQueryInfo() { |
| 276 | + global $wgUser; |
270 | 277 | $conds = $this->mConds; |
271 | 278 | $tables = array( 'flaggedpages', 'page', 'revision' ); |
272 | 279 | $fields = array('page_namespace','page_title','page_len','fp_stable','fp_quality', |
— | — | @@ -284,6 +291,13 @@ |
285 | 292 | $conds['cl_to'] = $this->category; |
286 | 293 | $useIndex['categorylinks'] = 'cl_from'; |
287 | 294 | } |
| 295 | + # Filter by watchlist |
| 296 | + if( $this->watched && $uid = $wgUser->getId() ) { |
| 297 | + $tables[] = 'watchlist'; |
| 298 | + $conds[] = "wl_user = '$uid'"; |
| 299 | + $conds[] = 'page_namespace = wl_namespace'; |
| 300 | + $conds[] = 'page_title = wl_title'; |
| 301 | + } |
288 | 302 | # Filter by bytes changed |
289 | 303 | if( $this->size ) { |
290 | 304 | $conds[] = 'ABS(page_len - rev_len) < '.intval($this->size); |