1: <?php
2:
3: namespace Mapbender\WmcBundle\Form\Type;
4:
5: use Mapbender\CoreBundle\Form\Type\StateType;
6: use Mapbender\WmsBundle\Form\Type\LegendUrlType;
7: use Mapbender\WmsBundle\Form\Type\OnlineResourceType;
8: use Symfony\Component\Form\AbstractType;
9: use Symfony\Component\Form\FormBuilderInterface;
10:
11:
12:
13: class WmcType extends AbstractType
14: {
15:
16: 17: 18:
19: public function getName()
20: {
21: return 'wmc';
22: }
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33: 34: 35:
36: public function buildForm(FormBuilderInterface $builder, array $options)
37: {
38: $builder->add('id', 'hidden')
39: ->add('state', new StateType(),
40: array(
41: 'data_class' => 'Mapbender\CoreBundle\Entity\State'))
42: ->add('keywords', 'text',
43: array(
44: 'required' => false))
45: ->add('abstract', 'textarea',
46: array(
47: 'required' => false))
48: ->add('logourl', new LegendUrlType(),
49: array(
50: 'data_class' => 'Mapbender\WmsBundle\Component\LegendUrl'))
51: ->add('screenshot', 'file',
52: array(
53: 'required' => true))
54: ->add('descriptionurl', new OnlineResourceType(),
55: array(
56: 'data_class' => 'Mapbender\WmsBundle\Component\OnlineResource'));
57: }
58:
59: }
60: