Index: trunk/extensions/ConfirmAccount/ConfirmAccount.php |
— | — | @@ -82,21 +82,15 @@ |
83 | 83 | # JS/CSS modules and message bundles used by JS scripts |
84 | 84 | ConfirmAccountUISetup::defineResourceModules( $wgResourceModules ); |
85 | 85 | |
86 | | -# ####### EVENT-HANDLER FUNCTIONS ######### |
| 86 | +# ####### EVENT-HANDLER FUNCTIONS ######### |
87 | 87 | |
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 |
94 | 92 | $wgHooks['AbortNewAccount'][] = 'ConfirmAccountUIHooks::checkIfAccountNameIsPending'; |
95 | | -# Status header like "new messages" bar |
96 | | -$wgHooks['BeforePageDisplay'][] = 'ConfirmAccountUIHooks::confirmAccountsNotice'; |
97 | 93 | |
98 | | -# Register admin pages for AdminLinks extension. |
99 | | -$wgHooks['AdminLinks'][] = 'ConfirmAccountUIHooks::confirmAccountAdminLinks'; |
100 | | - |
| 94 | +# Schema changes |
101 | 95 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'ConfirmAccountUpdaterHooks::addSchemaUpdates'; |
102 | 96 | |
103 | | -# ####### END HOOK TRIGGERED FUNCTIONS ######### |
| 97 | +# ####### END HOOK TRIGGERED FUNCTIONS ######### |
Index: trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.setup.php |
— | — | @@ -4,6 +4,23 @@ |
5 | 5 | */ |
6 | 6 | class ConfirmAccountUISetup { |
7 | 7 | /** |
| 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 | + /** |
8 | 25 | * Register ConfirmAccount special pages as needed. |
9 | 26 | * @param $pages Array $wgSpecialPages (list of special pages) |
10 | 27 | * @param $groups Array $wgSpecialPageGroups (assoc array of special page groups) |