app/Plugin/CouponPro42/CouponEvent.php line 58

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the CouponPro42 Plugin
  4.  *
  5.  * Copyright (C) 2022 Diezon.
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Plugin\CouponPro42;
  11. use Eccube\Event\TemplateEvent;
  12. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  13. class CouponEvent implements EventSubscriberInterface
  14. {
  15.     /**
  16.      * @return array
  17.      */
  18.     public static function getSubscribedEvents()
  19.     {
  20.         return [
  21.             'Mypage/index.twig' => 'onDefaultMypageNaviTwig',
  22.             'Mypage/history.twig' => [['onDefaultMypageNaviTwig'],['onDefaultMypageHistoryNaviTwig']],
  23.             'Mypage/favorite.twig' => 'onDefaultMypageNaviTwig',
  24.             'Mypage/change.twig' => 'onDefaultMypageNaviTwig',
  25.             'Mypage/change_complete.twig' => 'onDefaultMypageNaviTwig',
  26.             'Mypage/delivery.twig' => 'onDefaultMypageNaviTwig',
  27.             'Mypage/delivery_edit.twig' => 'onDefaultMypageNaviTwig',
  28.             'Mypage/withdraw.twig' => 'onDefaultMypageNaviTwig',
  29.             'Mypage/coupon_list.twig' => 'onDefaultMypageNaviTwig',
  30.             'Mypage/change_email.twig' => 'onDefaultMypageNaviTwig',
  31.             'Mypage/withdraw_confirm.twig' => 'onDefaultMypageNaviTwig',
  32.             '@EccubePaymentLite42/default/Mypage/edit_credit_card.twig' => 'onDefaultMypageNaviTwig',
  33.             '@EccubePaymentLite42/default/Mypage/regular_list.twig' => 'onDefaultMypageNaviTwig',
  34.             '@EccubePaymentLite42/default/Mypage/regular_detail.twig' => 'onDefaultMypageNaviTwig',
  35.             '@EccubePaymentLite42/default/Mypage/regular_cycle.twig' => 'onDefaultMypageNaviTwig',
  36.             '@EccubePaymentLite42/default/Mypage/regular_cancel.twig' => 'onDefaultMypageNaviTwig',
  37.             '@EccubePaymentLite42/default/Mypage/regular_complete.twig' => 'onDefaultMypageNaviTwig',
  38.             '@EccubePaymentLite42/default/Mypage/regular_next_delivery_date.twig' => 'onDefaultMypageNaviTwig',
  39.             '@EccubePaymentLite42/default/Mypage/regular_product_quantity.twig' => 'onDefaultMypageNaviTwig',
  40.             '@EccubePaymentLite42/default/Mypage/regular_resume.twig' => 'onDefaultMypageNaviTwig',
  41.             '@EccubePaymentLite42/default/Mypage/regular_shipping.twig' => 'onDefaultMypageNaviTwig',
  42.             '@EccubePaymentLite42/default/Mypage/regular_skip.twig' => 'onDefaultMypageNaviTwig',
  43.             '@EccubePaymentLite42/default/Mypage/regular_suspend.twig' => 'onDefaultMypageNaviTwig',
  44.             'Product/detail.twig' => 'onDefaultProductNaviTwig',
  45.             'Shopping/index.twig' => 'onDefaultShoppingIndexNaviTwig',
  46.             'Shopping/confirm.twig' => 'onDefaultShoppingConfirmNaviTwig',
  47.             '@admin/Order/edit.twig' => 'onDefaultOrderEditNaviTwig',
  48.         ];
  49.     }
  50.     /**
  51.      * @param TemplateEvent $event
  52.      */
  53.     public function onDefaultMypageNaviTwig(TemplateEvent $event)
  54.     {
  55.         $event->addSnippet('@CouponPro42/front/Mypage/navi.twig');
  56.     }
  57.     /**
  58.      * @param TemplateEvent $event
  59.      */
  60.     public function onDefaultProductNaviTwig(TemplateEvent $event)
  61.     {
  62.         $event->addSnippet('@CouponPro42/front/Product/detail.twig');
  63.     }
  64.     /**
  65.      * @param TemplateEvent $event
  66.      */
  67.     public function onDefaultShoppingIndexNaviTwig(TemplateEvent $event)
  68.     {
  69.         $event->addSnippet('@CouponPro42/front/Shopping/coupon_list.twig');
  70.     }
  71.     /**
  72.      * @param TemplateEvent $event
  73.      */
  74.     public function onDefaultShoppingConfirmNaviTwig(TemplateEvent $event)
  75.     {
  76.         $event->addSnippet('@CouponPro42/front/Shopping/confirm_coupon.twig');
  77.     }
  78.     /**
  79.      * @param TemplateEvent $event
  80.      */
  81.     public function onDefaultOrderEditNaviTwig(TemplateEvent $event)
  82.     {
  83.         $event->addSnippet('@CouponPro42/admin/Order/coupon.twig');
  84.     }
  85.     /**
  86.      * @param TemplateEvent $event
  87.      */
  88.     public function onDefaultMypageHistoryNaviTwig(TemplateEvent $event)
  89.     {
  90.         $event->addSnippet('@CouponPro42/front/History/coupon.twig');
  91.     }
  92. }