diff --git a/src/EventSuscriber/NavigationSettingEventSubscriber.php b/src/EventSuscriber/NavigationSettingEventSubscriber.php new file mode 100644 index 0000000..962b41b --- /dev/null +++ b/src/EventSuscriber/NavigationSettingEventSubscriber.php @@ -0,0 +1,63 @@ + + */ +class NavigationSettingEventSubscriber extends EventSubscriber +{ + protected NavigationSettingManager $manager; + + public function __construct(NavigationSettingManager $manager) + { + $this->manager = $manager; + } + + public function onInit(NavigationSettingEvent $event) + { + $data = $event->getData(); + $navigation = $data['navigation']; + + // $this->manager->init($navigation, 'nav_param1', 'Section', 'Param 1', 'Default value'); + // $this->manager->init($navigation, 'nav_param2', 'Section', 'Param 2', true); + } + + public function onFormInit(NavigationSettingEvent $event) + { + $data = $event->getData(); + $builder = $data['builder']; + $entity = $data['entity']; + + // if ('nav_param1' === $entity->getCode()) { + // $builder->add( + // 'value', + // CheckboxType::class, + // [ + // 'label' => $entity->getLabel(), + // 'required' => false, + // ] + // ); + // } + // + // if ('nav_param2' === $entity->getCode()) { + // $builder->add( + // 'value', + // CheckboxType::class, + // [ + // 'label' => $entity->getLabel(), + // 'required' => false, + // ] + // ); + // } + } +}