Index: trunk/extensions/FlaggedRevs/frontend/FlaggedRevsUI.hooks.php |
— | — | @@ -4,8 +4,8 @@ |
5 | 5 | */ |
6 | 6 | class FlaggedRevsUIHooks { |
7 | 7 | /** |
8 | | - * Add FlaggedRevs css/js. |
9 | | - */ |
| 8 | + * Add FlaggedRevs css/js. |
| 9 | + */ |
10 | 10 | protected static function injectStyleAndJS() { |
11 | 11 | global $wgOut, $wgUser; |
12 | 12 | static $loadedModules = false; |
— | — | @@ -46,9 +46,9 @@ |
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | | - * Add FlaggedRevs css for relevant special pages. |
51 | | - * @param OutputPage $out |
52 | | - */ |
| 50 | + * Add FlaggedRevs css for relevant special pages. |
| 51 | + * @param OutputPage $out |
| 52 | + */ |
53 | 53 | protected static function injectStyleForSpecial( &$out ) { |
54 | 54 | $title = $out->getTitle(); |
55 | 55 | $spPages = array( 'UnreviewedPages', 'PendingChanges', 'ProblemChanges', |
— | — | @@ -63,8 +63,8 @@ |
64 | 64 | } |
65 | 65 | |
66 | 66 | /* |
67 | | - * Add tag notice, CSS/JS, protect form link, and set robots policy |
68 | | - */ |
| 67 | + * Add tag notice, CSS/JS, protect form link, and set robots policy |
| 68 | + */ |
69 | 69 | public static function onBeforePageDisplay( &$out, &$skin ) { |
70 | 70 | if ( $out->getTitle()->getNamespace() != NS_SPECIAL ) { |
71 | 71 | $view = FlaggablePageView::singleton(); |
Index: trunk/extensions/FlaggedRevs/frontend/FlaggedRevsXML.php |
— | — | @@ -347,9 +347,9 @@ |
348 | 348 | } |
349 | 349 | |
350 | 350 | /* |
351 | | - * Creates CSS draft page icon |
352 | | - * @return string |
353 | | - */ |
| 351 | + * Creates CSS draft page icon |
| 352 | + * @return string |
| 353 | + */ |
354 | 354 | public static function draftStatusIcon() { |
355 | 355 | $encPath = htmlspecialchars( FlaggedRevs::styleUrlPath() . '/img' ); |
356 | 356 | $encTitle = wfMsgHtml( 'revreview-draft-title' ); |
— | — | @@ -358,10 +358,10 @@ |
359 | 359 | } |
360 | 360 | |
361 | 361 | /* |
362 | | - * Creates CSS stable page icon |
363 | | - * @param bool $isQuality |
364 | | - * @return string |
365 | | - */ |
| 362 | + * Creates CSS stable page icon |
| 363 | + * @param bool $isQuality |
| 364 | + * @return string |
| 365 | + */ |
366 | 366 | public static function stableStatusIcon( $isQuality ) { |
367 | 367 | $encPath = htmlspecialchars( FlaggedRevs::styleUrlPath() . '/img' ); |
368 | 368 | $file = $isQuality ? '3.png' : '2.png'; |
— | — | @@ -373,10 +373,10 @@ |
374 | 374 | } |
375 | 375 | |
376 | 376 | /* |
377 | | - * Creates CSS lock icon if page is locked/unlocked |
378 | | - * @param FlaggableWikiPage $flaggedArticle |
379 | | - * @return string |
380 | | - */ |
| 377 | + * Creates CSS lock icon if page is locked/unlocked |
| 378 | + * @param FlaggableWikiPage $flaggedArticle |
| 379 | + * @return string |
| 380 | + */ |
381 | 381 | public static function lockStatusIcon( $flaggedArticle ) { |
382 | 382 | $encPath = htmlspecialchars( FlaggedRevs::styleUrlPath() . '/img' ); |
383 | 383 | if ( $flaggedArticle->isPageLocked() ) { |
— | — | @@ -391,12 +391,12 @@ |
392 | 392 | } |
393 | 393 | |
394 | 394 | /* |
395 | | - * @param FlaggableWikiPage $flaggedArticle |
396 | | - * @param FlaggedRevision $frev |
397 | | - * @param int $revsSince |
398 | | - * @return string |
399 | | - * Creates "stable rev reviewed on"/"x pending edits" message |
400 | | - */ |
| 395 | + * @param FlaggableWikiPage $flaggedArticle |
| 396 | + * @param FlaggedRevision $frev |
| 397 | + * @param int $revsSince |
| 398 | + * @return string |
| 399 | + * Creates "stable rev reviewed on"/"x pending edits" message |
| 400 | + */ |
401 | 401 | public static function pendingEditNotice( $flaggedArticle, $frev, $revsSince ) { |
402 | 402 | global $wgLang; |
403 | 403 | $flags = $frev->getTags(); |
— | — | @@ -410,10 +410,10 @@ |
411 | 411 | } |
412 | 412 | |
413 | 413 | /* |
414 | | - * @param Page $article |
415 | | - * @return string |
416 | | - * Creates a stability log excerpt |
417 | | - */ |
| 414 | + * @param Page $article |
| 415 | + * @return string |
| 416 | + * Creates a stability log excerpt |
| 417 | + */ |
418 | 418 | public static function stabilityLogExcerpt( $article ) { |
419 | 419 | $logHtml = ''; |
420 | 420 | $params = array( |
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/UnreviewedPages_body.php |
— | — | @@ -189,9 +189,9 @@ |
190 | 190 | } |
191 | 191 | |
192 | 192 | /* |
193 | | - * Run an update to the cached query rows |
194 | | - * @return void |
195 | | - */ |
| 193 | + * Run an update to the cached query rows |
| 194 | + * @return void |
| 195 | + */ |
196 | 196 | public static function updateQueryCache() { |
197 | 197 | $rNamespaces = FlaggedRevs::getReviewNamespaces(); |
198 | 198 | if ( empty( $rNamespaces ) ) { |
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/QualityOversight_body.php |
— | — | @@ -85,9 +85,9 @@ |
86 | 86 | } |
87 | 87 | |
88 | 88 | /* |
89 | | - * Get actions for IN clause |
90 | | - * @return array |
91 | | - */ |
| 89 | + * Get actions for IN clause |
| 90 | + * @return array |
| 91 | + */ |
92 | 92 | private function getActions() { |
93 | 93 | $actions = array( |
94 | 94 | 'approve' => 1, 'approve2' => 1, 'approve-a' => 1, 'approve-i' => 1, |
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ConfiguredPages_body.php |
— | — | @@ -117,10 +117,10 @@ |
118 | 118 | public $mForm, $mConds, $namespace, $override, $autoreview; |
119 | 119 | |
120 | 120 | /* |
121 | | - * @param int $namespace (null for "all") |
122 | | - * @param int $override (null for "either") |
123 | | - * @param string $autoreview ('' for "all", 'none' for no restriction) |
124 | | - */ |
| 121 | + * @param int $namespace (null for "all") |
| 122 | + * @param int $override (null for "either") |
| 123 | + * @param string $autoreview ('' for "all", 'none' for no restriction) |
| 124 | + */ |
125 | 125 | function __construct( $form, $conds = array(), $namespace, $override, $autoreview ) { |
126 | 126 | $this->mForm = $form; |
127 | 127 | $this->mConds = $conds; |
Index: trunk/extensions/FlaggedRevs/frontend/FlaggablePageView.php |
— | — | @@ -21,8 +21,8 @@ |
22 | 22 | protected static $instance = null; |
23 | 23 | |
24 | 24 | /* |
25 | | - * Get the FlaggablePageView for this request |
26 | | - */ |
| 25 | + * Get the FlaggablePageView for this request |
| 26 | + */ |
27 | 27 | public static function singleton() { |
28 | 28 | if ( self::$instance == null ) { |
29 | 29 | self::$instance = new self(); |
— | — | @@ -33,16 +33,16 @@ |
34 | 34 | protected function __clone() { } |
35 | 35 | |
36 | 36 | /* |
37 | | - * Clear the FlaggablePageView for this request. |
38 | | - * Only needed when page redirection changes the environment. |
39 | | - */ |
| 37 | + * Clear the FlaggablePageView for this request. |
| 38 | + * Only needed when page redirection changes the environment. |
| 39 | + */ |
40 | 40 | public function clear() { |
41 | 41 | self::$instance = null; |
42 | 42 | } |
43 | 43 | |
44 | 44 | /* |
45 | | - * Load the global FlaggableWikiPage instance |
46 | | - */ |
| 45 | + * Load the global FlaggableWikiPage instance |
| 46 | + */ |
47 | 47 | protected function load() { |
48 | 48 | if ( !$this->loaded ) { |
49 | 49 | $this->loaded = true; |
— | — | @@ -179,7 +179,7 @@ |
180 | 180 | return false; |
181 | 181 | } |
182 | 182 | |
183 | | - /** |
| 183 | + /** |
184 | 184 | * Is this a view page action (including diffs)? |
185 | 185 | * @param $request WebRequest |
186 | 186 | * @return bool |
— | — | @@ -192,7 +192,7 @@ |
193 | 193 | return self::isViewAction( $action ); |
194 | 194 | } |
195 | 195 | |
196 | | - /** |
| 196 | + /** |
197 | 197 | * Is this a view page action (not including diffs)? |
198 | 198 | * @param $request WebRequest |
199 | 199 | * @return bool |
— | — | @@ -202,7 +202,7 @@ |
203 | 203 | && $request->getVal( 'diff' ) === null; |
204 | 204 | } |
205 | 205 | |
206 | | - /** |
| 206 | + /** |
207 | 207 | * Is this a web request to just *view* the *default* version of a page? |
208 | 208 | * @param $request WebRequest |
209 | 209 | * @return bool |
— | — | @@ -220,7 +220,7 @@ |
221 | 221 | ); |
222 | 222 | } |
223 | 223 | |
224 | | - /** |
| 224 | + /** |
225 | 225 | * Is this a view page action? |
226 | 226 | * @param $action string from MediaWiki::getAction() |
227 | 227 | * @return bool |
— | — | @@ -229,7 +229,7 @@ |
230 | 230 | return ( $action == 'view' || $action == 'purge' || $action == 'render' ); |
231 | 231 | } |
232 | 232 | |
233 | | - /** |
| 233 | + /** |
234 | 234 | * Output review notice |
235 | 235 | */ |
236 | 236 | public function displayTag() { |
— | — | @@ -241,7 +241,7 @@ |
242 | 242 | return true; |
243 | 243 | } |
244 | 244 | |
245 | | - /** |
| 245 | + /** |
246 | 246 | * Add a stable link when viewing old versions of an article that |
247 | 247 | * have been reviewed. (e.g. for &oldid=x urls) |
248 | 248 | */ |
— | — | @@ -276,8 +276,8 @@ |
277 | 277 | } |
278 | 278 | |
279 | 279 | /** |
280 | | - * @return mixed int/false/null |
281 | | - */ |
| 280 | + * @return mixed int/false/null |
| 281 | + */ |
282 | 282 | protected function getRequestedStableId() { |
283 | 283 | $request = $this->getRequest(); |
284 | 284 | $reqId = $request->getVal( 'stableid' ); |
— | — | @@ -287,7 +287,7 @@ |
288 | 288 | return $reqId; |
289 | 289 | } |
290 | 290 | |
291 | | - /** |
| 291 | + /** |
292 | 292 | * Replaces a page with the last stable version if possible |
293 | 293 | * Adds stable version status/info tags and notes |
294 | 294 | * Adds a quick review form on the bottom if needed |
— | — | @@ -386,11 +386,11 @@ |
387 | 387 | } |
388 | 388 | |
389 | 389 | /** |
390 | | - * If the page has a stable version and it shows by default, |
391 | | - * tell search crawlers to index only that version of the page. |
392 | | - * Also index the draft as well if they are synced (bug 27173). |
393 | | - * However, any URL with ?stableid=x should not be indexed (as with ?oldid=x). |
394 | | - */ |
| 390 | + * If the page has a stable version and it shows by default, |
| 391 | + * tell search crawlers to index only that version of the page. |
| 392 | + * Also index the draft as well if they are synced (bug 27173). |
| 393 | + * However, any URL with ?stableid=x should not be indexed (as with ?oldid=x). |
| 394 | + */ |
395 | 395 | public function setRobotPolicy() { |
396 | 396 | $request = $this->getRequest(); |
397 | 397 | if ( $this->article->getStableRev() && $this->article->isStableShownByDefault() ) { |
— | — | @@ -407,10 +407,10 @@ |
408 | 408 | } |
409 | 409 | |
410 | 410 | /** |
411 | | - * @param $tag review box/bar info |
412 | | - * @param $prot protection notice |
413 | | - * Tag output function must be called by caller |
414 | | - */ |
| 411 | + * @param $tag review box/bar info |
| 412 | + * @param $prot protection notice |
| 413 | + * Tag output function must be called by caller |
| 414 | + */ |
415 | 415 | protected function showUnreviewedPage( $tag, $prot ) { |
416 | 416 | if ( $this->out->isPrintable() ) { |
417 | 417 | return; // all this function does is add notices; don't show them |
— | — | @@ -432,13 +432,13 @@ |
433 | 433 | } |
434 | 434 | |
435 | 435 | /** |
436 | | - * Tag output function must be called by caller |
437 | | - * Parser cache control deferred to caller |
438 | | - * @param $srev stable version |
439 | | - * @param $tag review box/bar info |
440 | | - * @param $prot protection notice icon |
441 | | - * @return void |
442 | | - */ |
| 436 | + * Tag output function must be called by caller |
| 437 | + * Parser cache control deferred to caller |
| 438 | + * @param $srev stable version |
| 439 | + * @param $tag review box/bar info |
| 440 | + * @param $prot protection notice icon |
| 441 | + * @return void |
| 442 | + */ |
443 | 443 | protected function showDraftVersion( FlaggedRevision $srev, &$tag, $prot ) { |
444 | 444 | $request = $this->getRequest(); |
445 | 445 | $reqUser = $this->getUser(); |
— | — | @@ -544,14 +544,14 @@ |
545 | 545 | } |
546 | 546 | |
547 | 547 | /** |
548 | | - * Tag output function must be called by caller |
549 | | - * Parser cache control deferred to caller |
550 | | - * @param $srev stable version |
551 | | - * @param $frev selected flagged revision |
552 | | - * @param $tag review box/bar info |
553 | | - * @param $prot protection notice icon |
554 | | - * @return ParserOutput |
555 | | - */ |
| 548 | + * Tag output function must be called by caller |
| 549 | + * Parser cache control deferred to caller |
| 550 | + * @param $srev stable version |
| 551 | + * @param $frev selected flagged revision |
| 552 | + * @param $tag review box/bar info |
| 553 | + * @param $prot protection notice icon |
| 554 | + * @return ParserOutput |
| 555 | + */ |
556 | 556 | protected function showOldReviewedVersion( FlaggedRevision $frev, &$tag, $prot ) { |
557 | 557 | $reqUser = $this->getUser(); |
558 | 558 | $this->load(); |
— | — | @@ -623,13 +623,13 @@ |
624 | 624 | } |
625 | 625 | |
626 | 626 | /** |
627 | | - * Tag output function must be called by caller |
628 | | - * Parser cache control deferred to caller |
629 | | - * @param $srev stable version |
630 | | - * @param $tag review box/bar info |
631 | | - * @param $prot protection notice |
632 | | - * @return ParserOutput |
633 | | - */ |
| 627 | + * Tag output function must be called by caller |
| 628 | + * Parser cache control deferred to caller |
| 629 | + * @param $srev stable version |
| 630 | + * @param $tag review box/bar info |
| 631 | + * @param $prot protection notice |
| 632 | + * @return ParserOutput |
| 633 | + */ |
634 | 634 | protected function showStableVersion( FlaggedRevision $srev, &$tag, $prot ) { |
635 | 635 | $reqUser = $this->getUser(); |
636 | 636 | $this->load(); |
— | — | @@ -750,11 +750,11 @@ |
751 | 751 | } |
752 | 752 | |
753 | 753 | /** |
754 | | - * Get collapsible diff-to-stable html to add to the review notice as needed |
755 | | - * @param FlaggedRevision $srev, stable version |
756 | | - * @param bool $quality, revision is quality |
757 | | - * @return string, the html line (either "" or "<diff toggle><diff div>") |
758 | | - */ |
| 754 | + * Get collapsible diff-to-stable html to add to the review notice as needed |
| 755 | + * @param FlaggedRevision $srev, stable version |
| 756 | + * @param bool $quality, revision is quality |
| 757 | + * @return string, the html line (either "" or "<diff toggle><diff div>") |
| 758 | + */ |
759 | 759 | protected function getTopDiffToggle( FlaggedRevision $srev, $quality ) { |
760 | 760 | $reqUser = $this->getUser(); |
761 | 761 | $this->load(); |
— | — | @@ -1052,7 +1052,7 @@ |
1053 | 1053 | return true; |
1054 | 1054 | } |
1055 | 1055 | |
1056 | | - /** |
| 1056 | + /** |
1057 | 1057 | * Add review form to pages when necessary on a regular page view (action=view). |
1058 | 1058 | * If $output is an OutputPage then this prepends the form onto it. |
1059 | 1059 | * If $output is a string then this appends the review form to it. |
— | — | @@ -1127,7 +1127,7 @@ |
1128 | 1128 | return true; |
1129 | 1129 | } |
1130 | 1130 | |
1131 | | - /** |
| 1131 | + /** |
1132 | 1132 | * Add link to stable version setting to protection form |
1133 | 1133 | */ |
1134 | 1134 | public function addStabilizationLink() { |
— | — | @@ -1364,13 +1364,13 @@ |
1365 | 1365 | } |
1366 | 1366 | |
1367 | 1367 | /** |
1368 | | - * When viewing a diff: |
1369 | | - * (a) Add the review form to the top of the page |
1370 | | - * (b) Mark off which versions are checked or not |
1371 | | - * (c) When comparing the stable revision to the current: |
1372 | | - * (i) Show a tag with some explanation for the diff |
1373 | | - * (ii) List any template/file changes pending review |
1374 | | - */ |
| 1368 | + * When viewing a diff: |
| 1369 | + * (a) Add the review form to the top of the page |
| 1370 | + * (b) Mark off which versions are checked or not |
| 1371 | + * (c) When comparing the stable revision to the current: |
| 1372 | + * (i) Show a tag with some explanation for the diff |
| 1373 | + * (ii) List any template/file changes pending review |
| 1374 | + */ |
1375 | 1375 | public function addToDiffView( $diff, $oldRev, $newRev ) { |
1376 | 1376 | global $wgMemc, $wgParserCacheExpireTime; |
1377 | 1377 | $request = $this->getRequest(); |
— | — | @@ -1489,10 +1489,10 @@ |
1490 | 1490 | } |
1491 | 1491 | |
1492 | 1492 | /** |
1493 | | - * (a) Add a link to diff from stable to current as needed |
1494 | | - * (b) Show review status of the diff revision(s). Uses a <table>. |
1495 | | - * Note: used by ajax function to rebuild diff page |
1496 | | - */ |
| 1493 | + * (a) Add a link to diff from stable to current as needed |
| 1494 | + * (b) Show review status of the diff revision(s). Uses a <table>. |
| 1495 | + * Note: used by ajax function to rebuild diff page |
| 1496 | + */ |
1497 | 1497 | public static function diffLinkAndMarkers( FlaggableWikiPage $article, $oldRev, $newRev ) { |
1498 | 1498 | $s = '<form id="mw-fr-diff-dataform">'; |
1499 | 1499 | $s .= Html::hidden( 'oldid', $oldRev ? $oldRev->getId() : 0 ); |
— | — | @@ -1506,8 +1506,8 @@ |
1507 | 1507 | } |
1508 | 1508 | |
1509 | 1509 | /** |
1510 | | - * Add a link to diff-to-stable for reviewable pages |
1511 | | - */ |
| 1510 | + * Add a link to diff-to-stable for reviewable pages |
| 1511 | + */ |
1512 | 1512 | protected static function diffToStableLink( |
1513 | 1513 | FlaggableWikiPage $article, $oldRev, Revision $newRev |
1514 | 1514 | ) { |
— | — | @@ -1535,8 +1535,8 @@ |
1536 | 1536 | } |
1537 | 1537 | |
1538 | 1538 | /** |
1539 | | - * Add [checked version] and such to left and right side of diff |
1540 | | - */ |
| 1539 | + * Add [checked version] and such to left and right side of diff |
| 1540 | + */ |
1541 | 1541 | protected static function diffReviewMarkers( FlaggableWikiPage $article, $oldRev, $newRev ) { |
1542 | 1542 | $table = ''; |
1543 | 1543 | $srev = $article->getStableRev(); |
— | — | @@ -1628,9 +1628,9 @@ |
1629 | 1629 | } |
1630 | 1630 | |
1631 | 1631 | /** |
1632 | | - * Set $this->isDiffFromStable and $this->isMultiPageDiff fields |
1633 | | - * Note: $oldRev could be false |
1634 | | - */ |
| 1632 | + * Set $this->isDiffFromStable and $this->isMultiPageDiff fields |
| 1633 | + * Note: $oldRev could be false |
| 1634 | + */ |
1635 | 1635 | public function setViewFlags( $diff, $oldRev, $newRev ) { |
1636 | 1636 | $this->load(); |
1637 | 1637 | // We only want valid diffs that actually make sense... |
— | — | @@ -1668,9 +1668,9 @@ |
1669 | 1669 | } |
1670 | 1670 | |
1671 | 1671 | /** |
1672 | | - * Redirect users out to review the changes to the stable version. |
1673 | | - * Only for people who can review and for pages that have a stable version. |
1674 | | - */ |
| 1672 | + * Redirect users out to review the changes to the stable version. |
| 1673 | + * Only for people who can review and for pages that have a stable version. |
| 1674 | + */ |
1675 | 1675 | public function injectPostEditURLParams( &$sectionAnchor, &$extraQuery ) { |
1676 | 1676 | $reqUser = $this->getUser(); |
1677 | 1677 | $this->load(); |
— | — | @@ -1713,10 +1713,10 @@ |
1714 | 1714 | } |
1715 | 1715 | |
1716 | 1716 | /** |
1717 | | - * If submitting the edit will leave it pending, then change the button text |
1718 | | - * Note: interacts with 'review pending changes' checkbox |
1719 | | - * @TODO: would be nice if hook passed in button attribs, not XML |
1720 | | - */ |
| 1717 | + * If submitting the edit will leave it pending, then change the button text |
| 1718 | + * Note: interacts with 'review pending changes' checkbox |
| 1719 | + * @TODO: would be nice if hook passed in button attribs, not XML |
| 1720 | + */ |
1721 | 1721 | public function changeSaveButton( EditPage $editPage, array &$buttons ) { |
1722 | 1722 | if ( !$this->editWillRequireReview( $editPage ) ) { |
1723 | 1723 | return true; // edit will go live or be reviewed on save |
— | — | @@ -1740,10 +1740,10 @@ |
1741 | 1741 | } |
1742 | 1742 | |
1743 | 1743 | /** |
1744 | | - * If this edit will not go live on submit (accounting for wpReviewEdit) |
1745 | | - * @param EditPage $editPage |
1746 | | - * @return bool |
1747 | | - */ |
| 1744 | + * If this edit will not go live on submit (accounting for wpReviewEdit) |
| 1745 | + * @param EditPage $editPage |
| 1746 | + * @return bool |
| 1747 | + */ |
1748 | 1748 | protected function editWillRequireReview( EditPage $editPage ) { |
1749 | 1749 | $request = $this->getRequest(); |
1750 | 1750 | $title = $this->article->getTitle(); // convenience |
— | — | @@ -1756,10 +1756,10 @@ |
1757 | 1757 | } |
1758 | 1758 | |
1759 | 1759 | /** |
1760 | | - * If this edit will not go live on submit unless wpReviewEdit is checked |
1761 | | - * @param EditPage $editPage |
1762 | | - * @return bool |
1763 | | - */ |
| 1760 | + * If this edit will not go live on submit unless wpReviewEdit is checked |
| 1761 | + * @param EditPage $editPage |
| 1762 | + * @return bool |
| 1763 | + */ |
1764 | 1764 | protected function editRequiresReview( EditPage $editPage ) { |
1765 | 1765 | if ( !$this->article->editsRequireReview() ) { |
1766 | 1766 | return false; // edits go live immediatly |
— | — | @@ -1770,11 +1770,11 @@ |
1771 | 1771 | } |
1772 | 1772 | |
1773 | 1773 | /** |
1774 | | - * If this edit will be auto-reviewed on submit |
1775 | | - * Note: checking wpReviewEdit does not count as auto-reviewed |
1776 | | - * @param EditPage $editPage |
1777 | | - * @return bool |
1778 | | - */ |
| 1774 | + * If this edit will be auto-reviewed on submit |
| 1775 | + * Note: checking wpReviewEdit does not count as auto-reviewed |
| 1776 | + * @param EditPage $editPage |
| 1777 | + * @return bool |
| 1778 | + */ |
1779 | 1779 | protected function editWillBeAutoreviewed( EditPage $editPage ) { |
1780 | 1780 | $title = $this->article->getTitle(); // convenience |
1781 | 1781 | if ( !$this->article->isReviewable() ) { |
— | — | @@ -1796,10 +1796,10 @@ |
1797 | 1797 | } |
1798 | 1798 | |
1799 | 1799 | /** |
1800 | | - * Add a "review pending changes" checkbox to the edit form iff: |
1801 | | - * (a) there are currently any revisions pending (bug 16713) |
1802 | | - * (b) this is an unreviewed page (bug 23970) |
1803 | | - */ |
| 1800 | + * Add a "review pending changes" checkbox to the edit form iff: |
| 1801 | + * (a) there are currently any revisions pending (bug 16713) |
| 1802 | + * (b) this is an unreviewed page (bug 23970) |
| 1803 | + */ |
1804 | 1804 | public function addReviewCheck( EditPage $editPage, array &$checkboxes, &$tabindex ) { |
1805 | 1805 | $request = $this->getRequest(); |
1806 | 1806 | $title = $this->article->getTitle(); // convenience |
— | — | @@ -1843,11 +1843,11 @@ |
1844 | 1844 | } |
1845 | 1845 | |
1846 | 1846 | /** |
1847 | | - * (a) Add a hidden field that has the rev ID the text is based off. |
1848 | | - * (b) If an edit was undone, add a hidden field that has the rev ID of that edit. |
1849 | | - * Needed for autoreview and user stats (for autopromote). |
1850 | | - * Note: baseRevId trusted for Reviewers - text checked for others. |
1851 | | - */ |
| 1847 | + * (a) Add a hidden field that has the rev ID the text is based off. |
| 1848 | + * (b) If an edit was undone, add a hidden field that has the rev ID of that edit. |
| 1849 | + * Needed for autoreview and user stats (for autopromote). |
| 1850 | + * Note: baseRevId trusted for Reviewers - text checked for others. |
| 1851 | + */ |
1852 | 1852 | public function addRevisionIDField( EditPage $editPage, OutputPage $out ) { |
1853 | 1853 | $revId = self::getBaseRevId( $editPage, $this->getRequest() ); |
1854 | 1854 | $out->addHTML( "\n" . Html::hidden( 'baseRevId', $revId ) ); |
— | — | @@ -1857,10 +1857,10 @@ |
1858 | 1858 | } |
1859 | 1859 | |
1860 | 1860 | /** |
1861 | | - * Guess the rev ID the text of this form is based off |
1862 | | - * Note: baseRevId trusted for Reviewers - check text for others. |
1863 | | - * @return int |
1864 | | - */ |
| 1861 | + * Guess the rev ID the text of this form is based off |
| 1862 | + * Note: baseRevId trusted for Reviewers - check text for others. |
| 1863 | + * @return int |
| 1864 | + */ |
1865 | 1865 | protected static function getBaseRevId( EditPage $editPage, WebRequest $request ) { |
1866 | 1866 | if ( !isset( $editPage->fr_baseRevId ) ) { |
1867 | 1867 | $article = $editPage->getArticle(); // convenience |
Index: trunk/extensions/FlaggedRevs/frontend/RevisionReviewFormUI.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | protected $templateIDs = null; |
15 | 15 | protected $imageSHA1Keys = null; |
16 | 16 | |
17 | | - /** |
| 17 | + /** |
18 | 18 | * Generates a brief review form for a page |
19 | 19 | * @param RequestContext $context |
20 | 20 | * @param FlaggableWikiPage $article |
— | — | @@ -69,7 +69,7 @@ |
70 | 70 | $this->imageSHA1Keys = $imageSHA1Keys; |
71 | 71 | } |
72 | 72 | |
73 | | - /** |
| 73 | + /** |
74 | 74 | * Generates a brief review form for a page |
75 | 75 | * @return array (html string, error string or true) |
76 | 76 | */ |
— | — | @@ -243,9 +243,9 @@ |
244 | 244 | } |
245 | 245 | |
246 | 246 | /* |
247 | | - * If the REJECT button should show then get the ID of the last good rev |
248 | | - * @return int |
249 | | - */ |
| 247 | + * If the REJECT button should show then get the ID of the last good rev |
| 248 | + * @return int |
| 249 | + */ |
250 | 250 | protected function rejectRefRevId() { |
251 | 251 | if ( $this->refRev ) { |
252 | 252 | $priorId = $this->refRev->getId(); |
Index: trunk/extensions/FlaggedRevs/frontend/modules/ext.flaggedRevs.review.js |
— | — | @@ -43,13 +43,13 @@ |
44 | 44 | }, |
45 | 45 | |
46 | 46 | /* |
47 | | - * Updates for radios/checkboxes on patch by Daniel Arnold (bug 13744). |
48 | | - * Visually update the revision rating form on change. |
49 | | - * - Disable submit in case of invalid input. |
50 | | - * - Update colors when <select> changes. |
51 | | - * - Also remove comment box clutter in case of invalid input. |
52 | | - * NOTE: all buttons should exist (perhaps hidden though) |
53 | | - */ |
| 47 | + * Updates for radios/checkboxes on patch by Daniel Arnold (bug 13744). |
| 48 | + * Visually update the revision rating form on change. |
| 49 | + * - Disable submit in case of invalid input. |
| 50 | + * - Update colors when <select> changes. |
| 51 | + * - Also remove comment box clutter in case of invalid input. |
| 52 | + * NOTE: all buttons should exist (perhaps hidden though) |
| 53 | + */ |
54 | 54 | 'updateReviewForm': function( form ) { |
55 | 55 | if ( form.prop( 'disabled' ) ) { |
56 | 56 | return; |
— | — | @@ -105,8 +105,8 @@ |
106 | 106 | }, |
107 | 107 | |
108 | 108 | /* |
109 | | - * Update <select> color for the selected item/option |
110 | | - */ |
| 109 | + * Update <select> color for the selected item/option |
| 110 | + */ |
111 | 111 | 'updateReviewFormColors': function( form ) { |
112 | 112 | for ( var tag in wgFlaggedRevsParams.tags ) { // for each tag |
113 | 113 | var select = form.find( "[name='wp" + tag + "']" ).eq( 0 ); |
— | — | @@ -123,15 +123,15 @@ |
124 | 124 | }, |
125 | 125 | |
126 | 126 | /* |
127 | | - * Lock review form from submissions (using during AJAX requests) |
128 | | - */ |
| 127 | + * Lock review form from submissions (using during AJAX requests) |
| 128 | + */ |
129 | 129 | 'lockReviewForm': function( form ) { |
130 | 130 | form.find( 'input,textarea,select' ).prop( 'disabled', 'disabled' ); |
131 | 131 | }, |
132 | 132 | |
133 | 133 | /* |
134 | | - * Unlock review form from submissions (using after AJAX requests) |
135 | | - */ |
| 134 | + * Unlock review form from submissions (using after AJAX requests) |
| 135 | + */ |
136 | 136 | 'unlockReviewForm': function( form ) { |
137 | 137 | var inputs = form.find( 'input' ); |
138 | 138 | for ( var i=0; i < inputs.length; i++ ) { |
— | — | @@ -145,11 +145,11 @@ |
146 | 146 | }, |
147 | 147 | |
148 | 148 | /* |
149 | | - * Submit a revision review via AJAX and update form elements. |
| 149 | + * Submit a revision review via AJAX and update form elements. |
150 | 150 | * |
151 | | - * Note: requestArgs build-up from radios/checkboxes |
152 | | - * based on patch by Daniel Arnold (bug 13744) |
153 | | - */ |
| 151 | + * Note: requestArgs build-up from radios/checkboxes |
| 152 | + * based on patch by Daniel Arnold (bug 13744) |
| 153 | + */ |
154 | 154 | 'submitRevisionReview': function( button, form ) { |
155 | 155 | fr.lockReviewForm( form ); // disallow submissions |
156 | 156 | // Build up arguments array and update submit button text... |
— | — | @@ -207,8 +207,8 @@ |
208 | 208 | }, |
209 | 209 | |
210 | 210 | /* |
211 | | - * Update form elements after AJAX review. |
212 | | - */ |
| 211 | + * Update form elements after AJAX review. |
| 212 | + */ |
213 | 213 | 'postSubmitRevisionReview': function( form, response ) { |
214 | 214 | var msg = response.substr(6); // remove <err#> or <suc#> |
215 | 215 | // Read new "last change time" timestamp for conflict handling |
— | — | @@ -308,8 +308,8 @@ |
309 | 309 | }, |
310 | 310 | |
311 | 311 | /* |
312 | | - * Enable AJAX-based functionality to set that a user is reviewing a page/diff |
313 | | - */ |
| 312 | + * Enable AJAX-based functionality to set that a user is reviewing a page/diff |
| 313 | + */ |
314 | 314 | 'enableAjaxReviewActivity': function() { |
315 | 315 | // User is already reviewing in another tab... |
316 | 316 | if ( $('#mw-fr-user-reviewing').val() === 1 ) { |
— | — | @@ -323,8 +323,8 @@ |
324 | 324 | }, |
325 | 325 | |
326 | 326 | /* |
327 | | - * Flag users as "now reviewing" |
328 | | - */ |
| 327 | + * Flag users as "now reviewing" |
| 328 | + */ |
329 | 329 | 'advertiseReviewing': function( e, isInitial ) { |
330 | 330 | if ( isInitial !== true ) { // don't send if just setting up form |
331 | 331 | if ( !fr.setReviewingStatus( 1 ) ) { |
— | — | @@ -349,8 +349,8 @@ |
350 | 350 | }, |
351 | 351 | |
352 | 352 | /* |
353 | | - * Flag users as "no longer reviewing" |
354 | | - */ |
| 353 | + * Flag users as "no longer reviewing" |
| 354 | + */ |
355 | 355 | 'deadvertiseReviewing': function( e, isInitial ) { |
356 | 356 | if ( isInitial !== true ) { // don't send if just setting up form |
357 | 357 | if ( !fr.setReviewingStatus( 0 ) ) { |
— | — | @@ -377,8 +377,8 @@ |
378 | 378 | }, |
379 | 379 | |
380 | 380 | /* |
381 | | - * Set reviewing status for this page/diff |
382 | | - */ |
| 381 | + * Set reviewing status for this page/diff |
| 382 | + */ |
383 | 383 | 'setReviewingStatus': function( value ) { |
384 | 384 | var res = false; |
385 | 385 | // Get {previd,oldid} array for this page view. |
Index: trunk/extensions/FlaggedRevs/frontend/FlaggedRevsLogView.php |
— | — | @@ -2,9 +2,9 @@ |
3 | 3 | |
4 | 4 | class FlaggedRevsLogView { |
5 | 5 | /** |
6 | | - * Add setting change description to log line |
7 | | - * @return string |
8 | | - */ |
| 6 | + * Add setting change description to log line |
| 7 | + * @return string |
| 8 | + */ |
9 | 9 | public static function stabilityLogText( |
10 | 10 | $type, $action, $title = null, $skin = null, $params = array() |
11 | 11 | ) { |
— | — | @@ -26,13 +26,13 @@ |
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
30 | | - * Add history page link to log line |
| 30 | + * Add history page link to log line |
31 | 31 | * |
32 | | - * @param Title $title |
33 | | - * @param string $timestamp |
34 | | - * @param array $params |
35 | | - * @return string |
36 | | - */ |
| 32 | + * @param Title $title |
| 33 | + * @param string $timestamp |
| 34 | + * @param array $params |
| 35 | + * @return string |
| 36 | + */ |
37 | 37 | public static function stabilityLogLinks( $title, $timestamp, $params ) { |
38 | 38 | global $wgUser; |
39 | 39 | # Add history link showing edits right before the config change |
— | — | @@ -47,12 +47,12 @@ |
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | | - * Make a list of stability settings for display |
| 51 | + * Make a list of stability settings for display |
52 | 52 | * |
53 | | - * @param array $pars assoc array |
54 | | - * @param bool $forContent |
55 | | - * @return string |
56 | | - */ |
| 53 | + * @param array $pars assoc array |
| 54 | + * @param bool $forContent |
| 55 | + * @return string |
| 56 | + */ |
57 | 57 | public static function stabilitySettings( array $pars, $forContent ) { |
58 | 58 | global $wgLang, $wgContLang; |
59 | 59 | $set = array(); |
— | — | @@ -94,8 +94,8 @@ |
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
98 | | - * Create revision, diff, and history links for log line entry |
99 | | - */ |
| 98 | + * Create revision, diff, and history links for log line entry |
| 99 | + */ |
100 | 100 | public static function reviewLogLinks( $action, $title, $params ) { |
101 | 101 | global $wgUser, $wgLang; |
102 | 102 | $links = ''; |
Index: trunk/extensions/FlaggedRevs/backend/FRDependencyUpdate.php |
— | — | @@ -74,10 +74,10 @@ |
75 | 75 | } |
76 | 76 | |
77 | 77 | /* |
78 | | - * Get existing cache dependancies |
79 | | - * @param int $flags FR_MASTER |
80 | | - * @return array (ns => dbKey => 1) |
81 | | - */ |
| 78 | + * Get existing cache dependancies |
| 79 | + * @param int $flags FR_MASTER |
| 80 | + * @return array (ns => dbKey => 1) |
| 81 | + */ |
82 | 82 | protected function getExistingDeps( $flags = 0 ) { |
83 | 83 | $db = ( $flags & FR_MASTER ) ? |
84 | 84 | wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); |
— | — | @@ -97,9 +97,9 @@ |
98 | 98 | } |
99 | 99 | |
100 | 100 | /* |
101 | | - * Get INSERT rows for cache dependancies in $new but not in $existing |
102 | | - * @return array |
103 | | - */ |
| 101 | + * Get INSERT rows for cache dependancies in $new but not in $existing |
| 102 | + * @return array |
| 103 | + */ |
104 | 104 | protected function getDepInsertions( array $existing, array $new ) { |
105 | 105 | $arr = array(); |
106 | 106 | foreach ( $new as $ns => $dbkeys ) { |
— | — | @@ -120,9 +120,9 @@ |
121 | 121 | } |
122 | 122 | |
123 | 123 | /* |
124 | | - * Get WHERE clause to delete items in $existing but not in $new |
125 | | - * @return mixed (array/false) |
126 | | - */ |
| 124 | + * Get WHERE clause to delete items in $existing but not in $new |
| 125 | + * @return mixed (array/false) |
| 126 | + */ |
127 | 127 | protected function getDepDeletions( array $existing, array $new ) { |
128 | 128 | $del = array(); |
129 | 129 | foreach ( $existing as $ns => $dbkeys ) { |
Index: trunk/extensions/FlaggedRevs/backend/FRUserCounters.php |
— | — | @@ -4,12 +4,12 @@ |
5 | 5 | */ |
6 | 6 | class FRUserCounters { |
7 | 7 | /** |
8 | | - * Get params for a user ID |
9 | | - * @param int $uid |
10 | | - * @param int $flags FR_MASTER, FR_FOR_UPDATE |
11 | | - * @param string $dBName, optional wiki name |
12 | | - * @return array |
13 | | - */ |
| 8 | + * Get params for a user ID |
| 9 | + * @param int $uid |
| 10 | + * @param int $flags FR_MASTER, FR_FOR_UPDATE |
| 11 | + * @param string $dBName, optional wiki name |
| 12 | + * @return array |
| 13 | + */ |
14 | 14 | public static function getUserParams( $uid, $flags = 0, $dBName = false ) { |
15 | 15 | $p = array(); |
16 | 16 | $row = self::fetchParamsRow( $uid, $flags, $dBName ); |
— | — | @@ -21,10 +21,10 @@ |
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
25 | | - * Get params for a user |
26 | | - * @param User $user |
27 | | - * @return array|null |
28 | | - */ |
| 25 | + * Get params for a user |
| 26 | + * @param User $user |
| 27 | + * @return array|null |
| 28 | + */ |
29 | 29 | public static function getParams( User $user ) { |
30 | 30 | if ( $user->getId() ) { |
31 | 31 | if ( !isset( $user->fr_user_params ) ) { // process cache... |
— | — | @@ -36,9 +36,9 @@ |
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | | - * Initializes unset param fields to their starting values |
41 | | - * @param &array $p |
42 | | - */ |
| 40 | + * Initializes unset param fields to their starting values |
| 41 | + * @param &array $p |
| 42 | + */ |
43 | 43 | protected static function setUnitializedFields( array &$p ) { |
44 | 44 | if ( !isset( $p['uniqueContentPages'] ) ) { |
45 | 45 | $p['uniqueContentPages'] = array(); |
— | — | @@ -55,12 +55,12 @@ |
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
59 | | - * Get the params row for a user |
60 | | - * @param int $uid |
61 | | - * @param int $flags FR_MASTER, FR_FOR_UPDATE |
62 | | - * @param string $dBName, optional wiki name |
63 | | - * @return mixed (false or Row) |
64 | | - */ |
| 59 | + * Get the params row for a user |
| 60 | + * @param int $uid |
| 61 | + * @param int $flags FR_MASTER, FR_FOR_UPDATE |
| 62 | + * @param string $dBName, optional wiki name |
| 63 | + * @return mixed (false or Row) |
| 64 | + */ |
65 | 65 | protected static function fetchParamsRow( $uid, $flags = 0, $dBName = false ) { |
66 | 66 | $options = array(); |
67 | 67 | if ( $flags & FR_MASTER || $flags & FR_FOR_UPDATE ) { |
— | — | @@ -78,12 +78,12 @@ |
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
82 | | - * Save params for a user |
83 | | - * @param int $uid |
84 | | - * @param array $params |
85 | | - * @param string $dBName, optional wiki name |
86 | | - * @return bool success |
87 | | - */ |
| 82 | + * Save params for a user |
| 83 | + * @param int $uid |
| 84 | + * @param array $params |
| 85 | + * @param string $dBName, optional wiki name |
| 86 | + * @return bool success |
| 87 | + */ |
88 | 88 | public static function saveUserParams( $uid, array $params, $dBName = false ) { |
89 | 89 | $dbw = wfGetDB( DB_MASTER, array(), $dBName ); |
90 | 90 | $dbw->replace( 'flaggedrevs_promote', |
— | — | @@ -96,11 +96,11 @@ |
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
100 | | - * Increments a count for a user |
101 | | - * @param int $uid User id |
102 | | - * @param string $param Count name |
103 | | - * @return string |
104 | | - */ |
| 100 | + * Increments a count for a user |
| 101 | + * @param int $uid User id |
| 102 | + * @param string $param Count name |
| 103 | + * @return string |
| 104 | + */ |
105 | 105 | public static function incCount( $uid, $param ) { |
106 | 106 | $p = self::getUserParams( $uid, FR_FOR_UPDATE ); |
107 | 107 | if ( !isset( $p[$param] ) ) { |
— | — | @@ -111,11 +111,11 @@ |
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
115 | | - * Flatten params for a user for DB storage |
116 | | - * Note: param values must be integers |
117 | | - * @param array $params |
118 | | - * @return string |
119 | | - */ |
| 115 | + * Flatten params for a user for DB storage |
| 116 | + * Note: param values must be integers |
| 117 | + * @param array $params |
| 118 | + * @return string |
| 119 | + */ |
120 | 120 | protected static function flattenParams( array $params ) { |
121 | 121 | $flatRows = array(); |
122 | 122 | foreach ( $params as $key => $value ) { |
— | — | @@ -133,10 +133,10 @@ |
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
137 | | - * Expand params for a user from DB storage |
138 | | - * @param string $flatPars |
139 | | - * @return array |
140 | | - */ |
| 137 | + * Expand params for a user from DB storage |
| 138 | + * @param string $flatPars |
| 139 | + * @return array |
| 140 | + */ |
141 | 141 | protected static function expandParams( $flatPars ) { |
142 | 142 | $p = array(); // init |
143 | 143 | $flatPars = explode( "\n", trim( $flatPars ) ); |
— | — | @@ -157,12 +157,12 @@ |
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
161 | | - * Update users params array for a user on edit |
162 | | - * @param &array $p user params |
163 | | - * @param Page $article the article just edited |
164 | | - * @param string $summary edit summary |
165 | | - * @return bool anything changed |
166 | | - */ |
| 161 | + * Update users params array for a user on edit |
| 162 | + * @param &array $p user params |
| 163 | + * @param Page $article the article just edited |
| 164 | + * @param string $summary edit summary |
| 165 | + * @return bool anything changed |
| 166 | + */ |
167 | 167 | public static function updateUserParams( array &$p, Page $article, $summary ) { |
168 | 168 | global $wgFlaggedRevsAutoconfirm, $wgFlaggedRevsAutopromote; |
169 | 169 | # Update any special counters for non-null revisions |
Index: trunk/extensions/FlaggedRevs/backend/FlaggedRevs.hooks.php |
— | — | @@ -4,8 +4,8 @@ |
5 | 5 | */ |
6 | 6 | class FlaggedRevsHooks { |
7 | 7 | /** |
8 | | - * Update flaggedrevs table on revision restore |
9 | | - */ |
| 8 | + * Update flaggedrevs table on revision restore |
| 9 | + */ |
10 | 10 | public static function onRevisionRestore( $title, Revision $revision, $oldPageID ) { |
11 | 11 | $dbw = wfGetDB( DB_MASTER ); |
12 | 12 | # Some revisions may have had null rev_id values stored when deleted. |
— | — | @@ -20,8 +20,8 @@ |
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
24 | | - * Update flaggedrevs page/tracking tables (revision moving) |
25 | | - */ |
| 24 | + * Update flaggedrevs page/tracking tables (revision moving) |
| 25 | + */ |
26 | 26 | public static function onArticleMergeComplete( Title $sourceTitle, Title $destTitle ) { |
27 | 27 | $oldPageID = $sourceTitle->getArticleID(); |
28 | 28 | $newPageID = $destTitle->getArticleID(); |
— | — | @@ -56,9 +56,9 @@ |
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | | - * (a) Update flaggedrevs page/tracking tables |
61 | | - * (b) Autoreview pages moved into content NS |
62 | | - */ |
| 60 | + * (a) Update flaggedrevs page/tracking tables |
| 61 | + * (b) Autoreview pages moved into content NS |
| 62 | + */ |
63 | 63 | public static function onTitleMoveComplete( |
64 | 64 | Title $otitle, Title $ntitle, $user, $pageId |
65 | 65 | ) { |
— | — | @@ -87,10 +87,10 @@ |
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
91 | | - * (a) Update flaggedrevs page/tracking tables |
92 | | - * (b) Pages with stable versions that use this page will be purged |
93 | | - * Note: pages with current versions that use this page should already be purged |
94 | | - */ |
| 91 | + * (a) Update flaggedrevs page/tracking tables |
| 92 | + * (b) Pages with stable versions that use this page will be purged |
| 93 | + * Note: pages with current versions that use this page should already be purged |
| 94 | + */ |
95 | 95 | public static function onArticleEditUpdates( Page $article, $editInfo ) { |
96 | 96 | FlaggedRevs::stableVersionUpdates( $article->getTitle(), null, null, $editInfo ); |
97 | 97 | FlaggedRevs::extraHTMLCacheUpdate( $article->getTitle() ); |
— | — | @@ -98,10 +98,10 @@ |
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
102 | | - * (a) Update flaggedrevs page/tracking tables |
103 | | - * (b) Pages with stable versions that use this page will be purged |
104 | | - * Note: pages with current versions that use this page should already be purged |
105 | | - */ |
| 102 | + * (a) Update flaggedrevs page/tracking tables |
| 103 | + * (b) Pages with stable versions that use this page will be purged |
| 104 | + * Note: pages with current versions that use this page should already be purged |
| 105 | + */ |
106 | 106 | public static function onArticleDelete( Page $article, $user, $reason, $id ) { |
107 | 107 | FlaggedRevs::clearTrackingRows( $id ); |
108 | 108 | FlaggedRevs::extraHTMLCacheUpdate( $article->getTitle() ); |
— | — | @@ -109,10 +109,10 @@ |
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
113 | | - * (a) Update flaggedrevs page/tracking tables |
114 | | - * (b) Pages with stable versions that use this page will be purged |
115 | | - * Note: pages with current versions that use this page should already be purged |
116 | | - */ |
| 113 | + * (a) Update flaggedrevs page/tracking tables |
| 114 | + * (b) Pages with stable versions that use this page will be purged |
| 115 | + * Note: pages with current versions that use this page should already be purged |
| 116 | + */ |
117 | 117 | public static function onArticleUndelete( Title $title ) { |
118 | 118 | FlaggedRevs::stableVersionUpdates( $title ); |
119 | 119 | FlaggedRevs::HTMLCacheUpdates( $title ); |
— | — | @@ -120,10 +120,10 @@ |
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
124 | | - * (a) Update flaggedrevs page/tracking tables |
125 | | - * (b) Pages with stable versions that use this page will be purged |
126 | | - * Note: pages with current versions that use this page should already be purged |
127 | | - */ |
| 124 | + * (a) Update flaggedrevs page/tracking tables |
| 125 | + * (b) Pages with stable versions that use this page will be purged |
| 126 | + * Note: pages with current versions that use this page should already be purged |
| 127 | + */ |
128 | 128 | public static function onFileUpload( File $file ) { |
129 | 129 | FlaggedRevs::stableVersionUpdates( $file->getTitle() ); |
130 | 130 | FlaggedRevs::extraHTMLCacheUpdate( $file->getTitle() ); |
— | — | @@ -131,8 +131,8 @@ |
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
135 | | - * Update flaggedrevs page/tracking tables |
136 | | - */ |
| 135 | + * Update flaggedrevs page/tracking tables |
| 136 | + */ |
137 | 137 | public static function onRevisionDelete( Title $title ) { |
138 | 138 | $changed = FlaggedRevs::stableVersionUpdates( $title ); |
139 | 139 | if ( $changed ) { |
— | — | @@ -142,9 +142,9 @@ |
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
146 | | - * Select the desired templates based on the selected stable revision IDs |
147 | | - * Note: $parser can be false |
148 | | - */ |
| 146 | + * Select the desired templates based on the selected stable revision IDs |
| 147 | + * Note: $parser can be false |
| 148 | + */ |
149 | 149 | public static function parserFetchStableTemplate( $parser, Title $title, &$skip, &$id ) { |
150 | 150 | if ( !( $parser instanceof Parser ) ) { |
151 | 151 | return true; // nothing to do |
— | — | @@ -178,8 +178,8 @@ |
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
182 | | - * Select the desired images based on the selected stable version time/SHA-1 |
183 | | - */ |
| 182 | + * Select the desired images based on the selected stable version time/SHA-1 |
| 183 | + */ |
184 | 184 | public static function parserFetchStableFile( $parser, Title $title, &$options, &$query ) { |
185 | 185 | if ( !( $parser instanceof Parser ) ) { |
186 | 186 | return true; // nothing to do |
— | — | @@ -286,9 +286,9 @@ |
287 | 287 | } |
288 | 288 | |
289 | 289 | /** |
290 | | - * Detect if a ParserOutput object was added without mImageTimeKeys set. |
291 | | - * This is needed for older, cached, ParserOutput objects. |
292 | | - */ |
| 290 | + * Detect if a ParserOutput object was added without mImageTimeKeys set. |
| 291 | + * This is needed for older, cached, ParserOutput objects. |
| 292 | + */ |
293 | 293 | public static function outputSetVersioningFlag( OutputPage $out, ParserOutput $parserOut ) { |
294 | 294 | if ( !FlaggedRevs::parserOutputIsVersioned( $parserOut ) ) { |
295 | 295 | $out->fr_unversionedIncludes = true; |
— | — | @@ -297,8 +297,8 @@ |
298 | 298 | } |
299 | 299 | |
300 | 300 | /** |
301 | | - * Check page move and patrol permissions for FlaggedRevs |
302 | | - */ |
| 301 | + * Check page move and patrol permissions for FlaggedRevs |
| 302 | + */ |
303 | 303 | public static function onUserCan( Title $title, $user, $action, &$result ) { |
304 | 304 | if ( $result === false ) { |
305 | 305 | return true; // nothing to do |
— | — | @@ -345,15 +345,15 @@ |
346 | 346 | } |
347 | 347 | |
348 | 348 | /** |
349 | | - * When an edit is made by a user, review it if either: |
350 | | - * (a) The user can 'autoreview' and the edit's base revision is a checked |
351 | | - * (b) The edit is a self-revert to the stable version (by anyone) |
352 | | - * (c) The user can 'autoreview' new pages and this edit is a new page |
353 | | - * (d) The user can 'review' and the "review pending edits" checkbox was checked |
| 349 | + * When an edit is made by a user, review it if either: |
| 350 | + * (a) The user can 'autoreview' and the edit's base revision is a checked |
| 351 | + * (b) The edit is a self-revert to the stable version (by anyone) |
| 352 | + * (c) The user can 'autoreview' new pages and this edit is a new page |
| 353 | + * (d) The user can 'review' and the "review pending edits" checkbox was checked |
354 | 354 | * |
355 | | - * Note: RC items not inserted yet, RecentChange_save hook does rc_patrolled bit... |
356 | | - * Note: $article one of Article, ImagePage, Category page as appropriate. |
357 | | - */ |
| 355 | + * Note: RC items not inserted yet, RecentChange_save hook does rc_patrolled bit... |
| 356 | + * Note: $article one of Article, ImagePage, Category page as appropriate. |
| 357 | + */ |
358 | 358 | public static function maybeMakeEditReviewed( |
359 | 359 | Page $article, $rev, $baseRevId = false, $user = null |
360 | 360 | ) { |
— | — | @@ -485,8 +485,8 @@ |
486 | 486 | } |
487 | 487 | |
488 | 488 | /** |
489 | | - * Check if a user reverted himself to the stable version |
490 | | - */ |
| 489 | + * Check if a user reverted himself to the stable version |
| 490 | + */ |
491 | 491 | protected static function isSelfRevertToStable( |
492 | 492 | Revision $rev, $srev, $baseRevId, $user |
493 | 493 | ) { |
— | — | @@ -522,11 +522,11 @@ |
523 | 523 | } |
524 | 524 | |
525 | 525 | /** |
526 | | - * When an user makes a null-edit we sometimes want to review it... |
527 | | - * (a) Null undo or rollback |
528 | | - * (b) Null edit with review box checked |
529 | | - * Note: called after edit ops are finished |
530 | | - */ |
| 526 | + * When an user makes a null-edit we sometimes want to review it... |
| 527 | + * (a) Null undo or rollback |
| 528 | + * (b) Null edit with review box checked |
| 529 | + * Note: called after edit ops are finished |
| 530 | + */ |
531 | 531 | public static function maybeNullEditReview( |
532 | 532 | Page $article, $user, $text, $s, $m, $a, $b, $flags, $rev, &$status, $baseId |
533 | 533 | ) { |
— | — | @@ -594,12 +594,12 @@ |
595 | 595 | } |
596 | 596 | |
597 | 597 | /** |
598 | | - * When an edit is made to a page: |
599 | | - * (a) If the page is reviewable, silently mark the edit patrolled if it was auto-reviewed |
600 | | - * (b) If the page can be patrolled, auto-patrol the edit patrolled as normal |
601 | | - * (c) If the page is new and $wgUseNPPatrol is on, auto-patrol the edit patrolled as normal |
602 | | - * (d) If the edit is neither reviewable nor patrolleable, silently mark it patrolled |
603 | | - */ |
| 598 | + * When an edit is made to a page: |
| 599 | + * (a) If the page is reviewable, silently mark the edit patrolled if it was auto-reviewed |
| 600 | + * (b) If the page can be patrolled, auto-patrol the edit patrolled as normal |
| 601 | + * (c) If the page is new and $wgUseNPPatrol is on, auto-patrol the edit patrolled as normal |
| 602 | + * (d) If the edit is neither reviewable nor patrolleable, silently mark it patrolled |
| 603 | + */ |
604 | 604 | public static function autoMarkPatrolled( RecentChange &$rc ) { |
605 | 605 | if ( empty( $rc->mAttribs['rc_this_oldid'] ) ) { |
606 | 606 | return true; |
— | — | @@ -698,12 +698,12 @@ |
699 | 699 | } |
700 | 700 | |
701 | 701 | /** |
702 | | - * Check if a user has enough implicitly reviewed edits (before stable version) |
703 | | - * @param $user User |
704 | | - * @param $editsReq int |
705 | | - * @param $cutoff_unixtime int exclude edits after this timestamp |
706 | | - * @return bool |
707 | | - */ |
| 702 | + * Check if a user has enough implicitly reviewed edits (before stable version) |
| 703 | + * @param $user User |
| 704 | + * @param $editsReq int |
| 705 | + * @param $cutoff_unixtime int exclude edits after this timestamp |
| 706 | + * @return bool |
| 707 | + */ |
708 | 708 | protected static function reviewedEditsCheck( $user, $editsReq, $cutoff_unixtime = 0 ) { |
709 | 709 | $dbr = wfGetDB( DB_SLAVE ); |
710 | 710 | $encCutoff = $dbr->addQuotes( $dbr->timestamp( $cutoff_unixtime ) ); |
— | — | @@ -721,8 +721,8 @@ |
722 | 722 | } |
723 | 723 | |
724 | 724 | /** |
725 | | - * Checks if $user was previously blocked since $cutoff_unixtime |
726 | | - */ |
| 725 | + * Checks if $user was previously blocked since $cutoff_unixtime |
| 726 | + */ |
727 | 727 | protected static function wasPreviouslyBlocked( User $user, $cutoff_unixtime = 0 ) { |
728 | 728 | $dbr = wfGetDB( DB_SLAVE ); |
729 | 729 | $conds = array( |
— | — | @@ -771,8 +771,8 @@ |
772 | 772 | } |
773 | 773 | |
774 | 774 | /** |
775 | | - * Grant 'autoreview' rights to users with the 'bot' right |
776 | | - */ |
| 775 | + * Grant 'autoreview' rights to users with the 'bot' right |
| 776 | + */ |
777 | 777 | public static function onUserGetRights( $user, array &$rights ) { |
778 | 778 | # Make sure bots always have the 'autoreview' right |
779 | 779 | if ( in_array( 'bot', $rights ) && !in_array( 'autoreview', $rights ) ) { |
— | — | @@ -782,9 +782,9 @@ |
783 | 783 | } |
784 | 784 | |
785 | 785 | /** |
786 | | - * Callback that autopromotes user according to the setting in |
787 | | - * $wgFlaggedRevsAutopromote. This also handles user stats tallies. |
788 | | - */ |
| 786 | + * Callback that autopromotes user according to the setting in |
| 787 | + * $wgFlaggedRevsAutopromote. This also handles user stats tallies. |
| 788 | + */ |
789 | 789 | public static function onArticleSaveComplete( |
790 | 790 | Page $article, $user, $text, $summary, $m, $a, $b, &$f, $rev |
791 | 791 | ) { |
— | — | @@ -805,10 +805,10 @@ |
806 | 806 | } |
807 | 807 | |
808 | 808 | /** |
809 | | - * Check an autopromote condition that is defined by FlaggedRevs |
| 809 | + * Check an autopromote condition that is defined by FlaggedRevs |
810 | 810 | * |
811 | | - * Note: some unobtrusive caching is used to avoid DB hits. |
812 | | - */ |
| 811 | + * Note: some unobtrusive caching is used to avoid DB hits. |
| 812 | + */ |
813 | 813 | public static function checkAutoPromoteCond( $cond, array $params, User $user, &$result ) { |
814 | 814 | global $wgMemc; |
815 | 815 | switch( $cond ) { |
Index: trunk/extensions/FlaggedRevs/backend/FlaggedRevsLog.php |
— | — | @@ -2,25 +2,25 @@ |
3 | 3 | |
4 | 4 | class FlaggedRevsLog { |
5 | 5 | /** |
6 | | - * $action is a valid review log action |
7 | | - * @return bool |
8 | | - */ |
| 6 | + * $action is a valid review log action |
| 7 | + * @return bool |
| 8 | + */ |
9 | 9 | public static function isReviewAction( $action ) { |
10 | 10 | return preg_match( '/^(approve2?(-i|-a|-ia)?|unapprove2?)$/', $action ); |
11 | 11 | } |
12 | 12 | |
13 | 13 | /** |
14 | | - * $action is a valid stability log action |
15 | | - * @return bool |
16 | | - */ |
| 14 | + * $action is a valid stability log action |
| 15 | + * @return bool |
| 16 | + */ |
17 | 17 | public static function isStabilityAction( $action ) { |
18 | 18 | return preg_match( '/^(config|modify|reset)$/', $action ); |
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
22 | | - * $action is a valid review log deprecate action |
23 | | - * @return bool |
24 | | - */ |
| 22 | + * $action is a valid review log deprecate action |
| 23 | + * @return bool |
| 24 | + */ |
25 | 25 | public static function isReviewDeapproval( $action ) { |
26 | 26 | return ( $action == 'unapprove' || $action == 'unapprove2' ); |
27 | 27 | } |
Index: trunk/extensions/FlaggedRevs/backend/FlaggedRevs.class.php |
— | — | @@ -408,11 +408,11 @@ |
409 | 409 | # ################ Permission functions ################# |
410 | 410 | |
411 | 411 | /* |
412 | | - * Sanity check a (tag,value) pair |
413 | | - * @param string $tag |
414 | | - * @param int $value |
415 | | - * @return bool |
416 | | - */ |
| 412 | + * Sanity check a (tag,value) pair |
| 413 | + * @param string $tag |
| 414 | + * @param int $value |
| 415 | + * @return bool |
| 416 | + */ |
417 | 417 | public static function tagIsValid( $tag, $value ) { |
418 | 418 | $levels = self::getTagLevels( $tag ); |
419 | 419 | $highest = count( $levels ) - 1; |
— | — | @@ -496,11 +496,11 @@ |
497 | 497 | } |
498 | 498 | |
499 | 499 | /** |
500 | | - * Check if a user can set the autoreview restiction level to $right |
501 | | - * @param User $user |
502 | | - * @param string $right the level |
503 | | - * @return bool |
504 | | - */ |
| 500 | + * Check if a user can set the autoreview restiction level to $right |
| 501 | + * @param User $user |
| 502 | + * @param string $right the level |
| 503 | + * @return bool |
| 504 | + */ |
505 | 505 | public static function userCanSetAutoreviewLevel( $user, $right ) { |
506 | 506 | if ( $right == '' ) { |
507 | 507 | return true; // no restrictions (none) |
— | — | @@ -601,13 +601,13 @@ |
602 | 602 | # ################ Tracking/cache update update functions ################# |
603 | 603 | |
604 | 604 | /** |
605 | | - * Update the page tables with a new stable version. |
606 | | - * @param Title $title |
607 | | - * @param FlaggedRevision|null $sv, the new stable version (optional) |
608 | | - * @param FlaggedRevision|null $oldSv, the old stable version (optional) |
609 | | - * @param Object editInfo Article edit info about the current revision (optional) |
610 | | - * @return bool stable version text/file changed and FR_INCLUDES_STABLE |
611 | | - */ |
| 605 | + * Update the page tables with a new stable version. |
| 606 | + * @param Title $title |
| 607 | + * @param FlaggedRevision|null $sv, the new stable version (optional) |
| 608 | + * @param FlaggedRevision|null $oldSv, the old stable version (optional) |
| 609 | + * @param Object editInfo Article edit info about the current revision (optional) |
| 610 | + * @return bool stable version text/file changed and FR_INCLUDES_STABLE |
| 611 | + */ |
612 | 612 | public static function stableVersionUpdates( |
613 | 613 | Title $title, $sv = null, $oldSv = null, $editInfo = null |
614 | 614 | ) { |
— | — | @@ -652,9 +652,9 @@ |
653 | 653 | } |
654 | 654 | |
655 | 655 | /** |
656 | | - * Clear FlaggedRevs tracking tables for this page |
657 | | - * @param int|array $pageId (int or array) |
658 | | - */ |
| 656 | + * Clear FlaggedRevs tracking tables for this page |
| 657 | + * @param int|array $pageId (int or array) |
| 658 | + */ |
659 | 659 | public static function clearTrackingRows( $pageId ) { |
660 | 660 | $dbw = wfGetDB( DB_MASTER ); |
661 | 661 | $dbw->delete( 'flaggedpages', array( 'fp_page_id' => $pageId ), __METHOD__ ); |
— | — | @@ -663,10 +663,10 @@ |
664 | 664 | } |
665 | 665 | |
666 | 666 | /** |
667 | | - * @param Page $article |
668 | | - * @param parserOutput $parserOut |
669 | | - * Updates the stable-only cache dependency table |
670 | | - */ |
| 667 | + * @param Page $article |
| 668 | + * @param parserOutput $parserOut |
| 669 | + * Updates the stable-only cache dependency table |
| 670 | + */ |
671 | 671 | public static function updateStableOnlyDeps( Page $article, ParserOutput $stableOut ) { |
672 | 672 | wfProfileIn( __METHOD__ ); |
673 | 673 | if ( !wfReadOnly() ) { |
— | — | @@ -677,29 +677,29 @@ |
678 | 678 | } |
679 | 679 | |
680 | 680 | /** |
681 | | - * Clear tracking table of stable-only links for this page |
682 | | - * @param int|array $pageId (int or array) |
683 | | - */ |
| 681 | + * Clear tracking table of stable-only links for this page |
| 682 | + * @param int|array $pageId (int or array) |
| 683 | + */ |
684 | 684 | public static function clearStableOnlyDeps( $pageId ) { |
685 | 685 | $dbw = wfGetDB( DB_MASTER ); |
686 | 686 | $dbw->delete( 'flaggedrevs_tracking', array( 'ftr_from' => $pageId ), __METHOD__ ); |
687 | 687 | } |
688 | 688 | |
689 | 689 | /** |
690 | | - * @param Title $title |
691 | | - * Updates squid cache for a title. Defers till after main commit(). |
692 | | - */ |
| 690 | + * @param Title $title |
| 691 | + * Updates squid cache for a title. Defers till after main commit(). |
| 692 | + */ |
693 | 693 | public static function purgeSquid( Title $title ) { |
694 | 694 | global $wgDeferredUpdateList; |
695 | 695 | $wgDeferredUpdateList[] = new FRSquidUpdate( $title ); |
696 | 696 | } |
697 | 697 | |
698 | 698 | /** |
699 | | - * Do cache updates for when the stable version of a page changed. |
700 | | - * Invalidates/purges pages that include the given page. |
701 | | - * @param Title $title |
702 | | - * @param bool $recursive |
703 | | - */ |
| 699 | + * Do cache updates for when the stable version of a page changed. |
| 700 | + * Invalidates/purges pages that include the given page. |
| 701 | + * @param Title $title |
| 702 | + * @param bool $recursive |
| 703 | + */ |
704 | 704 | public static function HTMLCacheUpdates( Title $title ) { |
705 | 705 | global $wgDeferredUpdateList; |
706 | 706 | # Invalidate caches of articles which include this page... |
— | — | @@ -711,9 +711,9 @@ |
712 | 712 | } |
713 | 713 | |
714 | 714 | /** |
715 | | - * Invalidates/purges pages where only stable version includes this page. |
716 | | - * @param Title $title |
717 | | - */ |
| 715 | + * Invalidates/purges pages where only stable version includes this page. |
| 716 | + * @param Title $title |
| 717 | + */ |
718 | 718 | public static function extraHTMLCacheUpdate( Title $title ) { |
719 | 719 | global $wgDeferredUpdateList; |
720 | 720 | $wgDeferredUpdateList[] = new FRExtraCacheUpdate( $title ); |
— | — | @@ -756,12 +756,12 @@ |
757 | 757 | } |
758 | 758 | |
759 | 759 | /** |
760 | | - * Return memc value if not expired |
761 | | - * @param object|false $data makeMemcObj() tuple |
762 | | - * @param Page $article |
763 | | - * @param $allowStale Use 'allowStale' to skip page_touched check |
764 | | - * @return mixed |
765 | | - */ |
| 760 | + * Return memc value if not expired |
| 761 | + * @param object|false $data makeMemcObj() tuple |
| 762 | + * @param Page $article |
| 763 | + * @param $allowStale Use 'allowStale' to skip page_touched check |
| 764 | + * @return mixed |
| 765 | + */ |
766 | 766 | public static function getMemcValue( $data, Page $article, $allowStale = '' ) { |
767 | 767 | if ( is_object( $data ) ) { |
768 | 768 | if ( $allowStale === 'allowStale' || $data->time >= $article->getTouched() ) { |
— | — | @@ -772,27 +772,27 @@ |
773 | 773 | } |
774 | 774 | |
775 | 775 | /** |
776 | | - * @param array $flags |
777 | | - * @return bool, is this revision at basic review condition? |
778 | | - */ |
| 776 | + * @param array $flags |
| 777 | + * @return bool, is this revision at basic review condition? |
| 778 | + */ |
779 | 779 | public static function isChecked( array $flags ) { |
780 | 780 | self::load(); |
781 | 781 | return self::tagsAtLevel( $flags, self::$minSL ); |
782 | 782 | } |
783 | 783 | |
784 | 784 | /** |
785 | | - * @param array $flags |
786 | | - * @return bool, is this revision at quality review condition? |
787 | | - */ |
| 785 | + * @param array $flags |
| 786 | + * @return bool, is this revision at quality review condition? |
| 787 | + */ |
788 | 788 | public static function isQuality( array $flags ) { |
789 | 789 | self::load(); |
790 | 790 | return self::tagsAtLevel( $flags, self::$minQL ); |
791 | 791 | } |
792 | 792 | |
793 | 793 | /** |
794 | | - * @param array $flags |
795 | | - * @return bool, is this revision at pristine review condition? |
796 | | - */ |
| 794 | + * @param array $flags |
| 795 | + * @return bool, is this revision at pristine review condition? |
| 796 | + */ |
797 | 797 | public static function isPristine( array $flags ) { |
798 | 798 | self::load(); |
799 | 799 | return self::tagsAtLevel( $flags, self::$minPL ); |
— | — | @@ -813,11 +813,11 @@ |
814 | 814 | } |
815 | 815 | |
816 | 816 | /** |
817 | | - * Get the quality tier of review flags |
818 | | - * @param array $flags |
819 | | - * @param int $default Return value if one of the tags has value < 0 |
820 | | - * @return int flagging tier (FR_PRISTINE,FR_QUALITY,FR_CHECKED,-1) |
821 | | - */ |
| 817 | + * Get the quality tier of review flags |
| 818 | + * @param array $flags |
| 819 | + * @param int $default Return value if one of the tags has value < 0 |
| 820 | + * @return int flagging tier (FR_PRISTINE,FR_QUALITY,FR_CHECKED,-1) |
| 821 | + */ |
822 | 822 | public static function getQualityTier( array $flags, $default = -1 ) { |
823 | 823 | if ( self::isPristine( $flags ) ) { |
824 | 824 | return FR_PRISTINE; // 2 |
— | — | @@ -873,20 +873,20 @@ |
874 | 874 | } |
875 | 875 | |
876 | 876 | /** |
877 | | - * Get the list of reviewable namespaces |
878 | | - * @return array |
879 | | - */ |
| 877 | + * Get the list of reviewable namespaces |
| 878 | + * @return array |
| 879 | + */ |
880 | 880 | public static function getReviewNamespaces() { |
881 | 881 | self::load(); // validates namespaces |
882 | 882 | return self::$reviewNamespaces; |
883 | 883 | } |
884 | 884 | |
885 | 885 | /** |
886 | | - * Is this page in reviewable namespace? |
887 | | - * Note: this checks $wgFlaggedRevsWhitelist |
888 | | - * @param Title, $title |
889 | | - * @return bool |
890 | | - */ |
| 886 | + * Is this page in reviewable namespace? |
| 887 | + * Note: this checks $wgFlaggedRevsWhitelist |
| 888 | + * @param Title, $title |
| 889 | + * @return bool |
| 890 | + */ |
891 | 891 | public static function inReviewNamespace( Title $title ) { |
892 | 892 | global $wgFlaggedRevsWhitelist; |
893 | 893 | if ( in_array( $title->getPrefixedDBKey(), $wgFlaggedRevsWhitelist ) ) { |
— | — | @@ -900,19 +900,19 @@ |
901 | 901 | # ################ Auto-review function ################# |
902 | 902 | |
903 | 903 | /** |
904 | | - * Automatically review an revision and add a log entry in the review log. |
| 904 | + * Automatically review an revision and add a log entry in the review log. |
905 | 905 | * |
906 | | - * This is called during edit operations after the new revision is added |
907 | | - * and the page tables updated, but before LinksUpdate is called. |
| 906 | + * This is called during edit operations after the new revision is added |
| 907 | + * and the page tables updated, but before LinksUpdate is called. |
908 | 908 | * |
909 | | - * $auto is here for revisions checked off to be reviewed. Auto-review |
910 | | - * triggers on edit, but we don't want those to count as just automatic. |
911 | | - * This also makes it so the user's name shows up in the page history. |
| 909 | + * $auto is here for revisions checked off to be reviewed. Auto-review |
| 910 | + * triggers on edit, but we don't want those to count as just automatic. |
| 911 | + * This also makes it so the user's name shows up in the page history. |
912 | 912 | * |
913 | | - * If $flags is given, then they will be the review tags. If not, the one |
914 | | - * from the stable version will be used or minimal tags if that's not possible. |
915 | | - * If no appropriate tags can be found, then the review will abort. |
916 | | - */ |
| 913 | + * If $flags is given, then they will be the review tags. If not, the one |
| 914 | + * from the stable version will be used or minimal tags if that's not possible. |
| 915 | + * If no appropriate tags can be found, then the review will abort. |
| 916 | + */ |
917 | 917 | public static function autoReviewEdit( |
918 | 918 | Page $article, $user, Revision $rev, array $flags = null, $auto = true |
919 | 919 | ) { |
Index: trunk/extensions/FlaggedRevs/backend/FRUserActivity.php |
— | — | @@ -43,10 +43,10 @@ |
44 | 44 | } |
45 | 45 | |
46 | 46 | /* |
47 | | - * Get who is currently reviewing a page |
48 | | - * @param int $pageId |
49 | | - * @return array (username or null, MW timestamp or null) |
50 | | - */ |
| 47 | + * Get who is currently reviewing a page |
| 48 | + * @param int $pageId |
| 49 | + * @return array (username or null, MW timestamp or null) |
| 50 | + */ |
51 | 51 | public static function getUserReviewingPage( $pageId ) { |
52 | 52 | global $wgMemc; |
53 | 53 | $key = wfMemcKey( 'flaggedrevs', 'userReviewingPage', $pageId ); |
— | — | @@ -57,46 +57,46 @@ |
58 | 58 | } |
59 | 59 | |
60 | 60 | /* |
61 | | - * Check if someone is currently reviewing a page |
62 | | - * @param int $pageId |
63 | | - * @return bool |
64 | | - */ |
| 61 | + * Check if someone is currently reviewing a page |
| 62 | + * @param int $pageId |
| 63 | + * @return bool |
| 64 | + */ |
65 | 65 | public static function pageIsUnderReview( $pageId ) { |
66 | 66 | $m = self::getUserReviewingPage( $pageId ); |
67 | 67 | return ( $m[0] !== null ); |
68 | 68 | } |
69 | 69 | |
70 | 70 | /* |
71 | | - * Set the flag for who is reviewing a page if not already set by someone. |
72 | | - * If already set, then increment the instance counter (multiple windows) |
73 | | - * and add on time to the expiry. |
| 71 | + * Set the flag for who is reviewing a page if not already set by someone. |
| 72 | + * If already set, then increment the instance counter (multiple windows) |
| 73 | + * and add on time to the expiry. |
74 | 74 | * |
75 | | - * @param User $user |
76 | | - * @param int $pageId |
77 | | - * @return bool flag set |
78 | | - */ |
| 75 | + * @param User $user |
| 76 | + * @param int $pageId |
| 77 | + * @return bool flag set |
| 78 | + */ |
79 | 79 | public static function setUserReviewingPage( User $user, $pageId ) { |
80 | 80 | $key = wfMemcKey( 'flaggedrevs', 'userReviewingPage', $pageId ); |
81 | 81 | return self::incUserReviewingItem( $key, $user, self::PAGE_REVIEW_SEC ); |
82 | 82 | } |
83 | 83 | |
84 | 84 | /* |
85 | | - * Clear an instance of a user reviewing a page by decrementing the counter. |
86 | | - * If it reaches 0 instances, then clear the flag for who is reviewing the page. |
87 | | - * @param User $user |
88 | | - * @param int $pageId |
89 | | - * @return bool flag unset |
90 | | - */ |
| 85 | + * Clear an instance of a user reviewing a page by decrementing the counter. |
| 86 | + * If it reaches 0 instances, then clear the flag for who is reviewing the page. |
| 87 | + * @param User $user |
| 88 | + * @param int $pageId |
| 89 | + * @return bool flag unset |
| 90 | + */ |
91 | 91 | public static function clearUserReviewingPage( User $user, $pageId ) { |
92 | 92 | $key = wfMemcKey( 'flaggedrevs', 'userReviewingPage', $pageId ); |
93 | 93 | return self::decUserReviewingItem( $key, $user, self::PAGE_REVIEW_SEC ); |
94 | 94 | } |
95 | 95 | |
96 | 96 | /* |
97 | | - * Totally clear the flag for who is reviewing a page. |
98 | | - * @param int $pageId |
99 | | - * @return void |
100 | | - */ |
| 97 | + * Totally clear the flag for who is reviewing a page. |
| 98 | + * @param int $pageId |
| 99 | + * @return void |
| 100 | + */ |
101 | 101 | public static function clearAllReviewingPage( $pageId ) { |
102 | 102 | global $wgMemc; |
103 | 103 | $key = wfMemcKey( 'flaggedrevs', 'userReviewingPage', $pageId ); |
— | — | @@ -104,11 +104,11 @@ |
105 | 105 | } |
106 | 106 | |
107 | 107 | /* |
108 | | - * Get who is currently reviewing a diff |
109 | | - * @param int $oldId |
110 | | - * @param int $newId |
111 | | - * @return array (username or null, MW timestamp or null) |
112 | | - */ |
| 108 | + * Get who is currently reviewing a diff |
| 109 | + * @param int $oldId |
| 110 | + * @param int $newId |
| 111 | + * @return array (username or null, MW timestamp or null) |
| 112 | + */ |
113 | 113 | public static function getUserReviewingDiff( $oldId, $newId ) { |
114 | 114 | global $wgMemc; |
115 | 115 | $key = wfMemcKey( 'flaggedrevs', 'userReviewingDiff', $oldId, $newId ); |
— | — | @@ -119,48 +119,48 @@ |
120 | 120 | } |
121 | 121 | |
122 | 122 | /* |
123 | | - * Check if someone is currently reviewing a diff |
124 | | - * @param int $oldId |
125 | | - * @param int $newId |
126 | | - * @return bool |
127 | | - */ |
| 123 | + * Check if someone is currently reviewing a diff |
| 124 | + * @param int $oldId |
| 125 | + * @param int $newId |
| 126 | + * @return bool |
| 127 | + */ |
128 | 128 | public static function diffIsUnderReview( $oldId, $newId ) { |
129 | 129 | $m = self::getUserReviewingDiff( $oldId, $newId ); |
130 | 130 | return ( $m[0] !== null ); |
131 | 131 | } |
132 | 132 | |
133 | 133 | /* |
134 | | - * Set the flag for who is reviewing a diff if not already set by someone. |
135 | | - * If already set, then increment the instance counter (multiple windows) |
136 | | - * and add on time to the expiry. |
137 | | - * @param User $user |
138 | | - * @param int $pageId |
139 | | - * @return bool flag set |
140 | | - */ |
| 134 | + * Set the flag for who is reviewing a diff if not already set by someone. |
| 135 | + * If already set, then increment the instance counter (multiple windows) |
| 136 | + * and add on time to the expiry. |
| 137 | + * @param User $user |
| 138 | + * @param int $pageId |
| 139 | + * @return bool flag set |
| 140 | + */ |
141 | 141 | public static function setUserReviewingDiff( User $user, $oldId, $newId ) { |
142 | 142 | $key = wfMemcKey( 'flaggedrevs', 'userReviewingDiff', $oldId, $newId ); |
143 | 143 | return self::incUserReviewingItem( $key, $user, self::CHANGE_REVIEW_SEC ); |
144 | 144 | } |
145 | 145 | |
146 | 146 | /* |
147 | | - * Clear an instance of a user reviewing a diff by decrementing the counter. |
148 | | - * If it reaches 0 instances, then clear the flag for who is reviewing the diff. |
149 | | - * @param User $user |
150 | | - * @param int $oldId |
151 | | - * @param int $newId |
152 | | - * @return bool flag unset |
153 | | - */ |
| 147 | + * Clear an instance of a user reviewing a diff by decrementing the counter. |
| 148 | + * If it reaches 0 instances, then clear the flag for who is reviewing the diff. |
| 149 | + * @param User $user |
| 150 | + * @param int $oldId |
| 151 | + * @param int $newId |
| 152 | + * @return bool flag unset |
| 153 | + */ |
154 | 154 | public static function clearUserReviewingDiff( User $user, $oldId, $newId ) { |
155 | 155 | $key = wfMemcKey( 'flaggedrevs', 'userReviewingDiff', $oldId, $newId ); |
156 | 156 | return self::decUserReviewingItem( $key, $user, self::CHANGE_REVIEW_SEC ); |
157 | 157 | } |
158 | 158 | |
159 | 159 | /* |
160 | | - * Totally clear the flag for who is reviewing a diff. |
161 | | - * @param int $oldId |
162 | | - * @param int $newId |
163 | | - * @return void |
164 | | - */ |
| 160 | + * Totally clear the flag for who is reviewing a diff. |
| 161 | + * @param int $oldId |
| 162 | + * @param int $newId |
| 163 | + * @return void |
| 164 | + */ |
165 | 165 | public static function clearAllReviewingDiff( $oldId, $newId ) { |
166 | 166 | global $wgMemc; |
167 | 167 | $key = wfMemcKey( 'flaggedrevs', 'userReviewingDiff', $oldId, $newId ); |
Index: trunk/extensions/FlaggedRevs/backend/FlaggableWikiPage.php |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | return $this->file; |
56 | 56 | } |
57 | 57 | |
58 | | - /** |
| 58 | + /** |
59 | 59 | * Is the stable version shown by default for this page? |
60 | 60 | * @return bool |
61 | 61 | */ |
— | — | @@ -142,10 +142,10 @@ |
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
146 | | - * Checks if the stable version is synced with the current revision |
147 | | - * Note: slower than getPendingRevCount() |
148 | | - * @return bool |
149 | | - */ |
| 146 | + * Checks if the stable version is synced with the current revision |
| 147 | + * Note: slower than getPendingRevCount() |
| 148 | + * @return bool |
| 149 | + */ |
150 | 150 | public function stableVersionIsSynced() { |
151 | 151 | global $wgMemc, $wgParserCacheExpireTime; |
152 | 152 | $srev = $this->getStableRev(); |
— | — | @@ -220,7 +220,7 @@ |
221 | 221 | FlaggedRevs::isStableShownByDefault() == $this->isStableShownByDefault(); |
222 | 222 | } |
223 | 223 | |
224 | | - /** |
| 224 | + /** |
225 | 225 | * Is this article reviewable? |
226 | 226 | * @return bool |
227 | 227 | */ |
— | — | @@ -281,9 +281,9 @@ |
282 | 282 | } |
283 | 283 | |
284 | 284 | /* |
285 | | - * Get the fp_reviewed value for this page |
286 | | - * @return bool |
287 | | - */ |
| 285 | + * Get the fp_reviewed value for this page |
| 286 | + * @return bool |
| 287 | + */ |
288 | 288 | public function syncedInTracking() { |
289 | 289 | if ( !$this->mDataLoaded ) { |
290 | 290 | $this->loadPageData(); |
— | — | @@ -317,9 +317,9 @@ |
318 | 318 | } |
319 | 319 | |
320 | 320 | /** |
321 | | - * Updates the fp_reviewed field for this article |
322 | | - * @param bool $synced |
323 | | - */ |
| 321 | + * Updates the fp_reviewed field for this article |
| 322 | + * @param bool $synced |
| 323 | + */ |
324 | 324 | public function updateSyncStatus( $synced ) { |
325 | 325 | wfProfileIn( __METHOD__ ); |
326 | 326 | if ( !wfReadOnly() ) { |
— | — | @@ -393,11 +393,11 @@ |
394 | 394 | } |
395 | 395 | |
396 | 396 | /** |
397 | | - * Updates the flagging tracking tables for this page |
398 | | - * @param FlaggedRevision $srev The new stable version |
399 | | - * @param int|null $latest The latest rev ID (optional) |
400 | | - * @return bool Updates were done |
401 | | - */ |
| 397 | + * Updates the flagging tracking tables for this page |
| 398 | + * @param FlaggedRevision $srev The new stable version |
| 399 | + * @param int|null $latest The latest rev ID (optional) |
| 400 | + * @return bool Updates were done |
| 401 | + */ |
402 | 402 | public function updateStableVersion( FlaggedRevision $srev, $latest = null ) { |
403 | 403 | $rev = $srev->getRevision(); |
404 | 404 | if ( !$this->exists() || !$rev ) { |
— | — | @@ -464,9 +464,9 @@ |
465 | 465 | } |
466 | 466 | |
467 | 467 | /** |
468 | | - * Updates the flagging tracking tables for this page |
469 | | - * @return void |
470 | | - */ |
| 468 | + * Updates the flagging tracking tables for this page |
| 469 | + * @return void |
| 470 | + */ |
471 | 471 | public function clearStableVersion() { |
472 | 472 | if ( !$this->exists() ) { |
473 | 473 | return; // nothing to do |
— | — | @@ -479,11 +479,11 @@ |
480 | 480 | } |
481 | 481 | |
482 | 482 | /** |
483 | | - * Updates the flaggedpage_pending table |
484 | | - * @param int $pageId Page ID |
485 | | - * @abstract int $latest Latest revision |
486 | | - * @return void |
487 | | - */ |
| 483 | + * Updates the flaggedpage_pending table |
| 484 | + * @param int $pageId Page ID |
| 485 | + * @abstract int $latest Latest revision |
| 486 | + * @return void |
| 487 | + */ |
488 | 488 | protected static function updatePendingList( $pageId, $latest ) { |
489 | 489 | $data = array(); |
490 | 490 | # Get the highest tier used on this wiki |
Index: trunk/extensions/FlaggedRevs/backend/FlaggedRevision.php |
— | — | @@ -314,10 +314,10 @@ |
315 | 315 | } |
316 | 316 | |
317 | 317 | /* |
318 | | - * Insert a FlaggedRevision object into the database |
| 318 | + * Insert a FlaggedRevision object into the database |
319 | 319 | * |
320 | | - * @return bool success |
321 | | - */ |
| 320 | + * @return bool success |
| 321 | + */ |
322 | 322 | public function insert() { |
323 | 323 | $dbw = wfGetDB( DB_MASTER ); |
324 | 324 | # Set any flagged revision flags |
— | — | @@ -379,10 +379,10 @@ |
380 | 380 | } |
381 | 381 | |
382 | 382 | /* |
383 | | - * Remove a FlaggedRevision object from the database |
| 383 | + * Remove a FlaggedRevision object from the database |
384 | 384 | * |
385 | | - * @return bool success |
386 | | - */ |
| 385 | + * @return bool success |
| 386 | + */ |
387 | 387 | public function delete() { |
388 | 388 | $dbw = wfGetDB( DB_MASTER ); |
389 | 389 | # Delete from flaggedrevs table |
— | — | @@ -934,7 +934,7 @@ |
935 | 935 | * Get flags for a revision |
936 | 936 | * @param string $tags |
937 | 937 | * @return array |
938 | | - */ |
| 938 | + */ |
939 | 939 | public static function expandRevisionTags( $tags ) { |
940 | 940 | $flags = array(); |
941 | 941 | foreach ( FlaggedRevs::getTags() as $tag ) { |
— | — | @@ -963,7 +963,7 @@ |
964 | 964 | * Get flags for a revision |
965 | 965 | * @param array $tags |
966 | 966 | * @return string |
967 | | - */ |
| 967 | + */ |
968 | 968 | public static function flattenRevisionTags( array $tags ) { |
969 | 969 | $flags = ''; |
970 | 970 | foreach ( $tags as $tag => $value ) { |
Index: trunk/extensions/FlaggedRevs/backend/FlaggedRevsStats.php |
— | — | @@ -60,11 +60,11 @@ |
61 | 61 | } |
62 | 62 | |
63 | 63 | /* |
64 | | - * Run a stats update and update the DB |
65 | | - * Note: this can easily be too expensive to run live |
| 64 | + * Run a stats update and update the DB |
| 65 | + * Note: this can easily be too expensive to run live |
66 | 66 | * |
67 | | - * @return void |
68 | | - */ |
| 67 | + * @return void |
| 68 | + */ |
69 | 69 | public function updateCache() { |
70 | 70 | global $wgFlaggedRevsStatsAge; |
71 | 71 | $rNamespaces = FlaggedRevs::getReviewNamespaces(); |
Index: trunk/extensions/FlaggedRevs/business/FRGenericSubmitForm.php |
— | — | @@ -23,31 +23,31 @@ |
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
27 | | - * Initialize any parameters on construction |
28 | | - * @return void |
29 | | - */ |
| 27 | + * Initialize any parameters on construction |
| 28 | + * @return void |
| 29 | + */ |
30 | 30 | protected function initialize() {} |
31 | 31 | |
32 | 32 | /** |
33 | | - * Get the submitting user |
34 | | - * @return User |
35 | | - */ |
| 33 | + * Get the submitting user |
| 34 | + * @return User |
| 35 | + */ |
36 | 36 | final public function getUser() { |
37 | 37 | return $this->user; |
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
41 | | - * Get the internal form state |
42 | | - * @return int |
43 | | - */ |
| 41 | + * Get the internal form state |
| 42 | + * @return int |
| 43 | + */ |
44 | 44 | final protected function getState() { |
45 | 45 | return $this->state; |
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
49 | | - * Signal that inputs are all given (via accessors) |
50 | | - * @return mixed (true on success, error string on target failure) |
51 | | - */ |
| 49 | + * Signal that inputs are all given (via accessors) |
| 50 | + * @return mixed (true on success, error string on target failure) |
| 51 | + */ |
52 | 52 | final public function ready() { |
53 | 53 | if ( $this->state != self::FORM_UNREADY ) { |
54 | 54 | throw new MWException( __CLASS__ . " ready() already called.\n"); |
— | — | @@ -61,20 +61,20 @@ |
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
65 | | - * Load any objects after ready() called |
66 | | - * NOTE: do not do any DB hits here, just build objects |
67 | | - * @return mixed (true on success, error string on failure) |
68 | | - */ |
| 65 | + * Load any objects after ready() called |
| 66 | + * NOTE: do not do any DB hits here, just build objects |
| 67 | + * @return mixed (true on success, error string on failure) |
| 68 | + */ |
69 | 69 | protected function doBuildOnReady() { |
70 | 70 | return true; |
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
74 | | - * Set a member field to a value if the fields are unlocked |
75 | | - * @param mixed &$field Field of this form |
76 | | - * @param mixed $value Value to set the field to |
77 | | - * @return void |
78 | | - */ |
| 74 | + * Set a member field to a value if the fields are unlocked |
| 75 | + * @param mixed &$field Field of this form |
| 76 | + * @param mixed $value Value to set the field to |
| 77 | + * @return void |
| 78 | + */ |
79 | 79 | final protected function trySet( &$field, $value ) { |
80 | 80 | if ( $this->state != self::FORM_UNREADY ) { |
81 | 81 | throw new MWException( __CLASS__ . " fields cannot be set anymore.\n"); |
— | — | @@ -84,28 +84,28 @@ |
85 | 85 | } |
86 | 86 | |
87 | 87 | /* |
88 | | - * Check that a target is given (e.g. from GET/POST request) |
89 | | - * NOTE: do not do any DB hits here, just check if there is a target |
90 | | - * @return mixed (true on success, error string on failure) |
91 | | - */ |
| 88 | + * Check that a target is given (e.g. from GET/POST request) |
| 89 | + * NOTE: do not do any DB hits here, just check if there is a target |
| 90 | + * @return mixed (true on success, error string on failure) |
| 91 | + */ |
92 | 92 | protected function doCheckTargetGiven() { |
93 | 93 | return true; |
94 | 94 | } |
95 | 95 | |
96 | 96 | /* |
97 | | - * Check that the target is valid (e.g. from GET/POST request) |
98 | | - * @param int $flags FOR_SUBMISSION (set on submit) |
99 | | - * @return mixed (true on success, error string on failure) |
100 | | - */ |
| 97 | + * Check that the target is valid (e.g. from GET/POST request) |
| 98 | + * @param int $flags FOR_SUBMISSION (set on submit) |
| 99 | + * @return mixed (true on success, error string on failure) |
| 100 | + */ |
101 | 101 | protected function doCheckTarget( $flags = 0 ) { |
102 | 102 | return true; |
103 | 103 | } |
104 | 104 | |
105 | 105 | /* |
106 | | - * Check that a target is and it is valid (e.g. from GET/POST request) |
107 | | - * NOTE: do not do any DB hits here, just check if there is a target |
108 | | - * @return mixed (true on success, error string on failure) |
109 | | - */ |
| 106 | + * Check that a target is and it is valid (e.g. from GET/POST request) |
| 107 | + * NOTE: do not do any DB hits here, just check if there is a target |
| 108 | + * @return mixed (true on success, error string on failure) |
| 109 | + */ |
110 | 110 | final public function checkTarget() { |
111 | 111 | if ( $this->state != self::FORM_READY ) { |
112 | 112 | throw new MWException( __CLASS__ . " input fields not set yet.\n"); |
— | — | @@ -118,9 +118,9 @@ |
119 | 119 | } |
120 | 120 | |
121 | 121 | /* |
122 | | - * Validate and clean up target/parameters (e.g. from POST request) |
123 | | - * @return mixed (true on success, error string on failure) |
124 | | - */ |
| 122 | + * Validate and clean up target/parameters (e.g. from POST request) |
| 123 | + * @return mixed (true on success, error string on failure) |
| 124 | + */ |
125 | 125 | final protected function checkParameters() { |
126 | 126 | $status = $this->checkTarget( self::FOR_SUBMISSION ); |
127 | 127 | if ( $status !== true ) { |
— | — | @@ -130,18 +130,18 @@ |
131 | 131 | } |
132 | 132 | |
133 | 133 | /* |
134 | | - * Verify and clean up parameters (e.g. from POST request) |
135 | | - * @return mixed (true on success, error string on failure) |
136 | | - */ |
| 134 | + * Verify and clean up parameters (e.g. from POST request) |
| 135 | + * @return mixed (true on success, error string on failure) |
| 136 | + */ |
137 | 137 | protected function doCheckParameters() { |
138 | 138 | return true; |
139 | 139 | } |
140 | 140 | |
141 | 141 | /* |
142 | | - * Preload existing params for the target from the DB (e.g. for GET request) |
143 | | - * NOTE: do not call this and then submit() |
144 | | - * @return mixed (true on success, error string on failure) |
145 | | - */ |
| 142 | + * Preload existing params for the target from the DB (e.g. for GET request) |
| 143 | + * NOTE: do not call this and then submit() |
| 144 | + * @return mixed (true on success, error string on failure) |
| 145 | + */ |
146 | 146 | final public function preload() { |
147 | 147 | if ( $this->state != self::FORM_READY ) { |
148 | 148 | throw new MWException( __CLASS__ . " input fields not set yet.\n"); |
— | — | @@ -159,17 +159,17 @@ |
160 | 160 | } |
161 | 161 | |
162 | 162 | /* |
163 | | - * Preload existing params for the target from the DB (e.g. for GET request) |
164 | | - * @return mixed (true on success, error string on failure) |
165 | | - */ |
| 163 | + * Preload existing params for the target from the DB (e.g. for GET request) |
| 164 | + * @return mixed (true on success, error string on failure) |
| 165 | + */ |
166 | 166 | protected function doPreloadParameters() { |
167 | 167 | return true; |
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
171 | | - * Submit the form parameters for the page config to the DB |
172 | | - * @return mixed (true on success, error string on failure) |
173 | | - */ |
| 171 | + * Submit the form parameters for the page config to the DB |
| 172 | + * @return mixed (true on success, error string on failure) |
| 173 | + */ |
174 | 174 | final public function submit() { |
175 | 175 | if ( $this->state != self::FORM_READY ) { |
176 | 176 | throw new MWException( __CLASS__ . " input fields preloaded or not set yet.\n"); |
— | — | @@ -187,9 +187,9 @@ |
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
191 | | - * Submit the form parameters for the page config to the DB |
192 | | - * @return mixed (true on success, error string on failure) |
193 | | - */ |
| 191 | + * Submit the form parameters for the page config to the DB |
| 192 | + * @return mixed (true on success, error string on failure) |
| 193 | + */ |
194 | 194 | protected function doSubmit() { |
195 | 195 | return true; |
196 | 196 | } |
Index: trunk/extensions/FlaggedRevs/business/RevisionReviewForm.php |
— | — | @@ -125,9 +125,9 @@ |
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
129 | | - * Check that a target is given (e.g. from GET/POST request) |
130 | | - * @return mixed (true on success, error string on failure) |
131 | | - */ |
| 129 | + * Check that a target is given (e.g. from GET/POST request) |
| 130 | + * @return mixed (true on success, error string on failure) |
| 131 | + */ |
132 | 132 | public function doCheckTargetGiven() { |
133 | 133 | if ( is_null( $this->page ) ) { |
134 | 134 | return 'review_page_invalid'; |
— | — | @@ -136,19 +136,19 @@ |
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
140 | | - * Load any objects after ready() called |
141 | | - * @return mixed (true on success, error string on failure) |
142 | | - */ |
| 140 | + * Load any objects after ready() called |
| 141 | + * @return mixed (true on success, error string on failure) |
| 142 | + */ |
143 | 143 | protected function doBuildOnReady() { |
144 | 144 | $this->article = FlaggableWikiPage::getTitleInstance( $this->page ); |
145 | 145 | return true; |
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
149 | | - * Check that the target is valid (e.g. from GET/POST request) |
150 | | - * @param int $flags FOR_SUBMISSION (set on submit) |
151 | | - * @return mixed (true on success, error string on failure) |
152 | | - */ |
| 149 | + * Check that the target is valid (e.g. from GET/POST request) |
| 150 | + * @param int $flags FOR_SUBMISSION (set on submit) |
| 151 | + * @return mixed (true on success, error string on failure) |
| 152 | + */ |
153 | 153 | protected function doCheckTarget( $flags = 0 ) { |
154 | 154 | $flgs = ( $flags & self::FOR_SUBMISSION ) ? Title::GAID_FOR_UPDATE : 0; |
155 | 155 | if ( !$this->page->getArticleId( $flgs ) ) { |
— | — | @@ -162,9 +162,9 @@ |
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
166 | | - * Validate and clean up parameters (e.g. from POST request). |
167 | | - * @return mixed (true on success, error string on failure) |
168 | | - */ |
| 166 | + * Validate and clean up parameters (e.g. from POST request). |
| 167 | + * @return mixed (true on success, error string on failure) |
| 168 | + */ |
169 | 169 | protected function doCheckParameters() { |
170 | 170 | $action = $this->getAction(); |
171 | 171 | if ( $action === null ) { |
— | — | @@ -234,9 +234,9 @@ |
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
238 | | - * Get the action this submission is requesting |
239 | | - * @return string (approve,unapprove,reject) |
240 | | - */ |
| 238 | + * Get the action this submission is requesting |
| 239 | + * @return string (approve,unapprove,reject) |
| 240 | + */ |
241 | 241 | public function getAction() { |
242 | 242 | if ( !$this->reject && !$this->unapprove && $this->approve ) { |
243 | 243 | return 'approve'; |
— | — | @@ -249,10 +249,10 @@ |
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
253 | | - * Submit the form parameters for the page config to the DB. |
| 253 | + * Submit the form parameters for the page config to the DB. |
254 | 254 | * |
255 | | - * @return mixed (true on success, error string on failure) |
256 | | - */ |
| 255 | + * @return mixed (true on success, error string on failure) |
| 256 | + */ |
257 | 257 | public function doSubmit() { |
258 | 258 | # Double-check permissions |
259 | 259 | if ( !$this->isAllowed() ) { |
— | — | @@ -464,13 +464,13 @@ |
465 | 465 | } |
466 | 466 | |
467 | 467 | /** |
468 | | - * Get a validation key from versioning metadata |
469 | | - * @param string $tmpP |
470 | | - * @param string $imgP |
471 | | - * @param string $imgV |
472 | | - * @param integer $rid rev ID |
473 | | - * @return string |
474 | | - */ |
| 468 | + * Get a validation key from versioning metadata |
| 469 | + * @param string $tmpP |
| 470 | + * @param string $imgP |
| 471 | + * @param string $imgV |
| 472 | + * @param integer $rid rev ID |
| 473 | + * @return string |
| 474 | + */ |
475 | 475 | public static function validationKey( $tmpP, $imgP, $imgV, $rid ) { |
476 | 476 | global $wgSecretKey, $wgProxyKey; |
477 | 477 | $key = $wgSecretKey ? $wgSecretKey : $wgProxyKey; // fall back to $wgProxyKey |
— | — | @@ -479,16 +479,16 @@ |
480 | 480 | } |
481 | 481 | |
482 | 482 | /** |
483 | | - * Update rc_patrolled fields in recent changes after (un)accepting a rev. |
484 | | - * This maintains the patrolled <=> reviewed relationship for reviewable namespaces. |
| 483 | + * Update rc_patrolled fields in recent changes after (un)accepting a rev. |
| 484 | + * This maintains the patrolled <=> reviewed relationship for reviewable namespaces. |
485 | 485 | * |
486 | | - * RecentChange should only be passed in when an RC item is saved. |
| 486 | + * RecentChange should only be passed in when an RC item is saved. |
487 | 487 | * |
488 | | - * @param $rev Revision|RecentChange |
489 | | - * @param $patrol string "patrol" or "unpatrol" |
490 | | - * @param $srev FlaggedRevsion|null The new stable version |
491 | | - * @return void |
492 | | - */ |
| 488 | + * @param $rev Revision|RecentChange |
| 489 | + * @param $patrol string "patrol" or "unpatrol" |
| 490 | + * @param $srev FlaggedRevsion|null The new stable version |
| 491 | + * @return void |
| 492 | + */ |
493 | 493 | public static function updateRecentChanges( $rev, $patrol, $srev ) { |
494 | 494 | global $wgUseRCPatrol; |
495 | 495 | |
Index: trunk/extensions/FlaggedRevs/business/PageStabilityForm.php |
— | — | @@ -73,10 +73,10 @@ |
74 | 74 | } |
75 | 75 | |
76 | 76 | /* |
77 | | - * Get the final expiry, all inputs considered |
78 | | - * Note: does not check if the expiration is less than wfTimestampNow() |
79 | | - * @return 14-char timestamp or "infinity", or false if the input was invalid |
80 | | - */ |
| 77 | + * Get the final expiry, all inputs considered |
| 78 | + * Note: does not check if the expiration is less than wfTimestampNow() |
| 79 | + * @return 14-char timestamp or "infinity", or false if the input was invalid |
| 80 | + */ |
81 | 81 | public function getExpiry() { |
82 | 82 | $oldConfig = $this->getOldConfig(); |
83 | 83 | if ( $this->expirySelection == 'existing' ) { |
— | — | @@ -102,9 +102,9 @@ |
103 | 103 | } |
104 | 104 | |
105 | 105 | /* |
106 | | - * Get the final reason, all inputs considered |
107 | | - * @return string |
108 | | - */ |
| 106 | + * Get the final reason, all inputs considered |
| 107 | + * @return string |
| 108 | + */ |
109 | 109 | public function getReason() { |
110 | 110 | # Custom reason replaces dropdown |
111 | 111 | if ( $this->reasonSelection != 'other' ) { |
— | — | @@ -120,9 +120,9 @@ |
121 | 121 | } |
122 | 122 | |
123 | 123 | /* |
124 | | - * Check that a target is given (e.g. from GET/POST request) |
125 | | - * @return mixed (true on success, error string on failure) |
126 | | - */ |
| 124 | + * Check that a target is given (e.g. from GET/POST request) |
| 125 | + * @return mixed (true on success, error string on failure) |
| 126 | + */ |
127 | 127 | protected function doCheckTargetGiven() { |
128 | 128 | if ( is_null( $this->page ) ) { |
129 | 129 | return 'stabilize_page_invalid'; |
— | — | @@ -131,10 +131,10 @@ |
132 | 132 | } |
133 | 133 | |
134 | 134 | /* |
135 | | - * Check that the target page is valid |
136 | | - * @param int $flags FOR_SUBMISSION (set on submit) |
137 | | - * @return mixed (true on success, error string on failure) |
138 | | - */ |
| 135 | + * Check that the target page is valid |
| 136 | + * @param int $flags FOR_SUBMISSION (set on submit) |
| 137 | + * @return mixed (true on success, error string on failure) |
| 138 | + */ |
139 | 139 | protected function doCheckTarget( $flags = 0 ) { |
140 | 140 | $flgs = ( $flags & self::FOR_SUBMISSION ) ? Title::GAID_FOR_UPDATE : 0; |
141 | 141 | if ( !$this->page->getArticleId( $flgs ) ) { |
— | — | @@ -146,9 +146,9 @@ |
147 | 147 | } |
148 | 148 | |
149 | 149 | /* |
150 | | - * Verify and clean up parameters (e.g. from POST request) |
151 | | - * @return mixed (true on success, error string on failure) |
152 | | - */ |
| 150 | + * Verify and clean up parameters (e.g. from POST request) |
| 151 | + * @return mixed (true on success, error string on failure) |
| 152 | + */ |
153 | 153 | protected function doCheckParameters() { |
154 | 154 | # Load old config settings from the master |
155 | 155 | $this->oldConfig = FRPageConfig::getStabilitySettings( $this->page, FR_MASTER ); |
— | — | @@ -161,18 +161,18 @@ |
162 | 162 | } |
163 | 163 | |
164 | 164 | /* |
165 | | - * @return mixed (true on success, error string on failure) |
166 | | - */ |
| 165 | + * @return mixed (true on success, error string on failure) |
| 166 | + */ |
167 | 167 | protected function reallyDoCheckParameters() { |
168 | 168 | return true; |
169 | 169 | } |
170 | 170 | |
171 | 171 | /* |
172 | | - * Can the user change the settings for this page? |
173 | | - * Note: if the current autoreview restriction is too high for this user |
174 | | - * then this will return false. Useful for form selectors. |
175 | | - * @return bool |
176 | | - */ |
| 172 | + * Can the user change the settings for this page? |
| 173 | + * Note: if the current autoreview restriction is too high for this user |
| 174 | + * then this will return false. Useful for form selectors. |
| 175 | + * @return bool |
| 176 | + */ |
177 | 177 | public function isAllowed() { |
178 | 178 | # Users who cannot edit or review the page cannot set this |
179 | 179 | return ( $this->page |
— | — | @@ -183,9 +183,9 @@ |
184 | 184 | } |
185 | 185 | |
186 | 186 | /* |
187 | | - * Preload existing page settings (e.g. from GET request). |
188 | | - * @return mixed (true on success, error string on failure) |
189 | | - */ |
| 187 | + * Preload existing page settings (e.g. from GET request). |
| 188 | + * @return mixed (true on success, error string on failure) |
| 189 | + */ |
190 | 190 | public function doPreloadParameters() { |
191 | 191 | $oldConfig = $this->getOldConfig(); |
192 | 192 | if ( $oldConfig['expiry'] == Block::infinity() ) { |
— | — | @@ -197,17 +197,17 @@ |
198 | 198 | } |
199 | 199 | |
200 | 200 | /* |
201 | | - * @return mixed (true on success, error string on failure) |
202 | | - */ |
| 201 | + * @return mixed (true on success, error string on failure) |
| 202 | + */ |
203 | 203 | protected function reallyDoPreloadParameters() { |
204 | 204 | return true; |
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
208 | | - * Submit the form parameters for the page config to the DB. |
209 | | - * |
210 | | - * @return mixed (true on success, error string on failure) |
211 | | - */ |
| 208 | + * Submit the form parameters for the page config to the DB. |
| 209 | + * |
| 210 | + * @return mixed (true on success, error string on failure) |
| 211 | + */ |
212 | 212 | public function doSubmit() { |
213 | 213 | # Double-check permissions |
214 | 214 | if ( !$this->isAllowed() ) { |
— | — | @@ -263,11 +263,11 @@ |
264 | 264 | } |
265 | 265 | |
266 | 266 | /* |
267 | | - * Do history & log updates: |
268 | | - * (a) Add a new stability log entry |
269 | | - * (b) Add a null edit like the log entry |
270 | | - * @return Revision |
271 | | - */ |
| 267 | + * Do history & log updates: |
| 268 | + * (a) Add a new stability log entry |
| 269 | + * (b) Add a null edit like the log entry |
| 270 | + * @return Revision |
| 271 | + */ |
272 | 272 | protected function updateLogsAndHistory( FlaggableWikiPage $article ) { |
273 | 273 | global $wgContLang; |
274 | 274 | $newConfig = $this->getNewConfig(); |
— | — | @@ -311,9 +311,9 @@ |
312 | 312 | } |
313 | 313 | |
314 | 314 | /* |
315 | | - * Get current stability config array |
316 | | - * @return array |
317 | | - */ |
| 315 | + * Get current stability config array |
| 316 | + * @return array |
| 317 | + */ |
318 | 318 | public function getOldConfig() { |
319 | 319 | if ( $this->getState() == self::FORM_UNREADY ) { |
320 | 320 | throw new MWException( __CLASS__ . " input fields not set yet.\n"); |
— | — | @@ -325,9 +325,9 @@ |
326 | 326 | } |
327 | 327 | |
328 | 328 | /* |
329 | | - * Get proposed stability config array |
330 | | - * @return array |
331 | | - */ |
| 329 | + * Get proposed stability config array |
| 330 | + * @return array |
| 331 | + */ |
332 | 332 | public function getNewConfig() { |
333 | 333 | return array( |
334 | 334 | 'override' => $this->override, |
— | — | @@ -337,9 +337,9 @@ |
338 | 338 | } |
339 | 339 | |
340 | 340 | /* |
341 | | - * (a) Watch page if $watchThis is true |
342 | | - * (b) Unwatch if $watchThis is false |
343 | | - */ |
| 341 | + * (a) Watch page if $watchThis is true |
| 342 | + * (b) Unwatch if $watchThis is false |
| 343 | + */ |
344 | 344 | protected function updateWatchlist() { |
345 | 345 | # Apply watchlist checkbox value (may be NULL) |
346 | 346 | if ( $this->watchThis === true ) { |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.setup.php |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | * Note: avoid FlaggedRevs class calls here for performance (like load.php). |
7 | 7 | */ |
8 | 8 | class FlaggedRevsSetup { |
9 | | - /* Variable checked by FlaggedRevs::load() */ |
| 9 | + /* Status of whether FlaggedRevs::load() can be called */ |
10 | 10 | protected static $canLoad = false; |
11 | 11 | |
12 | 12 | /** |