r56308 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56307‎ | r56308 | r56309 >
Date:15:29, 14 September 2009
Author:aaron
Status:ok
Tags:
Comment:
* Removed unused function (useless since preference brange merge)
* Moved non-config option out of config area
* Doc cleanups
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsXML.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -182,10 +182,6 @@
183183 # Implicit autoreview group
184184 $wgGroupPermissions['autoreview']['autoreview'] = true;
185185
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 -
190186 # Define when users get automatically promoted to Editors. Set as false to disable.
191187 # 'spacing' and 'benchmarks' require edits to be spread out. Users must have X (benchmark)
192188 # edits Y (spacing) days apart.
@@ -269,6 +265,10 @@
270266 # End of configuration variables.
271267 #########
272268
 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+
273273 # Lets some users access the review UI and set some flags
274274 $wgAvailableRights[] = 'review';
275275 $wgAvailableRights[] = 'validate'; # Let some users set higher settings
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php
@@ -46,6 +46,7 @@
4747 * @param int $selected, selected level
4848 * @param string $all, all selector msg?
4949 * @param int $max max level?
 50+ * @returns string
5051 */
5152 public static function getLevelMenu( $selected=null, $all='revreview-filter-all', $max=2 ) {
5253 wfLoadExtensionMessages( 'FlaggedRevs' );
@@ -62,7 +63,12 @@
6364 $s .= Xml::closeElement('select')."\n";
6465 return $s;
6566 }
66 -
 67+
 68+ /**
 69+ * Get a radio options of available precendents
 70+ * @param int $selected, selected level
 71+ * @returns string
 72+ */
6773 public static function getPrecedenceMenu( $selected=null ) {
6874 wfLoadExtensionMessages( 'FlaggedRevs' );
6975 $s = Xml::openElement( 'select', array('name' => 'precedence','id' => 'wpPrecedence') );
@@ -78,6 +84,7 @@
7985 /**
8086 * Get a selector of "approved"/"unapproved"
8187 * @param int $selected, selected level
 88+ * @returns string
8289 */
8390 public static function getStatusFilterMenu( $selected=null ) {
8491 wfLoadExtensionMessages( 'FlaggedRevs' );
@@ -94,6 +101,7 @@
95102 /**
96103 * Get a selector of "auto"/"manual"
97104 * @param int $selected, selected level
 105+ * @returns string
98106 */
99107 public static function getAutoFilterMenu( $selected=null ) {
100108 wfLoadExtensionMessages( 'FlaggedRevs' );
@@ -108,7 +116,7 @@
109117
110118 /**
111119 * @param int $quality
112 - * @return string, css color for this quality
 120+ * @returns string, css color for this quality
113121 */
114122 public static function getQualityColor( $quality ) {
115123 if( $quality === false )
@@ -131,7 +139,7 @@
132140 * @param array $flags
133141 * @param bool $prettybox
134142 * @param string $css, class to wrap box in
135 - * @return string
 143+ * @returns string
136144 * Generates a review box/tag
137145 */
138146 public static function addTagRatings( $flags, $prettyBox = false, $css='' ) {
@@ -145,13 +153,13 @@
146154 $encValueText = wfMsgHtml("revreview-$quality-$level");
147155 $level = $flags[$quality];
148156 $minlevel = FlaggedRevs::getMinQL( $quality );
149 - if( $level >= $minlevel )
 157+ if( $level >= $minlevel ) {
150158 $classmarker = 2;
151 - elseif( $level > 0 )
 159+ } elseif( $level > 0 ) {
152160 $classmarker = 1;
153 - else
 161+ } else {
154162 $classmarker = 0;
155 -
 163+ }
156164 $levelmarker = $level * 20 + 20;
157165 if( $prettyBox ) {
158166 $tag .= "<tr><td class='fr-text' valign='middle'>" . wfMsgHtml("revreview-$quality") .
@@ -177,7 +185,7 @@
178186 * @param bool $stable, are we referring to the stable revision?
179187 * @param bool $synced, does stable=current and this is one of them?
180188 * @param bool $old, is this an old stable version?
181 - * @return string
 189+ * @returns string
182190 * Generates a review box using a table using FlaggedRevsXML::addTagRatings()
183191 */
184192 public static function prettyRatingBox( $frev, $shtml, $revsSince, $stable=true, $synced=false, $old=false ) {
@@ -226,7 +234,6 @@
227235 $box .= self::addTagRatings( $flags, true, $color );
228236 }
229237 $box .= "</td><td></td></tr></table>";
230 -
231238 return $box;
232239 }
233240
@@ -236,45 +243,4 @@
237244 " onclick='toggleRevRatings()' title='" . wfMsgHtml('revreview-toggle-title') . "' >" .
238245 wfMsg( 'revreview-toggle' ) . "</a>";
239246 }
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 - }
281247 }

Status & tagging log