vendor/ibexa/page-builder/src/bundle/Menu/EventListener/ConfigureMainMenuListener.php line 25

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\Bundle\PageBuilder\Menu\EventListener;
  8. use Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent;
  9. use JMS\TranslationBundle\Model\Message;
  10. use JMS\TranslationBundle\Translation\TranslationContainerInterface;
  11. class ConfigureMainMenuListener implements TranslationContainerInterface
  12. {
  13.     public const ITEM_PAGE 'ezplatform_page_manager';
  14.     /**
  15.      * @param \Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent $event
  16.      *
  17.      * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
  18.      * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
  19.      */
  20.     public function onMenuConfigure(ConfigureMenuEvent $event)
  21.     {
  22.         $root $event->getMenu();
  23.         $root->addChild(self::ITEM_PAGE, [
  24.             'attributes' => [
  25.                 'data-tooltip-placement' => 'right',
  26.                 'data-tooltip-extra-class' => 'ibexa-tooltip--navigation',
  27.             ],
  28.             'extras' => [
  29.                 'icon' => 'earth-access',
  30.                 'orderNumber' => 40,
  31.                 'translation_domain' => 'ibexa_page_builder_menu',
  32.             ],
  33.         ]);
  34.     }
  35.     /**
  36.      * Returns an array of messages.
  37.      *
  38.      * @return array<Message>
  39.      */
  40.     public static function getTranslationMessages()
  41.     {
  42.         return [
  43.             (new Message(self::ITEM_PAGE'ibexa_page_builder_menu'))->setDesc('Sites'),
  44.         ];
  45.     }
  46. }
  47. class_alias(ConfigureMainMenuListener::class, 'EzSystems\EzPlatformPageBuilderBundle\Menu\EventListener\ConfigureMainMenuListener');