MediaWiki REL1_34
NukeHooks.php
Go to the documentation of this file.
1<?php
2
3class NukeHooks {
4
13 public static function nukeContributionsLinks( $userId, $userPageTitle, &$toolLinks,
14 SpecialPage $sp
15 ) {
16 $username = $userPageTitle->getText();
17 if ( $sp->getUser()->isAllowed( 'nuke' ) && !IP::isValidRange( $username ) ) {
18 $toolLinks['nuke'] = $sp->getLinkRenderer()->makeKnownLink(
19 SpecialPage::getTitleFor( 'Nuke' ),
20 $sp->msg( 'nuke-linkoncontribs' )->text(),
21 [ 'title' => $sp->msg( 'nuke-linkoncontribs-text', $username )->text() ],
22 [ 'target' => $username ]
23 );
24 }
25 }
26}
static nukeContributionsLinks( $userId, $userPageTitle, &$toolLinks, SpecialPage $sp)
Shows link to Special:Nuke on Special:Contributions/username if applicable.
Definition NukeHooks.php:13
Parent class for all special pages.
getUser()
Shortcut to get the User executing this instance.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.