r32872 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32871‎ | r32872 | r32873 >
Date:19:29, 6 April 2008
Author:aaron
Status:old
Tags:
Comment:
Make reviewing go smoother by skipping reload (bug 13628)
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php
@@ -108,8 +108,8 @@
109109
110110 See the [[Special:Unreviewedpages]] for a list of unreviewed pages.',
111111 '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.''",
114114 'revreview-toolow' => 'You must at least rate each of the below attributes higher than "unapproved" in order for a revision to be considered reviewed.
115115 To depreciate a revision, set all fields to "unapproved".',
116116 'revreview-flag' => 'Review this revision',
@@ -135,6 +135,12 @@
136136 'revreview-style-4' => 'Featured',
137137 'revreview-log' => 'Comment:',
138138 '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.",
139145 'revreview-changed' => '\'\'\'The requested action could not be performed on this revision of [[:$1|$1]].\'\'\'
140146
141147 A template or image may have been requested when no specific version was specified.
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.php
@@ -183,7 +183,10 @@
184184 $wgOut->addWikiText( wfMsg('sessionfailure') );
185185 return;
186186 }
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.
188191 if( FlaggedRevs::isPageReviewable( $this->page ) ) {
189192 $wgOut->showErrorPage('notargettitle', 'notargettext' );
190193 return;
@@ -336,11 +339,24 @@
337340 }
338341 }
339342
340 - $success = $approved ?
341 - $this->approveRevision( $rev, $this->notes ) : $this->unapproveRevision( $frev );
 343+ $success = $approved ? $this->approveRevision( $rev ) : $this->unapproveRevision( $frev );
342344 # Return to our page
343345 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' ) );
345361 } else {
346362 $wgOut->showErrorPage( 'internalerror', 'revreview-changed', array($this->page->getPrefixedText()) );
347363 }
@@ -349,9 +365,8 @@
350366 /**
351367 * Adds or updates the flagged revision table for this page/id set
352368 * @param Revision $rev
353 - * @param string $notes
354369 */
355 - function approveRevision( $rev, $notes='' ) {
 370+ function approveRevision( $rev ) {
356371 global $wgUser, $wgParser;
357372 # Get the page this corresponds to
358373 $title = $rev->getTitle();
@@ -483,7 +498,7 @@
484499 'fr_page_id' => $title->getArticleID(),
485500 'fr_user' => $wgUser->getId(),
486501 'fr_timestamp' => $dbw->timestamp( wfTimestampNow() ),
487 - 'fr_comment' => $notes,
 502+ 'fr_comment' => $this->notes,
488503 'fr_quality' => $quality,
489504 'fr_tags' => FlaggedRevs::flattenRevisionTags( $flags ),
490505 'fr_text' => $fulltext, # Store expanded text for speed

Status & tagging log