<?php
declare(strict_types=1);
namespace App\Essesolutions\Z3950Bundle\EventListener\Admin;
use App\Essesolutions\Z3950Bundle\Configuration\ConfigurationAwareInterface;
use App\Essesolutions\Z3950Bundle\Configuration\ConfigurationAwareTrait;
use Pimcore\Event\Admin\IndexActionSettingsEvent;
use Pimcore\Event\AdminEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class SettingEventListener implements EventSubscriberInterface, ConfigurationAwareInterface
{
use ConfigurationAwareTrait;
/** @inheritDoc */
public static function getSubscribedEvents(): array
{
return [
AdminEvents::INDEX_ACTION_SETTINGS => 'onSettings'
];
}
/**
* @param IndexActionSettingsEvent $event
*
* @return void
*/
public function onSettings(IndexActionSettingsEvent $event)
{
$event->addSetting('essesolutions_z3950', [
'import' => [
'configs' => array_keys($this->z3950Configuration->getImportConfigsName()),
]
]);
}
}