r60134 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60133‎ | r60134 | r60135 >
Date:20:02, 16 December 2009
Author:aaron
Status:ok
Tags:
Comment:
Minor subroutine refactoring and comments
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -110,7 +110,8 @@
111111 * @returns bool
112112 */
113113 protected static function isViewAction( $action ) {
114 - return ( $action == 'view' || $action == 'purge' || $action == 'render' || $action == 'historysubmit' );
 114+ return ( $action == 'view' || $action == 'purge' || $action == 'render'
 115+ || $action == 'historysubmit' );
115116 }
116117
117118 /**
@@ -193,7 +194,8 @@
194195 if( $stableId && $reqId ) {
195196 # Treat requesting the stable version by ID as &stable=1
196197 if( $reqId != $stableId ) {
197 - $frev = FlaggedRevision::newFromTitle( $this->article->getTitle(), $reqId, FR_TEXT );
 198+ $frev = FlaggedRevision::newFromTitle( $this->article->getTitle(),
 199+ $reqId, FR_TEXT );
198200 $old = true; // old reviewed version requested by ID
199201 if( !$frev ) {
200202 $wgOut->addWikiText( wfMsg('revreview-invalid') );
@@ -255,11 +257,15 @@
256258 $this->showOldReviewedVersion( $srev, $frev, $tag, $prot );
257259 $outputDone = true; # Tell MW that parser output is done
258260 $pcache = false;
 261+ // Stable version requested by ID or relevant conditions met to
 262+ // to override page view.
 263+ } else if( $stable || $this->pageOverride() ) {
 264+ $this->showStableVersion( $srev, $tag, $prot );
 265+ $outputDone = true; # Tell MW that parser output is done
 266+ $pcache = false;
259267 // Looking at some specific old revision (&oldid=x) or if FlaggedRevs is not
260 - // set to override given the relevant conditions (like &stable=0).
261 - } elseif( !$stable && !$this->pageOverride() ) {
262 - $this->showRegularVersion( $srev, $tag, $prot );
263 - // The relevant conditions are met to override the page with the stable version.
 268+ // set to override given the relevant conditions (like &stable=0) or there
 269+ // is no stable version.
264270 } else {
265271 $this->showStableVersion( $srev, $tag, $prot );
266272 $outputDone = true; # Tell MW that parser output is done
@@ -304,7 +310,6 @@
305311 } else {
306312 $this->maybeShowTopDiff( $srev, $quality ); // user may want diff (via prefs)
307313 }
308 - $pending = '';
309314 # If they are synced, do special styling
310315 $simpleTag = !$synced;
311316 # Give notice to newer users if an unreviewed edit was completed...

Follow-up revisions

RevisionCommit summaryAuthorDate
r60169Fixed stupid mistake from r60134aaron18:05, 17 December 2009

Status & tagging log