r99297 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99296‎ | r99297 | r99298 >
Date:03:06, 8 October 2011
Author:aaron
Status:ok
Tags:
Comment:
Unclobber some whitespace (for viewvc at least)
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.config.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/business/FRGenericSubmitForm.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/business/PageStabilityForm.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/business/RevisionReviewForm.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/FlaggablePageView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/FlaggedRevsLogView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/FlaggedRevsXML.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/RevisionReviewFormUI.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.config.php
@@ -26,22 +26,22 @@
2727
2828 # Auto-review settings for edits/new pages:
2929 # FR_AUTOREVIEW_NONE
30 -# Don't auto-review any edits or new pages
 30+# Don't auto-review any edits or new pages
3131 # FR_AUTOREVIEW_CHANGES
32 -# Auto-review the following types of edits (to existing pages):
33 -# (a) changes directly to the stable version by users with 'autoreview'/'bot'
34 -# (b) reversions to old reviewed versions by users with 'autoreview'/'bot'
35 -# (c) self-reversions back to the stable version by any user
 32+# Auto-review the following types of edits (to existing pages):
 33+# (a) changes directly to the stable version by users with 'autoreview'/'bot'
 34+# (b) reversions to old reviewed versions by users with 'autoreview'/'bot'
 35+# (c) self-reversions back to the stable version by any user
3636 # FR_AUTOREVIEW_CREATION
37 -# Auto-review new pages as minimally "checked"
 37+# Auto-review new pages as minimally "checked"
3838 # FR_AUTOREVIEW_CREATION_AND_CHANGES
39 -# Combines FR_AUTOREVIEW_CHANGES and FR_AUTOREVIEW_CREATION
 39+# Combines FR_AUTOREVIEW_CHANGES and FR_AUTOREVIEW_CREATION
4040 $wgFlaggedRevsAutoReview = FR_AUTOREVIEW_CREATION_AND_CHANGES;
4141
4242 # Define the tags we can use to rate an article, number of levels,
4343 # and set the minimum level to have it become a "quality" or "pristine" version.
4444 # NOTE: When setting up new dimensions or levels, you will need to add some
45 -# MediaWiki messages for the UI to show properly; any sysop can do this.
 45+# MediaWiki messages for the UI to show properly; any sysop can do this.
4646 $wgFlaggedRevsTags = array(
4747 'accuracy' => array( 'levels' => 3, 'quality' => 2, 'pristine' => 4 ),
4848 'depth' => array( 'levels' => 3, 'quality' => 1, 'pristine' => 4 ),
@@ -54,8 +54,8 @@
5555 # NOTE: Users with 'validate' (Reviewers) can set all tags to all levels.
5656 $wgFlaggedRevsTagsRestrictions = array(
5757 'accuracy' => array( 'review' => 1, 'autoreview' => 1 ),
58 - 'depth' => array( 'review' => 2, 'autoreview' => 2 ),
59 - 'style' => array( 'review' => 3, 'autoreview' => 3 ),
 58+ 'depth' => array( 'review' => 2, 'autoreview' => 2 ),
 59+ 'style' => array( 'review' => 3, 'autoreview' => 3 ),
6060 );
6161 # For each tag, what is the highest level that it can be auto-reviewed to?
6262 # $wgFlaggedRevsAutoReview must be enabled for this to apply.
@@ -84,19 +84,19 @@
8585 # Define when users get automatically promoted to Editors. Set as false to disable.
8686 # Once users meet these requirements they will be promoted, unless previously demoted.
8787 $wgFlaggedRevsAutopromote = array(
88 - 'days' => 60, # days since registration
89 - 'edits' => 250, # total edit count
90 - 'excludeLastDays' => 1, # exclude the last X days of edits from edit counts
91 - 'benchmarks' => 15, # number of "spread out" edits
92 - 'spacing' => 3, # number of days between these edits (the "spread")
 88+ 'days' => 60, # days since registration
 89+ 'edits' => 250, # total edit count
 90+ 'excludeLastDays' => 1, # exclude the last X days of edits from edit counts
 91+ 'benchmarks' => 15, # number of "spread out" edits
 92+ 'spacing' => 3, # number of days between these edits (the "spread")
9393 // Either totalContentEdits reqs OR totalCheckedEdits requirements needed
94 - 'totalContentEdits' => 300, # edits to pages in $wgContentNamespaces
95 - 'totalCheckedEdits' => 200, # edits before the stable version of pages
96 - 'uniqueContentPages' => 14, # unique pages in $wgContentNamespaces edited
97 - 'editComments' => 50, # number of manual edit summaries used
98 - 'userpageBytes' => 0, # size of userpage (use 0 to not require a userpage)
99 - 'neverBlocked' => true, # username was never blocked before?
100 - 'maxRevertedEditRatio' => .03, # max fraction of edits reverted via "rollback"/"undo"
 94+ 'totalContentEdits' => 300, # edits to pages in $wgContentNamespaces
 95+ 'totalCheckedEdits' => 200, # edits before the stable version of pages
 96+ 'uniqueContentPages' => 14, # unique pages in $wgContentNamespaces edited
 97+ 'editComments' => 50, # number of manual edit summaries used
 98+ 'userpageBytes' => 0, # size of userpage (use 0 to not require a userpage)
 99+ 'neverBlocked' => true, # username was never blocked before?
 100+ 'maxRevertedEditRatio' => .03, # max fraction of edits reverted via "rollback"/"undo"
101101 );
102102
103103 # Define when users get to have their own edits auto-reviewed. Set to false to disable.
@@ -105,17 +105,17 @@
106106 $wgFlaggedRevsAutoconfirm = false;
107107 /* (example usage)
108108 $wgFlaggedRevsAutoconfirm = array(
109 - 'days' => 30, # days since registration
110 - 'edits' => 50, # total edit count
111 - 'benchmarks' => 7, # number of "spread out" edits
112 - 'spacing' => 3, # number of days between these edits (the "spread")
 109+ 'days' => 30, # days since registration
 110+ 'edits' => 50, # total edit count
 111+ 'benchmarks' => 7, # number of "spread out" edits
 112+ 'spacing' => 3, # number of days between these edits (the "spread")
113113 // Either totalContentEdits reqs OR totalCheckedEdits requirements needed
114 - 'totalContentEdits' => 150, # $wgContentNamespaces edits OR...
115 - 'totalCheckedEdits' => 50, # ...Edits before the stable version of pages
116 - 'uniqueContentPages' => 8, # $wgContentNamespaces unique pages edited
117 - 'editComments' => 20, # how many edit comments used?
118 - 'email' => false, # user must be emailconfirmed?
119 - 'neverBlocked' => true, # Can users that were blocked be promoted?
 114+ 'totalContentEdits' => 150, # $wgContentNamespaces edits OR...
 115+ 'totalCheckedEdits' => 50, # ...Edits before the stable version of pages
 116+ 'uniqueContentPages' => 8, # $wgContentNamespaces unique pages edited
 117+ 'editComments' => 20, # how many edit comments used?
 118+ 'email' => false, # user must be emailconfirmed?
 119+ 'neverBlocked' => true, # Can users that were blocked be promoted?
120120 );
121121 */
122122
@@ -151,18 +151,18 @@
152152
153153 # Configurable information to collect and display at Special:ValidationStatistics
154154 $wgFlaggedRevsStats = array(
155 - 'topReviewersCount' => 5, # how many top reviewers to list
156 - 'topReviewersHours' => 1, # how many hours of the last reviews to count
 155+ 'topReviewersCount' => 5, # how many top reviewers to list
 156+ 'topReviewersHours' => 1, # how many hours of the last reviews to count
157157 );
158158
159159 # How to handle templates and files used in stable versions:
160160 # FR_INCLUDES_CURRENT
161 -# Always use the current version of templates/files
 161+# Always use the current version of templates/files
162162 # FR_INCLUDES_FREEZE
163 -# Use the version of templates/files that the page used when reviewed
 163+# Use the version of templates/files that the page used when reviewed
164164 # FR_INCLUDES_STABLE
165 -# For each template/file, check if a version of it was used when the page was reviewed
166 -# and if the template/file itself has a stable version; use the newest those versions
 165+# For each template/file, check if a version of it was used when the page was reviewed
 166+# and if the template/file itself has a stable version; use the newest those versions
167167 # NOTE: We may have templates that do not have stable version. Also, given situational
168168 # inclusion of templates (e.g. parser functions selecting template X or Y based on date),
169169 # there may also be no "review time version" revision ID for a template used on a page.
Index: trunk/extensions/FlaggedRevs/business/FRGenericSubmitForm.php
@@ -3,19 +3,19 @@
44 * Class containing generic form business logic
55 * Note: edit tokens are the responsibility of the caller
66 * Usage: (a) set ALL form params before doing anything else
7 - * (b) call ready() when all params are set
8 - * (c) call preload() OR submit() as needed
 7+ * (b) call ready() when all params are set
 8+ * (c) call preload() OR submit() as needed
99 */
1010 abstract class FRGenericSubmitForm {
11 - const FOR_SUBMISSION = 1; # Notify functions when we are submitting
 11+ const FOR_SUBMISSION = 1; # Notify functions when we are submitting
1212 /* Internal form state */
13 - const FORM_UNREADY = 0; # Params not given yet
14 - const FORM_READY = 1; # Params given and ready to submit
15 - const FORM_PRELOADED = 2; # Params pre-loaded (likely from slave DB)
16 - const FORM_SUBMITTED = 3; # Form submitted
17 - private $state = self::FORM_UNREADY; # Form state (disallows bad operations)
 13+ const FORM_UNREADY = 0; # Params not given yet
 14+ const FORM_READY = 1; # Params given and ready to submit
 15+ const FORM_PRELOADED = 2; # Params pre-loaded (likely from slave DB)
 16+ const FORM_SUBMITTED = 3; # Form submitted
 17+ private $state = self::FORM_UNREADY; # Form state (disallows bad operations)
1818
19 - protected $user = null; # User performing the action
 19+ protected $user = null; # User performing the action
2020
2121 final public function __construct( User $user ) {
2222 $this->user = $user;
Index: trunk/extensions/FlaggedRevs/business/RevisionReviewForm.php
@@ -4,23 +4,23 @@
55 */
66 class RevisionReviewForm extends FRGenericSubmitForm {
77 /* Form parameters which can be user given */
8 - protected $page = null; # Target Title obj
 8+ protected $page = null; # Target Title obj
99 protected $article = null; # Target Page obj
10 - protected $approve = false; # Approval requested
11 - protected $unapprove = false; # De-approval requested
12 - protected $reject = false; # Rejection requested
13 - protected $oldid = 0; # ID being reviewed (last "bad" ID for rejection)
14 - protected $refid = 0; # Old, "last good", ID (used for rejection)
15 - protected $templateParams = ''; # Included template versions (flat string)
16 - protected $imageParams = ''; # Included file versions (flat string)
17 - protected $fileVersion = ''; # File page file version (flat string)
18 - protected $validatedParams = ''; # Parameter key
19 - protected $comment = ''; # Review comments
20 - protected $dims = array(); # Review flags (for approval)
21 - protected $lastChangeTime = null; # Conflict handling
22 - protected $newLastChangeTime = null; # Conflict handling
 10+ protected $approve = false; # Approval requested
 11+ protected $unapprove = false; # De-approval requested
 12+ protected $reject = false; # Rejection requested
 13+ protected $oldid = 0; # ID being reviewed (last "bad" ID for rejection)
 14+ protected $refid = 0; # Old, "last good", ID (used for rejection)
 15+ protected $templateParams = ''; # Included template versions (flat string)
 16+ protected $imageParams = ''; # Included file versions (flat string)
 17+ protected $fileVersion = ''; # File page file version (flat string)
 18+ protected $validatedParams = ''; # Parameter key
 19+ protected $comment = ''; # Review comments
 20+ protected $dims = array(); # Review flags (for approval)
 21+ protected $lastChangeTime = null; # Conflict handling
 22+ protected $newLastChangeTime = null; # Conflict handling
2323
24 - protected $oflags = array(); # Prior flags for Rev with ID $oldid
 24+ protected $oflags = array(); # Prior flags for Rev with ID $oldid
2525
2626 protected function initialize() {
2727 foreach ( FlaggedRevs::getTags() as $tag ) {
@@ -378,17 +378,17 @@
379379
380380 # The new review entry...
381381 $flaggedRevision = new FlaggedRevision( array(
382 - 'rev' => $rev,
383 - 'user_id' => $this->user->getId(),
384 - 'timestamp' => wfTimestampNow(),
385 - 'quality' => $quality,
386 - 'tags' => FlaggedRevision::flattenRevisionTags( $flags ),
387 - 'img_name' => $fileData['name'],
388 - 'img_timestamp' => $fileData['timestamp'],
389 - 'img_sha1' => $fileData['sha1'],
390 - 'templateVersions' => $tmpVersions,
391 - 'fileVersions' => $fileVersions,
392 - 'flags' => ''
 382+ 'rev' => $rev,
 383+ 'user_id' => $this->user->getId(),
 384+ 'timestamp' => wfTimestampNow(),
 385+ 'quality' => $quality,
 386+ 'tags' => FlaggedRevision::flattenRevisionTags( $flags ),
 387+ 'img_name' => $fileData['name'],
 388+ 'img_timestamp' => $fileData['timestamp'],
 389+ 'img_sha1' => $fileData['sha1'],
 390+ 'templateVersions' => $tmpVersions,
 391+ 'fileVersions' => $fileVersions,
 392+ 'flags' => ''
393393 ) );
394394 # Delete the old review entry if it exists...
395395 if ( $oldFrev ) {
Index: trunk/extensions/FlaggedRevs/business/PageStabilityForm.php
@@ -4,15 +4,15 @@
55 */
66 abstract class PageStabilityForm extends FRGenericSubmitForm {
77 /* Form parameters which can be user given */
8 - protected $page = false; # Target page obj
9 - protected $watchThis = null; # Watch checkbox
10 - protected $reviewThis = null; # Auto-review option...
11 - protected $reasonExtra = ''; # Custom/extra reason
12 - protected $reasonSelection = ''; # Reason dropdown key
13 - protected $expiryCustom = ''; # Custom expiry
14 - protected $expirySelection = ''; # Expiry dropdown key
15 - protected $override = -1; # Default version
16 - protected $autoreview = ''; # Autoreview restrictions...
 8+ protected $page = false; # Target page obj
 9+ protected $watchThis = null; # Watch checkbox
 10+ protected $reviewThis = null; # Auto-review option...
 11+ protected $reasonExtra = ''; # Custom/extra reason
 12+ protected $reasonSelection = ''; # Reason dropdown key
 13+ protected $expiryCustom = ''; # Custom expiry
 14+ protected $expirySelection = ''; # Expiry dropdown key
 15+ protected $override = -1; # Default version
 16+ protected $autoreview = ''; # Autoreview restrictions...
1717
1818 protected $oldConfig = array(); # Old page config
1919
@@ -170,7 +170,7 @@
171171 /*
172172 * Can the user change the settings for this page?
173173 * Note: if the current autoreview restriction is too high for this user
174 - * then this will return false. Useful for form selectors.
 174+ * then this will return false. Useful for form selectors.
175175 * @return bool
176176 */
177177 public function isAllowed() {
@@ -198,7 +198,7 @@
199199
200200 /*
201201 * @return mixed (true on success, error string on failure)
202 - */
 202+ */
203203 protected function reallyDoPreloadParameters() {
204204 return true;
205205 }
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php
@@ -45,26 +45,26 @@
4646 $localModulePath = dirname( __FILE__ ) . '/modules/';
4747 $remoteModulePath = 'FlaggedRevs/presentation/modules';
4848 $modules['ext.flaggedRevs.basic'] = array(
49 - 'styles' => array( 'flaggedrevs.css' ),
 49+ 'styles' => array( 'flaggedrevs.css' ),
5050 'localBasePath' => $localModulePath,
5151 'remoteExtPath' => $remoteModulePath,
5252 );
5353 $modules['ext.flaggedRevs.advanced'] = array(
54 - 'scripts' => array( 'flaggedrevs.js' ),
55 - 'messages' => array(
 54+ 'scripts' => array( 'flaggedrevs.js' ),
 55+ 'messages' => array(
5656 'revreview-toggle-show', 'revreview-toggle-hide',
5757 'revreview-diff-toggle-show', 'revreview-diff-toggle-hide',
5858 'revreview-log-toggle-show', 'revreview-log-toggle-hide',
5959 'revreview-log-details-show', 'revreview-log-details-hide'
6060 ),
61 - 'dependencies' => array( 'mediawiki.util' ),
62 - 'localBasePath' => $localModulePath,
63 - 'remoteExtPath' => $remoteModulePath,
 61+ 'dependencies' => array( 'mediawiki.util' ),
 62+ 'localBasePath' => $localModulePath,
 63+ 'remoteExtPath' => $remoteModulePath,
6464 );
6565 $modules['ext.flaggedRevs.review'] = array(
66 - 'scripts' => array( 'review.js' ),
67 - 'styles' => array( 'review.css' ),
68 - 'messages' => array(
 66+ 'scripts' => array( 'review.js' ),
 67+ 'styles' => array( 'review.css' ),
 68+ 'messages' => array(
6969 'savearticle', 'tooltip-save', 'accesskey-save',
7070 'revreview-submitedit', 'revreview-submitedit-title',
7171 'revreview-submit-review', 'revreview-submit-unreview',
@@ -74,9 +74,9 @@
7575 'revreview-sadv-reviewing-p', 'revreview-sadv-reviewing-c',
7676 'revreview-adv-start-link', 'revreview-adv-stop-link'
7777 ),
78 - 'dependencies' => array( 'mediawiki.util' ),
79 - 'localBasePath' => $localModulePath,
80 - 'remoteExtPath' => $remoteModulePath,
 78+ 'dependencies' => array( 'mediawiki.util' ),
 79+ 'localBasePath' => $localModulePath,
 80+ 'remoteExtPath' => $remoteModulePath,
8181 );
8282 }
8383
@@ -766,7 +766,7 @@
767767 array_unshift( $effectiveLevels, "none" );
768768 # Show all restriction levels in a <select>...
769769 $attribs = array(
770 - 'id' => 'mwStabilityLevel',
 770+ 'id' => 'mwStabilityLevel',
771771 'name' => 'mwStabilityLevel',
772772 'size' => count( $effectiveLevels ),
773773 ) + $disabledAttrib;
@@ -825,8 +825,8 @@
826826 <td class='mw-input'>" .
827827 Xml::tags( 'select',
828828 array(
829 - 'id' => 'mwStabilizeExpirySelection',
830 - 'name' => 'mwStabilizeExpirySelection',
 829+ 'id' => 'mwStabilizeExpirySelection',
 830+ 'name' => 'mwStabilizeExpirySelection',
831831 'onchange' => 'onFRChangeExpiryDropdown()',
832832 ) + $disabledAttrib,
833833 $expiryFormOptions ) .
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsXML.php
@@ -268,7 +268,7 @@
269269 $box .= '<div id="mw-fr-revisiondetails-wrapper" style="position:relative;">';
270270 $box .= Xml::openElement( 'div',
271271 array(
272 - 'id' => 'mw-fr-revisiondetails',
 272+ 'id' => 'mw-fr-revisiondetails',
273273 'class' => 'flaggedrevs_short_details',
274274 'style' => 'display:none' )
275275 );
Index: trunk/extensions/FlaggedRevs/presentation/FlaggablePageView.php
@@ -1362,8 +1362,8 @@
13631363 * (a) Add the review form to the top of the page
13641364 * (b) Mark off which versions are checked or not
13651365 * (c) When comparing the stable revision to the current:
1366 - * (i) Show a tag with some explanation for the diff
1367 - * (ii) List any template/file changes pending review
 1366+ * (i) Show a tag with some explanation for the diff
 1367+ * (ii) List any template/file changes pending review
13681368 */
13691369 public function addToDiffView( $diff, $oldRev, $newRev ) {
13701370 global $wgMemc, $wgParserCacheExpireTime;
Index: trunk/extensions/FlaggedRevs/presentation/RevisionReviewFormUI.php
@@ -320,7 +320,7 @@
321321 $attribs = array( 'class' => "fr-rating-option-$i",
322322 'onchange' => "FlaggedRevsReview.updateRatingForm()" );
323323 $item .= Xml::radioLabel( FlaggedRevs::getTagMsg( $name ), "wp$quality",
324 - $i, "wp$quality" . $i, ( $i == $selected ), $attribs ) . "\n";
 324+ $i, "wp$quality" . $i, ( $i == $selected ), $attribs ) . "\n";
325325 }
326326 # Otherwise make checkboxes (two levels available for current user)
327327 } elseif ( $numLevels == 2 ) {
@@ -389,10 +389,10 @@
390390 }
391391 $s = Xml::submitButton( wfMsgHtml( 'revreview-submit-review' ),
392392 array(
393 - 'name' => 'wpApprove',
394 - 'id' => 'mw-fr-submit-accept',
 393+ 'name' => 'wpApprove',
 394+ 'id' => 'mw-fr-submit-accept',
395395 'accesskey' => wfMsg( 'revreview-ak-review' ),
396 - 'title' => wfMsg( 'revreview-tt-flag' ) . ' [' .
 396+ 'title' => wfMsg( 'revreview-tt-flag' ) . ' [' .
397397 wfMsg( 'revreview-ak-review' ) . ']'
398398 ) + ( ( $disabled || !$applicable ) ? $disAttrib : array() )
399399 );
@@ -402,7 +402,7 @@
403403 $s .= Xml::submitButton( wfMsgHtml( 'revreview-submit-reject' ),
404404 array(
405405 'name' => 'wpReject',
406 - 'id' => 'mw-fr-submit-reject',
 406+ 'id' => 'mw-fr-submit-reject',
407407 'title' => wfMsg( 'revreview-tt-reject' ),
408408 ) + ( $disabled ? $disAttrib : array() )
409409 );
@@ -413,7 +413,7 @@
414414 $s .= Xml::submitButton( wfMsgHtml( 'revreview-submit-unreview' ),
415415 array(
416416 'name' => 'wpUnapprove',
417 - 'id' => 'mw-fr-submit-unaccept',
 417+ 'id' => 'mw-fr-submit-unaccept',
418418 'title' => wfMsg( 'revreview-tt-unflag' ),
419419 'style' => $frev ? '' : 'display:none'
420420 ) + ( $disabled ? $disAttrib : array() )
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsLogView.php
@@ -1,7 +1,7 @@
22 <?php
33
44 class FlaggedRevsLogView {
5 - /**
 5+ /**
66 * Add setting change description to log line
77 * @return string
88 */

Status & tagging log