mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Thanks
synced 2024-11-15 10:59:42 +00:00
3749db7eba
Change-Id: Ic9e0b8d6b3cc6b9be4d6b026cb0a3b4a12aef38f
32 lines
812 B
PHP
32 lines
812 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\Thanks;
|
|
|
|
use LogFormatter;
|
|
use Message;
|
|
use Title;
|
|
use User;
|
|
|
|
/**
|
|
* This class formats log entries for thanks
|
|
*/
|
|
class ThanksLogFormatter extends LogFormatter {
|
|
/**
|
|
* @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 [ Title::makeTitle( NS_USER_TALK, $this->entry->getTarget()->getText() ) ];
|
|
}
|
|
}
|