Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php |
— | — | @@ -210,8 +210,9 @@ |
211 | 211 | 'tooltip-ca-stable' => 'View the stable version of this page', |
212 | 212 | 'tooltip-ca-default' => 'Quality assurance settings', |
213 | 213 | |
214 | | - 'flaggedrevs-protect-legend' => 'Edit approval', |
215 | | - 'flaggedrevs-protect-none' => 'No additional restrictions', |
| 214 | + 'flaggedrevs-protect-legend' => 'Publish edits', |
| 215 | + 'flaggedrevs-protect-none' => 'Allow all users', |
| 216 | + 'flaggedrevs-protect-basic' => 'Default settings', |
216 | 217 | |
217 | 218 | 'revreview-locked-title' => 'Edits must be reviewed before being displayed on this page.', |
218 | 219 | 'revreview-unlocked-title' => 'Edits do not require review before being displayed on this page.', |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -186,13 +186,21 @@ |
187 | 187 | } |
188 | 188 | |
189 | 189 | /** |
190 | | - * Does the review form only show for pages were the stable version is the default? |
| 190 | + * Does FlaggedRevs only show for pages were the stable version is the default? |
191 | 191 | * @returns bool |
192 | 192 | */ |
193 | 193 | public static function forDefaultVersionOnly() { |
194 | 194 | global $wgFlaggedRevsReviewForDefault; |
195 | 195 | return (bool)$wgFlaggedRevsReviewForDefault; |
196 | 196 | } |
| 197 | + |
| 198 | + /** |
| 199 | + * Does FLaggedRevs only show for pages that have been set to do so? |
| 200 | + * @returns bool |
| 201 | + */ |
| 202 | + public static function stableOnlyIfConfigured() { |
| 203 | + return self::forDefaultVersionOnly() && !self::showStableByDefault(); |
| 204 | + } |
197 | 205 | |
198 | 206 | /** |
199 | 207 | * Should this user ignore the site and page default version settings? |
— | — | @@ -1503,7 +1511,7 @@ |
1504 | 1512 | } |
1505 | 1513 | |
1506 | 1514 | /** |
1507 | | - * Get JS script params for onloading |
| 1515 | + * Get JS script params |
1508 | 1516 | */ |
1509 | 1517 | public static function getJSTagParams() { |
1510 | 1518 | self::load(); |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -1889,21 +1889,32 @@ |
1890 | 1890 | $output .= "<tr><td>"; |
1891 | 1891 | $output .= Xml::openElement( 'fieldset' ); |
1892 | 1892 | $output .= Xml::element( 'legend', null, wfMsg('flaggedrevs-protect-legend') ); |
1893 | | - $output .= "<table>"; |
1894 | 1893 | # Add a "no restrictions" level |
1895 | 1894 | $effectiveLevels = array( "none" => null ); |
1896 | 1895 | $effectiveLevels += FlaggedRevs::getProtectionLevels(); |
1897 | | - # Show all restriction levels as radios... |
| 1896 | + |
| 1897 | + $attribs = array( |
| 1898 | + 'id' => 'mwStabilityConfig', |
| 1899 | + 'name' => 'mwStabilityConfig', |
| 1900 | + 'size' => count( $effectiveLevels ), |
| 1901 | + ) + $disabledAttrib; |
| 1902 | + $output .= Xml::openElement( 'select', $attribs ); |
| 1903 | + # Show all restriction levels in a select... |
1898 | 1904 | foreach( $effectiveLevels as $level => $x ) { |
1899 | | - $label = wfMsg( 'flaggedrevs-protect-'.$level ); |
| 1905 | + if( $level == 'none' ) { |
| 1906 | + $label = FlaggedRevs::stableOnlyIfConfigured() |
| 1907 | + ? wfMsg( 'flaggedrevs-protect-none' ) |
| 1908 | + : wfMsg( 'flaggedrevs-protect-basic' ); |
| 1909 | + } else { |
| 1910 | + $label = wfMsg( 'flaggedrevs-protect-'.$level ); |
| 1911 | + } |
1900 | 1912 | // Default to the key itself if no UI message |
1901 | 1913 | if( wfEmptyMsg('flaggedrevs-protect-'.$level,$label) ) { |
1902 | 1914 | $label = 'flaggedrevs-protect-'.$level; |
1903 | 1915 | } |
1904 | | - $output .= "<tr><td>" . Xml::radioLabel( $label, 'wpStabilityConfig', $level, |
1905 | | - 'wpStabilityConfig-'.$level, $level == $selected, $disabledAttrib ) . "</td></tr>"; |
| 1916 | + $output .= Xml::option( $label, $level, $level == $selected ); |
1906 | 1917 | } |
1907 | | - $output .= "</table>"; |
| 1918 | + $output .= Xml::closeElement( 'select' ); |
1908 | 1919 | # Get expiry dropdown |
1909 | 1920 | $scExpiryOptions = wfMsgForContent( 'protect-expiry-options' ); |
1910 | 1921 | $showProtectOptions = ($scExpiryOptions !== '-' && $isAllowed); |
— | — | @@ -2013,10 +2024,10 @@ |
2014 | 2025 | $form->expiry = $wgRequest->getText( 'mwStabilize-expiry' ); # Expiry |
2015 | 2026 | $form->expirySelection = $wgRequest->getVal( 'wpExpirySelection' ); # Expiry dropdown |
2016 | 2027 | # Fill in config from the protection level... |
2017 | | - $selected = $wgRequest->getVal( 'wpStabilityConfig' ); |
| 2028 | + $selected = $wgRequest->getVal( 'mwStabilityConfig' ); |
2018 | 2029 | if( $selected == "none" ) { |
2019 | 2030 | $form->select = FlaggedRevs::getPrecedence(); // default |
2020 | | - $form->override = FlaggedRevs::showStableByDefault(); // default |
| 2031 | + $form->override = (int)FlaggedRevs::showStableByDefault(); // default |
2021 | 2032 | $form->autoreview = ''; // default |
2022 | 2033 | } else if( isset($levels[$selected]) ) { |
2023 | 2034 | $form->select = $levels[$selected]['select']; |