@@ -129,44 +129,44 @@ discard block |
||
129 | 129 | if (method_exists($this->getConfigurationPool()->getContainer()->getParameter('app.entity_page'), 'getfaq')) { |
130 | 130 | $formMapper->add('faq', ModelAutocompleteType::class, [ |
131 | 131 | 'required' => false, |
132 | - 'multiple' => true, |
|
133 | - 'class' => Faq::class, |
|
134 | - 'property' => 'question', // or any field in your media entity |
|
135 | - 'label' => 'admin.page.faq.label', |
|
136 | - 'btn_add' => true, |
|
137 | - 'to_string_callback' => function ($entity, $property) { |
|
138 | - return $entity->getQuestion(); |
|
139 | - }, |
|
140 | - ]); |
|
132 | + 'multiple' => true, |
|
133 | + 'class' => Faq::class, |
|
134 | + 'property' => 'question', // or any field in your media entity |
|
135 | + 'label' => 'admin.page.faq.label', |
|
136 | + 'btn_add' => true, |
|
137 | + 'to_string_callback' => function ($entity, $property) { |
|
138 | + return $entity->getQuestion(); |
|
139 | + }, |
|
140 | + ]); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | if (method_exists($this->getConfigurationPool()->getContainer()->getParameter('app.entity_page'), 'getrelatedPages')) { |
144 | 144 | $formMapper->add('relatedPages', ModelAutocompleteType::class, [ |
145 | 145 | 'required' => false, |
146 | - 'multiple' => true, |
|
147 | - 'class' => $this->getConfigurationPool()->getContainer()->getParameter('app.entity_page'), |
|
148 | - 'property' => 'title', // or any field in your media entity |
|
149 | - 'label' => 'admin.page.relatedPage.label', |
|
150 | - 'btn_add' => false, |
|
151 | - 'to_string_callback' => function ($entity, $property) { |
|
152 | - return $entity->getTitle(); |
|
153 | - }, |
|
154 | - ]); |
|
146 | + 'multiple' => true, |
|
147 | + 'class' => $this->getConfigurationPool()->getContainer()->getParameter('app.entity_page'), |
|
148 | + 'property' => 'title', // or any field in your media entity |
|
149 | + 'label' => 'admin.page.relatedPage.label', |
|
150 | + 'btn_add' => false, |
|
151 | + 'to_string_callback' => function ($entity, $property) { |
|
152 | + return $entity->getTitle(); |
|
153 | + }, |
|
154 | + ]); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | if (method_exists($this->getConfigurationPool()->getContainer()->getParameter('app.entity_page'), 'getimages')) { |
158 | 158 | $formMapper->add('images', ModelAutocompleteType::class, [ |
159 | 159 | 'required' => false, |
160 | - 'multiple' => true, |
|
161 | - 'class' => $this->getConfigurationPool()->getContainer()->getParameter('app.entity_media'), |
|
162 | - 'property' => 'media', |
|
163 | - 'label' => 'admin.page.images.label', |
|
164 | - 'btn_add' => true, |
|
165 | - 'to_string_callback' => function ($entity, $property) { |
|
166 | - return $entity->getName(); |
|
167 | - //'<img src="'.$this->getConfigurationPool()->getContainer()->getParameter('img_dir').'/'.$entity->getImage().'" style="max-width:200px; max-height: 200px;">'; |
|
168 | - }, |
|
169 | - ]); |
|
160 | + 'multiple' => true, |
|
161 | + 'class' => $this->getConfigurationPool()->getContainer()->getParameter('app.entity_media'), |
|
162 | + 'property' => 'media', |
|
163 | + 'label' => 'admin.page.images.label', |
|
164 | + 'btn_add' => true, |
|
165 | + 'to_string_callback' => function ($entity, $property) { |
|
166 | + return $entity->getName(); |
|
167 | + //'<img src="'.$this->getConfigurationPool()->getContainer()->getParameter('img_dir').'/'.$entity->getImage().'" style="max-width:200px; max-height: 200px;">'; |
|
168 | + }, |
|
169 | + ]); |
|
170 | 170 | } |
171 | 171 | $formMapper->end(); |
172 | 172 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | 'choices' => [ |
178 | 178 | 'admin.page.metaRobots.choice.noIndex' => 'no-index, no-follow', |
179 | 179 | ], |
180 | - 'label' => 'admin.page.metaRobots.label', |
|
180 | + 'label' => 'admin.page.metaRobots.label', |
|
181 | 181 | 'required' => false, |
182 | 182 | ]); |
183 | 183 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | 'dp_calendar_weeks' => false, |
192 | 192 | 'dp_view_mode' => 'days', |
193 | 193 | 'dp_min_view_mode' => 'days', |
194 | - 'label' => 'admin.page.createdAt.label', |
|
194 | + 'label' => 'admin.page.createdAt.label', |
|
195 | 195 | ]); |
196 | 196 | $formMapper->add('updatedAt', DateTimePickerType::class, [ |
197 | 197 | //'date_format' => 'd MMMM y H:mm', |
@@ -203,21 +203,21 @@ discard block |
||
203 | 203 | 'dp_calendar_weeks' => false, |
204 | 204 | 'dp_view_mode' => 'days', |
205 | 205 | 'dp_min_view_mode' => 'days', |
206 | - 'label' => 'admin.page.updatedAt.label', |
|
206 | + 'label' => 'admin.page.updatedAt.label', |
|
207 | 207 | ]); |
208 | 208 | |
209 | 209 | if (method_exists($this->getConfigurationPool()->getContainer()->getParameter('app.entity_page'), 'getauthor')) { |
210 | 210 | $formMapper->add('author', EntityType::class, [ |
211 | - 'label' => 'admin.page.author.label', |
|
212 | - 'class' => $this->getConfigurationPool()->getContainer()->getParameter('app.entity_user'), 'label' => 'Auteur', |
|
213 | - 'required' => false, |
|
211 | + 'label' => 'admin.page.author.label', |
|
212 | + 'class' => $this->getConfigurationPool()->getContainer()->getParameter('app.entity_user'), 'label' => 'Auteur', |
|
213 | + 'required' => false, |
|
214 | 214 | ]); |
215 | 215 | } |
216 | 216 | |
217 | 217 | if (method_exists($this->getConfigurationPool()->getContainer()->getParameter('app.entity_page'), 'gettemplate')) { |
218 | 218 | $formMapper->add('template', null, [ |
219 | - 'label' => 'admin.page.template.label', |
|
220 | - 'required' => false, |
|
219 | + 'label' => 'admin.page.template.label', |
|
220 | + 'required' => false, |
|
221 | 221 | ]); |
222 | 222 | } |
223 | 223 |
@@ -131,10 +131,10 @@ discard block |
||
131 | 131 | 'required' => false, |
132 | 132 | 'multiple' => true, |
133 | 133 | 'class' => Faq::class, |
134 | - 'property' => 'question', // or any field in your media entity |
|
134 | + 'property' => 'question', // or any field in your media entity |
|
135 | 135 | 'label' => 'admin.page.faq.label', |
136 | 136 | 'btn_add' => true, |
137 | - 'to_string_callback' => function ($entity, $property) { |
|
137 | + 'to_string_callback' => function($entity, $property) { |
|
138 | 138 | return $entity->getQuestion(); |
139 | 139 | }, |
140 | 140 | ]); |
@@ -145,10 +145,10 @@ discard block |
||
145 | 145 | 'required' => false, |
146 | 146 | 'multiple' => true, |
147 | 147 | 'class' => $this->getConfigurationPool()->getContainer()->getParameter('app.entity_page'), |
148 | - 'property' => 'title', // or any field in your media entity |
|
148 | + 'property' => 'title', // or any field in your media entity |
|
149 | 149 | 'label' => 'admin.page.relatedPage.label', |
150 | 150 | 'btn_add' => false, |
151 | - 'to_string_callback' => function ($entity, $property) { |
|
151 | + 'to_string_callback' => function($entity, $property) { |
|
152 | 152 | return $entity->getTitle(); |
153 | 153 | }, |
154 | 154 | ]); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | 'property' => 'media', |
163 | 163 | 'label' => 'admin.page.images.label', |
164 | 164 | 'btn_add' => true, |
165 | - 'to_string_callback' => function ($entity, $property) { |
|
165 | + 'to_string_callback' => function($entity, $property) { |
|
166 | 166 | return $entity->getName(); |
167 | 167 | //'<img src="'.$this->getConfigurationPool()->getContainer()->getParameter('img_dir').'/'.$entity->getImage().'" style="max-width:200px; max-height: 200px;">'; |
168 | 168 | }, |
@@ -21,7 +21,7 @@ |
||
21 | 21 | if (null === $page && 'homepage' == $slug) { |
22 | 22 | $page = new \PiedWeb\CMSBundle\Entity\Page(); |
23 | 23 | $page->setTitle($translator->trans('installation.new.title')) |
24 | - ->setExcrept($translator->trans('installation.new.text')); |
|
24 | + ->setExcrept($translator->trans('installation.new.text')); |
|
25 | 25 | |
26 | 26 | return $this->render($params->get('app.default_page_template'), ['page' => $page]); |
27 | 27 | } elseif (null === $page) { |
@@ -55,8 +55,7 @@ |
||
55 | 55 | $defaultLocale = $this->container->getParameter('locale'); |
56 | 56 | |
57 | 57 | $expected = 'homepage' == $page->getSlug() && $defaultLocale == $request->getLocale() ? |
58 | - $this->get('router')->generate('piedweb_cms_homepage') : |
|
59 | - $this->get('router')->generate('piedweb_cms_page', ['slug' => $page->getRealSlug()]) |
|
58 | + $this->get('router')->generate('piedweb_cms_homepage') : $this->get('router')->generate('piedweb_cms_page', ['slug' => $page->getRealSlug()]) |
|
60 | 59 | ; |
61 | 60 | |
62 | 61 | if ($real != $expected) { |