mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-24 13:44:40 +00:00
9559105b59
Change-Id: I2c10cb69f1f1726b63d25579c6a35c882cc1fe7e
43 lines
960 B
PHP
43 lines
960 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( wfMessage( 'echo-no-title' )->text() );
|
|
}
|
|
|
|
$revid = $eventData['revid'];
|
|
$title = $event->getTitle();
|
|
|
|
if ( $this->outputFormat === 'html' ) {
|
|
$link = Linker::link(
|
|
$title,
|
|
'(' . wfMessage( 'diff' )->escaped() . ')',
|
|
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 );
|
|
}
|
|
}
|
|
}
|