1: <?php
2:
3: namespace Mapbender\CoreBundle\Element;
4:
5: use Mapbender\CoreBundle\Component\Element;
6:
7: //use Symfony\Component\DependencyInjection\ContainerInterface;
8:
9: class Ruler extends Element
10: {
11:
12: /**
13: * @inheritdoc
14: */
15: static public function getClassTitle()
16: {
17: return 'Line/Area Ruler';
18: }
19:
20: /**
21: * @inheritdoc
22: */
23: static public function getClassDescription()
24: {
25: return "";
26: }
27:
28: /**
29: * @inheritdoc
30: */
31: static public function getClassTags()
32: {
33: return array();
34: }
35:
36: /**
37: * @inheritdoc
38: */
39: public function getAssets()
40: {
41: return array(
42: 'js' => array('@MapbenderCoreBundle/Resources/public/mapbender.element.ruler.js',
43: '@FOMCoreBundle/Resources/public/js/widgets/popup.js'),
44: 'css' => array());
45: }
46:
47: /**
48: * @inheritdoc
49: */
50: public static function getType()
51: {
52: return 'Mapbender\CoreBundle\Element\Type\RulerAdminType';
53: }
54:
55: /**
56: * @inheritdoc
57: */
58: public static function getFormTemplate()
59: {
60: return 'MapbenderManagerBundle:Element:ruler.html.twig';
61: }
62:
63: /**
64: * @inheritdoc
65: */
66: public static function getDefaultConfiguration()
67: {
68: return array(
69: 'target' => null,
70: 'tooltip' => "ruler",
71: 'type' => null);
72: }
73:
74: /**
75: * @inheritdoc
76: */
77: public function getWidgetName()
78: {
79: return 'mapbender.mbRuler';
80: }
81:
82: /**
83: * @inheritdoc
84: */
85: public function render()
86: {
87: return $this->container->get('templating')
88: ->render('MapbenderCoreBundle:Element:measure_dialog.html.twig',
89: array(
90: 'id' => $this->getId(),
91: 'title' => $this->getTitle(),
92: 'configuration' => $this->getConfiguration()));
93: }
94:
95: }
96:
97: