mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Thanks
synced 2024-11-15 10:59:42 +00:00
0c71068040
Bug: T121822 Change-Id: Ie9b62252868e2fe752ffc776e6555686299f295f Depends-On: I3e36a6cd4bc8da96879158e1d7b65fd3a1d582fb
44 lines
1.1 KiB
PHP
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 array(
|
|
'url' => $title->getFullURL( array(
|
|
'workflow' => $this->event->getExtraParam( 'workflow' )
|
|
) ),
|
|
'label' => $this->msg( 'notification-link-text-view-post' )->text(),
|
|
);
|
|
}
|
|
|
|
public function getSecondaryLinks() {
|
|
return array( $this->getAgentLink(), $this->getBoardLink() );
|
|
}
|
|
}
|