mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 17:20:40 +00:00
8839f98735
Change-Id: Ie7c3d776d3698264d18ccaec90cc39aae83761dd
42 lines
926 B
PHP
42 lines
926 B
PHP
<?php
|
|
|
|
class EchoEditFormatter extends EchoBasicFormatter {
|
|
protected function processParam( $event, $param, $message, $user ) {
|
|
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 {
|
|
$link = $title->getFullURL(
|
|
array( 'oldid' => $revid, 'diff' => 'prev' ) );
|
|
|
|
$message->params($link);
|
|
}
|
|
} else {
|
|
parent::processParam( $event, $param, $message, $user );
|
|
}
|
|
}
|
|
} |