![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mautic.corals.io/app/bundles/ChannelBundle/EventListener/ |
<?php namespace Mautic\ChannelBundle\EventListener; use Mautic\CoreBundle\CoreEvents; use Mautic\CoreBundle\Event\CustomButtonEvent; use Mautic\CoreBundle\Twig\Helper\ButtonHelper; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Routing\RouterInterface; use Symfony\Contracts\Translation\TranslatorInterface; class ButtonSubscriber implements EventSubscriberInterface { public function __construct( private RouterInterface $router, private TranslatorInterface $translator ) { } public static function getSubscribedEvents(): array { return [ CoreEvents::VIEW_INJECT_CUSTOM_BUTTONS => ['injectContactBulkButtons', 0], ]; } public function injectContactBulkButtons(CustomButtonEvent $event): void { if (str_starts_with($event->getRoute(), 'mautic_contact_')) { $event->addButton( [ 'attr' => [ 'class' => 'btn btn-default btn-sm btn-nospin', 'data-toggle' => 'ajaxmodal', 'data-target' => '#MauticSharedModal', 'href' => $this->router->generate('mautic_channel_batch_contact_view'), 'data-header' => $this->translator->trans('mautic.lead.batch.channels'), ], 'btnText' => $this->translator->trans('mautic.lead.batch.channels'), 'iconClass' => 'ri-rss-line', ], ButtonHelper::LOCATION_BULK_ACTIONS ); } } }