mediawiki-extensions-Echo/includes/Formatters/EchoWelcomePresentationModel.php
Reedy 7619a76877 Namespace Echo Formatters
Change-Id: I5bf398cdb76a577543f6526ac1bee4a73897103d
2022-11-01 21:20:06 -06:00

30 lines
556 B
PHP

<?php
namespace MediaWiki\Extension\Notifications\Formatters;
use Title;
class EchoWelcomePresentationModel extends EchoEventPresentationModel {
public function getIconType() {
return 'site';
}
public function getPrimaryLink() {
$msg = $this->msg( 'notification-welcome-link' );
if ( $msg->isDisabled() ) {
return false;
}
$title = Title::newFromText( $msg->plain() );
if ( !$title ) {
return false;
}
return [
'url' => $title->getFullURL(),
'label' => $this->msg( 'notification-welcome-linktext' )->text(),
];
}
}