2015-10-28 07:23:38 +00:00
|
|
|
<?php
|
2016-02-08 17:45:35 +00:00
|
|
|
|
|
|
|
class EchoFlowThanksPresentationModel extends Flow\FlowPresentationModel {
|
2015-10-28 07:23:38 +00:00
|
|
|
public function canRender() {
|
|
|
|
return (bool)$this->event->getTitle();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getIconType() {
|
|
|
|
return 'thanks';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getHeaderMessage() {
|
2016-06-16 16:12:38 +00:00
|
|
|
if ( $this->isBundled() ) {
|
|
|
|
$msg = $this->msg( 'notification-bundle-header-flow-thank' );
|
|
|
|
$msg->params( $this->getBundleCount() );
|
|
|
|
$msg->plaintextParams( $this->getTopicTitle() );
|
|
|
|
$msg->params( $this->getViewingUserForGender() );
|
|
|
|
return $msg;
|
|
|
|
} else {
|
|
|
|
$msg = parent::getHeaderMessage();
|
|
|
|
$msg->plaintextParams( $this->getTopicTitle() );
|
|
|
|
$msg->params( $this->getTruncatedTitleText( $this->event->getTitle(), true ) );
|
|
|
|
$msg->params( $this->getViewingUserForGender() );
|
|
|
|
return $msg;
|
|
|
|
}
|
|
|
|
}
|
2015-10-28 07:23:38 +00:00
|
|
|
|
2016-06-16 16:12:38 +00:00
|
|
|
public function getCompactHeaderMessage() {
|
|
|
|
$msg = parent::getCompactHeaderMessage();
|
2015-11-13 00:03:55 +00:00
|
|
|
$msg->params( $this->getViewingUserForGender() );
|
2015-10-28 07:23:38 +00:00
|
|
|
return $msg;
|
|
|
|
}
|
|
|
|
|
2016-06-16 16:12:38 +00:00
|
|
|
public function getBodyMessage() {
|
|
|
|
$excerpt = $this->event->getExtraParam( 'excerpt' );
|
|
|
|
if ( $excerpt ) {
|
|
|
|
$msg = new RawMessage( '$1' );
|
|
|
|
$msg->plaintextParams( $excerpt );
|
|
|
|
return $msg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-10-28 07:23:38 +00:00
|
|
|
public function getPrimaryLink() {
|
|
|
|
$title = $this->event->getTitle();
|
|
|
|
// Make a link to #flow-post-{postid}
|
|
|
|
$title = Title::makeTitle(
|
|
|
|
$title->getNamespace(),
|
|
|
|
$title->getDBKey(),
|
2015-11-16 23:46:47 +00:00
|
|
|
'flow-post-' . $this->event->getExtraParam( 'post-id' )
|
2015-10-28 07:23:38 +00:00
|
|
|
);
|
|
|
|
|
2016-04-22 20:13:56 +00:00
|
|
|
return [
|
|
|
|
'url' => $title->getFullURL( [
|
2015-10-28 07:23:38 +00:00
|
|
|
'workflow' => $this->event->getExtraParam( 'workflow' )
|
2016-04-22 20:13:56 +00:00
|
|
|
] ),
|
2016-01-12 21:45:42 +00:00
|
|
|
'label' => $this->msg( 'notification-link-text-view-post' )->text(),
|
2016-04-22 20:13:56 +00:00
|
|
|
];
|
2015-10-28 07:23:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getSecondaryLinks() {
|
2016-06-16 16:12:38 +00:00
|
|
|
if ( $this->isBundled() ) {
|
|
|
|
return [ $this->getBoardLink() ];
|
|
|
|
} else {
|
|
|
|
return [ $this->getAgentLink(), $this->getBoardLink() ];
|
|
|
|
}
|
2015-10-28 07:23:38 +00:00
|
|
|
}
|
|
|
|
}
|