mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-10 06:27:24 +01:00
41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Subscriber;
|
|
|
|
use App\Event\Menu\MenuEvent;
|
|
use App\DBAL\Types\MenuEventType;
|
|
|
|
class SourceMenuSubscriber extends AbstractEntityMenuSubscriber
|
|
{
|
|
public function onSourceMenuConfigure(MenuEvent $event): void
|
|
{
|
|
$menu = $event->getItem();
|
|
$menu->addChild($this->trans('edit'), [
|
|
'route' => 'app_source_edit',
|
|
'routeParameters' => [
|
|
'id' => $this->getRequestId($event),
|
|
],
|
|
'attributes' => [
|
|
'icon' => 'fas fa-edit',
|
|
],
|
|
]);
|
|
$this->generateShowDropdown($menu, $event,'app_source_show');
|
|
$menu->addChild($this->trans('node'), [
|
|
'route' => 'app_source_node',
|
|
'routeParameters' => [
|
|
'id' => $this->getRequestId($event),
|
|
],
|
|
'attributes' => [
|
|
'icon' => 'fas fa-globe',
|
|
],
|
|
]);
|
|
}
|
|
|
|
public static function getSubscribedEvents(): array
|
|
{
|
|
return [
|
|
MenuEventType::SOURCE => 'onSourceMenuConfigure',
|
|
];
|
|
}
|
|
}
|