mediawiki-extensions-Nuke/Nuke.hooks.php
Siebrand Mazeland cfccbc52d8 Use mediawiki-codesniffer 0.6.0
Change-Id: I8a36102f403d6711d6ac3089a4d6fb1c8c52de9b
2016-03-07 15:53:32 +01:00

29 lines
643 B
PHP

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