Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5987001
ThanksLogFormatter.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
ThanksLogFormatter.php
View Options
<?php
namespace
MediaWiki\Extension\Thanks
;
use
LogEntry
;
use
LogFormatter
;
use
MediaWiki\Message\Message
;
use
MediaWiki\Title\NamespaceInfo
;
use
MediaWiki\User\User
;
/**
* This class formats log entries for thanks
*/
class
ThanksLogFormatter
extends
LogFormatter
{
private
NamespaceInfo
$namespaceInfo
;
public
function
__construct
(
LogEntry
$entry
,
NamespaceInfo
$namespaceInfo
)
{
parent
::
__construct
(
$entry
);
$this
->
namespaceInfo
=
$namespaceInfo
;
}
/**
* @inheritDoc
*/
protected
function
getMessageParameters
()
{
$params
=
parent
::
getMessageParameters
();
// Convert target from a pageLink to a userLink since the target is
// actually a user, not a page.
$recipient
=
User
::
newFromName
(
$this
->
entry
->
getTarget
()->
getText
(),
false
);
$params
[
2
]
=
Message
::
rawParam
(
$this
->
makeUserLink
(
$recipient
)
);
$params
[
3
]
=
$recipient
->
getName
();
return
$params
;
}
public
function
getPreloadTitles
()
{
// Add the recipient's user talk page to LinkBatch
return
[
$this
->
namespaceInfo
->
getTalkPage
(
$this
->
entry
->
getTarget
()
)
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Oct 4, 00:17 (2 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
90/4e/d4aca2b1e5381f0de16ef9f8d7bc
Default Alt Text
ThanksLogFormatter.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment