1: <?php
2:
3: namespace Mapbender\CoreBundle\Element\Type;
4:
5: use Symfony\Component\Form\AbstractType;
6: use Symfony\Component\Form\FormBuilderInterface;
7: use Mapbender\CoreBundle\Form\Type\PositionType;
8: use Symfony\Component\OptionsResolver\OptionsResolverInterface;
9:
10: 11: 12:
13: class ScaleDisplayAdminType extends AbstractType
14: {
15: 16: 17:
18: public function getName()
19: {
20: return 'scaledisplay';
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('target', 'target_element',
40: array(
41: 'element_class' => 'Mapbender\\CoreBundle\\Element\\Map',
42: 'application' => $options['application'],
43: 'property_path' => '[target]',
44: 'required' => false))
45: ->add('unitPrefix', 'checkbox', array('required' => false))
46: ->add('anchor', "choice",
47: array(
48: 'required' => true,
49: "choices" => array(
50: 'left-top' => 'left-top',
51: 'left-bottom' => 'left-bottom',
52: 'right-top' => 'right-top',
53: 'right-bottom' => 'right-bottom')));
54: }
55:
56: }