|
- <?php
-
- namespace Lc\CaracoleBundle\Controller\Section;
-
- use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
- use Lc\CaracoleBundle\Controller\AdminControllerTrait;
- use Lc\CaracoleBundle\Model\Section\SectionModel;
- use Lc\SovBundle\Controller\AbstractAdminController;
- use Lc\SovBundle\Field\BooleanField;
- use Lc\SovBundle\Field\CKEditorField;
- use Lc\SovBundle\Field\StatusField;
-
- abstract class SectionAdminController extends AbstractAdminController
- {
- use AdminControllerTrait;
-
- public function configureFields(string $pageName): iterable
- {
- $panel = parent::configureFields($pageName);
-
- return array_merge(
- [
- FormField::addPanel('general'),
- TextField::new('title'),
- ChoiceField::new('cycle')
- ->setRequired(true)
- ->setChoices(
- [
- 'Jour' => SectionModel::CYCLE_DAY,
- 'Semaine' => SectionModel::CYCLE_WEEK,
- 'Mois' => SectionModel::CYCLE_MONTH,
- 'Année' => SectionModel::CYCLE_YEAR,
- ]
- ),
- TextField::new('color')
- ->setRequired(true)
- ->hideOnIndex(),
- NumberField::new('position')
- ->hideOnForm()
- ->hideOnIndex(),
- CKEditorField::new('description')
- ->hideOnIndex(),
- BooleanField::new('isDefault', 'Section par défaut'),
- StatusField::new('status'),
- ],
- $panel
- );
- }
-
- }
|