vendor/abcpremium/asset-metadata-assigner/src/Event/Subscriber/AddFrontendSettingsToAdminPanel.php line 30

Open in your IDE?
  1. <?php
  2. namespace Abcpremium\AssetMetadataAssignerBundle\Event\Subscriber;
  3. use Abcpremium\AssetMetadataAssignerBundle\Configuration\BundleConfiguration;
  4. use Pimcore\Event\Admin\IndexActionSettingsEvent;
  5. use Pimcore\Event\AdminEvents;
  6. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  7. class AddFrontendSettingsToAdminPanel implements EventSubscriberInterface
  8. {
  9.     private BundleConfiguration $bundleConfiguration;
  10.     public function __construct(
  11.         BundleConfiguration $bundleConfiguration
  12.     ) {
  13.         $this->bundleConfiguration $bundleConfiguration;
  14.     }
  15.     /**
  16.      * {@inheritDoc}
  17.      */
  18.     public static function getSubscribedEvents(): array
  19.     {
  20.         return [
  21.             AdminEvents::INDEX_ACTION_SETTINGS => 'addBundleSettingsToAdminPanel',
  22.         ];
  23.     }
  24.     public function addBundleSettingsToAdminPanel(IndexActionSettingsEvent $event): void
  25.     {
  26.         $settings = [
  27.             'enabled' => $this->bundleConfiguration->isFrontendProcessingAllowed(),
  28.         ];
  29.         $event->addSetting('abcpremiumAssetMetadataAssignerBundle'$settings);
  30.     }
  31. }