vendor/coreshop/pimcore-bundle/CoreShopPimcoreBundle.php line 27

Open in your IDE?
  1. <?php
  2. /**
  3.  * CoreShop.
  4.  *
  5.  * This source file is subject to the GNU General Public License version 3 (GPLv3)
  6.  * For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt
  7.  * files that are distributed with this source code.
  8.  *
  9.  * @copyright  Copyright (c) 2015-2020 Dominik Pfaffenbauer (https://www.pfaffenbauer.at)
  10.  * @license    https://www.coreshop.org/license     GNU General Public License version 3 (GPLv3)
  11.  */
  12. namespace CoreShop\Bundle\PimcoreBundle;
  13. use CoreShop\Bundle\PimcoreBundle\DependencyInjection\Compiler\ExpressionLanguageServicePass;
  14. use CoreShop\Bundle\PimcoreBundle\DependencyInjection\Compiler\RegisterGridActionPass;
  15. use CoreShop\Bundle\PimcoreBundle\DependencyInjection\Compiler\RegisterGridFilterPass;
  16. use CoreShop\Bundle\PimcoreBundle\DependencyInjection\Compiler\RegisterPimcoreDocumentTagImplementationLoaderPass;
  17. use CoreShop\Bundle\PimcoreBundle\DependencyInjection\Compiler\RegisterPimcoreDocumentTagPass;
  18. use CoreShop\Bundle\PimcoreBundle\DependencyInjection\Compiler\RegisterTypeHintRegistriesPass;
  19. use PackageVersions\Versions;
  20. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  21. use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
  22. use Pimcore\Placeholder;
  23. use Symfony\Component\DependencyInjection\ContainerBuilder;
  24. final class CoreShopPimcoreBundle extends AbstractPimcoreBundle
  25. {
  26.     use PackageVersionTrait;
  27.     /**
  28.      * @return string
  29.      */
  30.     public function getNiceName()
  31.     {
  32.         return 'CoreShop - Pimcore';
  33.     }
  34.     /**
  35.      * @return string
  36.      */
  37.     public function getDescription()
  38.     {
  39.         return 'CoreShop - Pimcore Bundle';
  40.     }
  41.     /**
  42.      * @return string
  43.      */
  44.     public function getComposerPackageName()
  45.     {
  46.         if (isset(Versions::VERSIONS['coreshop/pimcore-bundle'])) {
  47.             return 'coreshop/pimcore-bundle';
  48.         }
  49.         return 'coreshop/core-shop';
  50.     }
  51.     /**
  52.      * {@inheritdoc}
  53.      */
  54.     public function boot()
  55.     {
  56.         parent::boot();
  57.         Placeholder::addPlaceholderClassPrefix('CoreShop\Component\Pimcore\Placeholder\\');
  58.     }
  59.     /**
  60.      * {@inheritdoc}
  61.      */
  62.     public function build(ContainerBuilder $container)
  63.     {
  64.         parent::build($container);
  65.         $container->addCompilerPass(new RegisterGridActionPass());
  66.         $container->addCompilerPass(new RegisterGridFilterPass());
  67.         $container->addCompilerPass(new RegisterPimcoreDocumentTagImplementationLoaderPass());
  68.         $container->addCompilerPass(new RegisterPimcoreDocumentTagPass());
  69.         $container->addCompilerPass(new ExpressionLanguageServicePass());
  70.         $container->addCompilerPass(new RegisterTypeHintRegistriesPass());
  71.     }
  72.     /**
  73.      * {@inheritdoc}
  74.      */
  75.     public function getJsPaths()
  76.     {
  77.         $jsFiles = [];
  78.         if ($this->container->hasParameter('coreshop.all.pimcore.admin.js')) {
  79.             $jsFiles $this->container->get('coreshop.resource_loader')->loadResources($this->container->getParameter('coreshop.all.pimcore.admin.js'), true);
  80.         }
  81.         return $jsFiles;
  82.     }
  83.     /**
  84.      * {@inheritdoc}
  85.      */
  86.     public function getCssPaths()
  87.     {
  88.         $cssFiles = [];
  89.         if ($this->container->hasParameter('coreshop.all.pimcore.admin.css')) {
  90.             $cssFiles $this->container->get('coreshop.resource_loader')->loadResources($this->container->getParameter('coreshop.all.pimcore.admin.css'));
  91.         }
  92.         return $cssFiles;
  93.     }
  94.     /**
  95.      * {@inheritdoc}
  96.      */
  97.     public function getEditmodeJsPaths()
  98.     {
  99.         $jsFiles = [];
  100.         if ($this->container->hasParameter('coreshop.all.pimcore.admin.editmode_js')) {
  101.             $jsFiles $this->container->get('coreshop.resource_loader')->loadResources($this->container->getParameter('coreshop.all.pimcore.admin.editmode_js'), false);
  102.         }
  103.         return $jsFiles;
  104.     }
  105.     /**
  106.      * {@inheritdoc}
  107.      */
  108.     public function getEditmodeCssPaths()
  109.     {
  110.         $cssFiles = [];
  111.         if ($this->container->hasParameter('coreshop.all.pimcore.admin.editmode_css')) {
  112.             $cssFiles $this->container->get('coreshop.resource_loader')->loadResources($this->container->getParameter('coreshop.all.pimcore.admin.editmode_css'));
  113.         }
  114.         return $cssFiles;
  115.     }
  116. }