/** * @DI\Observe("claroline_contact_additional_action") * * @param \Claroline\CoreBundle\Menu\ContactAdditionalActionEvent $event */ public function onContactActionMenuRender(ContactAdditionalActionEvent $event) { $user = $event->getUser(); $url = $this->router->generate('claro_chat_user', ['user' => $user->getId()]); $menu = $event->getMenu(); $menu->addChild($this->translator->trans('chat', [], 'chat'), ['uri' => $url])->setExtra('icon', 'fa fa-comments-o')->setExtra('display', 'new_small_window'); return $menu; }
/** * @DI\Observe("claroline_contact_additional_action") * * @param \Claroline\CoreBundle\Menu\ContactAdditionalActionEvent $event */ public function onContactActionMenuRender(ContactAdditionalActionEvent $event) { $user = $event->getUser(); $url = $this->router->generate('claro_message_show', array('message' => 0)) . '?userIds[]=' . $user->getId(); $menu = $event->getMenu(); $menu->addChild($this->translator->trans('send_message', array(), 'platform'), array('uri' => $url))->setExtra('icon', 'fa fa-envelope-o'); return $menu; }