1: <?php
2:
3: namespace Mapbender\WmcBundle\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: 13:
14: class WmcHandlerAdminType extends AbstractType
15: {
16:
17: 18: 19:
20: public function getName()
21: {
22: return 'wmchandler';
23: }
24:
25: 26: 27:
28: public function setDefaultOptions(OptionsResolverInterface $resolver)
29: {
30: $resolver->setDefaults(array(
31: 'application' => null
32: ));
33: }
34:
35: 36: 37:
38: public function buildForm(FormBuilderInterface $builder, array $options)
39: {
40: $builder->add('tooltip', 'text', array('required' => false))
41: ->add('target', 'target_element',
42: array(
43: 'element_class' => 'Mapbender\\CoreBundle\\Element\\Map',
44: 'application' => $options['application'],
45: 'property_path' => '[target]',
46: 'required' => false))
47: ->add('accessRoles', 'choice',
48: array(
49: 'choices' => array(),
50: 'required' => false))
51: ->add('keepBaseSources', 'checkbox',
52: array(
53: 'required' => false))
54: ->add('useEditor', 'checkbox',
55: array(
56: 'required' => false))
57: ->add('useSuggestMap', 'checkbox',
58: array(
59: 'required' => false))
60: ->add('receiver', 'choice',
61: array(
62: 'multiple' => true,
63: 'required' => false,
64: 'choices' => array(
65: 'email' => 'e-mail',
66: 'facebook' => 'facebook',
67: 'twitter' => 'twitter')))
68: ->add('useLoader', 'checkbox',
69: array(
70: 'required' => false))
71: ;
72: }
73:
74: }
75:
76: ?>
77: