mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Thanks
synced 2024-11-15 02:54:23 +00:00
f5db77c750
This requires 1.42 for some new names Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: I1b433ab02231087e0f84a734092751ce2cf28b2c
32 lines
843 B
PHP
32 lines
843 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\Thanks;
|
|
|
|
use LogFormatter;
|
|
use MediaWiki\Title\Title;
|
|
use MediaWiki\User\User;
|
|
use Message;
|
|
|
|
/**
|
|
* 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() ) ];
|
|
}
|
|
}
|