mediawiki-extensions-Thanks/includes/ThanksLogFormatter.php
Umherirrender 0da96a7000 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: If99e2c98969579306c7fdc626658bec5d6e26b5d
2024-06-10 22:00:22 +02:00

32 lines
861 B
PHP

<?php
namespace MediaWiki\Extension\Thanks;
use LogFormatter;
use MediaWiki\Message\Message;
use MediaWiki\Title\Title;
use MediaWiki\User\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() ) ];
}
}