r63609 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63608‎ | r63609 | r63610 >
Date:18:14, 11 March 2010
Author:aaron
Status:ok
Tags:
Comment:
Pull back recent $wgFlagAvailability var, likely not be needed (and complicates things)
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -131,14 +131,6 @@
132132 'depth' => array( 'review' => 2 ),
133133 'style' => array( 'review' => 3 ),
134134 );
135 -# Use this to make levels of flags only appear if the page configured to
136 -# select the stable version in a certain way. Array of tags=>level=>config.
137 -$wgFlagAvailability = array();
138 -/* (example usage)
139 -$wgFlagAvailability = array(
140 - 'style' => array( 1=>FLAGGED_VIS_LATEST, 2=>FLAGGED_VIS_QUALITY )
141 -);
142 -*/
143135
144136 # At what level of review do patrol marks go away?
145137 # 0 => sighted; 1 => quality; 2 => pristine
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php
@@ -713,17 +713,14 @@
714714 public static function userCan( $tag, $value, $config = null ) {
715715 global $wgUser;
716716 $restrictions = FlaggedRevs::getTagRestrictions();
717 - # Levels may not apply for some pages.
718 - # Skip this check if $config is not given.
719 - if ( !is_null( $config ) && !self::levelAvailable( $tag, $value, $config ) ) {
720 - return false;
721 - }
722717 # No restrictions -> full access
723 - if ( !isset( $restrictions[$tag] ) )
 718+ if ( !isset( $restrictions[$tag] ) ) {
724719 return true;
 720+ }
725721 # Validators always have full access
726 - if ( $wgUser->isAllowed( 'validate' ) )
 722+ if ( $wgUser->isAllowed( 'validate' ) ) {
727723 return true;
 724+ }
728725 # Check if this user has any right that lets him/her set
729726 # up to this particular value
730727 foreach ( $restrictions[$tag] as $right => $level ) {
@@ -763,20 +760,6 @@
764761 return true;
765762 }
766763
767 - // Check if a given level for a tag is available in $config
768 - public static function levelAvailable( $tag, $val, $config ) {
769 - global $wgFlagAvailability;
770 - if ( $val == 0 )
771 - return true; // unreviewed is always applicable
772 - if ( !array_key_exists( 'select', $config ) )
773 - return true; // missing config
774 - if ( isset( $wgFlagAvailability[$tag] ) && isset( $wgFlagAvailability[$tag][$val] ) ) {
775 - $precedence = $wgFlagAvailability[$tag][$val];
776 - return ( $config['select'] === $precedence );
777 - }
778 - return true;
779 - }
780 -
781764 public static function updateRecentChanges( $title, $revId, $rcId = false, $patrol = true ) {
782765 wfProfileIn( __METHOD__ );
783766 $revId = intval( $revId );

Follow-up revisions

RevisionCommit summaryAuthorDate
r63610Follow-up r63609: rm levelAvailable callaaron19:01, 11 March 2010
r64693Removed $wgFlaggedRevsPatrolLevel (unused) for same reason as r63609aaron08:04, 7 April 2010

Status & tagging log