File: Nuke.hooks.php

package info (click to toggle)
mediawiki 1%3A1.27.4-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 152,836 kB
  • sloc: php: 426,557; sql: 8,668; python: 3,484; xml: 2,201; pascal: 1,567; ruby: 1,017; perl: 789; sh: 612; makefile: 284
file content (28 lines) | stat: -rw-r--r-- 643 bytes parent folder | download | duplicates (2)
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
<?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(),
				[ 'title' => wfMessage( 'nuke-linkoncontribs-text' )->text() ],
				[ 'target' => $userPageTitle->getText() ]
			);
		}

		return true;
	}
}