mediawiki-extensions-Echo/formatters/CommentFormatter.php
bsitu 06e7317472 Archive page and overlay should respect ?uselang=xxx
In addition, any message used in the email should be
sent in the user's language.

Bug: 52992
Change-Id: I3585f28d4ec97b86a467958bdfd603791f293d52
2013-09-09 13:44:05 -07:00

35 lines
938 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( $this->getMessage( 'echo-no-title' )->text() );
} else {
$message->params( $event->getTitle()->getText() );
}
} else {
parent::processParam( $event, $param, $message, $user );
}
}
}