Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -76,10 +76,12 @@ |
77 | 77 | $action = $wgRequest->getVal( 'action', 'view' ); |
78 | 78 | if( !self::isViewAction($action) || !$this->isReviewable() ) |
79 | 79 | return false; |
80 | | - # Does not apply to diffs/old revision. Explicit requests |
81 | | - # for a certain stable version will be handled elsewhere. |
82 | | - if( $wgRequest->getVal('oldid') || $wgRequest->getVal('diff') || $wgRequest->getVal('stableid') ) |
| 80 | + # Does not apply to diffs/old revision... |
| 81 | + if( $wgRequest->getVal('oldid') || $wgRequest->getVal('diff') ) |
83 | 82 | return false; |
| 83 | + # Explicit requests for a certain stable version handled elsewhere... |
| 84 | + if( $wgRequest->getVal('stableid') ) |
| 85 | + return false; |
84 | 86 | # Check user preferences |
85 | 87 | if( $wgUser->getOption('flaggedrevsstable') ) |
86 | 88 | return !( $wgRequest->getIntOrNull('stable') === 0 ); |
— | — | @@ -235,7 +237,8 @@ |
236 | 238 | if( !FlaggedRevs::useSimpleUI() && !empty($flags) ) { |
237 | 239 | $tag .= " " . FlaggedRevsXML::ratingToggle() . |
238 | 240 | "<span id='mw-revisionratings' style='display:block;'><br/>" . |
239 | | - wfMsgHtml('revreview-oldrating') . FlaggedRevsXML::addTagRatings( $flags ) . '</span>'; |
| 241 | + wfMsgHtml('revreview-oldrating') . |
| 242 | + FlaggedRevsXML::addTagRatings( $flags ) . '</span>'; |
240 | 243 | } |
241 | 244 | $tag = "<div id='mw-revisiontag-old' class='flaggedrevs_notice plainlinks noprint'>$tag</div>"; |
242 | 245 | $wgOut->addHTML( $tag ); |
— | — | @@ -348,7 +351,8 @@ |
349 | 352 | $msg = $quality ? 'revreview-quick-quality-old' : 'revreview-quick-basic-old'; |
350 | 353 | $html = "{$prot}<span class='{$class}' title=\"{$tooltip}\"></span>" . |
351 | 354 | wfMsgExt( $msg, array('parseinline'), $frev->getRevId(), $time ); |
352 | | - $tag .= FlaggedRevsXML::prettyRatingBox( $frev, $html, $revsSince, true, false, $old ); |
| 355 | + $tag .= FlaggedRevsXML::prettyRatingBox( $frev, $html, $revsSince, |
| 356 | + true, false, $old ); |
353 | 357 | // Standard UI |
354 | 358 | } else { |
355 | 359 | $msg = $quality ? 'revreview-quality-old' : 'revreview-basic-old'; |
— | — | @@ -413,18 +417,21 @@ |
414 | 418 | } |
415 | 419 | $tooltip = wfMsgHtml($tooltip); |
416 | 420 | $msgHTML = "{$prot}<span class='{$class}' title=\"{$tooltip}\"></span>$msgHTML"; |
417 | | - $tag .= FlaggedRevsXML::prettyRatingBox( $frev, $msgHTML, $revsSince, $synced, $synced, $old ); |
| 421 | + $tag .= FlaggedRevsXML::prettyRatingBox( $frev, $msgHTML, $revsSince, |
| 422 | + $synced, $synced, $old ); |
418 | 423 | // Standard UI |
419 | 424 | } else { |
420 | 425 | if( $synced ) { |
421 | 426 | $msg = $quality ? 'revreview-quality-same' : 'revreview-basic-same'; |
422 | 427 | $class = $quality ? 'fr-icon-quality' : 'fr-icon-stable'; |
423 | 428 | $tooltip = $quality ? 'revreview-quality-title' : 'revreview-stable-title'; |
424 | | - $msgHTML = wfMsgExt( $msg, array('parseinline'), $frev->getRevId(), $time, $revsSince ); |
| 429 | + $msgHTML = wfMsgExt( $msg, array('parseinline'), $frev->getRevId(), |
| 430 | + $time, $revsSince ); |
425 | 431 | } else { |
426 | 432 | $msg = $quality ? 'revreview-newest-quality' : 'revreview-newest-basic'; |
427 | 433 | $msg .= ($revsSince == 0) ? '-i' : ''; |
428 | | - $msgHTML = wfMsgExt( $msg, array('parseinline'), $frev->getRevId(), $time, $revsSince ); |
| 434 | + $msgHTML = wfMsgExt( $msg, array('parseinline'), $frev->getRevId(), |
| 435 | + $time, $revsSince ); |
429 | 436 | } |
430 | 437 | $tooltip = wfMsgHtml($tooltip); |
431 | 438 | $tag .= "{$prot}<span class='{$class}' title=\"{$tooltip}\"></span>" . $msgHTML; |
— | — | @@ -655,7 +662,9 @@ |
656 | 663 | return true; |
657 | 664 | } |
658 | 665 | # Don't show for old revisions, diff, preview, or undo. |
659 | | - if( $editPage->oldid || $editPage->section === "new" || in_array($editPage->formtype,array('diff','preview')) ) { |
| 666 | + if( $editPage->oldid || $editPage->section === "new" |
| 667 | + || in_array($editPage->formtype,array('diff','preview')) ) |
| 668 | + { |
660 | 669 | return true; // nothing to show here |
661 | 670 | } |
662 | 671 | |
— | — | @@ -683,8 +692,10 @@ |
684 | 693 | "<col class='diff-marker' />" . |
685 | 694 | "<col class='diff-content' />" . |
686 | 695 | "<tr>" . |
687 | | - "<td colspan='2' width='50%' align='center' class='diff-otitle'><b>" . $leftNote . "</b></td>" . |
688 | | - "<td colspan='2' width='50%' align='center' class='diff-ntitle'><b>" . $rightNote . "</b></td>" . |
| 696 | + "<td colspan='2' width='50%' align='center' class='diff-otitle'><b>" . |
| 697 | + $leftNote . "</b></td>" . |
| 698 | + "<td colspan='2' width='50%' align='center' class='diff-ntitle'><b>" . |
| 699 | + $rightNote . "</b></td>" . |
689 | 700 | "</tr>" . |
690 | 701 | $diffEngine->generateDiffBody( $text, $editPage->textbox1 ) . |
691 | 702 | "</table>" . |
— | — | @@ -732,12 +743,12 @@ |
733 | 744 | $category = $this->parent->getTitle()->getText(); |
734 | 745 | |
735 | 746 | $unreviewed = SpecialPage::getTitleFor( 'UnreviewedPages' ); |
736 | | - $unreviewedLink = $wgUser->getSkin()->makeKnownLinkObj( $unreviewed, wfMsgHtml('unreviewedpages'), |
737 | | - 'category=' . urlencode($category) ); |
| 747 | + $unreviewedLink = $wgUser->getSkin()->makeKnownLinkObj( $unreviewed, |
| 748 | + wfMsgHtml('unreviewedpages'), 'category=' . urlencode($category) ); |
738 | 749 | |
739 | 750 | $oldreviewed = SpecialPage::getTitleFor( 'OldReviewedPages' ); |
740 | | - $oldreviewedLink = $wgUser->getSkin()->makeKnownLinkObj( $oldreviewed, wfMsgHtml('oldreviewedpages'), |
741 | | - 'category=' . urlencode($category) ); |
| 751 | + $oldreviewedLink = $wgUser->getSkin()->makeKnownLinkObj( $oldreviewed, |
| 752 | + wfMsgHtml('oldreviewedpages'), 'category=' . urlencode($category) ); |
742 | 753 | |
743 | 754 | $wgOut->appendSubtitle("<span id='mw-category-oldreviewed'>$unreviewedLink / $oldreviewedLink</span>"); |
744 | 755 | |
— | — | @@ -813,16 +824,16 @@ |
814 | 825 | $frev = $this->getStableRev(); |
815 | 826 | if( $frev && $frev->getRevId() == $this->parent->getLatest() ) { |
816 | 827 | $wgOut->prependHTML( "<span class='plainlinks'>" . |
817 | | - wfMsgExt( 'revreview-visibility',array('parseinline'), $title->getPrefixedText() ) . |
818 | | - "</span>" ); |
| 828 | + wfMsgExt( 'revreview-visibility',array('parseinline'), |
| 829 | + $title->getPrefixedText() ) . "</span>" ); |
819 | 830 | } else if( $frev ) { |
820 | 831 | $wgOut->prependHTML( "<span class='plainlinks'>" . |
821 | | - wfMsgExt( 'revreview-visibility2',array('parseinline'), $title->getPrefixedText() ) . |
822 | | - "</span>" ); |
| 832 | + wfMsgExt( 'revreview-visibility2',array('parseinline'), |
| 833 | + $title->getPrefixedText() ) . "</span>" ); |
823 | 834 | } else { |
824 | 835 | $wgOut->prependHTML( "<span class='plainlinks'>" . |
825 | | - wfMsgExt( 'revreview-visibility3',array('parseinline'), $title->getPrefixedText() ) . |
826 | | - "</span>" ); |
| 836 | + wfMsgExt( 'revreview-visibility3',array('parseinline'), |
| 837 | + $title->getPrefixedText() ) . "</span>" ); |
827 | 838 | } |
828 | 839 | } |
829 | 840 | return true; |
— | — | @@ -1063,11 +1074,13 @@ |
1064 | 1075 | } else if( !empty($changeList) && $wgUser->isAllowed('review') ) { |
1065 | 1076 | $changeList = implode(', ',$changeList); |
1066 | 1077 | $wgOut->addHTML( "<div id='mw-difftostable' class='flaggedrevs_diffnotice plainlinks'>" . |
1067 | | - wfMsgExt('revreview-update', array('parseinline')).' '.$changeList.$notice.'</div>' ); |
| 1078 | + wfMsgExt('revreview-update', array('parseinline')).' '. |
| 1079 | + $changeList.$notice.'</div>' ); |
1068 | 1080 | } else if( !empty($changeList) ) { |
1069 | 1081 | $changeList = implode(', ',$changeList); |
1070 | 1082 | $wgOut->addHTML( "<div id='mw-difftostable' class='flaggedrevs_diffnotice plainlinks'>" . |
1071 | | - wfMsgExt('revreview-update-includes', array('parseinline')).' '.$changeList.$notice.'</div>' ); |
| 1083 | + wfMsgExt('revreview-update-includes', array('parseinline')).' '. |
| 1084 | + $changeList.$notice.'</div>' ); |
1072 | 1085 | } |
1073 | 1086 | # Set flag for review form to tell it to autoselect tag settings from the |
1074 | 1087 | # old revision unless the current one is tagged to. |
— | — | @@ -1519,7 +1532,8 @@ |
1520 | 1533 | wfLoadExtensionMessages( 'FlaggedRevs' ); |
1521 | 1534 | $reviewTitle = SpecialPage::getTitleFor( 'ReaderFeedback' ); |
1522 | 1535 | $action = $reviewTitle->getLocalUrl( 'action=submit' ); |
1523 | | - $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'mw-feedbackform' ) ); |
| 1536 | + $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, |
| 1537 | + 'id' => 'mw-feedbackform' ) ); |
1524 | 1538 | $form .= Xml::openElement( 'fieldset', array('class' => 'flaggedrevs_reviewform noprint') ); |
1525 | 1539 | $form .= "<legend><strong>" . wfMsgHtml( 'readerfeedback' ) . "</strong></legend>\n"; |
1526 | 1540 | # Avoid clutter |
— | — | @@ -1532,7 +1546,8 @@ |
1533 | 1547 | $label = array(); |
1534 | 1548 | $selected = ( isset($flags[$quality]) && $flags[$quality] > 0 ) ? $flags[$quality] : -1; |
1535 | 1549 | $form .= "<b>" . Xml::label( wfMsgHtml("readerfeedback-$quality"), "wp$quality" ) . ":</b>"; |
1536 | | - $attribs = array( 'name' => "wp$quality", 'id' => "wp$quality", 'onchange' => "updateFeedbackForm()" ); |
| 1550 | + $attribs = array( 'name' => "wp$quality", 'id' => "wp$quality", |
| 1551 | + 'onchange' => "updateFeedbackForm()" ); |
1537 | 1552 | $form .= ' ' . Xml::openElement( 'select', $attribs ); |
1538 | 1553 | $levels = array_reverse($levels,true); |
1539 | 1554 | foreach( $levels as $i => $name ) { |