mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Nuke
synced 2024-11-15 11:59:48 +00:00
cfccbc52d8
Change-Id: I8a36102f403d6711d6ac3089a4d6fb1c8c52de9b
29 lines
643 B
PHP
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;
|
|
}
|
|
}
|