1 | <?php |
||
2 | |||
3 | namespace ProjetNormandie\PageBundle\Admin; |
||
4 | |||
5 | use A2lix\TranslationFormBundle\Form\Type\TranslationsType; |
||
6 | use Sonata\AdminBundle\Admin\AbstractAdmin; |
||
7 | use Sonata\AdminBundle\Route\RouteCollectionInterface; |
||
8 | use Sonata\AdminBundle\Show\ShowMapper; |
||
9 | use Sonata\AdminBundle\Form\FormMapper; |
||
10 | use Sonata\AdminBundle\Datagrid\ListMapper; |
||
11 | use Sonata\AdminBundle\Route\RouteCollection; |
||
12 | use FOS\CKEditorBundle\Form\Type\CKEditorType; |
||
0 ignored issues
–
show
|
|||
13 | use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
||
14 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
||
15 | use ProjetNormandie\PageBundle\Entity\Page; |
||
16 | |||
17 | /** |
||
18 | * Administration manager for the Page Bundle. |
||
19 | */ |
||
20 | class PageAdmin extends AbstractAdmin |
||
21 | { |
||
22 | protected $baseRouteName = 'pnforumbundle_admin_page'; |
||
23 | |||
24 | /** |
||
25 | * @param RouteCollection $collection |
||
26 | */ |
||
27 | protected function configureRoutes(RouteCollectionInterface $collection): void |
||
28 | { |
||
29 | $collection->remove('export'); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param FormMapper $form |
||
34 | */ |
||
35 | protected function configureFormFields(FormMapper $form): void |
||
36 | { |
||
37 | $form |
||
38 | ->add('id', TextType::class, ['label' => 'id', 'attr' => ['readonly' => true]]) |
||
39 | ->add('name', TextType::class) |
||
40 | ->add( |
||
41 | 'status', |
||
42 | ChoiceType::class, |
||
43 | [ |
||
44 | 'label' => 'label.status', |
||
45 | 'choices' => Page::getStatusChoices(), |
||
46 | ] |
||
47 | ) |
||
48 | ->add('translations', TranslationsType::class, [ |
||
49 | 'required' => true, |
||
50 | 'fields' => [ |
||
51 | 'text' => [ |
||
52 | 'field_type' => CKEditorType::class, |
||
53 | 'label' => 'Text', |
||
54 | ] |
||
55 | ] |
||
56 | ]); |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @param ListMapper $list |
||
61 | */ |
||
62 | protected function configureListFields(ListMapper $list): void |
||
63 | { |
||
64 | $list->addIdentifier('id') |
||
65 | ->add('name', null, ['label' => 'Name']) |
||
66 | ->add( |
||
67 | 'status', |
||
68 | 'choice', |
||
69 | [ |
||
70 | 'label' => 'label.status', |
||
71 | 'choices' => Page::getStatusChoices(), |
||
72 | ] |
||
73 | ) |
||
74 | ->add('slug', null, ['label' => 'Slug']) |
||
75 | ->add('createdAt', null, ['label' => 'Created At']) |
||
76 | ->add('updatedAt', null, ['label' => 'Updated At']) |
||
77 | ->add('_action', 'actions', [ |
||
78 | 'actions' => [ |
||
79 | 'show' => [], |
||
80 | 'edit' => [], |
||
81 | ] |
||
82 | ]); |
||
83 | } |
||
84 | |||
85 | /** |
||
86 | * @param ShowMapper $show |
||
87 | */ |
||
88 | protected function configureShowFields(ShowMapper $show): void |
||
89 | { |
||
90 | $show |
||
91 | ->add('id') |
||
92 | ->add('name') |
||
93 | ->add('status', null, ['label' => 'label.status']) |
||
94 | ->add('createdAt', null, ['label' => 'Created At']) |
||
95 | ->add('updatedAt', null, ['label' => 'Updated At']) |
||
96 | ->add('getText', null, ['label' => 'Text', 'safe' => true]); |
||
97 | } |
||
98 | } |
||
99 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths