mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-25 00:05:29 +00:00
3a43ea2e05
* Update docs. * Remove unused local variables. * JSLint/JSHint suggested updates. * Merge CSS lines. Change-Id: Ib2a2e8129d5ff8aca6c612a39d22698f078df9d5
50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
<?php
|
|
|
|
class EchoEditFormatter extends EchoBasicFormatter {
|
|
|
|
/**
|
|
* @param EchoEvent $event
|
|
* @param $param
|
|
* @param $message Message
|
|
* @param $user User
|
|
*/
|
|
protected function processParam( EchoEvent $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 );
|
|
}
|
|
}
|
|
}
|