mediawiki-extensions-Thanks/ThanksPresentationModel.php
Stephane Bisson 882f6da0bf Truncate title
Bug: T121822
Depends-On: Ia0a52926133ab7e04d7d9c2a095ef8f9d0871a49
Change-Id: Ic4711a61d68d82de69f063354e93e45aaa6485c7
2016-01-21 11:12:44 -05:00

32 lines
797 B
PHP

<?php
class EchoThanksPresentationModel extends EchoEventPresentationModel {
public function canRender() {
return (bool)$this->event->getTitle();
}
public function getIconType() {
return 'thanks';
}
public function getHeaderMessage() {
$msg = parent::getHeaderMessage();
$msg->params( $this->getTruncatedTitleText( $this->event->getTitle(), true ) );
$msg->params( $this->getViewingUserForGender() );
return $msg;
}
public function getPrimaryLink() {
return array(
'url' => $this->event->getTitle()->getLocalURL( array(
'oldid' => 'prev',
'diff' => $this->event->getExtraParam( 'revid' )
) ),
'label' => $this->msg( 'notification-link-text-view-edit' )->text(),
);
}
public function getSecondaryLinks() {
return array( $this->getAgentLink() );
}
}