2014-02-01 04:34:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class NukeHooks {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows link to Special:Nuke on Special:Contributions/username if applicable
|
|
|
|
*
|
2017-02-25 10:18:18 +00:00
|
|
|
* @param int $userId
|
|
|
|
* @param Title $userPageTitle
|
|
|
|
* @param string[] $toolLinks
|
|
|
|
* @param SpecialPage $sp
|
2014-02-01 04:34:44 +00:00
|
|
|
*/
|
2017-02-25 10:18:18 +00:00
|
|
|
public static function nukeContributionsLinks( $userId, $userPageTitle, &$toolLinks,
|
|
|
|
SpecialPage $sp
|
|
|
|
) {
|
|
|
|
if ( $sp->getUser()->isAllowed( 'nuke' ) ) {
|
|
|
|
$toolLinks['nuke'] = $sp->getLinkRenderer()->makeKnownLink(
|
2014-02-01 04:34:44 +00:00
|
|
|
SpecialPage::getTitleFor( 'Nuke' ),
|
2017-02-25 10:18:18 +00:00
|
|
|
$sp->msg( 'nuke-linkoncontribs' )->text(),
|
|
|
|
[ 'title' => $sp->msg( 'nuke-linkoncontribs-text' )->text() ],
|
2016-03-07 14:53:32 +00:00
|
|
|
[ 'target' => $userPageTitle->getText() ]
|
2014-02-01 04:34:44 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|