r99294 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99293‎ | r99294 | r99295 >
Date:01:51, 8 October 2011
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Removed $wgFlaggedRevsRCCrap related code, which was already disabled
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -211,11 +211,6 @@
212212 return;
213213 }
214214
215 -# Temp var
216 -$wgFlaggedRevsRCCrap = false;
217 -# Patrollable namespaces (overridden by reviewable namespaces) (don't use)
218 -$wgFlaggedRevsPatrolNamespaces = array(); // @TODO: remove when ready
219 -
220215 # Bots are granted autoreview via hooks, mark in rights
221216 # array so that it shows up in sp:ListGroupRights...
222217 $wgGroupPermissions['bot']['autoreview'] = true;
@@ -367,7 +362,7 @@
368363 $wgLogTypes[] = 'stable';
369364
370365 # Log action handlers
371 -FlaggedRevsUIHooks::defineBasicLogUI( $wgLogNames, $wgLogHeaders, $wgFilterLogTypes );
 366+FlaggedRevsUIHooks::defineLogBasicDesc( $wgLogNames, $wgLogHeaders, $wgFilterLogTypes );
372367 FlaggedRevsUIHooks::defineLogActionHanders( $wgLogActions, $wgLogActionsHandlers );
373368
374369 # JS/CSS modules and message bundles used by JS scripts
@@ -524,34 +519,6 @@
525520
526521 // Note: avoid calls to FlaggedRevs class here for performance
527522 function efLoadFlaggedRevs() {
528 - global $wgFlaggedRevsRCCrap, $wgUseRCPatrol, $wgGroupPermissions;
529 - global $wgFlaggedRevsNamespaces, $wgFlaggedRevsProtection;
530 - if ( $wgFlaggedRevsRCCrap ) {
531 - # If patrolling is already on, then we know that it
532 - # was intended to have all namespaces patrollable.
533 - if ( $wgUseRCPatrol ) {
534 - global $wgFlaggedRevsPatrolNamespaces;
535 - $wgFlaggedRevsPatrolNamespaces = MWNamespace::getValidNamespaces();
536 - }
537 - /* TODO: decouple from rc patrol */
538 - # Check if FlaggedRevs is enabled by default for pages...
539 - if ( $wgFlaggedRevsNamespaces && !$wgFlaggedRevsProtection ) {
540 - # Use RC Patrolling to check for vandalism.
541 - # Edits to reviewable pages must be flagged to be patrolled.
542 - $wgUseRCPatrol = true;
543 - }
544 - if ( isset( $wgGroupPermissions['editor'] )
545 - && !isset( $wgGroupPermissions['editor']['patrolmarks'] ) )
546 - {
547 - $wgGroupPermissions['editor']['patrolmarks'] = true;
548 - }
549 - if ( isset( $wgGroupPermissions['reviewer'] )
550 - && !isset( $wgGroupPermissions['reviewer']['patrolmarks'] ) )
551 - {
552 - $wgGroupPermissions['reviewer']['patrolmarks'] = true;
553 - }
554 - }
555 -
556523 # Conditional autopromote groups
557524 efSetFlaggedRevsAutopromoteConfig();
558525
Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.hooks.php
@@ -622,37 +622,6 @@
623623 }
624624 return true;
625625 }
626 - global $wgFlaggedRevsRCCrap;
627 - if ( $wgFlaggedRevsRCCrap ) {
628 - // Is this page in patrollable namespace?
629 - if ( FlaggedRevs::inPatrolNamespace( $rc->getTitle() ) ) {
630 - # Bots and users with 'autopatrol' have edits to patrollable
631 - # pages marked automatically on edit.
632 - $patrol = $wgUser->isAllowed( 'autopatrol' ) || $wgUser->isAllowed( 'bot' );
633 - $record = true; // record if patrolled
634 - } else {
635 - global $wgUseNPPatrol;
636 - // Is this is a new page edit and $wgUseNPPatrol is enabled?
637 - if ( $wgUseNPPatrol && !empty( $rc->mAttribs['rc_new'] ) ) {
638 - # Automatically mark it patrolled if the user can do so
639 - $patrol = $wgUser->isAllowed( 'autopatrol' );
640 - $record = true;
641 - // Otherwise, this edit is not patrollable
642 - } else {
643 - # Silently mark it "patrolled" so that it doesn't show up as being unpatrolled
644 - $patrol = true;
645 - $record = false;
646 - }
647 - }
648 - // Set rc_patrolled flag and add log entry as needed
649 - if ( $patrol ) {
650 - $rc->reallyMarkPatrolled();
651 - $rc->mAttribs['rc_patrolled'] = 1; // make sure irc/email notifs now status
652 - if ( $record ) {
653 - PatrolLog::record( $rc->mAttribs['rc_id'], true );
654 - }
655 - }
656 - }
657626 return true;
658627 }
659628
Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.class.php
@@ -16,7 +16,6 @@
1717 protected static $binaryFlagging = true;
1818 # Namespace config
1919 protected static $reviewNamespaces = array();
20 - protected static $patrolNamespaces = array();
2120 # Restriction levels/config
2221 protected static $restrictionLevels = array();
2322 # Autoreview config
@@ -108,8 +107,6 @@
109108 }
110109 }
111110 self::$reviewNamespaces = $wgFlaggedRevsNamespaces;
112 - # Note: reviewable *pages* override patrollable ones
113 - self::$patrolNamespaces = $wgFlaggedRevsPatrolNamespaces;
114111 # Handle $wgFlaggedRevsAutoReview settings
115112 global $wgFlaggedRevsAutoReview, $wgFlaggedRevsAutoReviewNew;
116113 if ( is_int( $wgFlaggedRevsAutoReview ) ) {
@@ -882,15 +879,6 @@
883880 }
884881
885882 /**
886 - * Get the list of patrollable namespaces
887 - * @return array
888 - */
889 - public static function getPatrolNamespaces() {
890 - self::load(); // validates namespaces
891 - return self::$patrolNamespaces;
892 - }
893 -
894 - /**
895883 * Is this page in reviewable namespace?
896884 * Note: this checks $wgFlaggedRevsWhitelist
897885 * @param Title, $title
@@ -906,18 +894,6 @@
907895 return in_array( $ns, self::getReviewNamespaces() );
908896 }
909897
910 - /**
911 - * Is this page in patrollable namespace?
912 - * @param Title, $title
913 - * @return bool
914 - */
915 - public static function inPatrolNamespace( Title $title ) {
916 - $namespaces = self::getPatrolNamespaces();
917 - $ns = ( $title->getNamespace() == NS_MEDIA ) ?
918 - NS_FILE : $title->getNamespace(); // Treat NS_MEDIA as NS_FILE
919 - return ( in_array( $ns, $namespaces ) );
920 - }
921 -
922898 # ################ Auto-review function #################
923899
924900 /**
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php
@@ -86,7 +86,7 @@
8787 * @param $logHeaders Array $wgLogHeaders
8888 * @param $filterLogTypes Array $wgFilterLogTypes
8989 */
90 - public static function defineBasicLogUI( &$logNames, &$logHeaders, &$filterLogTypes ) {
 90+ public static function defineLogBasicDesc( &$logNames, &$logHeaders, &$filterLogTypes ) {
9191 $logNames['review'] = 'review-logpage';
9292 $logHeaders['review'] = 'review-logpagetext';
9393

Comments

#Comment by Aaron Schulz (talk | contribs)   02:46, 8 October 2011

Also renamed defineBasicLogUI(), which managed to slip in there.

Status & tagging log