mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Nuke
synced 2024-11-15 11:59:48 +00:00
c18591354c
For motivation see T159657. Change-Id: I245b3eca53cbc0f8459fb18ac1c78006d6ce385a
27 lines
699 B
PHP
27 lines
699 B
PHP
<?php
|
|
|
|
class NukeHooks {
|
|
|
|
/**
|
|
* Shows link to Special:Nuke on Special:Contributions/username if applicable
|
|
*
|
|
* @param int $userId
|
|
* @param Title $userPageTitle
|
|
* @param string[] &$toolLinks
|
|
* @param SpecialPage $sp
|
|
*/
|
|
public static function nukeContributionsLinks( $userId, $userPageTitle, &$toolLinks,
|
|
SpecialPage $sp
|
|
) {
|
|
if ( $sp->getUser()->isAllowed( 'nuke' ) ) {
|
|
$toolLinks['nuke'] = $sp->getLinkRenderer()->makeKnownLink(
|
|
SpecialPage::getTitleFor( 'Nuke' ),
|
|
$sp->msg( 'nuke-linkoncontribs' )->text(),
|
|
[ 'title' => $sp->msg( 'nuke-linkoncontribs-text',
|
|
$userPageTitle->getText() )->text() ],
|
|
[ 'target' => $userPageTitle->getText() ]
|
|
);
|
|
}
|
|
}
|
|
}
|