1: <?php
2:
3: namespace Mapbender\CoreBundle\Element;
4:
5: use Mapbender\CoreBundle\Component\Element;
6:
7: 8: 9: 10: 11:
12: class Legend extends Element
13: {
14:
15: 16: 17:
18: public static function getClassTitle()
19: {
20: return "Legend Object";
21: }
22:
23: 24: 25:
26: public static function getClassDescription()
27: {
28: return "The legend object shows the legend of the map's layers.";
29: }
30:
31: 32: 33:
34: public static function getClassTags()
35: {
36: return array('legend', "dialog");
37: }
38:
39: 40: 41:
42: public function getAssets()
43: {
44: return array(
45: 'js' => array(
46: 'mapbender.element.legend.js',
47: '@FOMCoreBundle/Resources/public/js/widgets/popup.js'
48: ), 'css' => array()
49: );
50: }
51:
52: 53: 54:
55: public static function getDefaultConfiguration()
56: {
57: return array(
58: "target" => null,
59: "elementType" => null,
60: "displayType" => null,
61: "noLegend" => "No legend available",
62: "autoOpen" => true,
63: "tooltip" => "Legend",
64: "checkGraphic" => false,
65: "hideEmptyLayers" => true,
66: "generateLegendGraphicUrl" => false,
67: "showSourceTitle" => true,
68: "showLayerTitle" => true,
69: "showGrouppedTitle" => true);
70: }
71:
72: 73: 74:
75: public static function getType()
76: {
77: return 'Mapbender\CoreBundle\Element\Type\LegendAdminType';
78: }
79:
80: 81: 82:
83: public function getWidgetName()
84: {
85: return 'mapbender.mbLegend';
86: }
87:
88: 89: 90:
91: public function render()
92: {
93: return $this->container->get('templating')->render(
94: 'MapbenderCoreBundle:Element:legend.html.twig',
95: array('id' => $this->getId(),
96: "title" => $this->getTitle(),
97: 'configuration' => $this->getConfiguration()));
98: }
99:
100: 101: 102:
103: public static function getFormTemplate()
104: {
105: return 'MapbenderManagerBundle:Element:legend.html.twig';
106: }
107: }
108:
109: