@@ 14-53 (lines=40) @@ | ||
11 | /** |
|
12 | * This class represents the type for the CheckboxPagePart |
|
13 | */ |
|
14 | class CheckboxPagePartAdminType extends AbstractType |
|
15 | { |
|
16 | /** |
|
17 | * @param FormBuilderInterface $builder The form builder |
|
18 | * @param array $options The options |
|
19 | */ |
|
20 | public function buildForm(FormBuilderInterface $builder, array $options) |
|
21 | { |
|
22 | $builder |
|
23 | ->add('label', TextType::class, array( |
|
24 | 'label' => 'kuma_form.form.checkbox_page_part.label.label', |
|
25 | 'required' => true, |
|
26 | )) |
|
27 | ->add('required', CheckboxType::class, array( |
|
28 | 'label' => 'kuma_form.form.checkbox_page_part.required.label', |
|
29 | 'required' => false, |
|
30 | )) |
|
31 | ->add('errormessage_required', TextType::class, array( |
|
32 | 'label' => 'kuma_form.form.checkbox_page_part.errormessage_required.label', |
|
33 | 'required' => false, |
|
34 | )) |
|
35 | ; |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * @return string |
|
40 | */ |
|
41 | public function getBlockPrefix() |
|
42 | { |
|
43 | return 'kunstmaan_formbundle_checkboxpageparttype'; |
|
44 | } |
|
45 | ||
46 | /** |
|
47 | * @param OptionsResolver $resolver |
|
48 | */ |
|
49 | public function configureOptions(OptionsResolver $resolver) |
|
50 | { |
|
51 | $resolver->setDefaults(array('data_class' => 'Kunstmaan\FormBundle\Entity\PageParts\CheckboxPagePart')); |
|
52 | } |
|
53 | } |
|
54 |
@@ 14-54 (lines=41) @@ | ||
11 | /** |
|
12 | * This class represents the type for the file FileUploadPagePart |
|
13 | */ |
|
14 | class FileUploadPagePartAdminType extends AbstractType |
|
15 | { |
|
16 | /** |
|
17 | * @param FormBuilderInterface $builder The form builder |
|
18 | * @param array $options The options |
|
19 | */ |
|
20 | public function buildForm(FormBuilderInterface $builder, array $options) |
|
21 | { |
|
22 | $builder |
|
23 | ->add('label', TextType::class, array( |
|
24 | 'required' => true, |
|
25 | 'label' => 'kuma_form.form.file_upload_page_part.label.label', |
|
26 | )) |
|
27 | ->add('required', CheckboxType::class, array( |
|
28 | 'required' => false, |
|
29 | 'label' => 'kuma_form.form.file_upload_page_part.required.label', |
|
30 | )) |
|
31 | ->add('errormessage_required', TextType::class, array( |
|
32 | 'required' => false, |
|
33 | 'label' => 'kuma_form.form.file_upload_page_part.errormessage_required.label', |
|
34 | )) |
|
35 | ; |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * @return string |
|
40 | */ |
|
41 | public function getBlockPrefix() |
|
42 | { |
|
43 | return 'kunstmaan_formbundle_fileuploadpageparttype'; |
|
44 | } |
|
45 | ||
46 | /** |
|
47 | * @param OptionsResolver $resolver |
|
48 | */ |
|
49 | public function configureOptions(OptionsResolver $resolver) |
|
50 | { |
|
51 | $resolver->setDefaults(array('data_class' => 'Kunstmaan\FormBundle\Entity\PageParts\FileUploadPagePart')); |
|
52 | } |
|
53 | } |
|
54 |
@@ 15-55 (lines=41) @@ | ||
12 | /** |
|
13 | * LinkPagePartAdminType |
|
14 | */ |
|
15 | class LinkPagePartAdminType extends AbstractType |
|
16 | { |
|
17 | /** |
|
18 | * @param \Symfony\Component\Form\FormBuilderInterface $builder |
|
19 | * @param array $options |
|
20 | */ |
|
21 | public function buildForm(FormBuilderInterface $builder, array $options) |
|
22 | { |
|
23 | $builder |
|
24 | ->add('url', URLChooserType::class, array( |
|
25 | 'label' => false, |
|
26 | 'required' => false, |
|
27 | )) |
|
28 | ->add('openinnewwindow', CheckboxType::class, array( |
|
29 | 'label' => 'pagepart.link.openinnewwindow', |
|
30 | 'required' => false, |
|
31 | )) |
|
32 | ->add('text', TextType::class, array( |
|
33 | 'label' => 'pagepart.link.text', |
|
34 | 'required' => false, |
|
35 | )); |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * @return string |
|
40 | */ |
|
41 | public function getBlockPrefix() |
|
42 | { |
|
43 | return 'kunstmaan_pagepartbundle_linkpageparttype'; |
|
44 | } |
|
45 | ||
46 | /** |
|
47 | * @param \Symfony\Component\OptionsResolver\OptionsResolver $resolver |
|
48 | */ |
|
49 | public function configureOptions(OptionsResolver $resolver) |
|
50 | { |
|
51 | $resolver->setDefaults(array( |
|
52 | 'data_class' => 'Kunstmaan\PagePartBundle\Entity\LinkPagePart', |
|
53 | )); |
|
54 | } |
|
55 | } |
|
56 |