r84447 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84446‎ | r84447 | r84448 >
Date:14:49, 21 March 2011
Author:aaron
Status:ok
Tags:
Comment:
* Follow-up r84446: use formatNum()
* Pass pager rows to msg in AdvancedReviewLog too
Modified paths:
  • /trunk/extensions/FlaggedRevs/specialpages/ConfiguredPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/PendingChanges_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ReviewedPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/specialpages/PendingChanges_body.php
@@ -62,9 +62,10 @@
6363 }
6464
6565 public function showForm() {
66 - global $wgUser, $wgOut, $wgScript;
 66+ global $wgUser, $wgOut, $wgScript, $wgLang;
6767 # Explanatory text
68 - $wgOut->addWikiMsg( 'pendingchanges-list', $this->pager->getNumRows() );
 68+ $wgOut->addWikiMsg( 'pendingchanges-list',
 69+ $wgLang->formatNum( $this->pager->getNumRows() ) );
6970
7071 $form = Html::openElement( 'form', array( 'name' => 'pendingchanges',
7172 'action' => $wgScript, 'method' => 'get' ) ) . "\n";
Index: trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php
@@ -44,7 +44,7 @@
4545 protected function showForm() {
4646 global $wgOut, $wgLang, $wgScript;
4747 # Add explanatory text
48 - $wgOut->addWikiMsg( 'unreviewedpages-list', $this->pager->getNumRows() );
 48+ $wgOut->addWikiMsg( 'unreviewedpages-list', $wgLang->formatNum( $this->pager->getNumRows() ) );
4949
5050 # show/hide links
5151 $showhide = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) );
Index: trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php
@@ -11,10 +11,9 @@
1212 }
1313
1414 public function execute( $par ) {
15 - global $wgOut, $wgUser, $wgRequest, $wgFlaggedRevsOversightAge;
 15+ global $wgOut, $wgUser, $wgRequest, $wgLang, $wgFlaggedRevsOversightAge;
1616
1717 $this->setHeaders();
18 - $wgOut->addHTML( wfMsgExt( 'qualityoversight-list', array( 'parse' ) ) );
1918
2019 $this->namespace = $wgRequest->getInt( 'namespace' );
2120 $this->level = $wgRequest->getIntOrNull( 'level' );
@@ -24,28 +23,35 @@
2524 # Check if the user exists
2625 $usertitle = Title::makeTitleSafe( NS_USER, $this->user );
2726 $u = $usertitle ? User::idFromName( $this->user ) : false;
28 -
29 - # Show options
30 - $this->showForm();
31 -
 27+
 28+ # Are the dropdown params given even valid?
3229 $actions = $this->getActions();
3330 if ( empty( $actions ) ) {
 31+ $wgOut->addWikiMsg( 'qualityoversight-list', 0 );
3432 $wgOut->addWikiMsg( 'logempty' );
3533 return;
3634 }
37 -
38 - $dbr = wfGetDB( DB_SLAVE );
 35+
3936 # Get extra query conds
4037 $conds = array( 'log_namespace' => $this->namespace, 'log_action' => $actions );
4138 # Get cutoff time (mainly for performance)
4239 if ( !$u ) {
 40+ $dbr = wfGetDB( DB_SLAVE );
4341 $cutoff_unixtime = time() - $wgFlaggedRevsOversightAge;
4442 $cutoff = $dbr->addQuotes( $dbr->timestamp( $cutoff_unixtime ) );
4543 $conds[] = "log_timestamp >= $cutoff";
4644 }
 45+
4746 # Create a LogPager item to get the results and a LogEventsList item to format them...
4847 $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 );
4948 $pager = new LogPager( $loglist, 'review', $this->user, '', '', $conds );
 49+
 50+ # Explanatory text
 51+ $wgOut->addWikiMsg( 'qualityoversight-list',
 52+ $wgLang->formatNum( $pager->getNumRows() ) );
 53+ # Show form options
 54+ $this->showForm();
 55+
5056 # Insert list
5157 $logBody = $pager->getBody();
5258 if ( $logBody ) {
Index: trunk/extensions/FlaggedRevs/specialpages/ConfiguredPages_body.php
@@ -31,9 +31,10 @@
3232 }
3333
3434 protected function showForm() {
35 - global $wgOut, $wgScript;
 35+ global $wgOut, $wgScript, $wgLang;
3636 # Explanatory text
37 - $wgOut->addWikiMsg( 'configuredpages-list', $this->pager->getNumRows() );
 37+ $wgOut->addWikiMsg( 'configuredpages-list',
 38+ $wgLang->formatNum( $this->pager->getNumRows() ) );
3839
3940 $fields = array();
4041 # Namespace selector
Index: trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php
@@ -57,9 +57,10 @@
5858 }
5959
6060 public function showForm() {
61 - global $wgOut, $wgScript;
 61+ global $wgOut, $wgScript, $wgLang;
6262 // Add explanatory text
63 - $wgOut->addWikiMsg( 'problemchanges-list', $this->pager->getNumRows() );
 63+ $wgOut->addWikiMsg( 'problemchanges-list',
 64+ $wgLang->formatNum( $this->pager->getNumRows() ) );
6465
6566 $form = Html::openElement( 'form', array( 'name' => 'problemchanges',
6667 'action' => $wgScript, 'method' => 'get' ) ) . "\n";
Index: trunk/extensions/FlaggedRevs/specialpages/ReviewedPages_body.php
@@ -34,11 +34,12 @@
3535 }
3636
3737 public function showForm() {
38 - global $wgOut, $wgScript;
 38+ global $wgOut, $wgScript, $wgLang;
3939
4040 // Text to explain level select (if there are several levels)
4141 if ( FlaggedRevs::qualityVersions() ) {
42 - $wgOut->addWikiMsg( 'reviewedpages-list', $this->pager->getNumRows() );
 42+ $wgOut->addWikiMsg( 'reviewedpages-list',
 43+ $wgLang->formatNum( $this->pager->getNumRows() ) );
4344 }
4445 $form = Html::openElement( 'form',
4546 array( 'name' => 'reviewedpages', 'action' => $wgScript, 'method' => 'get' ) );
Index: trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php
@@ -31,8 +31,9 @@
3232 }
3333
3434 protected function showForm() {
35 - global $wgOut, $wgScript;
36 - $wgOut->addWikiMsg( 'stablepages-list', $this->pager->getNumRows() );
 35+ global $wgOut, $wgScript, $wgLang;
 36+ $wgOut->addWikiMsg( 'stablepages-list',
 37+ $wgLang->formatNum( $this->pager->getNumRows() ) );
3738 $fields = array();
3839 # Namespace selector
3940 if ( count( FlaggedRevs::getReviewNamespaces() ) > 1 ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r84539Followup for r84446 and r84447 making some check for variables optional.purodha17:31, 22 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84446* Pass pager->getNumRows() into explanatory message...aaron14:32, 21 March 2011

Status & tagging log