Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php |
— | — | @@ -108,8 +108,8 @@ |
109 | 109 | |
110 | 110 | See the [[Special:Unreviewedpages]] for a list of unreviewed pages.', |
111 | 111 | 'revreview-selected' => "Selected revision of '''$1:'''", |
112 | | - 'revreview-text' => "''Stable versions are the default page content for viewers rather than the newest revision.''", |
113 | | - 'revreview-text2' => "''Stable versions are checked revisions of pages and can be set as the default content for viewers.''", |
| 112 | + 'revreview-text' => "''[[{{MediaWiki:Validationpage}}|Stable versions]] are the default page content for viewers rather than the newest revision.''", |
| 113 | + 'revreview-text2' => "''[[{{MediaWiki:Validationpage}}|Stable versions]] are checked revisions of pages and can be set as the default content for viewers.''", |
114 | 114 | 'revreview-toolow' => 'You must at least rate each of the below attributes higher than "unapproved" in order for a revision to be considered reviewed. |
115 | 115 | To depreciate a revision, set all fields to "unapproved".', |
116 | 116 | 'revreview-flag' => 'Review this revision', |
— | — | @@ -135,6 +135,12 @@ |
136 | 136 | 'revreview-style-4' => 'Featured', |
137 | 137 | 'revreview-log' => 'Comment:', |
138 | 138 | 'revreview-submit' => 'Submit review', |
| 139 | + 'revreview-successful' => "'''Selected revision of [[:$1|$1]] successfully flagged and marked in recent changes.''' |
| 140 | + |
| 141 | +You may want to view the [{{fullurl:$2|stable=1}} stable version] of this page.", |
| 142 | + 'revreview-successful2' => "'''Selected revision of [[:$1|$1]] successfully unflagged.''' |
| 143 | + |
| 144 | +You may want to view the [{{fullurl:$2|stable=1}} stable version] of this page.", |
139 | 145 | 'revreview-changed' => '\'\'\'The requested action could not be performed on this revision of [[:$1|$1]].\'\'\' |
140 | 146 | |
141 | 147 | A template or image may have been requested when no specific version was specified. |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.php |
— | — | @@ -183,7 +183,10 @@ |
184 | 184 | $wgOut->addWikiText( wfMsg('sessionfailure') ); |
185 | 185 | return; |
186 | 186 | } |
187 | | - # Make sure page is not reviewable |
| 187 | + # Make sure page is not reviewable. This can be spoofed in theory, |
| 188 | + # but the token is salted with the id and title and this should |
| 189 | + # be a trusted user...so it is not really worth doing extra query |
| 190 | + # work over. |
188 | 191 | if( FlaggedRevs::isPageReviewable( $this->page ) ) { |
189 | 192 | $wgOut->showErrorPage('notargettitle', 'notargettext' ); |
190 | 193 | return; |
— | — | @@ -336,11 +339,24 @@ |
337 | 340 | } |
338 | 341 | } |
339 | 342 | |
340 | | - $success = $approved ? |
341 | | - $this->approveRevision( $rev, $this->notes ) : $this->unapproveRevision( $frev ); |
| 343 | + $success = $approved ? $this->approveRevision( $rev ) : $this->unapproveRevision( $frev ); |
342 | 344 | # Return to our page |
343 | 345 | if( $success ) { |
344 | | - $wgOut->redirect( $this->page->getFullUrl( 'redirect=no&stable=1' ) ); |
| 346 | + global $wgFlaggedRevsOverride; |
| 347 | + |
| 348 | + $wgOut->setPageTitle( wfMsgHtml('actioncomplete') ); |
| 349 | + |
| 350 | + $msg = $approved ? 'revreview-successful' : 'revreview-successful2'; |
| 351 | + $wgOut->addHtml( "<span class='plainlinks'>" .wfMsgExt( $msg, array('parseinline'), |
| 352 | + $this->page->getPrefixedText(), $this->page->getPrefixedUrl() ) . "</span>" ); |
| 353 | + |
| 354 | + if( $wgFlaggedRevsOverride ) { |
| 355 | + $wgOut->addHtml( '<p>'.wfMsgExt( 'revreview-text', array('parseinline') ).'</p>' ); |
| 356 | + } else { |
| 357 | + $wgOut->addHtml( '<p>'.wfMsgExt( 'revreview-text2', array('parseinline') ).'</p>' ); |
| 358 | + } |
| 359 | + |
| 360 | + $wgOut->returnToMain( false, SpecialPage::getTitleFor( 'Recentchanges' ) ); |
345 | 361 | } else { |
346 | 362 | $wgOut->showErrorPage( 'internalerror', 'revreview-changed', array($this->page->getPrefixedText()) ); |
347 | 363 | } |
— | — | @@ -349,9 +365,8 @@ |
350 | 366 | /** |
351 | 367 | * Adds or updates the flagged revision table for this page/id set |
352 | 368 | * @param Revision $rev |
353 | | - * @param string $notes |
354 | 369 | */ |
355 | | - function approveRevision( $rev, $notes='' ) { |
| 370 | + function approveRevision( $rev ) { |
356 | 371 | global $wgUser, $wgParser; |
357 | 372 | # Get the page this corresponds to |
358 | 373 | $title = $rev->getTitle(); |
— | — | @@ -483,7 +498,7 @@ |
484 | 499 | 'fr_page_id' => $title->getArticleID(), |
485 | 500 | 'fr_user' => $wgUser->getId(), |
486 | 501 | 'fr_timestamp' => $dbw->timestamp( wfTimestampNow() ), |
487 | | - 'fr_comment' => $notes, |
| 502 | + 'fr_comment' => $this->notes, |
488 | 503 | 'fr_quality' => $quality, |
489 | 504 | 'fr_tags' => FlaggedRevs::flattenRevisionTags( $flags ), |
490 | 505 | 'fr_text' => $fulltext, # Store expanded text for speed |