custom/plugins/RHWebCleue/src/RHWebCleue.php line 13

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace RHWeb\Cleue;
  3. use RHWeb\Cleue\Core\PluginHelpers;
  4. use Shopware\Storefront\Framework\ThemeInterface;
  5. use Shopware\Core\Framework\Plugin;
  6. use Symfony\Component\Config\FileLocator;
  7. use Symfony\Component\DependencyInjection\ContainerBuilder;
  8. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  9. use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
  10. class RHWebCleue extends Plugin implements ThemeInterface
  11. {
  12.     public function getThemeConfigPath(): string
  13.     {
  14.         return 'theme.json';
  15.     }
  16.     public function getStorefrontScriptPath(): string
  17.     {
  18.         return 'Resources/app/storefront/dist/storefront/js';
  19.     }
  20.     public function build(ContainerBuilder $container): void
  21.     {
  22.         parent::build($container);
  23.         $loader = new XmlFileLoader($container, new FileLocator(__DIR__ '/Content/DependencyInjection'));
  24.         $loader->load('manufacturer.xml');
  25.         $loader->load('media.xml');
  26.     }
  27.     public function uninstall(UninstallContext $context): void
  28.     {
  29.         parent::uninstall($context);
  30.         if ($context->keepUserData()) {
  31.             return;
  32.         }
  33.         PluginHelpers::removeCmsBlocks($this->container$context->getContext(), [
  34.             'rhweb-brand-slider',
  35.             'rhweb-cta-banner-basic',
  36.             'rhweb-cta-banner-category-four-columns',
  37.             'rhweb-cta-banner-category-three-columns',
  38.             'rhweb-cta-banner-category-two-columns',
  39.             'rhweb-cta-banner-video',
  40.             'rhweb-multi-slider-five',
  41.             'rhweb-multi-slider-four',
  42.             'rhweb-multi-slider-three',
  43.             'rhweb-multi-slider-two',
  44.             'rhweb-service-area-service-area-service-area-four-columns',
  45.             'rhweb-service-area-service-area-service-area-three-columns',
  46.             'rhweb-service-area-service-area-service-area-two-columns',
  47.             'rhweb-service-area-service-area-service-area-one-column',
  48.             'rhweb-testimonial-four-column',
  49.             'rhweb-testimonial-three-column',
  50.             'rhweb-testimonial-two-column',
  51.             'rhweb-testimonial-one-column',
  52.             'rhweb-testimonial-five-slider',
  53.             'rhweb-testimonial-four-slider',
  54.             'rhweb-testimonial-three-slider',
  55.             'rhweb-testimonial-two-slider',
  56.             'rhweb-shop-the-look',
  57.             'rhweb-deal-counter'
  58.         ]);
  59.         PluginHelpers::removeCmsSlots($this->container$context->getContext(), [
  60.             'rhweb-brand-slider',
  61.             'rhweb-cta-banner',
  62.             'rhweb-testimonial',
  63.             'rhweb-shop-the-look',
  64.             'rhweb-products-list',
  65.             'rhweb-deal-counter'
  66.         ]);
  67.     }
  68. }