mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-14 19:28:31 +00:00
0b1275b9e3
http://www.mediawiki.org/wiki/Echo_%28Notifications%29/Feature_requirements#Improved_Notification_Structure Change-Id: I2da35e8ed092c42ac95ae34012426834a37c3cde
35 lines
930 B
PHP
35 lines
930 B
PHP
<?php
|
|
|
|
class EchoCommentFormatter extends EchoEditFormatter {
|
|
public function __construct( $params ) {
|
|
parent::__construct( $params );
|
|
}
|
|
|
|
/**
|
|
* @param EchoEvent $event
|
|
* @param $param
|
|
* @param Message $message
|
|
* @param User $user
|
|
*/
|
|
protected function processParam( $event, $param, $message, $user ) {
|
|
if ( $param === 'content-page' ) {
|
|
if ( $event->getTitle() ) {
|
|
$message->params( $event->getTitle()->getSubjectPage()->getPrefixedText() );
|
|
} else {
|
|
$message->params( '' );
|
|
}
|
|
} elseif ( $param === 'subject-link' ) {
|
|
$this->setTitleLink( $event, $message );
|
|
// The title text without namespace
|
|
} elseif ( $param === 'main-title-text' ) {
|
|
if ( !$event->getTitle() ) {
|
|
$message->params( wfMessage( 'echo-no-title' )->text() );
|
|
} else {
|
|
$message->params( $event->getTitle()->getText() );
|
|
}
|
|
} else {
|
|
parent::processParam( $event, $param, $message, $user );
|
|
}
|
|
}
|
|
}
|