Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -87,10 +87,9 @@ |
88 | 88 | $wgFlaggedRevsWhitelist = array(); |
89 | 89 | # $wgFlaggedRevsWhitelist = array( 'Main_Page' ); |
90 | 90 | |
91 | | -# Do flagged revs override the default view? |
| 91 | +# Is a "stable version" used as the default display |
| 92 | +# version for all pages in reviewable namespaces? |
92 | 93 | $wgFlaggedRevsOverride = true; |
93 | | -# Are pages only reviewable if the stable shows by default? |
94 | | -$wgFlaggedRevsReviewForDefault = false; |
95 | 94 | # Precedence order for stable version selection. |
96 | 95 | # The stable version will be the highest ranked version in the page. |
97 | 96 | # FR_PRISTINE : "pristine" > "quality" > "sighted" |
— | — | @@ -143,9 +142,11 @@ |
144 | 143 | # requires approval unless that user has the specified permission. |
145 | 144 | # Levels are set at the Stabilization special page. |
146 | 145 | $wgFlaggedRevsRestrictionLevels = array( '', 'sysop' ); |
147 | | -# Set this to disable Stabilization and show the above restriction levels |
| 146 | +# Set this to use FlaggedRevs *only* as a protection-like mechanism. |
| 147 | +# This will disable Stabilization and show the above restriction levels |
148 | 148 | # on the protection form of pages. Each level has the stable version shown by default. |
149 | | -# A "none" level will appear in the forms as well, to restore the default settings. |
| 149 | +# A "none" level will appear in the form as well, to disable the review process. |
| 150 | +# Pages will only be reviewable if manually restricted to a level above "none". |
150 | 151 | # NOTE: The stable version precedence cannot be configured per page with this. |
151 | 152 | $wgFlaggedRevsProtection = false; |
152 | 153 | |
— | — | @@ -261,7 +262,7 @@ |
262 | 263 | # pointed to by the metadata of how the article was when it was reviewed. |
263 | 264 | # An example would be an article that selects a template based on time. |
264 | 265 | # The template to be selected will change, and the metadata only points |
265 | | -# to the reviewed revision ID of the old template. In such cases, we can s |
| 266 | +# to the reviewed revision ID of the old template. In such cases, we can |
266 | 267 | # select the current (unreviewed) revision. |
267 | 268 | $wgUseCurrentTemplates = true; |
268 | 269 | |
— | — | @@ -522,7 +523,7 @@ |
523 | 524 | function efSetFlaggedRevsConditionalHooks() { |
524 | 525 | global $wgHooks, $wgFlaggedRevsVisible; |
525 | 526 | # Mark items in user contribs |
526 | | - if ( !FlaggedRevs::stableOnlyIfConfigured() ) { |
| 527 | + if ( !FlaggedRevs::useOnlyIfStabilized() ) { |
527 | 528 | $wgHooks['ContribsPager::getQueryInfo'][] = 'FlaggedRevsHooks::addToContribsQuery'; |
528 | 529 | $wgHooks['ContributionsLineEnding'][] = 'FlaggedRevsHooks::addToContribsLine'; |
529 | 530 | } |
— | — | @@ -557,7 +558,7 @@ |
558 | 559 | } |
559 | 560 | /* TODO: decouple from rc patrol */ |
560 | 561 | # Check if FlaggedRevs is enabled by default for pages... |
561 | | - if ( $wgFlaggedRevsNamespaces && !FlaggedRevs::stableOnlyIfConfigured() ) { |
| 562 | + if ( $wgFlaggedRevsNamespaces && !FlaggedRevs::useOnlyIfStabilized() ) { |
562 | 563 | # Use RC Patrolling to check for vandalism. |
563 | 564 | # Edits to reviewable pages must be flagged to be patrolled. |
564 | 565 | $wgUseRCPatrol = true; |
— | — | @@ -574,7 +575,7 @@ |
575 | 576 | |
576 | 577 | function efSetFlaggedRevsConditionalAPIModules() { |
577 | 578 | global $wgAPIModules, $wgAPIListModules; |
578 | | - if ( FlaggedRevs::stableOnlyIfConfigured() ) { |
| 579 | + if ( FlaggedRevs::useOnlyIfStabilized() ) { |
579 | 580 | $wgAPIModules['stabilize'] = 'ApiStabilizeProtect'; |
580 | 581 | } else { |
581 | 582 | $wgAPIModules['stabilize'] = 'ApiStabilizeGeneral'; |
— | — | @@ -585,7 +586,7 @@ |
586 | 587 | |
587 | 588 | function efSetFlaggedRevsConditionalRights() { |
588 | 589 | global $wgGroupPermissions, $wgImplicitGroups, $wgFlaggedRevsAutoconfirm; |
589 | | - if ( FlaggedRevs::stableOnlyIfConfigured() ) { |
| 590 | + if ( FlaggedRevs::useOnlyIfStabilized() ) { |
590 | 591 | // Removes sp:ListGroupRights cruft |
591 | 592 | if ( isset( $wgGroupPermissions['editor'] ) ) { |
592 | 593 | unset( $wgGroupPermissions['editor']['unreviewedpages'] ); |
Index: trunk/extensions/FlaggedRevs/maintenance/updateStats.inc |
— | — | @@ -143,7 +143,7 @@ |
144 | 144 | $minTS = max($minTS,$installed); |
145 | 145 | # Get timestamp boundaries |
146 | 146 | $timeCondition = 'rev_timestamp BETWEEN '.$encMinTS.' AND '.$encMaxTS; |
147 | | - if ( FlaggedRevs::stableOnlyIfConfigured() ) { |
| 147 | + if ( FlaggedRevs::useOnlyIfStabilized() ) { |
148 | 148 | $mod = 1; // can't estimate $mod based on all edits in the range |
149 | 149 | } else { |
150 | 150 | # Modulus (to spread out over range) |
Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php |
— | — | @@ -262,7 +262,6 @@ |
263 | 263 | |
264 | 264 | 'flaggedrevs-protect-legend' => 'Automatic edit review ([[{{MediaWiki:Validationpage}}|help]])', |
265 | 265 | 'flaggedrevs-protect-none' => 'Allow all users', |
266 | | - 'flaggedrevs-protect-basic' => 'Default settings', |
267 | 266 | |
268 | 267 | 'revreview-locked-title' => 'Edits must be reviewed before being displayed to readers on this page.', |
269 | 268 | 'revreview-unlocked-title' => 'Edits do not require review before being displayed to readers on this page.', |
Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -243,7 +243,7 @@ |
244 | 244 | if ( !FlaggedRevs::inReviewNamespace( $this->getTitle() ) ) { |
245 | 245 | return false; |
246 | 246 | } |
247 | | - return !( FlaggedRevs::forDefaultVersionOnly() |
| 247 | + return !( FlaggedRevs::useOnlyIfStabilized() |
248 | 248 | && !$this->isStableShownByDefault( $flags ) ); |
249 | 249 | } |
250 | 250 | |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -173,34 +173,31 @@ |
174 | 174 | global $wgFlaggedRevsAutoReviewNew; |
175 | 175 | return (bool)$wgFlaggedRevsAutoReviewNew; |
176 | 176 | } |
177 | | - |
| 177 | + |
178 | 178 | /** |
179 | | - * Should this user see stable versions by default? |
| 179 | + * Is a "stable version" used as the default display |
| 180 | + * version for all pages in reviewable namespaces? |
180 | 181 | * @returns bool |
181 | 182 | */ |
182 | 183 | public static function isStableShownByDefault() { |
183 | 184 | global $wgFlaggedRevsOverride; |
| 185 | + if ( self::useOnlyIfStabilized() ) { |
| 186 | + return false; // must be configured per-page |
| 187 | + } |
184 | 188 | return (bool)$wgFlaggedRevsOverride; |
185 | 189 | } |
186 | 190 | |
187 | 191 | /** |
188 | | - * Does FlaggedRevs only show for pages were the stable version is the default? |
| 192 | + * Are pages reviewable only if they have been manually |
| 193 | + * configured by an admin to use a "stable version" as the default? |
189 | 194 | * @returns bool |
190 | 195 | */ |
191 | | - public static function forDefaultVersionOnly() { |
192 | | - global $wgFlaggedRevsReviewForDefault; |
193 | | - return (bool)$wgFlaggedRevsReviewForDefault; |
| 196 | + public static function useOnlyIfStabilized() { |
| 197 | + global $wgFlaggedRevsProtection; |
| 198 | + return (bool)$wgFlaggedRevsProtection; |
194 | 199 | } |
195 | 200 | |
196 | 201 | /** |
197 | | - * Does FlaggedRevs only show for pages that have been set to do so? |
198 | | - * @returns bool |
199 | | - */ |
200 | | - public static function stableOnlyIfConfigured() { |
201 | | - return self::forDefaultVersionOnly() && !self::isStableShownByDefault(); |
202 | | - } |
203 | | - |
204 | | - /** |
205 | 202 | * Return the include handling configuration |
206 | 203 | * @returns int |
207 | 204 | */ |
— | — | @@ -1133,7 +1130,7 @@ |
1134 | 1131 | // If FlaggedRevs got "turned off" for this page (due to not |
1135 | 1132 | // having the stable version as the default), then clear it |
1136 | 1133 | // from the tracking tables... |
1137 | | - if ( !$config['override'] && self::forDefaultVersionOnly() ) { |
| 1134 | + if ( !$config['override'] && self::useOnlyIfStabilized() ) { |
1138 | 1135 | $pagesClearTracking[] = $row->fpc_page_id; // no stable version |
1139 | 1136 | // Check if the new (default) config has a different way |
1140 | 1137 | // of selecting the stable version of this page... |
Index: trunk/extensions/FlaggedRevs/FlaggedRevision.php |
— | — | @@ -154,7 +154,7 @@ |
155 | 155 | if ( empty( $config ) ) { |
156 | 156 | $config = FlaggedRevs::getPageVisibilitySettings( $title, $flags ); |
157 | 157 | } |
158 | | - if ( !$config['override'] && FlaggedRevs::forDefaultVersionOnly() ) { |
| 158 | + if ( !$config['override'] && FlaggedRevs::useOnlyIfStabilized() ) { |
159 | 159 | return $row; // page is not reviewable; no stable version |
160 | 160 | } |
161 | 161 | $dbw = wfGetDB( DB_MASTER ); |
Index: trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php |
— | — | @@ -235,7 +235,7 @@ |
236 | 236 | $this->level = intval( $level ); |
237 | 237 | $this->showredirs = (bool)$redirs; |
238 | 238 | parent::__construct(); |
239 | | - // Don't get to expensive |
| 239 | + // Don't get too expensive |
240 | 240 | $this->mLimitsShown = array( 20, 50 ); |
241 | 241 | $this->mLimit = min( $this->mLimit, 50 ); |
242 | 242 | } |
Index: trunk/extensions/FlaggedRevs/specialpages/OldReviewedPages_body.php |
— | — | @@ -71,8 +71,7 @@ |
72 | 72 | '</span> ' |
73 | 73 | : "" |
74 | 74 | ) . |
75 | | - ( ( !FlaggedRevs::isStableShownByDefault() |
76 | | - && !FlaggedRevs::forDefaultVersionOnly() ) |
| 75 | + ( ( !FlaggedRevs::isStableShownByDefault() && !FlaggedRevs::useOnlyIfStabilized() ) |
77 | 76 | ? "<span style='white-space: nowrap;'>" . |
78 | 77 | Xml::check( 'stable', $this->stable, array( 'id' => 'wpStable' ) ) . |
79 | 78 | Xml::label( wfMsg( 'oldreviewed-stable' ), 'wpStable' ) . '</span> ' |
— | — | @@ -300,9 +299,9 @@ |
301 | 300 | $this->size = ( $size !== null ) ? intval( $size ) : null; |
302 | 301 | $this->watched = (bool)$watched; |
303 | 302 | $this->stable = $stable && !FlaggedRevs::isStableShownByDefault() |
304 | | - && !FlaggedRevs::forDefaultVersionOnly(); |
| 303 | + && !FlaggedRevs::useOnlyIfStabilized(); |
305 | 304 | parent::__construct(); |
306 | | - // Don't get to expensive |
| 305 | + // Don't get too expensive |
307 | 306 | $this->mLimitsShown = array( 20, 50, 100 ); |
308 | 307 | $this->mLimit = min( $this->mLimit, 100 ); |
309 | 308 | } |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | if ( $wgUseTagFilter && ChangeTags::listDefinedTags() ) { |
26 | 26 | $list['ProblemChanges'] = $wgSpecialPages['ProblemChanges'] = 'ProblemChanges'; |
27 | 27 | } |
28 | | - if ( !FlaggedRevs::stableOnlyIfConfigured() ) { |
| 28 | + if ( !FlaggedRevs::useOnlyIfStabilized() ) { |
29 | 29 | $list['ReviewedPages'] = $wgSpecialPages['ReviewedPages'] = 'ReviewedPages'; |
30 | 30 | $list['UnreviewedPages'] = $wgSpecialPages['UnreviewedPages'] = 'UnreviewedPages'; |
31 | 31 | } |
— | — | @@ -1930,7 +1930,7 @@ |
1931 | 1931 | if ( $rc->mAttribs['fp_stable'] == null ) { |
1932 | 1932 | // Is this a config were pages start off reviewable? |
1933 | 1933 | // Hide notice from non-reviewers due to vandalism concerns (bug 24002). |
1934 | | - if ( !FlaggedRevs::stableOnlyIfConfigured() && $wgUser->isAllowed( 'review' ) ) { |
| 1934 | + if ( !FlaggedRevs::useOnlyIfStabilized() && $wgUser->isAllowed( 'review' ) ) { |
1935 | 1935 | $rlink = wfMsgHtml( 'revreview-unreviewedpage' ); |
1936 | 1936 | $css = 'flaggedrevs-unreviewed'; |
1937 | 1937 | } |
— | — | @@ -2085,9 +2085,7 @@ |
2086 | 2086 | $output .= Xml::openElement( 'select', $attribs ); |
2087 | 2087 | foreach ( $effectiveLevels as $limit ) { |
2088 | 2088 | if ( $limit == 'none' ) { |
2089 | | - $label = FlaggedRevs::stableOnlyIfConfigured() |
2090 | | - ? wfMsg( 'flaggedrevs-protect-none' ) |
2091 | | - : wfMsg( 'flaggedrevs-protect-basic' ); |
| 2089 | + $label = wfMsg( 'flaggedrevs-protect-none' ); |
2092 | 2090 | } else { |
2093 | 2091 | $label = wfMsg( 'flaggedrevs-protect-' . $limit ); |
2094 | 2092 | } |
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -654,11 +654,11 @@ |
655 | 655 | } |
656 | 656 | return ''; |
657 | 657 | } |
658 | | - |
| 658 | + |
659 | 659 | // Show icons for draft/stable/old reviewed versions |
660 | 660 | protected function showRatingIcon() { |
661 | | - if ( FlaggedRevs::forDefaultVersionOnly() ) { |
662 | | - // If there is only on quality level and we have tabs to know |
| 661 | + if ( FlaggedRevs::useOnlyIfStabilized() ) { |
| 662 | + // If there is only one quality level and we have tabs to know |
663 | 663 | // which version we are looking at, then just use the lock icon... |
664 | 664 | return FlaggedRevs::qualityVersions(); |
665 | 665 | } |
— | — | @@ -974,7 +974,7 @@ |
975 | 975 | if ( !$wgUser->isAllowed( 'review' ) ) { |
976 | 976 | return true; |
977 | 977 | } |
978 | | - if ( !FlaggedRevs::stableOnlyIfConfigured() ) { |
| 978 | + if ( !FlaggedRevs::useOnlyIfStabilized() ) { |
979 | 979 | $links = array(); |
980 | 980 | $category = $this->article->getTitle()->getText(); |
981 | 981 | # Add link to list of unreviewed pages in this category |