Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -1018,10 +1018,14 @@ |
1019 | 1019 | public function addDiffNoticeAndIncludes( $diff, $oldRev, $newRev ) { |
1020 | 1020 | global $wgRequest, $wgUser, $wgOut, $wgMemc; |
1021 | 1021 | $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() ) { |
1025 | 1024 | 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 | + } |
1026 | 1030 | # Check if this might be the diff to stable. If so, enhance it. |
1027 | 1031 | if( $newRev->isCurrent() && $oldRev ) { |
1028 | 1032 | $article = new Article( $newRev->getTitle() ); |
— | — | @@ -1215,24 +1219,28 @@ |
1216 | 1220 | } |
1217 | 1221 | |
1218 | 1222 | /** |
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 |
1221 | 1224 | */ |
1222 | 1225 | public function addDiffLink( $diff, $oldRev, $newRev ) { |
1223 | 1226 | global $wgUser, $wgOut; |
1224 | 1227 | $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 | + } |
1225 | 1232 | // 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>" ); |
1237 | 1245 | } |
1238 | 1246 | } |
1239 | 1247 | return true; |
— | — | @@ -1467,17 +1475,13 @@ |
1468 | 1476 | $submitMsg = $frev |
1469 | 1477 | ? 'revreview-submit-unreview' |
1470 | 1478 | : 'revreview-submit-review'; |
1471 | | - $titleMsg = $frev |
1472 | | - ? 'revreview-tt-unreview' |
1473 | | - : 'revreview-tt-review'; |
1474 | 1479 | } else { |
1475 | 1480 | $submitMsg = 'revreview-submit'; |
1476 | | - $titleMsg = 'revreview-tt-review'; |
1477 | 1481 | } |
1478 | 1482 | $form .= Xml::submitButton( wfMsg($submitMsg), |
1479 | 1483 | array( |
1480 | 1484 | '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').']' |
1482 | 1486 | ) + $toggle |
1483 | 1487 | ); |
1484 | 1488 | |
— | — | @@ -1497,7 +1501,9 @@ |
1498 | 1502 | # Pass this in if given; useful for new page patrol |
1499 | 1503 | $form .= Xml::hidden( 'rcid', $wgRequest->getVal('rcid') ) . "\n"; |
1500 | 1504 | # Special token to discourage fiddling... |
1501 | | - $checkCode = RevisionReview::validationKey( $templateParams, $imageParams, $fileVersion, $id ); |
| 1505 | + $checkCode = RevisionReview::validationKey( |
| 1506 | + $templateParams, $imageParams, $fileVersion, $id |
| 1507 | + ); |
1502 | 1508 | $form .= Xml::hidden( 'validatedParams', $checkCode ) . "\n"; |
1503 | 1509 | |
1504 | 1510 | $form .= Xml::closeElement( 'fieldset' ); |