mediawiki-extensions-Echo/includes/formatters/WelcomePresentationModel.php
Matthias Mullie 3f65ed519f Use current (with keys) array format for primary & secondary links
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
2015-12-16 17:52:04 +01:00

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(),
);
}
}