2012-07-27 22:16:19 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class EchoCommentFormatter extends EchoEditFormatter {
|
2012-07-31 00:29:49 +00:00
|
|
|
public function __construct( $params ) {
|
|
|
|
parent::__construct( $params );
|
|
|
|
}
|
|
|
|
|
2012-09-26 05:09:43 +00:00
|
|
|
/**
|
|
|
|
* @param EchoEvent $event
|
|
|
|
* @param $param
|
|
|
|
* @param Message $message
|
|
|
|
* @param User $user
|
|
|
|
*/
|
2012-07-27 22:16:19 +00:00
|
|
|
protected function processParam( $event, $param, $message, $user ) {
|
2013-05-14 22:22:52 +00:00
|
|
|
if ( $param === 'content-page' ) {
|
2012-08-01 21:23:37 +00:00
|
|
|
if ( $event->getTitle() ) {
|
|
|
|
$message->params( $event->getTitle()->getSubjectPage()->getPrefixedText() );
|
|
|
|
} else {
|
|
|
|
$message->params( '' );
|
|
|
|
}
|
2012-10-28 16:47:41 +00:00
|
|
|
} elseif ( $param === 'subject-link' ) {
|
2013-05-14 22:22:52 +00:00
|
|
|
$this->setTitleLink( $event, $message );
|
2013-07-24 03:50:43 +00:00
|
|
|
// 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() );
|
|
|
|
}
|
2012-07-27 22:16:19 +00:00
|
|
|
} else {
|
|
|
|
parent::processParam( $event, $param, $message, $user );
|
|
|
|
}
|
|
|
|
}
|
2012-08-30 16:04:39 +00:00
|
|
|
}
|