r60400 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60399‎ | r60400 | r60401 >
Date:20:20, 25 December 2009
Author:aaron
Status:ok
Tags:
Comment:
* Follow up r60396: removed reference to non-existing message
* A few code style tweaks
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -1018,10 +1018,14 @@
10191019 public function addDiffNoticeAndIncludes( $diff, $oldRev, $newRev ) {
10201020 global $wgRequest, $wgUser, $wgOut, $wgMemc;
10211021 $this->load();
1022 - # Page must be reviewable. Exempt printer-friendly output.
1023 - # UI may be limited to unobtrusive patrolling system
1024 - if( $wgOut->isPrintable() || !$this->article->isReviewable() || $this->article->limitedUI() )
 1022+ # Exempt printer-friendly output
 1023+ if( $wgOut->isPrintable() ) {
10251024 return true;
 1025+ }
 1026+ # Page must be reviewable. UI may be limited to unobtrusive patrolling system.
 1027+ if( !$this->article->isReviewable() || $this->article->limitedUI() ) {
 1028+ return true;
 1029+ }
10261030 # Check if this might be the diff to stable. If so, enhance it.
10271031 if( $newRev->isCurrent() && $oldRev ) {
10281032 $article = new Article( $newRev->getTitle() );
@@ -1215,24 +1219,28 @@
12161220 }
12171221
12181222 /**
1219 - * Add a link to patrol non-reviewable pages.
1220 - * Also add a diff-to-stable for other pages if possible.
 1223+ * Add a link to diff-to-stable for reviewable pages
12211224 */
12221225 public function addDiffLink( $diff, $oldRev, $newRev ) {
12231226 global $wgUser, $wgOut;
12241227 $this->load();
 1228+ // Both revs must exists and the page must be reviewable
 1229+ if( !$newRev || !$oldRev || !$this->article->isReviewable() ) {
 1230+ return true; // nothing to do
 1231+ }
12251232 // Is there a stable version?
1226 - if( $newRev && $oldRev && $this->article->isReviewable() ) {
1227 - $frev = $this->article->getStableRev();
1228 - # Give a link to the diff-to-stable if needed
1229 - if( $frev && !$this->isDiffFromStable ) {
1230 - $article = new Article( $newRev->getTitle() );
1231 - # Is the stable revision using the same revision as the current?
1232 - if( $article->getLatest() != $frev->getRevId() ) {
1233 - $patrol = '(' . $wgUser->getSkin()->makeKnownLinkObj( $newRev->getTitle(),
1234 - wfMsgHtml( 'review-diff2stable' ), "oldid={$frev->getRevId()}&diff=cur&diffonly=0" ) . ')';
1235 - $wgOut->addHTML( "<div class='fr-diff-to-stable' align='center'>$patrol</div>" );
1236 - }
 1233+ $frev = $this->article->getStableRev();
 1234+ # Give a link to the diff-to-stable if needed
 1235+ if( $frev && !$this->isDiffFromStable ) {
 1236+ $article = new Article( $newRev->getTitle() );
 1237+ # Is the stable revision using the same revision as the current?
 1238+ if( $article->getLatest() != $frev->getRevId() ) {
 1239+ $patrol .= $wgUser->getSkin()->makeKnownLinkObj(
 1240+ $newRev->getTitle(),
 1241+ wfMsgHtml( 'review-diff2stable' ),
 1242+ "oldid={$frev->getRevId()}&diff=cur&diffonly=0"
 1243+ );
 1244+ $wgOut->addHTML( "<div class='fr-diff-to-stable' align='center'>($patrol)</div>" );
12371245 }
12381246 }
12391247 return true;
@@ -1467,17 +1475,13 @@
14681476 $submitMsg = $frev
14691477 ? 'revreview-submit-unreview'
14701478 : 'revreview-submit-review';
1471 - $titleMsg = $frev
1472 - ? 'revreview-tt-unreview'
1473 - : 'revreview-tt-review';
14741479 } else {
14751480 $submitMsg = 'revreview-submit';
1476 - $titleMsg = 'revreview-tt-review';
14771481 }
14781482 $form .= Xml::submitButton( wfMsg($submitMsg),
14791483 array(
14801484 'id' => 'mw-submitreview', 'accesskey' => wfMsg('revreview-ak-review'),
1481 - 'title' => wfMsg($titleMsg).' ['.wfMsg('revreview-ak-review').']'
 1485+ 'title' => wfMsg('revreview-tt-review').' ['.wfMsg('revreview-ak-review').']'
14821486 ) + $toggle
14831487 );
14841488
@@ -1497,7 +1501,9 @@
14981502 # Pass this in if given; useful for new page patrol
14991503 $form .= Xml::hidden( 'rcid', $wgRequest->getVal('rcid') ) . "\n";
15001504 # Special token to discourage fiddling...
1501 - $checkCode = RevisionReview::validationKey( $templateParams, $imageParams, $fileVersion, $id );
 1505+ $checkCode = RevisionReview::validationKey(
 1506+ $templateParams, $imageParams, $fileVersion, $id
 1507+ );
15021508 $form .= Xml::hidden( 'validatedParams', $checkCode ) . "\n";
15031509
15041510 $form .= Xml::closeElement( 'fieldset' );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60396* Use review/unreview button for binary flagging case...aaron18:56, 25 December 2009

Status & tagging log