mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-01 02:46:46 +00:00
3f65ed519f
They're currently auto-converted to the new format, but ideally, we wouldn't need that B/C code. And since this is the extension others will likely look at for examples when implementing, we should do it right here. Also: there is no B/C correction for missing keys in secondary links (description, icon). Change-Id: If1a8b9911e81bb4c565f21a4b9e31fdc73426d93
26 lines
492 B
PHP
26 lines
492 B
PHP
<?php
|
|
|
|
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 array(
|
|
'url' => $title->getFullURL(),
|
|
'label' => $this->msg( 'notification-welcome-linktext' )->text(),
|
|
);
|
|
}
|
|
}
|