@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | 'attr' => [ |
94 | 94 | 'placeholder' => 'part.name.placeholder', |
95 | 95 | ], |
96 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
96 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
97 | 97 | ]) |
98 | 98 | |
99 | 99 | ->add('parent', StructuralEntityType::class, [ |
100 | 100 | 'class' => get_class($entity), |
101 | 101 | 'required' => false, |
102 | 102 | 'label' => 'parent.label', |
103 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
103 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
104 | 104 | ]) |
105 | 105 | |
106 | 106 | ->add('not_selectable', CheckboxType::class, [ |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | 'label_attr' => [ |
111 | 111 | 'class' => 'checkbox-custom', |
112 | 112 | ], |
113 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
113 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
114 | 114 | ]) |
115 | 115 | |
116 | 116 | ->add('comment', CKEditorType::class, [ |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | 'rows' => 4, |
122 | 122 | ], |
123 | 123 | 'help' => 'bbcode.hint', |
124 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
124 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
125 | 125 | ]); |
126 | 126 | |
127 | 127 | $this->additionalFormElements($builder, $options, $entity); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | 'allow_delete' => true, |
134 | 134 | 'label' => false, |
135 | 135 | 'reindex_enable' => true, |
136 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
136 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
137 | 137 | 'entry_options' => [ |
138 | 138 | 'data_class' => $options['attachment_class'], |
139 | 139 | ], |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | $builder->add('master_picture_attachment', MasterPictureAttachmentType::class, [ |
144 | 144 | 'required' => false, |
145 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
145 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
146 | 146 | 'label' => 'part.edit.master_attachment', |
147 | 147 | 'entity' => $entity, |
148 | 148 | ]); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | 'entry_type' => ParameterType::class, |
159 | 159 | 'allow_add' => $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
160 | 160 | 'allow_delete' => $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
161 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
161 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
162 | 162 | 'reindex_enable' => true, |
163 | 163 | 'label' => false, |
164 | 164 | 'by_reference' => false, |
@@ -174,11 +174,11 @@ discard block |
||
174 | 174 | 'attr' => [ |
175 | 175 | 'class' => $is_new ? 'btn-success' : '', |
176 | 176 | ], |
177 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
177 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
178 | 178 | ]) |
179 | 179 | ->add('reset', ResetType::class, [ |
180 | 180 | 'label' => 'entity.edit.reset', |
181 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
181 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
182 | 182 | ]); |
183 | 183 | } |
184 | 184 |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | public function buildForm(FormBuilderInterface $builder, array $options) |
76 | 76 | { |
77 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($options) { |
|
77 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($options) { |
|
78 | 78 | $data = $event->getData(); |
79 | 79 | $config = $event->getForm()->getConfig(); |
80 | 80 | //If enabled do a reindexing of the collection |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | $error_mapping = []; |
85 | 85 | |
86 | 86 | foreach ($data->toArray() as $key => $item) { |
87 | - $index = $options['reindex_prefix'] . $this->propertyAccess->getValue($item, $options['reindex_path']); |
|
88 | - $error_mapping['[' . $key . ']'] = $index; |
|
87 | + $index = $options['reindex_prefix'].$this->propertyAccess->getValue($item, $options['reindex_path']); |
|
88 | + $error_mapping['['.$key.']'] = $index; |
|
89 | 89 | $reindexed_data->set($index, $item); |
90 | 90 | } |
91 | 91 | $event->setData($reindexed_data); |