1: <?php
2:
3: namespace Mapbender\ManagerBundle\Form\Type;
4:
5: use Symfony\Component\Form\AbstractType;
6: use Symfony\Component\Form\FormBuilderInterface;
7: use Symfony\Component\OptionsResolver\OptionsResolverInterface;
8:
9: use Mapbender\ManagerBundle\Form\Type\BaseElementType;
10:
11: class ApplicationType extends AbstractType {
12: public function getName() {
13: return 'application';
14: }
15:
16: public function setDefaultOptions(OptionsResolverInterface $resolver)
17: {
18: $resolver->setDefaults(array(
19: 'available_templates' => array()));
20: }
21:
22: public function buildForm(FormBuilderInterface $builder, array $options) {
23: $builder
24:
25: ->add('title', 'text', array(
26: 'attr' => array(
27: 'title' => 'The application title, as shown in the browser '
28: . 'title bar and in lists.')))
29: ->add('slug', 'text', array(
30: 'label' => 'URL title',
31: 'attr' => array(
32: 'title' => 'The URL title (slug) is based on the title and used in the '
33: . 'application URL.')))
34: ->add('description', 'textarea', array(
35: 'required' => false,
36: 'attr' => array(
37: 'title' => 'The description is used in overview lists.')))
38: ->add('template', 'choice', array(
39: 'choices' => $options['available_templates'],
40: 'attr' => array(
41: 'title' => 'The HTML template used for this '
42: .'application.')))
43:
44:
45: ->add('published', 'checkbox', array(
46: 'required' => false,
47: 'label' => 'Published'));
48:
49: $builder->add('acl', 'acl', array(
50: 'property_path' => false,
51: 'data' => $options['data'],
52: 'permissions' => 'standard::object'));
53: }
54: }
55:
56: