app/Customize/Controller/HelpController.php line 54

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Customize\Controller;
  13. use Eccube\Controller\AbstractController;
  14. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  15. use Symfony\Component\Routing\Annotation\Route;
  16. use Customize\Repository\ProductTagRepository;
  17. use Symfony\Component\Filesystem\Filesystem;
  18. class HelpController extends AbstractController
  19. {
  20.     /**
  21.      * @var ProductTagRepository
  22.      */
  23.     protected $productTagRepository;
  24.     /**
  25.      * HelpController constructor.
  26.      */
  27.     public function __construct(ProductTagRepository $productTagRepository)
  28.     {
  29.         $this->productTagRepository $productTagRepository;
  30.     }
  31.     /**
  32.      * 特定商取引法.
  33.      *
  34.      * @Route("/help/tradelaw", name="help_tradelaw", methods={"GET"})
  35.      * @Template("Help/tradelaw.twig")
  36.      */
  37.     public function tradelaw()
  38.     {
  39.         return [];
  40.     }
  41.     /**
  42.      * ご利用ガイド.
  43.      *
  44.      * @Route("/guide", name="help_guide", methods={"GET"})
  45.      */
  46.     public function guide()
  47.     {
  48.         $fs = new Filesystem();
  49.         $school_id $this->getUser()->getSchool()->getSchoolId();
  50.         $templatePath $this->getParameter('eccube_theme_front_dir');
  51.         $guidFileRelPath 'Help/School/guide'.$school_id.'.twig';
  52.         $guideFilePath $templatePath.'/'.$guidFileRelPath;
  53.         if (!$fs->exists($guideFilePath)) {
  54.             $guideFilePath $templatePath.'/Help/guide.twig';
  55.             $guidFileRelPath 'Help/guide.twig';
  56.         }
  57.         return $this->render($guidFileRelPath, array(
  58.             'school_id' => $school_id,
  59.             'show_necessity' => $this->productTagRepository->isNecessityExist()
  60.         ));
  61.     }
  62.     /**
  63.      * ご利用ガイド(兄弟).
  64.      *
  65.      * @Route("/guide/brother/{school_id}", name="help_guide_brother", methods={"GET"}, requirements={"school_id" = "\d+"})
  66.      */
  67.     public function guide_brother($school_id)
  68.     {
  69.         $fs = new Filesystem();
  70.         $templatePath $this->getParameter('eccube_theme_front_dir');
  71.         $guidFileRelPath 'Help/School/guide'.$school_id.'.twig';
  72.         $guideFilePath $templatePath.'/'.$guidFileRelPath;
  73.         if (!$fs->exists($guideFilePath)) {
  74.             $guideFilePath $templatePath.'/Help/guide.twig';
  75.             $guidFileRelPath 'Help/guide.twig';
  76.         }
  77.         return $this->render($guidFileRelPath, array(
  78.             'school_id' => $school_id,
  79.             'show_necessity' => $this->productTagRepository->isNecessityExist()
  80.         ));
  81.     }
  82.     /**
  83.      * 当サイトについて.
  84.      *
  85.      * @Route("/help/about", name="help_about", methods={"GET"})
  86.      * @Template("Help/about.twig")
  87.      */
  88.     public function about()
  89.     {
  90.         return [];
  91.     }
  92.     /**
  93.      * プライバシーポリシー.
  94.      *
  95.      * @Route("/help/privacy", name="help_privacy", methods={"GET"})
  96.      * @Template("Help/privacy.twig")
  97.      */
  98.     public function privacy()
  99.     {
  100.         return [];
  101.     }
  102.     /**
  103.      * 利用規約.
  104.      *
  105.      * @Route("/help/agreement", name="help_agreement", methods={"GET"})
  106.      * @Template("Help/agreement.twig")
  107.      */
  108.     public function agreement()
  109.     {
  110.         return [];
  111.     }
  112. }