r49648 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49647‎ | r49648 | r49649 >
Date:19:34, 19 April 2009
Author:aaron
Status:ok
Tags:
Comment:
Bug 18512 &action=render now respects FlaggedRevs' default view
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php
@@ -74,7 +74,7 @@
7575 global $wgUser, $wgRequest;
7676 # This only applies to viewing content pages
7777 $action = $wgRequest->getVal( 'action', 'view' );
78 - if( ($action !='view' && $action !='purge') || !$this->isReviewable() )
 78+ if( !self::isViewAction($action) || !$this->isReviewable() )
7979 return false;
8080 # Does not apply to diffs/old revision. Explicit requests
8181 # for a certain stable version will be handled elsewhere.
@@ -98,6 +98,15 @@
9999 }
100100 return false;
101101 }
 102+
 103+ /**
 104+ * Is this a view page action?
 105+ * @param $action string
 106+ * @returns bool
 107+ */
 108+ protected static function isViewAction( $action ) {
 109+ return ( $action == 'view' || $action == 'purge' || $action == 'render' );
 110+ }
102111
103112 /**
104113 * Is the stable version shown by default for this page?
@@ -243,7 +252,7 @@
244253 global $wgRequest, $wgOut, $wgUser, $wgLang;
245254 # Only trigger on article view for content pages, not for protect/delete/hist...
246255 $action = $wgRequest->getVal( 'action', 'view' );
247 - if( ($action !='view' && $action !='purge') || !$this->parent->exists() )
 256+ if( !self::isViewAction($action) || !$this->parent->exists() )
248257 return true;
249258 # Do not clutter up diffs any further and leave archived versions alone...
250259 if( $wgRequest->getVal('diff') || $wgRequest->getVal('oldid') ) {
@@ -750,7 +759,7 @@
751760 }
752761 # Check action and if page is protected
753762 $action = $wgRequest->getVal( 'action', 'view' );
754 - if( ($action !='view' && $action !='purge') ) {
 763+ if( !self::isViewAction($action) ) {
755764 return true;
756765 }
757766 $this->addQuickReview( $data, $wgRequest->getVal('diff'), false );
@@ -768,7 +777,7 @@
769778 }
770779 # Check action and if page is protected
771780 $action = $wgRequest->getVal( 'action', 'view' );
772 - if( ($action !='view' && $action !='purge') ) {
 781+ if( !self::isViewAction($action) ) {
773782 return true;
774783 }
775784 if( $wgUser->isAllowed( 'feedback' ) ) {
@@ -881,7 +890,7 @@
882891 $draftTabCss = '';
883892 $stableTabCss = 'selected';
884893 // We are looking at the talk page or diffs/hist/oldids
885 - } else if( !in_array($action,array('view','purge','edit')) || $skin->mTitle->isTalkPage() ) {
 894+ } else if( !(self::isViewAction($action) || $action=='edit') || $skin->mTitle->isTalkPage() ) {
886895 $draftTabCss = '';
887896 $stableTabCss = '';
888897 // We are looking at the current revision or in edit mode
@@ -1564,8 +1573,9 @@
15651574 global $wgUser, $wgRequest;
15661575
15671576 $action = $wgRequest->getVal( 'action', 'view' );
 1577+ if( $action == 'purge' ) return true; // already purging!
15681578 # Only trigger on article view for content pages, not for protect/delete/hist
1569 - if( $action !='view' || !$wgUser->isAllowed( 'review' ) )
 1579+ if( !self::isViewAction($action) || !$wgUser->isAllowed( 'review' ) )
15701580 return true;
15711581 if( !$this->parent->exists() || !$this->isReviewable() )
15721582 return true;

Status & tagging log