Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -359,7 +359,7 @@ |
360 | 360 | |
361 | 361 | # New user preferences |
362 | 362 | $wgDefaultUserOptions['flaggedrevssimpleui'] = (int)$wgSimpleFlaggedRevsUI; |
363 | | -$wgDefaultUserOptions['flaggedrevsstable'] = false; |
| 363 | +$wgDefaultUserOptions['flaggedrevsstable'] = FR_SHOW_STABLE_DEFAULT; |
364 | 364 | $wgDefaultUserOptions['flaggedrevseditdiffs'] = true; |
365 | 365 | $wgDefaultUserOptions['flaggedrevsviewdiffs'] = false; |
366 | 366 | |
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php |
— | — | @@ -151,9 +151,14 @@ |
152 | 152 | // Default versions... |
153 | 153 | $preferences['flaggedrevsstable'] = |
154 | 154 | array( |
155 | | - 'type' => 'toggle', |
| 155 | + 'type' => 'radio', |
156 | 156 | 'section' => 'flaggedrevs/flaggedrevs-ui', |
157 | 157 | '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 | + ), |
158 | 163 | ); |
159 | 164 | // Review-related rights... |
160 | 165 | if ( $user->isAllowed( 'review' ) ) { |
Index: trunk/extensions/FlaggedRevs/presentation/language/FlaggedRevs.i18n.php |
— | — | @@ -28,7 +28,10 @@ |
29 | 29 | 'flaggedrevs-stable-categories' => '', # A asterix separated list of categories that must be reviewed; do not translate or duplicate this message to other languages |
30 | 30 | 'prefs-flaggedrevs' => 'Edit review', |
31 | 31 | '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', |
33 | 36 | 'flaggedrevs-prefs-watch' => 'Add pages I review to my watchlist', |
34 | 37 | 'flaggedrevs-prefs-editdiffs' => 'Show the pending changes diff when editing pages', |
35 | 38 | '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 @@ |
86 | 86 | return false; |
87 | 87 | } |
88 | 88 | # 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 ) { |
90 | 91 | return true; |
| 92 | + } elseif ( $pref == FR_SHOW_STABLE_NEVER ) { |
| 93 | + return false; |
91 | 94 | } |
92 | 95 | # Viewer may be in a group that sees the draft by default |
93 | 96 | if ( $this->userViewsDraftByDefault( $wgUser ) ) { |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsDefines.php |
— | — | @@ -23,6 +23,11 @@ |
24 | 24 | define( 'FR_AUTOREVIEW_CREATION', 2 ); |
25 | 25 | define( 'FR_AUTOREVIEW_CREATION_AND_CHANGES', FR_AUTOREVIEW_CHANGES | FR_AUTOREVIEW_CREATION ); |
26 | 26 | |
| 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 | + |
27 | 32 | # Autopromote conds (F=70,R=82) |
28 | 33 | # @TODO: move these 5 to core |
29 | 34 | define( 'APCOND_FR_EDITSUMMARYCOUNT', 70821 ); |