summaryrefslogtreecommitdiff
path: root/extensions/tmwa/frontend/TMWAccountUI.setup.php
blob: 9ff8800d1f3c25f0698bd5deacd2d59901e75fcd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
 * Class containing hooked functions for a TMWAccount environment
 */
class TMWAccountUISetup {
	/**
	 * Register TMWAccount hooks.
	 * @param $hooks Array $wgHooks (assoc array of hooks and handlers)
	 * @return void
	 */
	public static function defineHookHandlers( array &$hooks ) {
		# Make sure "login / create account" notice still as "create account"
		$hooks['PersonalUrls'][] = 'TMWAccountUIHooks::setRequestLoginLinks';
		# Add notice of where to request an account at UserLogin
		$hooks['UserCreateForm'][] = 'TMWAccountUIHooks::addRequestLoginText';
		$hooks['UserLoginForm'][] = 'TMWAccountUIHooks::addRequestLoginText';
		# Status header like "new messages" bar
		$hooks['BeforePageDisplay'][] = 'TMWAccountUIHooks::tmwAccountsNotice';
		# Register admin pages for AdminLinks extension.
		$hooks['AdminLinks'][] = 'TMWAccountUIHooks::tmwAccountAdminLinks';
	}

	/**
	 * Register TMWAccount special pages as needed.
	 * @param $pages Array $wgSpecialPages (list of special pages)
	 * @param $groups Array $wgSpecialPageGroups (assoc array of special page groups)
	 * @return void
	 */
	public static function defineSpecialPages( array &$pages, array &$groups ) {
		$pages['GameAccount'] = 'GameAccountPage';
		$groups['GameAccount'] = 'login';
		$pages['GameNews'] = 'GameNewsPage';
		$groups['GameNews'] = 'changes';
	}
}