mediawiki-extensions-Nuke/Nuke.hooks.php
Matěj Suchánek c18591354c Add GENDER to nuke-linkoncontribs-text message
For motivation see T159657.

Change-Id: I245b3eca53cbc0f8459fb18ac1c78006d6ce385a
2017-08-23 11:13:03 +00:00

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() ]
);
}
}
}