Browse Source

Ajout de methode pour limiter l'affichage en dehors d'une section donnée

feature/section_export
Fabien Normand 2 weeks ago
parent
commit
ca38d4f22a
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      Controller/AdminControllerTrait.php

+ 8
- 0
Controller/AdminControllerTrait.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Controller;

use App\Entity\Section\Section;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManagerInterface;
use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection;
@@ -59,6 +60,13 @@ trait AdminControllerTrait
}
}

public function configureResponseParametersDisableShowIfNotSection(KeyValueStore $responseParameters, Section $section)
{
if($this->getSectionCurrent() != $section) {
$responseParameters->set('replace_content_with_message', "Vous devez vous rendre sur la section ". $section->getTitle().' pour afficher cette page');
}
}

public function createIndexRepositoryQuery(
SearchDto $searchDto,
EntityDto $entityDto,

Loading…
Cancel
Save