src/Controller/Commun/IndexBackOfficeController.php line 28

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Commun;
  3. use Psr\Log\LoggerInterface;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  6. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  7. use App\Entity\Parametrage\EnumModule;
  8. use App\Entity\Parametrage\EnumParametre;
  9. use App\Service\Parametrage\ParametrageService;
  10. class IndexBackOfficeController extends AbstractController
  11. {
  12.     private $logger;
  13.     private $parametrageService;
  14.     public function __construct(LoggerInterface $loggerParametrageService $parametrageService)
  15.     {
  16.         $this->logger $logger;
  17.         $this->parametrageService $parametrageService;
  18.     }
  19.     /**
  20.      * @Route("/", name="index_back_office")
  21.      */
  22.     public function index()
  23.     {
  24.         $contentContact $this->parametrageService->getParametre(EnumParametre::CONTENU_MES_CONTACTS)->getValeur();
  25.         $contactsActifs $this->parametrageService->estModuleActif(EnumModule::CONTACTS) && $contentContact != '';
  26.         $urlRedirect $this->parametrageService->getParametre(EnumParametre::URL_ADMIN_AM_LEGACY)->getValeur();
  27.         $moderationActive $this->parametrageService->getParametre(EnumParametre::ACTIVE_MODERATION_OFFRE_ACCUEIL)->getValeur() == 'true';
  28.         return $this->render('commun/index.html.twig', [
  29.                     'assmat' => $this->getUser()->getAssistantMaternel(),
  30.                     'moduleGDAActif' => $this->parametrageService->estModuleActif(EnumModule::GDA),
  31.                     'moduleMAMActif' => $this->parametrageService->estModuleActif(EnumModule::MAM),
  32.                     'moduleFormulaireActif' => $this->parametrageService->estModuleActif(EnumModule::FORMULAIRES),
  33.                     'moduleGrandPublicActif' => $this->parametrageService->estModuleActif(EnumModule::GRANDPUBLIC) && $urlRedirect != '',
  34.                     'moduleGrandPublicEditActif' => $this->parametrageService->estModuleActif(EnumModule::GRANDPUBLIC) && $urlRedirect == '',
  35.                     'moduleListesActif' => $this->parametrageService->estModuleActif(EnumModule::LISTES),
  36.                     'moduleStatistiquesActif' => $this->parametrageService->estModuleActif(EnumModule::STATISTIQUES),
  37.                     'moduleContactsActif' => $contactsActifs,
  38.                     'moderationActive' => $moderationActive,
  39.         ]);
  40.     }
  41.     /**
  42.      * Page Mes contacts pour l'assmat
  43.      * @Route("/contacts/", name="contacts_assmat")
  44.      */
  45.     public function contactsAssmat()
  46.     {
  47.         $content $this->parametrageService->getParametre(EnumParametre::CONTENU_MES_CONTACTS)->getValeur();
  48.         return $this->render('commun/mes_contacts.html.twig', [
  49.                     'content' => $content
  50.         ]);
  51.     }
  52.     /**
  53.      * @Route("/mentions_legales/", name="mentions_legales")
  54.      */
  55.     public function mentionsLegales()
  56.     {
  57.         $content $this->parametrageService->getParametre(EnumParametre::CONTENU_MENTIONS_LEGALES_EFC)->getValeur();
  58.         return $this->render('commun/mentions_legales.html.twig', [
  59.                     'content' => $content
  60.         ]);
  61.     }
  62.     /**
  63.      * @Route("/protection_donnees/", name="protection_donnees")
  64.      */
  65.     public function protectionDonnees()
  66.     {
  67.         $num $this->parametrageService->getParametre(EnumParametre::NUMERO_DEPARTEMENT)->getValeur();
  68.         $content $this->parametrageService->getParametre(EnumParametre::CONTENU_MENTIONS_LEGALES_EFC)->getValeur();
  69.         if($num == ''){
  70.             return $this->mentionsLegales();
  71.         }
  72.         return $this->render('commun/protection_donnees_'.$num.'.html.twig', [
  73.                     'content' => $content
  74.         ]);
  75.     }
  76. }