Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5994389
EchoForeignPresentationModel.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
EchoForeignPresentationModel.php
View Options
<?php
namespace
MediaWiki\Extension\Notifications\Formatters
;
use
MediaWiki\Extension\Notifications\ForeignNotifications
;
class
EchoForeignPresentationModel
extends
EchoEventPresentationModel
{
public
function
getIconType
()
{
return
'global'
;
}
public
function
getPrimaryLink
()
{
return
false
;
}
protected
function
getHeaderMessageKey
()
{
$data
=
$this
->
event
->
getExtra
();
$section
=
$data
[
'section'
]
==
'message'
?
'notice'
:
$data
[
'section'
];
// notification-header-foreign-alert
// notification-header-foreign-notice
// notification-header-foreign-all
return
"notification-header-foreign-{$section}"
;
}
public
function
getHeaderMessage
()
{
$msg
=
parent
::
getHeaderMessage
();
$data
=
$this
->
event
->
getExtra
();
$firstWiki
=
reset
(
$data
[
'wikis'
]
);
$names
=
$this
->
getWikiNames
(
[
$firstWiki
]
);
$msg
->
params
(
$names
[
0
]
);
$msg
->
numParams
(
count
(
$data
[
'wikis'
]
)
-
1
);
$msg
->
numParams
(
count
(
$data
[
'wikis'
]
)
);
return
$msg
;
}
public
function
getBodyMessage
()
{
$data
=
$this
->
event
->
getExtra
();
$msg
=
$this
->
msg
(
'notification-body-foreign'
);
$msg
->
params
(
$this
->
language
->
listToText
(
$this
->
getWikiNames
(
$data
[
'wikis'
]
)
)
);
return
$msg
;
}
/**
* @param string[] $wikis
* @return string[]
*/
protected
function
getWikiNames
(
array
$wikis
):
array
{
$data
=
ForeignNotifications
::
getApiEndpoints
(
$wikis
);
$names
=
[];
foreach
(
$wikis
as
$wiki
)
{
$names
[]
=
$data
[
$wiki
][
'title'
];
}
return
$names
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 4 2026, 03:16 (4 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ce/e0/ff196a3c1b1fd19a02d560aabe07
Default Alt Text
EchoForeignPresentationModel.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment