mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-25 00:05:29 +00:00
3979919087
Bug: T121936 Change-Id: Ic14fe65f4ecc6db94fc6774ca0c39d1c2a47db9d
35 lines
801 B
PHP
35 lines
801 B
PHP
<?php
|
|
|
|
class EchoForeignPresentationModel extends EchoEventPresentationModel {
|
|
public function getIconType() {
|
|
return 'global';
|
|
}
|
|
|
|
public function getPrimaryLink() {
|
|
return false;
|
|
}
|
|
|
|
protected function getHeaderMessageKey() {
|
|
$data = $this->event->getExtra();
|
|
$section = $data['section'];
|
|
|
|
return "notification-header-{$this->type}-{$section}";
|
|
}
|
|
|
|
public function getHeaderMessage() {
|
|
$msg = parent::getHeaderMessage();
|
|
|
|
$data = $this->event->getExtra();
|
|
$msg->params( $this->getWikiName( reset( $data['wikis'] ) ) );
|
|
$msg->numParams( count( $data['wikis'] ) - 1 );
|
|
|
|
return $msg;
|
|
}
|
|
|
|
protected function getWikiName( $wiki ) {
|
|
$foreign = new EchoForeignNotifications( new User );
|
|
$data = $foreign->getApiEndpoints( array( $wiki ) );
|
|
return $data[$wiki]['title'];
|
|
}
|
|
}
|