1: <?php
2:
3: namespace Mapbender\CoreBundle\Element\Type;
4:
5: use Symfony\Component\Form\AbstractType;
6: use Symfony\Component\Form\FormBuilderInterface;
7: use Symfony\Component\OptionsResolver\OptionsResolverInterface;
8:
9: 10: 11:
12: class LayertreeAdminType extends AbstractType
13: {
14:
15: 16: 17:
18: public function getName()
19: {
20: return 'layertree';
21: }
22:
23: 24: 25:
26: public function setDefaultOptions(OptionsResolverInterface $resolver)
27: {
28: $resolver->setDefaults(array(
29: 'application' => null
30: ));
31: }
32:
33: 34: 35:
36: public function buildForm(FormBuilderInterface $builder, array $options)
37: {
38: $builder->add('target', 'target_element',
39: array(
40: 'element_class' => 'Mapbender\\CoreBundle\\Element\\Map',
41: 'application' => $options['application'],
42: 'property_path' => '[target]',
43: 'required' => false))
44: ->add('layerMenu', 'checkbox',
45: array(
46: 'required' => false))
47: ->add('layerRemove', 'checkbox',
48: array(
49: 'required' => false))
50: ->add('type', 'choice',
51: array(
52: 'required' => true,
53: 'choices' => array('dialog' => 'Dialog', 'element' => 'Element')))
54: ->add('autoOpen', 'checkbox',
55: array(
56: 'required' => false))
57: ->add('displaytype', 'choice',
58: array(
59: 'required' => true,
60: 'choices' => array('tree' => 'Tree')
61:
62:
63:
64:
65: ))
66:
67:
68:
69:
70:
71: ->add('titlemaxlength', 'text',
72: array('required' => true))
73: ->add('showBaseSource', 'checkbox',
74: array(
75: 'required' => false))
76: ->add('showHeader', 'checkbox',
77: array(
78: 'required' => false));
79: }
80:
81: }