mediawiki-extensions-Thanks/ThanksFormatter.php
addshore 422f0f6062 Add really basic API tests
This also includes the unit test hooks

Jenkings job will be added with I6ec2edf62b9

Change-Id: Id085db7096db420416e9fba72a65586d021f1c76
2013-11-04 16:38:23 +00:00

36 lines
746 B
PHP

<?php
class EchoThanksFormatter extends EchoBasicFormatter {
/**
* @param $event EchoEvent
* @param $param
* @param $message Message
* @param $user User
*/
protected function processParam( $event, $param, $message, $user ) {
if ( $param === 'difflink' ) {
$eventData = $event->getExtra();
if ( !isset( $eventData['revid'] ) ) {
$message->params( '' );
return;
}
$this->setTitleLink(
$event,
$message,
array(
'class' => 'mw-echo-diff',
'linkText' => wfMessage( 'notification-thanks-diff-link' )->text(),
'param' => array(
'oldid' => $eventData['revid'],
'diff' => 'prev',
)
)
);
} else {
parent::processParam( $event, $param, $message, $user );
}
}
}