mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-25 00:05:29 +00:00
ece6e3f80a
Change-Id: Id6352b133e88827047dac85423b6914b83e71909
20 lines
704 B
PHP
20 lines
704 B
PHP
<?php
|
|
|
|
/**
|
|
* A formatter for the notification flyout popup. Just the bare data needed to
|
|
* render everything client-side.
|
|
*/
|
|
class EchoModelFormatter extends EchoFlyoutFormatter {
|
|
/**
|
|
* @param EchoEventPresentationModel $model
|
|
* @return array
|
|
*/
|
|
protected function formatModel( EchoEventPresentationModel $model ) {
|
|
$data = $model->jsonSerialize();
|
|
$data['iconUrl'] = EchoNotificationFormatter::getIconUrl( $model->getIconType(), $this->language->getDir() );
|
|
$data['links']['primary'] = EchoLinkNormalizer::normalizePrimaryLink( $data['links']['primary'] );
|
|
$data['links']['secondary'] = EchoLinkNormalizer::normalizeSecondaryLinks( $data['links']['secondary'] );
|
|
return $data;
|
|
}
|
|
}
|