r63680 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63679‎ | r63680 | r63681 >
Date:16:04, 13 March 2010
Author:aaron
Status:ok
Tags:
Comment:
Simplified $wgFlaggedRevsProtectLevels. Stable is the default for each level.
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -145,16 +145,19 @@
146146 # 0 => sighted; 1 => quality; 2 => pristine
147147 $wgFlaggedRevsPatrolLevel = 0;
148148
149 -# Stability levels, defined below, that appear in protection form
 149+# Protection levels, defined below, that appear in protection form.
 150+# The stable version is the default for each level. A "none" level
 151+# will appear in the forms as well, to restore the default settings.
150152 $wgFlaggedRevsProtectLevels = array();
151153 /* (example usage)
152154 $wgFlaggedRevsProtectLevels = array(
153 - 'semi-review' => array('select' => FLAGGED_VIS_LATEST, 'override' => true, 'autoreview' => ''),
154 - 'intm-review' => array('select' => FLAGGED_VIS_LATEST, 'override' => true, 'autoreview' => 'review'),
 155+ 'semi-review' => array('select' => FLAGGED_VIS_LATEST, 'autoreview' => ''),
 156+ 'intm-review' => array('select' => FLAGGED_VIS_LATEST, 'autoreview' => 'review'),
155157 );
156158 */
157159
158160 # Restriction levels for auto-review right at Stabilization page
 161+# No effect if $wgFlaggedRevsProtectLevels is used.
159162 $wgFlaggedRevsRestrictionLevels = array( '', 'sysop' );
160163
161164 # Please set these as something different. Any text will do, though it probably
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -80,15 +80,13 @@
8181 $wgFlaggedRevsProtectLevels = (array)$wgFlaggedRevsProtectLevels;
8282 foreach ( $wgFlaggedRevsProtectLevels as $level => $config ) {
8383 # Sanity check that the config is complete
84 - if ( !isset( $config['select'] ) || !isset( $config['override'] )
85 - || !isset( $config['autoreview'] )
86 - ) {
 84+ if ( !isset( $config['select'] ) || !isset( $config['autoreview'] ) ) {
8785 throw new MWException( 'FlaggedRevs given incomplete $wgFlaggedRevsProtectLevels value!' );
8886 # Disallow reserved level names
8987 } else if ( $level == 'invalid' || $level == 'none' ) {
9088 throw new MWException( 'FlaggedRevs given reserved $wgFlaggedRevsProtectLevels key!' );
9189 }
92 - $config['override'] = intval( $config['override'] ); // Type cleanup
 90+ $config['override'] = 1; // stable is default
9391 self::$protectionLevels[$level] = $config;
9492 }
9593 global $wgFlaggedRevsRestrictionLevels;

Status & tagging log