2012-04-27 15:14:24 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class EchoEditFormatter extends EchoBasicFormatter {
|
2012-05-17 15:36:18 +00:00
|
|
|
protected function processParam( $event, $param, $message, $user ) {
|
2012-04-27 15:14:24 +00:00
|
|
|
if ( $param === 'difflink' ) {
|
|
|
|
$eventData = $event->getExtra();
|
|
|
|
if ( !isset($eventData['revid']) ) {
|
|
|
|
$message->params('');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !$event->getTitle() ) {
|
|
|
|
$message->params(wfMsg('echo-no-title'));
|
|
|
|
}
|
|
|
|
|
|
|
|
$revid = $eventData['revid'];
|
|
|
|
$title = $event->getTitle();
|
|
|
|
|
|
|
|
if ( $this->outputFormat === 'html' ) {
|
|
|
|
$link = Linker::link(
|
|
|
|
$title,
|
|
|
|
'('.wfMessage('diff')->text().')',
|
|
|
|
array(
|
|
|
|
'class' => 'mw-echo-diff',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'oldid' => $revid,
|
|
|
|
'diff' => 'prev',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
$message->rawParams($link);
|
|
|
|
} else {
|
2012-05-17 15:36:18 +00:00
|
|
|
$link = $title->getFullURL(
|
2012-04-27 15:14:24 +00:00
|
|
|
array( 'oldid' => $revid, 'diff' => 'prev' ) );
|
|
|
|
|
|
|
|
$message->params($link);
|
|
|
|
}
|
2012-05-17 15:36:18 +00:00
|
|
|
} else {
|
|
|
|
parent::processParam( $event, $param, $message, $user );
|
2012-04-27 15:14:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|