Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1432401
ThrottleFilterPresentationModel.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
ThrottleFilterPresentationModel.php
View Options
<?php
namespace
MediaWiki\Extension\AbuseFilter
;
use
MediaWiki\Extension\Notifications\Formatters\EchoEventPresentationModel
;
use
MediaWiki\Message\Message
;
class
ThrottleFilterPresentationModel
extends
EchoEventPresentationModel
{
/**
* @inheritDoc
*/
public
function
getIconType
()
{
return
'placeholder'
;
}
/**
* @inheritDoc
*/
public
function
getHeaderMessage
()
{
$text
=
$this
->
event
->
getTitle
()->
getText
();
[
,
$filter
]
=
explode
(
'/'
,
$text
,
2
);
$disabledActions
=
$this
->
event
->
getExtraParam
(
'throttled-actions'
);
if
(
$disabledActions
===
null
)
{
// BC for when we didn't include the actions here.
return
$this
->
msg
(
'notification-header-throttle-filter'
)
->
params
(
$this
->
getViewingUserForGender
()
)
->
numParams
(
$filter
);
}
if
(
$disabledActions
)
{
$specsFormatter
=
AbuseFilterServices
::
getSpecsFormatter
();
$specsFormatter
->
setMessageLocalizer
(
$this
);
$disabledActionsLocalized
=
[];
foreach
(
$disabledActions
as
$action
)
{
$disabledActionsLocalized
[]
=
$specsFormatter
->
getActionMessage
(
$action
)->
text
();
}
return
$this
->
msg
(
'notification-header-throttle-filter-actions'
)
->
params
(
$this
->
getViewingUserForGender
()
)
->
numParams
(
$filter
)
->
params
(
Message
::
listParam
(
$disabledActionsLocalized
)
)
->
params
(
count
(
$disabledActionsLocalized
)
);
}
return
$this
->
msg
(
'notification-header-throttle-filter-no-actions'
)
->
params
(
$this
->
getViewingUserForGender
()
)
->
numParams
(
$filter
);
}
/**
* @inheritDoc
*/
public
function
getSubjectMessage
()
{
return
$this
->
msg
(
'notification-subject-throttle-filter'
)
->
params
(
$this
->
getViewingUserForGender
()
);
}
/**
* @inheritDoc
*/
public
function
getPrimaryLink
()
{
return
[
'url'
=>
$this
->
event
->
getTitle
()->
getFullURL
(),
'label'
=>
$this
->
msg
(
'notification-link-text-show-filter'
)->
text
()
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 21:43 (1 d, 4 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ad/d6/7abba743a01810582b37df1dcc19
Default Alt Text
ThrottleFilterPresentationModel.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment