vendor/ibexa/connector-qualifio/src/lib/Menu/MainMenuEventListener.php line 29

Open in your IDE?
  1. <?php
  2. /**
  3.  * @copyright Copyright (C) Ibexa AS. All rights reserved.
  4.  * @license For full copyright and license information view LICENSE file distributed with this source code.
  5.  */
  6. declare(strict_types=1);
  7. namespace Ibexa\ConnectorQualifio\Menu;
  8. use Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent;
  9. use JMS\TranslationBundle\Model\Message;
  10. use JMS\TranslationBundle\Translation\TranslationContainerInterface;
  11. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  12. final class MainMenuEventListener implements EventSubscriberInterfaceTranslationContainerInterface
  13. {
  14.     public const ITEM_INTEGRATION__ENGAGE_CAMPAIGN 'main__integration__engage_campaign';
  15.     public static function getSubscribedEvents(): array
  16.     {
  17.         return [
  18.             ConfigureMenuEvent::MAIN_MENU => [
  19.                 ['addMenu', -45],
  20.             ],
  21.         ];
  22.     }
  23.     public function addMenu(ConfigureMenuEvent $event): void
  24.     {
  25.         $menu $event->getMenu();
  26.         $menu->addChild(
  27.             self::ITEM_INTEGRATION__ENGAGE_CAMPAIGN,
  28.             [
  29.                 'route' => 'ibexa.qualifio.index',
  30.                 'attributes' => [
  31.                     'data-tooltip-placement' => 'right',
  32.                     'data-tooltip-extra-class' => 'ibexa-tooltip--navigation',
  33.                 ],
  34.                 'extras' => [
  35.                     'icon' => 'campaign',
  36.                     'orderNumber' => 135,
  37.                 ],
  38.             ],
  39.         );
  40.     }
  41.     public static function getTranslationMessages(): array
  42.     {
  43.         return [
  44.             Message::create(self::ITEM_INTEGRATION__ENGAGE_CAMPAIGN'ibexa_menu')->setDesc('Ibexa Engage'),
  45.         ];
  46.     }
  47. }