diff --git a/src/lib/EventListener/UserPasswordChangeRightSidebarListener.php b/src/lib/EventListener/UserPasswordChangeRightSidebarListener.php index e98613a..b18fbaf 100644 --- a/src/lib/EventListener/UserPasswordChangeRightSidebarListener.php +++ b/src/lib/EventListener/UserPasswordChangeRightSidebarListener.php @@ -12,6 +12,7 @@ use JMS\TranslationBundle\Translation\TranslationContainerInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use JMS\TranslationBundle\Model\Message; +use Symfony\Contracts\Translation\TranslatorInterface; class UserPasswordChangeRightSidebarListener implements EventSubscriberInterface, TranslationContainerInterface { @@ -19,6 +20,14 @@ class UserPasswordChangeRightSidebarListener implements EventSubscriberInterface public const ITEM__UPDATE = 'user_password_change__sidebar_right__update'; public const ITEM__CANCEL = 'user_password_change__sidebar_right__cancel'; + /** @var \Symfony\Contracts\Translation\TranslatorInterface */ + private $translator; + + public function __construct(TranslatorInterface $translator) + { + $this->translator = $translator; + } + /** * @return array */ @@ -40,6 +49,13 @@ public function onUserPasswordChangeRightSidebarConfigure(ConfigureMenuEvent $ev 'attributes' => [ 'class' => 'btn--trigger', 'data-click' => '#user_password_change_change', + 'data-extra-classes' => 'ez-tooltip--medium', + 'data-placement' => 'left', + 'title' => $this->translator->trans( +/** @Ignore */ self::ITEM__UPDATE, + [], + 'menu' + ), ], 'extras' => ['icon' => 'publish', 'translation_domain' => 'menu'], ] @@ -47,8 +63,17 @@ public function onUserPasswordChangeRightSidebarConfigure(ConfigureMenuEvent $ev $menu->addChild( self::ITEM__CANCEL, [ - 'route' => 'ezplatform.dashboard', + 'attributes' => [ + 'data-extra-classes' => 'ez-tooltip--medium', + 'data-placement' => 'left', + 'title' => $this->translator->trans( +/** @Ignore */ self::ITEM__CANCEL, + [], + 'menu' + ), + ], 'extras' => ['icon' => 'circle-close', 'translation_domain' => 'menu'], + 'route' => 'ezplatform.dashboard', ] ); }