2015-11-25 04:07:54 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class EchoForeignPresentationModel extends EchoEventPresentationModel {
|
|
|
|
public function getIconType() {
|
2016-01-15 22:19:01 +00:00
|
|
|
return 'global';
|
2015-11-25 04:07:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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();
|
2016-01-26 08:23:32 +00:00
|
|
|
$msg->params( $this->getWikiName( reset( $data['wikis'] ) ) );
|
2015-11-25 04:07:54 +00:00
|
|
|
$msg->numParams( count( $data['wikis'] ) - 1 );
|
|
|
|
|
|
|
|
return $msg;
|
|
|
|
}
|
2016-01-26 08:23:32 +00:00
|
|
|
|
|
|
|
protected function getWikiName( $wiki ) {
|
|
|
|
$foreign = new EchoForeignNotifications( new User );
|
|
|
|
$data = $foreign->getApiEndpoints( array( $wiki ) );
|
|
|
|
return $data[$wiki]['title'];
|
|
|
|
}
|
2015-11-25 04:07:54 +00:00
|
|
|
}
|