mediawiki-extensions-Thanks/includes/ThanksLogFormatter.php
Umherirrender f5db77c750 Use namespaced classes
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
2024-01-04 22:22:56 +01:00

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() ) ];
}
}