r99337 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99336‎ | r99337 | r99338 >
Date:06:03, 9 October 2011
Author:aaron
Status:deferred
Tags:
Comment:
Moved setting of UI hook handlers to ConfirmAccountUISetup::defineHookHandlers()
Modified paths:
  • /trunk/extensions/ConfirmAccount/ConfirmAccount.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.setup.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmAccount/ConfirmAccount.php
@@ -82,21 +82,15 @@
8383 # JS/CSS modules and message bundles used by JS scripts
8484 ConfirmAccountUISetup::defineResourceModules( $wgResourceModules );
8585
86 -# ####### EVENT-HANDLER FUNCTIONS #########
 86+# ####### EVENT-HANDLER FUNCTIONS #########
8787
88 -# Make sure "login / create account" notice still as "create account"
89 -$wgHooks['PersonalUrls'][] = 'ConfirmAccountUIHooks::setRequestLoginLinks';
90 -# Add notice of where to request an account at UserLogin
91 -$wgHooks['UserCreateForm'][] = 'ConfirmAccountUIHooks::addRequestLoginText';
92 -$wgHooks['UserLoginForm'][] = 'ConfirmAccountUIHooks::addRequestLoginText';
93 -# Check for collisions
 88+# UI-related hook handlers
 89+ConfirmAccountUISetup::defineHookHandlers( $wgHooks );
 90+
 91+# Check for account name collisions
9492 $wgHooks['AbortNewAccount'][] = 'ConfirmAccountUIHooks::checkIfAccountNameIsPending';
95 -# Status header like "new messages" bar
96 -$wgHooks['BeforePageDisplay'][] = 'ConfirmAccountUIHooks::confirmAccountsNotice';
9793
98 -# Register admin pages for AdminLinks extension.
99 -$wgHooks['AdminLinks'][] = 'ConfirmAccountUIHooks::confirmAccountAdminLinks';
100 -
 94+# Schema changes
10195 $wgHooks['LoadExtensionSchemaUpdates'][] = 'ConfirmAccountUpdaterHooks::addSchemaUpdates';
10296
103 -# ####### END HOOK TRIGGERED FUNCTIONS #########
 97+# ####### END HOOK TRIGGERED FUNCTIONS #########
Index: trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.setup.php
@@ -4,6 +4,23 @@
55 */
66 class ConfirmAccountUISetup {
77 /**
 8+ * Register ConfirmAccount hooks.
 9+ * @param $hooks Array $wgHooks (assoc array of hooks and handlers)
 10+ * @return void
 11+ */
 12+ public static function defineHookHandlers( &$hooks ) {
 13+ # Make sure "login / create account" notice still as "create account"
 14+ $hooks['PersonalUrls'][] = 'ConfirmAccountUIHooks::setRequestLoginLinks';
 15+ # Add notice of where to request an account at UserLogin
 16+ $hooks['UserCreateForm'][] = 'ConfirmAccountUIHooks::addRequestLoginText';
 17+ $hooks['UserLoginForm'][] = 'ConfirmAccountUIHooks::addRequestLoginText';
 18+ # Status header like "new messages" bar
 19+ $hooks['BeforePageDisplay'][] = 'ConfirmAccountUIHooks::confirmAccountsNotice';
 20+ # Register admin pages for AdminLinks extension.
 21+ $hooks['AdminLinks'][] = 'ConfirmAccountUIHooks::confirmAccountAdminLinks';
 22+ }
 23+
 24+ /**
825 * Register ConfirmAccount special pages as needed.
926 * @param $pages Array $wgSpecialPages (list of special pages)
1027 * @param $groups Array $wgSpecialPageGroups (assoc array of special page groups)

Status & tagging log