mediawiki-extensions-Thanks/FlowThanksPresentationModel.php
James D. Forrester 03b8f88fff build: Add doxygen, use composer for phpcs, make pass
Change-Id: I939d6f4d989cf21c0f817d262bf3e4acedcf2ffe
2016-04-25 15:42:04 +00:00

44 lines
1.1 KiB
PHP

<?php
class EchoFlowThanksPresentationModel extends Flow\FlowPresentationModel {
public function canRender() {
return (bool)$this->event->getTitle();
}
public function getIconType() {
return 'thanks';
}
public function getHeaderMessage() {
$msg = parent::getHeaderMessage();
$truncatedTopicTitle = $this->getTopicTitle();
$msg->plaintextParams( $truncatedTopicTitle );
$msg->params( $this->getTruncatedTitleText( $this->event->getTitle(), true ) );
$msg->params( $this->getViewingUserForGender() );
return $msg;
}
public function getPrimaryLink() {
$title = $this->event->getTitle();
// Make a link to #flow-post-{postid}
$title = Title::makeTitle(
$title->getNamespace(),
$title->getDBKey(),
'flow-post-' . $this->event->getExtraParam( 'post-id' )
);
return [
'url' => $title->getFullURL( [
'workflow' => $this->event->getExtraParam( 'workflow' )
] ),
'label' => $this->msg( 'notification-link-text-view-post' )->text(),
];
}
public function getSecondaryLinks() {
return [ $this->getAgentLink(), $this->getBoardLink() ];
}
}