mediawiki-extensions-Nuke/Nuke.hooks.php
isarra 48af2dada4 (Bug 55424) Add a link to nuke a user from Special:Contributions
If I have to lock you two in a room, I will.

Change-Id: I1bb2907db948b8e26cfa2532a38b1e25f2dda1fc
2014-02-02 19:30:56 +01:00

28 lines
652 B
PHP
Executable file

<?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;
}
}