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 ButtonAdminType extends AbstractType
13: {
14:
15: 16: 17:
18: public function getName()
19: {
20: return 'button';
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('icon', 'choice',
40: array(
41: 'required' => false,
42: "choices" => array(
43: "" => "None",
44: "iconAbout" => "About",
45: "iconAreaRuler" => "Area ruler",
46: "iconInfoActive" => "Feature info",
47: "iconGps" => "GPS",
48: "iconLegend" => "Legend",
49: "iconPrint" => "Print",
50: "iconSearch" => "Search",
51: "iconLayertree" => "Layer tree",
52: "iconWms" => "WMS"
53: )))
54: ->add('label', 'checkbox', array('required' => false))
55: ->add('target', 'target_element',
56: array(
57: 'element_class' => '%Element%',
58: 'application' => $options['application'],
59: 'property_path' => '[target]',
60: 'required' => false))
61: ->add('click', 'text', array('required' => false))
62: ->add('group', 'text', array('required' => false))
63: ->add('action', 'text', array('required' => false))
64: ->add('deactivate', 'text', array('required' => false));
65: }
66:
67: }