r61514 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61513‎ | r61514 | r61515 >
Date:09:49, 26 January 2010
Author:aaron
Status:ok
Tags:
Comment:
Separate out important data hooks from UI ones
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -403,7 +403,7 @@
404404 $wgAutoloadClasses['ApiStabilize'] = $dir . 'api/ApiStabilize.php';
405405 $wgAPIModules['stabilize'] = 'ApiStabilize';
406406
407 -# ######## Hook attachments #########
 407+# ######## Hook triggered data operations #########
408408 # Autopromote Editors
409409 $wgHooks['ArticleSaveComplete'][] = 'FlaggedRevsHooks::maybeMakeEditor';
410410 # Adds table link references to include ones from the stable version
@@ -432,6 +432,25 @@
433433 $wgHooks['LogLine'][] = 'FlaggedRevsHooks::logLineLinks';
434434 # Disable auto-promotion for demoted users
435435 $wgHooks['UserRights'][] = 'FlaggedRevsHooks::recordDemote';
 436+# User stats
 437+$wgHooks['ArticleRollbackComplete'][] = 'FlaggedRevsHooks::incrementRollbacks';
 438+$wgHooks['NewRevisionFromEditComplete'][] = 'FlaggedRevsHooks::incrementReverts';
 439+# Null edit review via checkbox
 440+$wgHooks['ArticleSaveComplete'][] = 'FlaggedRevsHooks::maybeNullEditReview';
 441+# Special auto-promote
 442+$wgHooks['GetAutoPromoteGroups'][] = 'FlaggedRevsHooks::checkAutoPromote';
 443+# Save stability settings
 444+$wgHooks['ProtectionForm::save'][] = 'FlaggedRevsHooks::onProtectionSave';
 445+
 446+# Actually register special pages
 447+$wgHooks['SpecialPage_initList'][] = 'efLoadFlaggedRevsSpecialPages';
 448+
 449+# Stable dump hook
 450+$wgHooks['WikiExporter::dumpStableQuery'][] = 'FlaggedRevsHooks::stableDumpQuery';
 451+# ########
 452+
 453+
 454+# ######## Hook triggered UI operations #########
436455 # Local user account preference
437456 $wgHooks['GetPreferences'][] = 'FlaggedRevsHooks::onGetPreferences';
438457 # Show unreviewed pages links
@@ -459,7 +478,6 @@
460479 # Add protection form field
461480 $wgHooks['ProtectionForm::buildForm'][] = 'FlaggedRevsHooks::onProtectionForm';
462481 $wgHooks['ProtectionForm::showLogExtract'][] = 'FlaggedRevsHooks::insertStabilityLog';
463 -$wgHooks['ProtectionForm::save'][] = 'FlaggedRevsHooks::onProtectionSave';
464482 # Mark items in page history
465483 $wgHooks['PageHistoryPager::getQueryInfo'][] = 'FlaggedRevsHooks::addToHistQuery';
466484 $wgHooks['PageHistoryLineEnding'][] = 'FlaggedRevsHooks::addToHistLine';
@@ -479,15 +497,10 @@
480498 # Autoreview stuff
481499 $wgHooks['EditPage::showEditForm:fields'][] = 'FlaggedRevsHooks::addRevisionIDField';
482500 $wgHooks['EditPageBeforeEditChecks'][] = 'FlaggedRevsHooks::addReviewCheck';
483 -# User stats
484 -$wgHooks['ArticleRollbackComplete'][] = 'FlaggedRevsHooks::incrementRollbacks';
485 -$wgHooks['NewRevisionFromEditComplete'][] = 'FlaggedRevsHooks::incrementReverts';
486501 # Add diff url param alias
487502 $wgHooks['NewDifferenceEngine'][] = 'FlaggedRevsHooks::checkDiffUrl';
488 -# Check if a page is being reviewed
 503+# Check if a page is currently being reviewed
489504 $wgHooks['MediaWikiPerformAction'][] = 'FlaggedRevsHooks::markUnderReview';
490 -# Null edit review via checkbox
491 -$wgHooks['ArticleSaveComplete'][] = 'FlaggedRevsHooks::maybeNullEditReview';
492505
493506 # Add CSS/JS as needed
494507 $wgHooks['BeforePageDisplay'][] = 'FlaggedRevsHooks::onBeforePageDisplay';
@@ -502,14 +515,6 @@
503516 # Add flagging data to ApiQueryRevisions
504517 $wgHooks['APIGetAllowedParams'][] = 'FlaggedRevsApiHooks::addApiRevisionParams';
505518 $wgHooks['APIQueryAfterExecute'][] = 'FlaggedRevsApiHooks::addApiRevisionData';
506 -
507 -# Actually register special pages
508 -$wgHooks['SpecialPage_initList'][] = 'efLoadFlaggedRevsSpecialPages';
509 -# Special auto-promote
510 -$wgHooks['GetAutoPromoteGroups'][] = 'FlaggedRevsHooks::checkAutoPromote';
511 -
512 -# Stable dump hook
513 -$wgHooks['WikiExporter::dumpStableQuery'][] = 'FlaggedRevsHooks::stableDumpQuery';
514519 # ########
515520
516521 function efLoadFlaggedRevs() {

Status & tagging log