Skip to content

Commit

Permalink
EZP-31236: Added title to action buttons (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti authored Feb 24, 2020
1 parent 7cd3305 commit e0b6acb
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/lib/EventListener/UserPasswordChangeRightSidebarListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,22 @@
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
{
/* Menu items */
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
*/
Expand All @@ -40,15 +49,31 @@ 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'],
]
);
$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',
]
);
}
Expand Down

0 comments on commit e0b6acb

Please sign in to comment.