mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 09:26:05 +00:00
8da85396d6
This version is very rough. For an example set of Minimum Releasable Functionality, this version will notify users on changes to their watchlists or to their user talk pages. However, it is still missing a conversion script to turn watchlists into echo subscriptions. For now, notifications can be viewed through the new special page Special:Notifications, or through the API module provided. Change-Id: I5867226e3e6195fbed81f4b5803e2310f057ffc4
42 lines
906 B
PHP
42 lines
906 B
PHP
<?php
|
|
|
|
class EchoEditFormatter extends EchoBasicFormatter {
|
|
protected function processParam( $event, $param, $message ) {
|
|
parent::processParam( $event, $param, $message );
|
|
|
|
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 = Linker::linkUrl( $title,
|
|
array( 'oldid' => $revid, 'diff' => 'prev' ) );
|
|
|
|
$message->params($link);
|
|
}
|
|
}
|
|
}
|
|
} |