Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -182,10 +182,6 @@ |
183 | 183 | # Implicit autoreview group |
184 | 184 | $wgGroupPermissions['autoreview']['autoreview'] = true; |
185 | 185 | |
186 | | -# Bots are granted autoreview via hooks, mark in rights |
187 | | -# array so that it shows up in sp:ListGroupRights... |
188 | | -$wgGroupPermissions['bot']['autoreview'] = true; |
189 | | - |
190 | 186 | # Define when users get automatically promoted to Editors. Set as false to disable. |
191 | 187 | # 'spacing' and 'benchmarks' require edits to be spread out. Users must have X (benchmark) |
192 | 188 | # edits Y (spacing) days apart. |
— | — | @@ -269,6 +265,10 @@ |
270 | 266 | # End of configuration variables. |
271 | 267 | ######### |
272 | 268 | |
| 269 | +# Bots are granted autoreview via hooks, mark in rights |
| 270 | +# array so that it shows up in sp:ListGroupRights... |
| 271 | +$wgGroupPermissions['bot']['autoreview'] = true; |
| 272 | + |
273 | 273 | # Lets some users access the review UI and set some flags |
274 | 274 | $wgAvailableRights[] = 'review'; |
275 | 275 | $wgAvailableRights[] = 'validate'; # Let some users set higher settings |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php |
— | — | @@ -46,6 +46,7 @@ |
47 | 47 | * @param int $selected, selected level |
48 | 48 | * @param string $all, all selector msg? |
49 | 49 | * @param int $max max level? |
| 50 | + * @returns string |
50 | 51 | */ |
51 | 52 | public static function getLevelMenu( $selected=null, $all='revreview-filter-all', $max=2 ) { |
52 | 53 | wfLoadExtensionMessages( 'FlaggedRevs' ); |
— | — | @@ -62,7 +63,12 @@ |
63 | 64 | $s .= Xml::closeElement('select')."\n"; |
64 | 65 | return $s; |
65 | 66 | } |
66 | | - |
| 67 | + |
| 68 | + /** |
| 69 | + * Get a radio options of available precendents |
| 70 | + * @param int $selected, selected level |
| 71 | + * @returns string |
| 72 | + */ |
67 | 73 | public static function getPrecedenceMenu( $selected=null ) { |
68 | 74 | wfLoadExtensionMessages( 'FlaggedRevs' ); |
69 | 75 | $s = Xml::openElement( 'select', array('name' => 'precedence','id' => 'wpPrecedence') ); |
— | — | @@ -78,6 +84,7 @@ |
79 | 85 | /** |
80 | 86 | * Get a selector of "approved"/"unapproved" |
81 | 87 | * @param int $selected, selected level |
| 88 | + * @returns string |
82 | 89 | */ |
83 | 90 | public static function getStatusFilterMenu( $selected=null ) { |
84 | 91 | wfLoadExtensionMessages( 'FlaggedRevs' ); |
— | — | @@ -94,6 +101,7 @@ |
95 | 102 | /** |
96 | 103 | * Get a selector of "auto"/"manual" |
97 | 104 | * @param int $selected, selected level |
| 105 | + * @returns string |
98 | 106 | */ |
99 | 107 | public static function getAutoFilterMenu( $selected=null ) { |
100 | 108 | wfLoadExtensionMessages( 'FlaggedRevs' ); |
— | — | @@ -108,7 +116,7 @@ |
109 | 117 | |
110 | 118 | /** |
111 | 119 | * @param int $quality |
112 | | - * @return string, css color for this quality |
| 120 | + * @returns string, css color for this quality |
113 | 121 | */ |
114 | 122 | public static function getQualityColor( $quality ) { |
115 | 123 | if( $quality === false ) |
— | — | @@ -131,7 +139,7 @@ |
132 | 140 | * @param array $flags |
133 | 141 | * @param bool $prettybox |
134 | 142 | * @param string $css, class to wrap box in |
135 | | - * @return string |
| 143 | + * @returns string |
136 | 144 | * Generates a review box/tag |
137 | 145 | */ |
138 | 146 | public static function addTagRatings( $flags, $prettyBox = false, $css='' ) { |
— | — | @@ -145,13 +153,13 @@ |
146 | 154 | $encValueText = wfMsgHtml("revreview-$quality-$level"); |
147 | 155 | $level = $flags[$quality]; |
148 | 156 | $minlevel = FlaggedRevs::getMinQL( $quality ); |
149 | | - if( $level >= $minlevel ) |
| 157 | + if( $level >= $minlevel ) { |
150 | 158 | $classmarker = 2; |
151 | | - elseif( $level > 0 ) |
| 159 | + } elseif( $level > 0 ) { |
152 | 160 | $classmarker = 1; |
153 | | - else |
| 161 | + } else { |
154 | 162 | $classmarker = 0; |
155 | | - |
| 163 | + } |
156 | 164 | $levelmarker = $level * 20 + 20; |
157 | 165 | if( $prettyBox ) { |
158 | 166 | $tag .= "<tr><td class='fr-text' valign='middle'>" . wfMsgHtml("revreview-$quality") . |
— | — | @@ -177,7 +185,7 @@ |
178 | 186 | * @param bool $stable, are we referring to the stable revision? |
179 | 187 | * @param bool $synced, does stable=current and this is one of them? |
180 | 188 | * @param bool $old, is this an old stable version? |
181 | | - * @return string |
| 189 | + * @returns string |
182 | 190 | * Generates a review box using a table using FlaggedRevsXML::addTagRatings() |
183 | 191 | */ |
184 | 192 | public static function prettyRatingBox( $frev, $shtml, $revsSince, $stable=true, $synced=false, $old=false ) { |
— | — | @@ -226,7 +234,6 @@ |
227 | 235 | $box .= self::addTagRatings( $flags, true, $color ); |
228 | 236 | } |
229 | 237 | $box .= "</td><td></td></tr></table>"; |
230 | | - |
231 | 238 | return $box; |
232 | 239 | } |
233 | 240 | |
— | — | @@ -236,45 +243,4 @@ |
237 | 244 | " onclick='toggleRevRatings()' title='" . wfMsgHtml('revreview-toggle-title') . "' >" . |
238 | 245 | wfMsg( 'revreview-toggle' ) . "</a>"; |
239 | 246 | } |
240 | | - |
241 | | - /** |
242 | | - * Add user preference to form HTML |
243 | | - */ |
244 | | - public static function stabilityPreferences( $form ) { |
245 | | - global $wgUser; |
246 | | - wfLoadExtensionMessages( 'FlaggedRevs' ); |
247 | | - $html = Xml::openElement( 'fieldset' ) . |
248 | | - Xml::element( 'legend', null, wfMsgHtml('flaggedrevs-prefs') ) . |
249 | | - Xml::openElement( 'table' ) . |
250 | | - Xml::openElement( 'tr' ) . |
251 | | - '<td>' . Xml::check( 'wpFlaggedRevsStable', $form->mFlaggedRevsStable, |
252 | | - array('id' => 'wpFlaggedRevsStable') ) . '</td><td> ' . |
253 | | - Xml::label( wfMsg( 'flaggedrevs-prefs-stable' ), 'wpFlaggedRevsStable' ) . '</td>' . |
254 | | - Xml::closeElement( 'tr' ) . |
255 | | - Xml::openElement( 'tr' ) . |
256 | | - '<td>' . |
257 | | - Xml::radio( 'wpFlaggedRevsSUI', 0, $form->mFlaggedRevsSUI==0, array('id' => 'standardUI') ) . |
258 | | - '</td><td> ' . |
259 | | - Xml::label( wfMsgHtml('flaggedrevs-pref-UI-0'), 'standardUI' ) . |
260 | | - '</td>' . |
261 | | - Xml::closeElement( 'tr' ) . |
262 | | - Xml::openElement( 'tr' ) . |
263 | | - '<td>' . |
264 | | - Xml::radio( 'wpFlaggedRevsSUI', 1, $form->mFlaggedRevsSUI==1, array('id' => 'simpleUI') ) . |
265 | | - '</td><td> ' . |
266 | | - Xml::label( wfMsgHtml('flaggedrevs-pref-UI-1'), 'simpleUI' ) . |
267 | | - '</td>'; |
268 | | - if( $wgUser->isAllowed( 'review' ) ) { |
269 | | - $html .= Xml::closeElement( 'tr' ) . |
270 | | - Xml::openElement( 'tr' ) . '<td><br/></td>' . Xml::closeElement( 'tr' ) . |
271 | | - Xml::openElement( 'tr' ) . |
272 | | - '<td>' . Xml::check( 'wpFlaggedRevsWatch', $form->mFlaggedRevsWatch, array('id' => 'wpFlaggedRevsWatch') ) . |
273 | | - '</td><td> ' . Xml::label( wfMsg( 'flaggedrevs-prefs-watch' ), 'wpFlaggedRevsWatch' ) . '</td>'; |
274 | | - } |
275 | | - $html .= Xml::closeElement( 'tr' ) . |
276 | | - Xml::closeElement( 'table' ) . |
277 | | - Xml::closeElement( 'fieldset' ); |
278 | | - |
279 | | - return $html; |
280 | | - } |
281 | 247 | } |