vendor/dachcom-digital/toolbox/src/ToolboxBundle/ToolboxBundle.php line 16

Open in your IDE?
  1. <?php
  2. namespace ToolboxBundle;
  3. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  4. use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
  5. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  6. use Symfony\Component\DependencyInjection\ContainerBuilder;
  7. use ToolboxBundle\DependencyInjection\Compiler\AreaBrickAutoloadWatcherPass;
  8. use ToolboxBundle\DependencyInjection\Compiler\AreaBrickRegistryPass;
  9. use ToolboxBundle\DependencyInjection\Compiler\CalculatorRegistryPass;
  10. use ToolboxBundle\DependencyInjection\Compiler\MembersBundlePass;
  11. use ToolboxBundle\DependencyInjection\Compiler\StoreProviderPass;
  12. use ToolboxBundle\Tool\Install;
  13. class ToolboxBundle extends AbstractPimcoreBundle
  14. {
  15.     use PackageVersionTrait;
  16.     public const PACKAGE_NAME 'dachcom-digital/toolbox';
  17.     /**
  18.      * {@inheritdoc}
  19.      */
  20.     public function build(ContainerBuilder $container)
  21.     {
  22.         $container->addCompilerPass(new AreaBrickRegistryPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION255);
  23.         $container->addCompilerPass(new AreaBrickAutoloadWatcherPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -255);
  24.         $container->addCompilerPass(new MembersBundlePass());
  25.         $container->addCompilerPass(new CalculatorRegistryPass());
  26.         $container->addCompilerPass(new StoreProviderPass());
  27.     }
  28.     public function getInstaller(): Install
  29.     {
  30.         return $this->container->get(Install::class);
  31.     }
  32.     public function getJsPaths(): array
  33.     {
  34.         return [
  35.             '/admin/toolbox-ckeditor-object-style.js',
  36.             '/bundles/toolbox/js/toolbox-ckeditor-plugins.js',
  37.             '/bundles/toolbox/js/document/edit.js'
  38.         ];
  39.     }
  40.     public function getEditmodeJsPaths(): array
  41.     {
  42.         return [
  43.             '/bundles/toolbox/js/toolbox-ckeditor-plugins.js',
  44.             '/bundles/toolbox/js/document/editables/areablock.js',
  45.             '/bundles/toolbox/js/document/editables/googlemap.js',
  46.             '/bundles/toolbox/js/document/editables/parallaximage.js',
  47.             '/bundles/toolbox/js/document/editables/columnadjuster.js',
  48.             '/bundles/toolbox/js/document/editables/vhs.js',
  49.             '/bundles/toolbox/js/document/editables/vhs/editor.js',
  50.         ];
  51.     }
  52.     public function getEditmodeCssPaths(): array
  53.     {
  54.         return [
  55.             '/bundles/toolbox/css/admin.css',
  56.             '/bundles/toolbox/css/admin_uikit.css'
  57.         ];
  58.     }
  59.     protected function getComposerPackageName(): string
  60.     {
  61.         return self::PACKAGE_NAME;
  62.     }
  63.     /**
  64.      * @return string
  65.      */
  66.     protected static function getPimcoreVersion()
  67.     {
  68.         return preg_replace('/[^0-9.]/'''\Pimcore\Version::getVersion());
  69.     }
  70. }