1: <?php
2:
3: namespace Mapbender\CoreBundle\Element;
4:
5: use Mapbender\CoreBundle\Component\Element;
6:
7: 8: 9: 10: 11:
12: class Button extends Element
13: {
14:
15: 16: 17:
18: static public function getClassTitle()
19: {
20: return "Button";
21: }
22:
23: 24: 25:
26: static public function getClassDescription()
27: {
28: return "Renders a button";
29: }
30:
31: 32: 33:
34: static public function getClassTags()
35: {
36: return array('Button');
37: }
38:
39: 40: 41:
42: public static function getDefaultConfiguration()
43: {
44: return array(
45: 'title' => 'button',
46: 'tooltip' => 'button',
47: 'label' => true,
48: 'icon' => null,
49: 'target' => null,
50: 'click' => null,
51: 'group' => null,
52: 'action' => null,
53: 'deactivate' => null);
54: }
55:
56: 57: 58:
59: public function getWidgetName()
60: {
61: return 'mapbender.mbButton';
62: }
63:
64: 65: 66:
67: public static function getType()
68: {
69: return 'Mapbender\CoreBundle\Element\Type\ButtonAdminType';
70: }
71:
72: 73: 74:
75: public function getAssets()
76: {
77: return array(
78: 'js' => array('mapbender.element.button.js'),
79: 'css' => array());
80: }
81:
82: 83: 84:
85: public function render()
86: {
87: return $this->container->get('templating')
88: ->render('MapbenderCoreBundle:Element:button.html.twig',
89: array(
90: 'id' => $this->getId(),
91: 'title' => $this->getTitle(),
92: 'configuration' => $this->entity->getConfiguration()));
93: }
94:
95: 96: 97:
98: public static function getFormTemplate()
99: {
100: return 'MapbenderManagerBundle:Element:button.html.twig';
101: }
102: }
103:
104: