mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-11 07:26:29 +00:00
9d08c96fad
Mainly because I was annoyed at m<tab>o<tab>d<tab>u<tab> to reach modules/. Change-Id: Ib149cb2e2612ccddd0503f9d0c5d05b554860a00
35 lines
937 B
PHP
35 lines
937 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 );
|
|
}
|
|
}
|
|
}
|