r59945 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59944‎ | r59945 | r59946 >
Date:05:50, 11 December 2009
Author:aaron
Status:ok
Tags:
Comment:
Removed wfLoadExtensionMessages no-ops
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsXML.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/OldReviewedPages_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/RevisionReview_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/StableVersions_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/UnstablePages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ValidationStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -332,7 +332,6 @@
333333 * @returns string
334334 */
335335 public static function getTagMsg( $tag ) {
336 - wfLoadExtensionMessages( 'FlaggedRevs' );
337336 return wfMsgExt( "revreview-$tag", array( 'escapenoentities' ) );
338337 }
339338
@@ -1310,7 +1309,6 @@
13111310 return array("",""); // not reviewed
13121311 }
13131312 $css = FlaggedRevsXML::getQualityColor( $row->fr_quality );
1314 - wfLoadExtensionMessages( 'FlaggedRevs' );
13151313 $user = User::whois( $row->fr_user ); // FIXME: o(N)
13161314 $flags = explode(',',$row->fr_flags);
13171315 if( in_array('auto',$flags) ) {
Index: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php
@@ -8,8 +8,6 @@
99 {
1010 public function __construct() {
1111 parent::__construct( 'Stabilization', 'stablesettings' );
12 - wfLoadExtensionMessages( 'Stabilization' );
13 - wfLoadExtensionMessages( 'FlaggedRevs' );
1412 }
1513
1614 public function execute( $par ) {
Index: trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php
@@ -8,8 +8,6 @@
99 {
1010 public function __construct() {
1111 parent::__construct( 'UnreviewedPages', 'unreviewedpages' );
12 - wfLoadExtensionMessages( 'UnreviewedPages' );
13 - wfLoadExtensionMessages( 'FlaggedRevs' );
1412 }
1513
1614 public function execute( $par ) {
Index: trunk/extensions/FlaggedRevs/specialpages/UnstablePages_body.php
@@ -8,8 +8,6 @@
99 {
1010 public function __construct() {
1111 parent::__construct( 'UnstablePages' );
12 - wfLoadExtensionMessages( 'UnstablePages' );
13 - wfLoadExtensionMessages( 'FlaggedRevs' );
1412 }
1513
1614 public function execute( $par ) {
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php
@@ -26,7 +26,6 @@
2727 public function __construct() {
2828 global $wgUser;
2929 parent::__construct( 'RevisionReview', 'review' );
30 - wfLoadExtensionMessages( 'FlaggedRevs' );
3130 $this->skin = $wgUser->getSkin();
3231 }
3332
@@ -159,7 +158,6 @@
160159 // Basic permission check
161160 if( $wgUser->isAllowed( 'review' ) ) {
162161 if( $wgUser->isBlocked() ) {
163 - wfLoadExtensionMessages( 'FlaggedRevs' );
164162 $blocklist = SpecialPage::getTitleFor( 'Ipblocklist' );
165163 $blocklog = $blocklist->getFullUrl( 'ip=' . urlencode('#'.$wgUser->getBlockId()) );
166164 return '<err#><h2>'.wfMsgHtml('blockedtitle').'</h2>'.
@@ -897,7 +895,6 @@
898896 $revId, $stableId, $approve, $auto=false )
899897 {
900898 global $wgFlaggedRevsLogInRC;
901 - wfLoadExtensionMessages( 'FlaggedRevs' );
902899 $log = new LogPage( 'review', $auto ? false : $wgFlaggedRevsLogInRC, $auto ? "skipUDP" : "UDP" );
903900 # ID, accuracy, depth, style
904901 $ratings = array();
Index: trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php
@@ -8,8 +8,6 @@
99 {
1010 public function __construct() {
1111 SpecialPage::SpecialPage( 'QualityOversight' );
12 - wfLoadExtensionMessages( 'FlaggedRevs' );
13 - wfLoadExtensionMessages( 'QualityOversight' );
1412 }
1513
1614 public function execute( $par ) {
Index: trunk/extensions/FlaggedRevs/specialpages/StableVersions_body.php
@@ -8,8 +8,6 @@
99 {
1010 public function __construct() {
1111 parent::__construct( 'StableVersions' );
12 - wfLoadExtensionMessages( 'StableVersions' );
13 - wfLoadExtensionMessages( 'FlaggedRevs' );
1412 }
1513
1614 public function execute( $par ) {
Index: trunk/extensions/FlaggedRevs/specialpages/ValidationStatistics_body.php
@@ -8,8 +8,6 @@
99 {
1010 public function __construct() {
1111 parent::__construct( 'ValidationStatistics' );
12 - wfLoadExtensionMessages( 'ValidationStatistics' );
13 - wfLoadExtensionMessages( 'FlaggedRevs' );
1412 }
1513
1614 public function execute( $par ) {
Index: trunk/extensions/FlaggedRevs/specialpages/OldReviewedPages_body.php
@@ -9,8 +9,6 @@
1010 public function __construct() {
1111 parent::__construct( 'OldReviewedPages' );
1212 $this->includable( true );
13 - wfLoadExtensionMessages( 'OldReviewedPages' );
14 - wfLoadExtensionMessages( 'FlaggedRevs' );
1513 }
1614
1715 public function execute( $par ) {
Index: trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php
@@ -9,9 +9,6 @@
1010 public function __construct() {
1111 parent::__construct( 'ProblemChanges' );
1212 $this->includable( true );
13 - wfLoadExtensionMessages( 'ProblemChanges' );
14 - wfLoadExtensionMessages( 'OldReviewedPages' );
15 - wfLoadExtensionMessages( 'FlaggedRevs' );
1613 }
1714
1815 public function execute( $par ) {
Index: trunk/extensions/FlaggedRevs/specialpages/ReviewedPages_body.php
@@ -8,8 +8,6 @@
99 {
1010 public function __construct() {
1111 parent::__construct( 'ReviewedPages' );
12 - wfLoadExtensionMessages( 'ReviewedPages' );
13 - wfLoadExtensionMessages( 'FlaggedRevs' );
1412 }
1513
1614 public function execute( $par ) {
Index: trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php
@@ -8,8 +8,6 @@
99 {
1010 public function __construct() {
1111 parent::__construct( 'StablePages' );
12 - wfLoadExtensionMessages( 'StablePages' );
13 - wfLoadExtensionMessages( 'FlaggedRevs' );
1412 }
1513
1614 public function execute( $par ) {
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php
@@ -50,7 +50,6 @@
5151 * @returns string
5252 */
5353 public static function getLevelMenu( $selected=null, $all='revreview-filter-all', $max=2 ) {
54 - wfLoadExtensionMessages( 'FlaggedRevs' );
5554 $s = "<label for='wpLevel'>" . wfMsgHtml('revreview-levelfilter') . "</label>&nbsp;";
5655 $s .= Xml::openElement( 'select', array('name' => 'level','id' => 'wpLevel') );
5756 if( $all !== false )
@@ -71,7 +70,6 @@
7271 * @returns string
7372 */
7473 public static function getPrecedenceMenu( $selected=null ) {
75 - wfLoadExtensionMessages( 'FlaggedRevs' );
7674 $s = Xml::openElement( 'select', array('name' => 'precedence','id' => 'wpPrecedence') );
7775 $s .= Xml::option( wfMsg( 'revreview-lev-sighted' ), FLAGGED_VIS_LATEST,
7876 $selected==FLAGGED_VIS_LATEST );
@@ -91,7 +89,6 @@
9290 * @returns string
9391 */
9492 public static function getStatusFilterMenu( $selected=null ) {
95 - wfLoadExtensionMessages( 'FlaggedRevs' );
9693 $s = "<label for='wpStatus'>" . wfMsgHtml('revreview-statusfilter') . "</label>&nbsp;";
9794 $s .= Xml::openElement( 'select', array('name' => 'status','id' => 'wpStatus') );
9895 $s .= Xml::option( wfMsg( "revreview-filter-all" ), -1, $selected===-1 );
@@ -108,7 +105,6 @@
109106 * @returns string
110107 */
111108 public static function getAutoFilterMenu( $selected=null ) {
112 - wfLoadExtensionMessages( 'FlaggedRevs' );
113109 $s = "<label for='wpApproved'>" . wfMsgHtml('revreview-typefilter') . "</label>&nbsp;";
114110 $s .= Xml::openElement( 'select', array('name' => 'automatic','id' => 'wpApproved') );
115111 $s .= Xml::option( wfMsg( "revreview-filter-all" ), -1, $selected===-1 );
@@ -147,7 +143,6 @@
148144 * Generates a review box/tag
149145 */
150146 public static function addTagRatings( $flags, $prettyBox = false, $css='' ) {
151 - wfLoadExtensionMessages( 'FlaggedRevs' );
152147 $tag = '';
153148 if( $prettyBox ) {
154149 $tag .= "<table id='mw-revisionratings-box' align='center' class='$css' cellpadding='0'>";
@@ -196,7 +191,6 @@
197192 $frev, $shtml, $revsSince, $stable=true, $synced=false, $old=false
198193 ) {
199194 global $wgLang;
200 - wfLoadExtensionMessages( 'FlaggedRevs' );
201195 # Get quality level
202196 $flags = $frev->getTags();
203197 $quality = FlaggedRevs::isQuality( $flags );
@@ -245,7 +239,6 @@
246240 }
247241
248242 public static function ratingToggle() {
249 - wfLoadExtensionMessages( 'FlaggedRevs' );
250243 return "<a id='mw-revisiontoggle' class='flaggedrevs_toggle' style='display:none;'" .
251244 " onclick='toggleRevRatings()' title='" . wfMsgHtml('revreview-toggle-title') . "' >" .
252245 wfMsg( 'revreview-toggle' ) . "</a>";
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -36,8 +36,6 @@
3737 if( !$fa || !$fa->isReviewable(true) ) {
3838 return true;
3939 }
40 - # Load required messages
41 - wfLoadExtensionMessages( 'FlaggedRevs' );
4240 # Get the review tags on this wiki
4341 $rTags = FlaggedRevs::getJSTagParams();
4442 # Get page-specific meta-data
@@ -1386,7 +1384,6 @@
13871385 $newGroups = $groups ;
13881386 array_push( $newGroups, 'editor' );
13891387
1390 - wfLoadExtensionMessages( 'FlaggedRevs' ); // load UI messages
13911388 global $wgFlaggedRevsAutopromoteInRC;
13921389 $log = new LogPage( 'rights', $wgFlaggedRevsAutopromoteInRC );
13931390 $log->addEntry( 'rights', $user->getUserPage(), wfMsg('rights-editor-autosum'),
@@ -1486,8 +1483,6 @@
14871484 # Param format is <rev id, last stable id, rev timestamp>.
14881485 if( in_array($action,$actionsValid) && isset($params[0]) ) {
14891486 $revId = (int)$params[0]; // the reviewed revision
1490 - # Load required messages
1491 - wfLoadExtensionMessages( 'FlaggedRevs' );
14921487 # Don't show diff if param missing or rev IDs are the same
14931488 if( !empty($params[1]) && $revId != $params[1] ) {
14941489 $rv = '(' . $wgUser->getSkin()->makeKnownLinkObj( $title,
@@ -1724,7 +1719,6 @@
17251720 return true; // page is not listed in pending edit table
17261721 if( !FlaggedRevs::isPageReviewable($rc->getTitle()) )
17271722 return true; // confirm that page is in reviewable namespace
1728 - wfLoadExtensionMessages( 'FlaggedRevs' );
17291723 $rlink = $list->skin->makeKnownLinkObj( $rc->getTitle(), wfMsg('revreview-reviewlink'),
17301724 'oldid='.intval($rc->mAttribs['fpp_rev_id']).'&diff=cur' );
17311725 $articlelink .= " <span class='mw-fr-reviewlink'>($rlink)</span>";
@@ -1778,7 +1772,6 @@
17791773 # the user decide if he/she wants it reviewed on the spot. One might
17801774 # do this if he/she just saw the diff-to-stable and *then* decided to edit.
17811775 if( !$srev || $srev->getRevId() != $editPage->getArticle()->getLatest() ) {
1782 - wfLoadExtensionMessages( 'FlaggedRevs' );
17831776 $checkboxes['reviewed'] = '';
17841777 $reviewLabel = wfMsgExt('revreview-flag', array('parseinline'));
17851778 $attribs = array( 'tabindex' => ++$tabindex, 'id' => 'wpReviewEdit' );
@@ -1818,7 +1811,6 @@
18191812 );
18201813 # Give a notice if pages on the wachlist are outdated
18211814 if( $watchedOutdated ) {
1822 - wfLoadExtensionMessages( 'FlaggedRevs' );
18231815 $notice .= "<div id='mw-oldreviewed-notice' class='plainlinks fr-watchlist-old-notice'>" .
18241816 wfMsgExt('flaggedrevs-watched-pending',array('parseinline')) . "</div>";
18251817 # Otherwise, give a notice if there is a large backlog in general
@@ -1836,7 +1828,6 @@
18371829 'fp_pending_since IS NOT NULL', __METHOD__ );
18381830 }
18391831 if( $unreviewed > .02*$pages ) {
1840 - wfLoadExtensionMessages( 'FlaggedRevs' );
18411832 $notice .= "<div id='mw-oldreviewed-notice' class='plainlinks fr-backlognotice'>" .
18421833 wfMsgExt('flaggedrevs-backlog',array('parseinline')) . "</div>";
18431834 }
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -142,7 +142,6 @@
143143 $frev = FlaggedRevision::newFromTitle( $this->article->getTitle(), $revID );
144144 # Give a notice if this rev ID corresponds to a reviewed version...
145145 if( !is_null($frev) ) {
146 - wfLoadExtensionMessages( 'FlaggedRevs' );
147146 $time = $wgLang->date( $frev->getTimestamp(), true );
148147 $flags = $frev->getTags();
149148 $quality = FlaggedRevs::isQuality( $flags );
@@ -181,8 +180,6 @@
182181 if( !$this->article->isReviewable() ) {
183182 return true;
184183 }
185 - # Load required messages
186 - wfLoadExtensionMessages( 'FlaggedRevs' );
187184 $simpleTag = $old = $stable = false;
188185 $tag = $prot = '';
189186 # Check the newest stable version.
@@ -510,7 +507,6 @@
511508 return false; // not viewing the draft
512509 }
513510 # Conditions are met to show diff...
514 - wfLoadExtensionMessages( 'FlaggedRevs' ); // load required messages
515511 $leftNote = $quality ? 'revreview-quality-title' : 'revreview-stable-title';
516512 $rClass = FlaggedRevsXML::getQualityColor( false );
517513 $lClass = FlaggedRevsXML::getQualityColor( (int)$quality );
@@ -648,19 +644,16 @@
649645 # makes will be autoreviewed...
650646 $ofrev = FlaggedRevision::newFromTitle( $this->article->getTitle(), $revId );
651647 if( !is_null($ofrev) ) {
652 - wfLoadExtensionMessages( 'FlaggedRevs' );
653648 $msg = ( $revId==$frev->getRevId() ) ? 'revreview-auto-w' : 'revreview-auto-w-old';
654649 $warning = "<div id='mw-autoreviewtag' class='flaggedrevs_warning plainlinks'>" .
655650 wfMsgExt($msg,array('parseinline')) . "</div>";
656651 }
657652 # Let new users know about review procedure a tag
658653 } elseif( !$wgUser->getId() && $this->article->showStableByDefault() ) {
659 - wfLoadExtensionMessages( 'FlaggedRevs' );
660654 $warning = "<div id='mw-editwarningtag' class='flaggedrevs_editnotice plainlinks'>" .
661655 wfMsgExt('revreview-editnotice',array('parseinline')) . "</div>";
662656 }
663657 if( $frev->getRevId() != $revId ) {
664 - wfLoadExtensionMessages( 'FlaggedRevs' );
665658 $time = $wgLang->date( $frev->getTimestamp(), true );
666659 $flags = $frev->getTags();
667660 if( FlaggedRevs::isQuality($flags) ) {
@@ -716,7 +709,6 @@
717710 }
718711
719712 # Conditions are met to show diff...
720 - wfLoadExtensionMessages( 'FlaggedRevs' ); // load required messages
721713 $leftNote = $quality ? 'revreview-quality-title' : 'revreview-stable-title';
722714 $rClass = FlaggedRevsXML::getQualityColor( false );
723715 $lClass = FlaggedRevsXML::getQualityColor( (int)$quality );
@@ -759,7 +751,6 @@
760752 $this->load();
761753 # Only for pages manually made to be stable...
762754 if( $this->article->isPageLocked() ) {
763 - wfLoadExtensionMessages( 'FlaggedRevs' );
764755 $wgOut->addHTML( "<div class='mw-warning-with-logexcerpt'>" );
765756 $wgOut->addWikiMsg( 'revreview-locked' );
766757 LogEventsList::showLogExtract( $wgOut, 'stable',
@@ -767,7 +758,6 @@
768759 $wgOut->addHTML( "</div>" );
769760 # ...or unstable
770761 } elseif( $this->article->isPageUnlocked() ) {
771 - wfLoadExtensionMessages( 'FlaggedRevs' );
772762 $wgOut->addHTML( "<div class='mw-warning-with-logexcerpt'>" );
773763 $wgOut->addWikiMsg( 'revreview-unlocked' );
774764 LogEventsList::showLogExtract( $wgOut, 'stable',
@@ -786,11 +776,6 @@
787777 if( !$wgUser->isAllowed( 'review' ) ) {
788778 return true;
789779 }
790 - wfLoadExtensionMessages( 'FlaggedRevs' );
791 - # Load special page names
792 - wfLoadExtensionMessages( 'OldReviewedPages' );
793 - wfLoadExtensionMessages( 'UnreviewedPages' );
794 -
795780 $category = $this->article->getTitle()->getText();
796781
797782 $unreviewed = SpecialPage::getTitleFor( 'UnreviewedPages' );
@@ -850,8 +835,6 @@
851836 }
852837 $action = $wgRequest->getVal( 'action', 'view' );
853838 if( $action == 'protect' || $action == 'unprotect' ) {
854 - wfLoadExtensionMessages( 'FlaggedRevs' );
855 - wfLoadExtensionMessages( 'Stabilization' ); // Load special page name
856839 $title = SpecialPage::getTitleFor( 'Stabilization' );
857840 # Give a link to the page to configure the stable version
858841 $frev = $this->article->getStableRev();
@@ -895,7 +878,6 @@
896879 $wgUser->isAllowed( 'stablesettings' ) &&
897880 $title->exists()
898881 ) {
899 - wfLoadExtensionMessages( 'Stabilization' );
900882 $stableTitle = SpecialPage::getTitleFor( 'Stabilization' );
901883 // Add a tab
902884 $actions['default'] = array(
@@ -929,7 +911,6 @@
930912 if( is_null( $srev ) ) {
931913 return true; // No stable revision exists
932914 }
933 - wfLoadExtensionMessages( 'FlaggedRevs' );
934915 $synced = FlaggedRevs::stableVersionIsSynced( $srev, $article );
935916 // Set draft tab as needed...
936917 if ( !$skin->mTitle->isTalkPage() && !$synced ) {
@@ -1010,7 +991,6 @@
1011992 global $wgUser;
1012993 $this->load();
1013994 if( FlaggedRevs::allowComments() && $frev && $frev->getComment() ) {
1014 - wfLoadExtensionMessages( 'FlaggedRevs' );
1015995 $notes = "<br /><div class='flaggedrevs_notes plainlinks'>";
1016996 $notes .= wfMsgExt('revreview-note', array('parseinline'), User::whoIs( $frev->getUser() ) );
1017997 $notes .= '<br /><i>' . $wgUser->getSkin()->formatComment( $frev->getComment() ) . '</i></div>';
@@ -1029,8 +1009,6 @@
10301010 # UI may be limited to unobtrusive patrolling system
10311011 if( $wgOut->isPrintable() || !$this->article->isReviewable() || $this->article->limitedUI() )
10321012 return true;
1033 - # Load required messages
1034 - wfLoadExtensionMessages( 'FlaggedRevs' );
10351013 # Check if this might be the diff to stable. If so, enhance it.
10361014 if( $newRev->isCurrent() && $oldRev ) {
10371015 $article = new Article( $newRev->getTitle() );
@@ -1232,7 +1210,6 @@
12331211 $article = new Article( $newRev->getTitle() );
12341212 # Is the stable revision using the same revision as the current?
12351213 if( $article->getLatest() != $frev->getRevId() ) {
1236 - wfLoadExtensionMessages( 'FlaggedRevs' );
12371214 $patrol = '(' . $wgUser->getSkin()->makeKnownLinkObj( $newRev->getTitle(),
12381215 wfMsgHtml( 'review-diff2stable' ), "oldid={$frev->getRevId()}&diff=cur&diffonly=0" ) . ')';
12391216 $wgOut->addHTML( "<div class='fr-diff-to-stable' align='center'>$patrol</div>" );
@@ -1342,8 +1319,6 @@
13431320 } else {
13441321 $rev = Revision::newFromTitle( $this->article->getTitle(), $id );
13451322 }
1346 - # Load required messages
1347 - wfLoadExtensionMessages( 'FlaggedRevs' );
13481323 # Must be a valid non-printable output and revision must be public
13491324 if( $wgOut->isPrintable() || !$rev || $rev->isDeleted(Revision::DELETED_TEXT) ) {
13501325 return false;

Status & tagging log