Overview

Namespaces

  • Mapbender
    • Component
      • HTTP
    • CoreBundle
      • Command
      • Component
        • Exception
      • Controller
      • DataFixtures
        • ORM
      • DependencyInjection
      • Element
        • Type
      • Entity
      • EventListener
      • Extension
      • Form
        • DataTransformer
        • EventListener
        • Type
      • Security
      • Template
    • DrupalIntegrationBundle
      • DependencyInjection
      • Security
        • Authentication
          • Provider
          • Token
        • Authorization
          • Voter
        • Factory
        • Firewall
        • User
      • Session
    • KmlBundle
      • Element
    • ManagerBundle
      • Controller
      • Form
        • DataTransformer
        • Type
    • MonitoringBundle
      • Command
      • Component
      • Controller
      • DependencyInjection
      • Entity
      • EventListener
      • Form
    • PrintBundle
      • Component
      • Controller
    • WmcBundle
      • Component
        • Exception
      • Element
        • Type
      • Entity
      • Form
        • EventListener
        • Type
    • WmsBundle
      • Component
        • Exception
      • Controller
      • DependencyInjection
      • Element
        • Type
      • Entity
      • Event
      • Form
        • EventListener
        • Type
    • WmtsBundle
      • Component
        • Exception
      • Controller
      • Entity
      • Form
        • Type
  • None
  • PHP

Classes

  • AboutDialogAdminType
  • ActivityIndicatorAdminType
  • ButtonAdminType
  • CoordinatesDisplayAdminType
  • CopyrightAdminType
  • FeatureInfoAdminType
  • GpsPositionAdminType
  • LayertreeAdminType
  • LegendAdminType
  • MapAdminType
  • OverviewAdminType
  • PrintClientAdminType
  • PrintClientQualityAdminType
  • PrintClientTemplateAdminType
  • RulerAdminType
  • ScaleBarAdminType
  • ScaleDisplayAdminType
  • ScaleSelectorAdminType
  • SearchRouterFormType
  • SearchRouterSelectType
  • SrsSelectorAdminType
  • TargetElementType
  • ZoomBarAdminType
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download
 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: use Mapbender\CoreBundle\Form\Type\ExtentType;
10: use Mapbender\CoreBundle\Entity\Layerset;
11: use Mapbender\CoreBundle\Element\DataTranformer\LayersetNameTranformer;
12: 
13: /**
14:  * 
15:  */
16: class ScaleBarAdminType extends AbstractType
17: {
18: 
19:     /**
20:      * @inheritdoc
21:      */
22:     public function getName()
23:     {
24:         return 'scalebar';
25:     }
26: 
27:     /**
28:      * @inheritdoc
29:      */
30:     public function setDefaultOptions(OptionsResolverInterface $resolver)
31:     {
32:         $resolver->setDefaults(array(
33:             'application' => null
34:         ));
35:     }
36: 
37:     /**
38:      * @inheritdoc
39:      */
40:     public function buildForm(FormBuilderInterface $builder, array $options)
41:     {
42:         $app = $options['application'];
43:         $layersets = array();
44:         foreach($app->getLayersets() as $layerset)
45:         {
46:             $layersets[$layerset->getId()] = $layerset->getTitle();
47:         }
48: 
49:         $builder->add('tooltip', 'text', array('required' => false))
50:                 ->add('target', 'target_element',
51:                       array(
52:                     'element_class' => 'Mapbender\\CoreBundle\\Element\\Map',
53:                     'application' => $options['application'],
54:                     'property_path' => '[target]',
55:                     'required' => false))
56:                 ->add('maxWidth', 'text', array('required' => true))
57:                 ->add('anchor', "choice",
58:                       array(
59:                     'required' => true,
60:                     "choices" => array(
61:                         'left-top' => 'left-top',
62:                         'left-bottom' => 'left-bottom',
63:                         'right-top' => 'right-top',
64:                         'right-bottom' => 'right-bottom')))
65:                 ->add('units', 'choice',
66:                       array(
67:                     'required' => true,
68:                     'multiple' => true,
69:                     'choices' => array(
70:                         'km' => 'kilometer',
71:                         'ml' => 'mile')));
72:     }
73: 
74: }
Mapbender3 API documenation API documentation generated by ApiGen 2.8.0