mediawiki-extensions-Thanks/ThanksLogFormatter.php
kaldari ec71096c1a Adding logging to Thanks extension
Change-Id: I6f58924ae9ec9f581434f9f183cf8842b6142159
2013-04-09 20:54:19 -07:00

20 lines
661 B
PHP

<?php
/**
* This class formats log entries for thanks
*/
class ThanksLogFormatter extends LogFormatter {
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 ) );
return $params;
}
public function getPreloadTitles() {
// Add the recipient's user talk page to LinkBatch
return array( Title::makeTitle( NS_USER_TALK, $this->entry->getTarget()->getText() ) );
}
}