2015-11-03 00:00:29 +00:00
|
|
|
<?php
|
|
|
|
|
2022-11-01 22:01:23 +00:00
|
|
|
namespace MediaWiki\Extension\Notifications\Formatters;
|
|
|
|
|
|
|
|
use Title;
|
|
|
|
|
2015-11-03 00:00:29 +00:00
|
|
|
class EchoWelcomePresentationModel extends EchoEventPresentationModel {
|
|
|
|
|
|
|
|
public function getIconType() {
|
|
|
|
return 'site';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPrimaryLink() {
|
2015-11-12 22:30:51 +00:00
|
|
|
$msg = $this->msg( 'notification-welcome-link' );
|
|
|
|
if ( $msg->isDisabled() ) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
$title = Title::newFromText( $msg->plain() );
|
|
|
|
if ( !$title ) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-12-05 18:51:07 +00:00
|
|
|
return [
|
2015-12-16 16:52:02 +00:00
|
|
|
'url' => $title->getFullURL(),
|
|
|
|
'label' => $this->msg( 'notification-welcome-linktext' )->text(),
|
2016-12-05 18:51:07 +00:00
|
|
|
];
|
2015-11-03 00:00:29 +00:00
|
|
|
}
|
|
|
|
}
|