@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | 'label' => $this->trans->trans('entity.edit.not_selectable'), |
97 | 97 | 'help' => $this->trans->trans('entity.edit.not_selectable.help'), |
98 | 98 | 'label_attr' => ['class' => 'checkbox-custom'], |
99 | - 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity) ]) |
|
99 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity)]) |
|
100 | 100 | |
101 | 101 | ->add('comment', CKEditorType::class, ['required' => false, 'empty_data' => '', |
102 | 102 | 'label' => $this->trans->trans('comment.label'), |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | //Buttons |
129 | 129 | $builder->add('save', SubmitType::class, [ |
130 | - 'label' => $is_new ? $this->trans->trans('entity.create') : $this->trans->trans('entity.edit.save'), |
|
130 | + 'label' => $is_new ? $this->trans->trans('entity.create') : $this->trans->trans('entity.edit.save'), |
|
131 | 131 | 'attr' => ['class' => $is_new ? 'btn-success' : ''], |
132 | 132 | 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity)]) |
133 | 133 | ->add('reset', ResetType::class, ['label' => 'entity.edit.reset', |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | $resolver->setDefaults([ |
52 | 52 | 'filter' => 'picture', |
53 | 53 | 'attr' => ['class' => 'selectpicker'], |
54 | - 'choice_attr' => function (Options $options) { |
|
55 | - return function ($choice, $key, $value) use ($options) { |
|
54 | + 'choice_attr' => function(Options $options) { |
|
55 | + return function($choice, $key, $value) use ($options) { |
|
56 | 56 | /** @var Attachment $choice */ |
57 | 57 | $tmp = ['data-subtext' => $choice->getFilename() ?? 'URL']; |
58 | 58 | |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | }; |
65 | 65 | }, |
66 | 66 | 'choice_label' => 'name', |
67 | - 'class' => function (Options $options) { |
|
67 | + 'class' => function(Options $options) { |
|
68 | 68 | $short_class_name = (new \ReflectionClass($options['entity']))->getShortName(); |
69 | 69 | //Category becomes CategoryAttachment |
70 | - return 'App\\Entity\\Attachments\\' . $short_class_name . 'Attachment'; |
|
70 | + return 'App\\Entity\\Attachments\\'.$short_class_name.'Attachment'; |
|
71 | 71 | }, |
72 | - 'query_builder' => function (Options $options) { |
|
73 | - return function (EntityRepository $er) use ($options) { |
|
72 | + 'query_builder' => function(Options $options) { |
|
73 | + return function(EntityRepository $er) use ($options) { |
|
74 | 74 | $entity = $options['entity']; |
75 | 75 | if ($entity->getID() === null) { |
76 | 76 | //This query is always false, so we get empty results |