Index: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsXML.php |
— | — | @@ -57,13 +57,16 @@ |
58 | 58 | ) { |
59 | 59 | $s = "<label for='wpLevel'>" . wfMsgHtml( 'revreview-levelfilter' ) . "</label>\n"; |
60 | 60 | $s .= Xml::openElement( 'select', array( 'name' => 'level', 'id' => 'wpLevel' ) ); |
61 | | - if ( $all !== false ) |
| 61 | + if ( $all !== false ) { |
62 | 62 | $s .= Xml::option( wfMsg( $all ), - 1, $selected === - 1 ); |
| 63 | + } |
63 | 64 | $s .= Xml::option( wfMsg( 'revreview-lev-basic' ), 0, $selected === 0 ); |
64 | | - if ( FlaggedRevs::qualityVersions() ) |
| 65 | + if ( FlaggedRevs::qualityVersions() ) { |
65 | 66 | $s .= Xml::option( wfMsg( 'revreview-lev-quality' ), 1, $selected === 1 ); |
66 | | - if ( $max >= 2 && FlaggedRevs::pristineVersions() ) |
| 67 | + } |
| 68 | + if ( $max >= 2 && FlaggedRevs::pristineVersions() ) { |
67 | 69 | $s .= Xml::option( wfMsg( 'revreview-lev-pristine' ), 2, $selected === 2 ); |
| 70 | + } |
68 | 71 | # Note: Pristine not tracked at sp:QualityOversight (counts as quality) |
69 | 72 | $s .= Xml::closeElement( 'select' ) . "\n"; |
70 | 73 | return $s; |
Index: trunk/extensions/FlaggedRevs/presentation/specialpages/reports/PendingChanges_body.php |
— | — | @@ -339,13 +339,12 @@ |
340 | 340 | $query['category'] = $this->category; |
341 | 341 | return $query; |
342 | 342 | } |
343 | | - |
| 343 | + |
344 | 344 | function getDefaultDirections() { |
345 | 345 | return false; |
346 | 346 | } |
347 | 347 | |
348 | 348 | function getQueryInfo() { |
349 | | - global $wgUser; |
350 | 349 | $tables = array( 'page', 'revision' ); |
351 | 350 | $fields = array( 'page_namespace', 'page_title', 'page_len', 'rev_len', 'page_latest' ); |
352 | 351 | # Show outdated "stable" versions |
— | — | @@ -401,11 +400,14 @@ |
402 | 401 | $conds['page_namespace'] = $this->namespace; |
403 | 402 | } |
404 | 403 | # Filter by watchlist |
405 | | - if ( $this->watched && ( $uid = $wgUser->getId() ) ) { |
406 | | - $tables[] = 'watchlist'; |
407 | | - $conds[] = "wl_user = '$uid'"; |
408 | | - $conds[] = 'page_namespace = wl_namespace'; |
409 | | - $conds[] = 'page_title = wl_title'; |
| 404 | + if ( $this->watched ) { |
| 405 | + $uid = (int)$this->getUser()->getId(); |
| 406 | + if ( $uid ) { |
| 407 | + $tables[] = 'watchlist'; |
| 408 | + $conds[] = "wl_user = '$uid'"; |
| 409 | + $conds[] = 'page_namespace = wl_namespace'; |
| 410 | + $conds[] = 'page_title = wl_title'; |
| 411 | + } |
410 | 412 | } |
411 | 413 | # Filter by bytes changed |
412 | 414 | if ( $this->size !== null && $this->size >= 0 ) { |
— | — | @@ -423,19 +425,21 @@ |
424 | 426 | function getIndexField() { |
425 | 427 | return $this->mIndexField; |
426 | 428 | } |
427 | | - |
428 | | - function getStartBody() { |
| 429 | + |
| 430 | + function doBatchLookups() { |
429 | 431 | wfProfileIn( __METHOD__ ); |
430 | | - # Do a link batch query |
431 | 432 | $lb = new LinkBatch(); |
432 | 433 | foreach ( $this->mResult as $row ) { |
433 | 434 | $lb->add( $row->page_namespace, $row->page_title ); |
434 | 435 | } |
435 | 436 | $lb->execute(); |
436 | 437 | wfProfileOut( __METHOD__ ); |
| 438 | + } |
| 439 | + |
| 440 | + function getStartBody() { |
437 | 441 | return '<ul>'; |
438 | 442 | } |
439 | | - |
| 443 | + |
440 | 444 | function getEndBody() { |
441 | 445 | return '</ul>'; |
442 | 446 | } |
Index: trunk/extensions/FlaggedRevs/presentation/specialpages/reports/UnreviewedPages_body.php |
— | — | @@ -432,15 +432,17 @@ |
433 | 433 | return $this->mIndexField; |
434 | 434 | } |
435 | 435 | |
436 | | - function getStartBody() { |
| 436 | + function doBatchLookups() { |
437 | 437 | wfProfileIn( __METHOD__ ); |
438 | | - # Do a link batch query |
439 | 438 | $lb = new LinkBatch(); |
440 | 439 | foreach ( $this->mResult as $row ) { |
441 | 440 | $lb->add( $row->page_namespace, $row->page_title ); |
442 | 441 | } |
443 | 442 | $lb->execute(); |
444 | 443 | wfProfileOut( __METHOD__ ); |
| 444 | + } |
| 445 | + |
| 446 | + function getStartBody() { |
445 | 447 | return '<ul>'; |
446 | 448 | } |
447 | 449 | |
Index: trunk/extensions/FlaggedRevs/presentation/specialpages/reports/ConfiguredPages_body.php |
— | — | @@ -177,18 +177,20 @@ |
178 | 178 | return 'fpc_page_id'; |
179 | 179 | } |
180 | 180 | |
181 | | - function getStartBody() { |
| 181 | + function doBatchLookups() { |
182 | 182 | wfProfileIn( __METHOD__ ); |
183 | | - # Do a link batch query |
184 | 183 | $lb = new LinkBatch(); |
185 | 184 | foreach ( $this->mResult as $row ) { |
186 | 185 | $lb->add( $row->page_namespace, $row->page_title ); |
187 | 186 | } |
188 | 187 | $lb->execute(); |
189 | 188 | wfProfileOut( __METHOD__ ); |
| 189 | + } |
| 190 | + |
| 191 | + function getStartBody() { |
190 | 192 | return '<ul>'; |
191 | 193 | } |
192 | | - |
| 194 | + |
193 | 195 | function getEndBody() { |
194 | 196 | return '</ul>'; |
195 | 197 | } |
Index: trunk/extensions/FlaggedRevs/presentation/specialpages/reports/ProblemChanges_body.php |
— | — | @@ -314,7 +314,7 @@ |
315 | 315 | function formatRow( $row ) { |
316 | 316 | return $this->mForm->formatRow( $row ); |
317 | 317 | } |
318 | | - |
| 318 | + |
319 | 319 | function getDefaultDirections() { |
320 | 320 | return false; |
321 | 321 | } |
— | — | @@ -394,19 +394,21 @@ |
395 | 395 | function getIndexField() { |
396 | 396 | return $this->mIndexField; |
397 | 397 | } |
398 | | - |
399 | | - function getStartBody() { |
| 398 | + |
| 399 | + function doBatchLookups() { |
400 | 400 | wfProfileIn( __METHOD__ ); |
401 | | - # Do a link batch query |
402 | 401 | $lb = new LinkBatch(); |
403 | 402 | foreach ( $this->mResult as $row ) { |
404 | 403 | $lb->add( $row->page_namespace, $row->page_title ); |
405 | 404 | } |
406 | 405 | $lb->execute(); |
407 | 406 | wfProfileOut( __METHOD__ ); |
| 407 | + } |
| 408 | + |
| 409 | + function getStartBody() { |
408 | 410 | return '<ul>'; |
409 | 411 | } |
410 | | - |
| 412 | + |
411 | 413 | function getEndBody() { |
412 | 414 | return '</ul>'; |
413 | 415 | } |
Index: trunk/extensions/FlaggedRevs/presentation/specialpages/reports/ReviewedPages_body.php |
— | — | @@ -166,27 +166,30 @@ |
167 | 167 | 'tables' => array( 'flaggedpages', 'page' ), |
168 | 168 | 'fields' => 'page_namespace,page_title,page_len,fp_page_id', |
169 | 169 | 'conds' => $conds, |
170 | | - 'options' => array( 'USE INDEX' => array( 'flaggedpages' => $index, |
171 | | - 'page' => 'PRIMARY' ) ) |
| 170 | + 'options' => array( |
| 171 | + 'USE INDEX' => array( 'flaggedpages' => $index, 'page' => 'PRIMARY' ) |
| 172 | + ) |
172 | 173 | ); |
173 | 174 | } |
174 | 175 | |
175 | 176 | function getIndexField() { |
176 | 177 | return 'fp_page_id'; |
177 | 178 | } |
178 | | - |
179 | | - function getStartBody() { |
| 179 | + |
| 180 | + function doBatchLookups() { |
180 | 181 | wfProfileIn( __METHOD__ ); |
181 | | - # Do a link batch query |
182 | 182 | $lb = new LinkBatch(); |
183 | 183 | foreach ( $this->mResult as $row ) { |
184 | 184 | $lb->add( $row->page_namespace, $row->page_title ); |
185 | 185 | } |
186 | 186 | $lb->execute(); |
187 | 187 | wfProfileOut( __METHOD__ ); |
| 188 | + } |
| 189 | + |
| 190 | + function getStartBody() { |
188 | 191 | return '<ul>'; |
189 | 192 | } |
190 | | - |
| 193 | + |
191 | 194 | function getEndBody() { |
192 | 195 | return '</ul>'; |
193 | 196 | } |
Index: trunk/extensions/FlaggedRevs/presentation/specialpages/reports/StablePages_body.php |
— | — | @@ -168,19 +168,21 @@ |
169 | 169 | function getIndexField() { |
170 | 170 | return 'fpc_page_id'; |
171 | 171 | } |
172 | | - |
173 | | - function getStartBody() { |
| 172 | + |
| 173 | + function doBatchLookups() { |
174 | 174 | wfProfileIn( __METHOD__ ); |
175 | | - # Do a link batch query |
176 | 175 | $lb = new LinkBatch(); |
177 | 176 | foreach ( $this->mResult as $row ) { |
178 | 177 | $lb->add( $row->page_namespace, $row->page_title ); |
179 | 178 | } |
180 | 179 | $lb->execute(); |
181 | 180 | wfProfileOut( __METHOD__ ); |
| 181 | + } |
| 182 | + |
| 183 | + function getStartBody() { |
182 | 184 | return '<ul>'; |
183 | 185 | } |
184 | | - |
| 186 | + |
185 | 187 | function getEndBody() { |
186 | 188 | return '</ul>'; |
187 | 189 | } |