Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -127,15 +127,13 @@ |
128 | 128 | |
129 | 129 | # When setting up new dimensions or levels, you will need to add some |
130 | 130 | # MediaWiki messages for the UI to show properly; any sysop can do this. |
131 | | -# Define the tags we can use to rate an article, and set the minimum level |
132 | | -# to have it become a "quality" or "pristine" version. |
| 131 | +# Define the tags we can use to rate an article, number of levels, |
| 132 | +# and set the minimum level to have it become a "quality" or "pristine" version. |
133 | 133 | $wgFlaggedRevTags = array( |
134 | | - 'accuracy' => array( 'quality' => 2, 'pristine' => 4 ), |
135 | | - 'depth' => array( 'quality' => 1, 'pristine' => 4 ), |
136 | | - 'style' => array( 'quality' => 1, 'pristine' => 4 ), |
| 134 | + 'accuracy' => array( 'levels' => 3, 'quality' => 2, 'pristine' => 4 ), |
| 135 | + 'depth' => array( 'levels' => 3, 'quality' => 1, 'pristine' => 4 ), |
| 136 | + 'style' => array( 'levels' => 3, 'quality' => 1, 'pristine' => 4 ), |
137 | 137 | ); |
138 | | -# How high can we rate these revisions? |
139 | | -$wgFlaggedRevValues = 3; |
140 | 138 | # Who can set what flags to what level? (use -1 or 0 for not at all) |
141 | 139 | # This maps rights to the highest reviewable level for each tag. |
142 | 140 | # Users cannot lower tags from a level they can't set |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | protected static $includeVersionCache = array(); |
14 | 14 | |
15 | 15 | public static function load() { |
16 | | - global $wgFlaggedRevTags, $wgFlaggedRevValues, $wgFlaggedRevsFeedbackTags; |
| 16 | + global $wgFlaggedRevTags, $wgFlaggedRevsFeedbackTags; |
17 | 17 | if( self::$loaded ) return true; |
18 | 18 | # Assume true, then set to false if needed |
19 | 19 | if( !empty($wgFlaggedRevTags) ) { |
— | — | @@ -25,30 +25,32 @@ |
26 | 26 | if( !preg_match('/^[a-zA-Z]{1,20}$/',$tag) || $safeTag !== $tag ) { |
27 | 27 | throw new MWException( 'FlaggedRevs given invalid tag name!' ); |
28 | 28 | } |
29 | | - # Set FlaggedRevs tags |
30 | | - self::$dimensions[$tag] = array(); |
31 | | - for( $i=0; $i <= $wgFlaggedRevValues; $i++ ) { |
32 | | - self::$dimensions[$tag][$i] = "{$tag}-{$i}"; |
33 | | - } |
34 | 29 | # Define "quality" and "pristine" reqs |
35 | 30 | if( is_array($levels) ) { |
36 | 31 | $minQL = $levels['quality']; |
37 | 32 | $minPL = $levels['pristine']; |
38 | | - # B/C, $levels is just an integer |
| 33 | + $ratingLevels = $levels['levels']; |
| 34 | + # B/C, $levels is just an integer (minQL) |
39 | 35 | } else { |
40 | | - global $wgFlaggedRevPristine; |
| 36 | + global $wgFlaggedRevPristine, $wgFlaggedRevValues; |
41 | 37 | $minQL = $levels; |
42 | 38 | $minPL = isset($wgFlaggedRevPristine) ? $wgFlaggedRevPristine : $wgFlaggedRevValues+1; |
| 39 | + $ratingLevels = isset($wgFlaggedRevValues) ? $wgFlaggedRevValues : 1; |
43 | 40 | } |
| 41 | + # Set FlaggedRevs tags |
| 42 | + self::$dimensions[$tag] = array(); |
| 43 | + for( $i=0; $i <= $ratingLevels; $i++ ) { |
| 44 | + self::$dimensions[$tag][$i] = "{$tag}-{$i}"; |
| 45 | + } |
44 | 46 | # Sanity checks |
45 | 47 | if( !is_integer($minQL) || !is_integer($minPL) ) { |
46 | 48 | throw new MWException( 'FlaggedRevs given invalid tag value!' ); |
47 | 49 | } |
48 | | - if( $minQL > $wgFlaggedRevValues ) { |
| 50 | + if( $minQL > $ratingLevels ) { |
49 | 51 | self::$qualityVersions = false; |
50 | 52 | self::$pristineVersions = false; |
51 | 53 | } |
52 | | - if( $minPL > $wgFlaggedRevValues ) { |
| 54 | + if( $minPL > $ratingLevels ) { |
53 | 55 | self::$pristineVersions = false; |
54 | 56 | } |
55 | 57 | self::$minQL[$tag] = $minQL; |