/** * {@inheritDoc} */ protected function applyChangeBeforeFormatting(EchoEvent $event, User $user, $type) { parent::applyChangeBeforeFormatting($event, $user, $type); // If we can't find a section title for the mention, // fall back to `notification-mention-nosection`. if (!$this->getSectionTitle($event, $user)) { $this->title = array('message' => 'notification-mention-nosection', 'params' => array('agent', 'main-title-text', 'title')); $this->flyoutTitle = array('message' => 'notification-mention-nosection-flyout', 'params' => array('agent', 'main-title-text', 'title')); $this->email['batch-body'] = array('message' => 'notification-mention-nosection-email-batch-body', 'params' => array('agent', 'main-title-text')); } }
/** * @param $event EchoEvent * @param $param * @param $message Message * @param $user User */ protected function processParam($event, $param, $message, $user) { if ($param === 'giftview') { $eventData = $event->getExtra(); if (!isset($eventData['gift-id'])) { $message->params(''); return; } $this->setTitleLink($event, $message, array('class' => 'mw-echo-gift-view', 'linkText' => wfMessage('notification-gift-view-link')->text(), 'param' => array('gift_id' => $eventData['gift-id']))); } else { parent::processParam($event, $param, $message, $user); } }
/** * @param $event EchoEvent * @param $param * @param $message Message * @param $user User */ protected function processParam($event, $param, $message, $user) { if ($param === 'b2b') { $eventData = $event->getExtra(); if (!isset($eventData['board-user']) || !isset($eventData['board-user-conv'])) { $message->params(''); return; } if (isset($eventData['mentioned-users'])) { $this->setTitleLink($event, $message, array('class' => 'mw-echo-board-msg', 'linkText' => wfMessage('notification-board-msg-mention-link')->text(), 'param' => array('user' => $eventData['board-user'], 'conv' => $eventData['board-user-conv']))); } else { $this->setTitleLink($event, $message, array('class' => 'mw-echo-board-msg', 'linkText' => wfMessage('notification-board-msg-link')->text(), 'param' => array('user' => $eventData['board-user'], 'conv' => $eventData['board-user-conv']))); } } else { parent::processParam($event, $param, $message, $user); } }
/** * @param $event EchoEvent * @param $param * @param $message Message * @param $user User */ protected function processParam($event, $param, $message, $user) { if ($param === 'lvl') { $eventData = $event->getExtra(); if (!isset($eventData['new-level'])) { $message->params(''); return; } $this->setTitleLink($event, $message, array('class' => 'mw-echo-advancement', 'linkText' => $eventData['new-level'])); } else { parent::processParam($event, $param, $message, $user); } }
/** * @param $event EchoEvent * @param $param * @param $message Message * @param $user User */ protected function processParam($event, $param, $message, $user) { if ($param === 'follow') { $this->setTitleLink($event, $message, array('class' => 'mw-echo-follow-msg', 'linkText' => wfMessage('notification-follow-msg-link')->text())); } elseif ($param === 'agent-link') { $eventData = $event->getExtra(); if (!isset($eventData['agent-page'])) { $message->params(''); return; } $link = $this->buildLinkParam($eventData['agent-page'], array('class' => 'mw-echo-follow-msg', 'linkText' => $eventData['agent-page']->getText())); $message->params($link); } else { parent::processParam($event, $param, $message, $user); } }