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 CoordinatesDisplayAdminType extends AbstractType
13: {
14:
15: 16: 17:
18: public function getName()
19: {
20: return 'coordinatesdisplay';
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('tooltip', 'text', array('required' => false))
39: ->add('anchor', "choice",
40: array(
41: 'required' => true,
42: "choices" => array(
43: 'left-top' => 'left-top',
44: 'left-bottom' => 'left-bottom',
45: 'right-top' => 'right-top',
46: 'right-bottom' => 'right-bottom')))
47: ->add('numDigits', 'text', array('required' => true))
48: ->add('label', 'checkbox', array('required' => false))
49: ->add('target', 'target_element',
50: array(
51: 'element_class' => 'Mapbender\\CoreBundle\\Element\\Map',
52: 'application' => $options['application'],
53: 'property_path' => '[target]',
54: 'required' => false))
55: ->add('empty', 'text', array('required' => false))
56: ->add('prefix', 'text', array('required' => false))
57: ->add('separator', 'text', array('required' => false))
58: ;
59: }
60:
61: }