r90034 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90033‎ | r90034 | r90035 >
Date:04:14, 14 June 2011
Author:aaron
Status:ok
Tags:
Comment:
Generalized flaggedrevsstable to a radio option with the added option of "always show draft". This was the one step getting in the way of deprecating $wgFlaggedRevsExceptions (see http://www.mediawiki.org/wiki/Pending_Changes_enwiki_trial/NovemberReleaseDesignChanges#The_Problem).
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsDefines.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/FlaggedPageView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/language/FlaggedRevs.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -359,7 +359,7 @@
360360
361361 # New user preferences
362362 $wgDefaultUserOptions['flaggedrevssimpleui'] = (int)$wgSimpleFlaggedRevsUI;
363 -$wgDefaultUserOptions['flaggedrevsstable'] = false;
 363+$wgDefaultUserOptions['flaggedrevsstable'] = FR_SHOW_STABLE_DEFAULT;
364364 $wgDefaultUserOptions['flaggedrevseditdiffs'] = true;
365365 $wgDefaultUserOptions['flaggedrevsviewdiffs'] = false;
366366
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php
@@ -151,9 +151,14 @@
152152 // Default versions...
153153 $preferences['flaggedrevsstable'] =
154154 array(
155 - 'type' => 'toggle',
 155+ 'type' => 'radio',
156156 'section' => 'flaggedrevs/flaggedrevs-ui',
157157 'label-message' => 'flaggedrevs-prefs-stable',
 158+ 'options' => array(
 159+ wfMsg( 'flaggedrevs-pref-stable-0' ) => FR_SHOW_STABLE_DEFAULT,
 160+ wfMsg( 'flaggedrevs-pref-stable-1' ) => FR_SHOW_STABLE_ALWAYS,
 161+ wfMsg( 'flaggedrevs-pref-stable-2' ) => FR_SHOW_STABLE_NEVER,
 162+ ),
158163 );
159164 // Review-related rights...
160165 if ( $user->isAllowed( 'review' ) ) {
Index: trunk/extensions/FlaggedRevs/presentation/language/FlaggedRevs.i18n.php
@@ -28,7 +28,10 @@
2929 'flaggedrevs-stable-categories' => '', # A asterix separated list of categories that must be reviewed; do not translate or duplicate this message to other languages
3030 'prefs-flaggedrevs' => 'Edit review',
3131 'prefs-flaggedrevs-ui' => 'Edit review',
32 - 'flaggedrevs-prefs-stable' => 'Always show the stable version of content pages by default (if there is one)',
 32+ 'flaggedrevs-prefs-stable' => 'When to show the stable version of content pages by default',
 33+ 'flaggedrevs-pref-stable-0' => 'Use the default settings for each pages',
 34+ 'flaggedrevs-pref-stable-1' => 'Always show the stable version (if there is one)',
 35+ 'flaggedrevs-pref-stable-2' => 'Always show the latest version',
3336 'flaggedrevs-prefs-watch' => 'Add pages I review to my watchlist',
3437 'flaggedrevs-prefs-editdiffs' => 'Show the pending changes diff when editing pages',
3538 'flaggedrevs-prefs-viewdiffs' => 'Show the pending changes diff when viewing the latest pending revision',
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedPageView.php
@@ -85,8 +85,11 @@
8686 return false;
8787 }
8888 # Check user preferences ("show stable by default?")
89 - if ( $wgUser->getOption( 'flaggedrevsstable' ) ) {
 89+ $pref = (int)$wgUser->getOption( 'flaggedrevsstable' );
 90+ if ( $pref == FR_SHOW_STABLE_ALWAYS ) {
9091 return true;
 92+ } elseif ( $pref == FR_SHOW_STABLE_NEVER ) {
 93+ return false;
9194 }
9295 # Viewer may be in a group that sees the draft by default
9396 if ( $this->userViewsDraftByDefault( $wgUser ) ) {
Index: trunk/extensions/FlaggedRevs/FlaggedRevsDefines.php
@@ -23,6 +23,11 @@
2424 define( 'FR_AUTOREVIEW_CREATION', 2 );
2525 define( 'FR_AUTOREVIEW_CREATION_AND_CHANGES', FR_AUTOREVIEW_CHANGES | FR_AUTOREVIEW_CREATION );
2626
 27+# User preference for showing stable versions
 28+define( 'FR_SHOW_STABLE_DEFAULT', 0 ); // b/c with "false"
 29+define( 'FR_SHOW_STABLE_ALWAYS', 1 ); // b/c with "true"
 30+define( 'FR_SHOW_STABLE_NEVER', 2 );
 31+
2732 # Autopromote conds (F=70,R=82)
2833 # @TODO: move these 5 to core
2934 define( 'APCOND_FR_EDITSUMMARYCOUNT', 70821 );

Status & tagging log