http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99294
Revision: 99294 Author: aaron Date: 2011-10-08 01:51:34 +0000 (Sat, 08 Oct 2011) Log Message: ----------- Removed $wgFlaggedRevsRCCrap related code, which was already disabled Modified Paths: -------------- trunk/extensions/FlaggedRevs/FlaggedRevs.php trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.class.php trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.hooks.php trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.php =================================================================== --- trunk/extensions/FlaggedRevs/FlaggedRevs.php 2011-10-08 01:05:32 UTC (rev 99293) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.php 2011-10-08 01:51:34 UTC (rev 99294) @@ -211,11 +211,6 @@ return; } -# Temp var -$wgFlaggedRevsRCCrap = false; -# Patrollable namespaces (overridden by reviewable namespaces) (don't use) -$wgFlaggedRevsPatrolNamespaces = array(); // @TODO: remove when ready - # Bots are granted autoreview via hooks, mark in rights # array so that it shows up in sp:ListGroupRights... $wgGroupPermissions['bot']['autoreview'] = true; @@ -367,7 +362,7 @@ $wgLogTypes[] = 'stable'; # Log action handlers -FlaggedRevsUIHooks::defineBasicLogUI( $wgLogNames, $wgLogHeaders, $wgFilterLogTypes ); +FlaggedRevsUIHooks::defineLogBasicDesc( $wgLogNames, $wgLogHeaders, $wgFilterLogTypes ); FlaggedRevsUIHooks::defineLogActionHanders( $wgLogActions, $wgLogActionsHandlers ); # JS/CSS modules and message bundles used by JS scripts @@ -524,34 +519,6 @@ // Note: avoid calls to FlaggedRevs class here for performance function efLoadFlaggedRevs() { - global $wgFlaggedRevsRCCrap, $wgUseRCPatrol, $wgGroupPermissions; - global $wgFlaggedRevsNamespaces, $wgFlaggedRevsProtection; - if ( $wgFlaggedRevsRCCrap ) { - # If patrolling is already on, then we know that it - # was intended to have all namespaces patrollable. - if ( $wgUseRCPatrol ) { - global $wgFlaggedRevsPatrolNamespaces; - $wgFlaggedRevsPatrolNamespaces = MWNamespace::getValidNamespaces(); - } - /* TODO: decouple from rc patrol */ - # Check if FlaggedRevs is enabled by default for pages... - if ( $wgFlaggedRevsNamespaces && !$wgFlaggedRevsProtection ) { - # Use RC Patrolling to check for vandalism. - # Edits to reviewable pages must be flagged to be patrolled. - $wgUseRCPatrol = true; - } - if ( isset( $wgGroupPermissions['editor'] ) - && !isset( $wgGroupPermissions['editor']['patrolmarks'] ) ) - { - $wgGroupPermissions['editor']['patrolmarks'] = true; - } - if ( isset( $wgGroupPermissions['reviewer'] ) - && !isset( $wgGroupPermissions['reviewer']['patrolmarks'] ) ) - { - $wgGroupPermissions['reviewer']['patrolmarks'] = true; - } - } - # Conditional autopromote groups efSetFlaggedRevsAutopromoteConfig(); Modified: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.class.php =================================================================== --- trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.class.php 2011-10-08 01:05:32 UTC (rev 99293) +++ trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.class.php 2011-10-08 01:51:34 UTC (rev 99294) @@ -16,7 +16,6 @@ protected static $binaryFlagging = true; # Namespace config protected static $reviewNamespaces = array(); - protected static $patrolNamespaces = array(); # Restriction levels/config protected static $restrictionLevels = array(); # Autoreview config @@ -108,8 +107,6 @@ } } self::$reviewNamespaces = $wgFlaggedRevsNamespaces; - # Note: reviewable *pages* override patrollable ones - self::$patrolNamespaces = $wgFlaggedRevsPatrolNamespaces; # Handle $wgFlaggedRevsAutoReview settings global $wgFlaggedRevsAutoReview, $wgFlaggedRevsAutoReviewNew; if ( is_int( $wgFlaggedRevsAutoReview ) ) { @@ -882,15 +879,6 @@ } /** - * Get the list of patrollable namespaces - * @return array - */ - public static function getPatrolNamespaces() { - self::load(); // validates namespaces - return self::$patrolNamespaces; - } - - /** * Is this page in reviewable namespace? * Note: this checks $wgFlaggedRevsWhitelist * @param Title, $title @@ -906,18 +894,6 @@ return in_array( $ns, self::getReviewNamespaces() ); } - /** - * Is this page in patrollable namespace? - * @param Title, $title - * @return bool - */ - public static function inPatrolNamespace( Title $title ) { - $namespaces = self::getPatrolNamespaces(); - $ns = ( $title->getNamespace() == NS_MEDIA ) ? - NS_FILE : $title->getNamespace(); // Treat NS_MEDIA as NS_FILE - return ( in_array( $ns, $namespaces ) ); - } - # ################ Auto-review function ################# /** Modified: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.hooks.php =================================================================== --- trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.hooks.php 2011-10-08 01:05:32 UTC (rev 99293) +++ trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.hooks.php 2011-10-08 01:51:34 UTC (rev 99294) @@ -622,37 +622,6 @@ } return true; } - global $wgFlaggedRevsRCCrap; - if ( $wgFlaggedRevsRCCrap ) { - // Is this page in patrollable namespace? - if ( FlaggedRevs::inPatrolNamespace( $rc->getTitle() ) ) { - # Bots and users with 'autopatrol' have edits to patrollable - # pages marked automatically on edit. - $patrol = $wgUser->isAllowed( 'autopatrol' ) || $wgUser->isAllowed( 'bot' ); - $record = true; // record if patrolled - } else { - global $wgUseNPPatrol; - // Is this is a new page edit and $wgUseNPPatrol is enabled? - if ( $wgUseNPPatrol && !empty( $rc->mAttribs['rc_new'] ) ) { - # Automatically mark it patrolled if the user can do so - $patrol = $wgUser->isAllowed( 'autopatrol' ); - $record = true; - // Otherwise, this edit is not patrollable - } else { - # Silently mark it "patrolled" so that it doesn't show up as being unpatrolled - $patrol = true; - $record = false; - } - } - // Set rc_patrolled flag and add log entry as needed - if ( $patrol ) { - $rc->reallyMarkPatrolled(); - $rc->mAttribs['rc_patrolled'] = 1; // make sure irc/email notifs now status - if ( $record ) { - PatrolLog::record( $rc->mAttribs['rc_id'], true ); - } - } - } return true; } Modified: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php =================================================================== --- trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php 2011-10-08 01:05:32 UTC (rev 99293) +++ trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php 2011-10-08 01:51:34 UTC (rev 99294) @@ -86,7 +86,7 @@ * @param $logHeaders Array $wgLogHeaders * @param $filterLogTypes Array $wgFilterLogTypes */ - public static function defineBasicLogUI( &$logNames, &$logHeaders, &$filterLogTypes ) { + public static function defineLogBasicDesc( &$logNames, &$logHeaders, &$filterLogTypes ) { $logNames['review'] = 'review-logpage'; $logHeaders['review'] = 'review-logpagetext'; _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs