mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Thanks
synced 2024-11-15 10:59:42 +00:00
256f21d6c4
This is what links used to look like, but we've changed that awhile ago. Echo still has B/C support for this, but ideally we should conform to the interface. Change-Id: I7503db28b0d81fb818b525ea9362e49b9b56342a
49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?php
|
|
class EchoFlowThanksPresentationModel extends EchoEventPresentationModel {
|
|
public function canRender() {
|
|
return (bool)$this->event->getTitle();
|
|
}
|
|
|
|
public function getIconType() {
|
|
return 'thanks';
|
|
}
|
|
|
|
public function getHeaderMessage() {
|
|
$msg = parent::getHeaderMessage();
|
|
$msg->params( $this->event->getExtraParam( 'topic-title' ) );
|
|
$msg->params( $this->event->getTitle()->getPrefixedText() );
|
|
|
|
$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() {
|
|
$titleLink = array(
|
|
'url' => $this->event->getTitle()->getLocalURL(),
|
|
'label' => $this->event->getTitle()->getPrefixedText(),
|
|
'description' => '',
|
|
'icon' => 'speechBubbles',
|
|
'prioritized' => true,
|
|
);
|
|
|
|
return array( $this->getAgentLink(), $titleLink );
|
|
}
|
|
}
|