1: <?php
2:
3: namespace Mapbender\CoreBundle\Element;
4:
5: use Mapbender\CoreBundle\Component\Element;
6: use Mapbender\CoreBundle\Component\ElementInterface;
7: use Symfony\Component\DependencyInjection\ContainerInterface;
8: use Symfony\Component\HttpFoundation\Response;
9:
10: 11: 12:
13: class Layertree extends Element
14: {
15:
16: 17: 18:
19: static public function getClassTitle()
20: {
21: return "Layertree";
22: }
23:
24: 25: 26:
27: static public function getClassDescription()
28: {
29: return "Tree of map's layers";
30: }
31:
32: 33: 34:
35: public function getDescription()
36: {
37: return "Shows a treeview of the layers on the map";
38: }
39:
40: 41: 42:
43: public function getTags()
44: {
45: return array('Layertree', 'Layer');
46: }
47:
48: 49: 50:
51: public function getWidgetName()
52: {
53: return 'mapbender.mbLayertree';
54: }
55:
56: 57: 58:
59: public static function getType()
60: {
61: return 'Mapbender\CoreBundle\Element\Type\LayertreeAdminType';
62: }
63:
64: 65: 66:
67: public function getAssets()
68: {
69: return array('js' => array('mapbender.element.layertree.js',
70: '@FOMCoreBundle/Resources/public/js/frontend/components.js',
71: '@FOMCoreBundle/Resources/public/js/widgets/popup.js'),
72: 'css' => array()
73: );
74: }
75:
76: 77: 78:
79: static public function getDefaultConfiguration()
80: {
81: return array(
82: "target" => null,
83: "layerMenu" => true,
84: "layerRemove" => true,
85: "type" => null,
86: "displaytype" => null,
87: "useAccordion" => false,
88: "titlemaxlength" => intval(20),
89: "autoOpen" => false,
90: "showBaseSource" => true,
91: "showHeader" => false,
92: );
93: }
94:
95: 96: 97:
98: public function render()
99: {
100: return $this->container->get('templating')->render(
101: 'MapbenderCoreBundle:Element:layertree.html.twig',
102: array(
103: 'id' => $this->getId(),
104: 'configuration' => $this->entity->getConfiguration(),
105: 'title' => $this->getTitle()
106: )
107: );
108: }
109:
110: 111: 112:
113: public static function getFormTemplate()
114: {
115: return 'MapbenderManagerBundle:Element:layer_tree.html.twig';
116: }
117:
118: }
119:
120: