Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4157002
Hooks.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
Hooks.php
View Options
<?php
namespace
MediaWiki\Extension\Nuke
;
use
MediaWiki\Hook\ContributionsToolLinksHook
;
use
MediaWiki\SpecialPage\SpecialPage
;
use
MediaWiki\Title\Title
;
use
Wikimedia\IPUtils
;
class
Hooks
implements
ContributionsToolLinksHook
{
/**
* Shows link to Special:Nuke on Special:Contributions/username if applicable
*
* @param int $id
* @param Title $title
* @param string[] &$tools
* @param SpecialPage $specialPage
*/
public
function
onContributionsToolLinks
(
$id
,
Title
$title
,
array
&
$tools
,
SpecialPage
$specialPage
)
{
$username
=
$title
->
getText
();
if
(
$specialPage
->
getUser
()->
isAllowed
(
'nuke'
)
&&
!
IPUtils
::
isValidRange
(
$username
)
)
{
$tools
[
'nuke'
]
=
$specialPage
->
getLinkRenderer
()->
makeKnownLink
(
SpecialPage
::
getTitleFor
(
'Nuke'
),
$specialPage
->
msg
(
'nuke-linkoncontribs'
)->
text
(),
[
'title'
=>
$specialPage
->
msg
(
'nuke-linkoncontribs-text'
,
$username
)->
text
(),
'class'
=>
'mw-contributions-link-nuke'
],
[
'target'
=>
$username
]
);
}
}
/**
* Registers Nuke tag for deletion logs
*
* @param string[] &$tags
*/
public
static
function
onRegisterTags
(
array
&
$tags
):
bool
{
$tags
[]
=
'Nuke'
;
return
true
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 19 2026, 22:35 (8 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
31/45/0c0555a4ebe6d05510f6a3306a64
Default Alt Text
Hooks.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment