summaryrefslogtreecommitdiff
path: root/extensions/Nuke/Nuke.hooks.php
blob: fddcf51a4cc39fdce04d4951fdbdbaca19cad6e5 (plain)
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
<?php

class NukeHooks {

	/**
	 * Shows link to Special:Nuke on Special:Contributions/username if applicable
	 *
	 * @param $userId Integer
	 * @param $userPageTitle Title
	 * @param $toolLinks Array
	 *
	 * @return true
	 */
	public static function nukeContributionsLinks( $userId, $userPageTitle, &$toolLinks ) {
		global $wgUser;

		if ( $wgUser->isAllowed( 'nuke' ) ) {
			$toolLinks[] = Linker::link(
				SpecialPage::getTitleFor( 'Nuke' ),
				wfMessage( 'nuke-linkoncontribs' )->escaped(),
				array( 'title' => wfMessage( 'nuke-linkoncontribs-text' )->text() ),
				array( 'target' => $userPageTitle->getText() )
			);
		}
		return true;
	}
}