Skip to content

Commit e97a67c

Browse files
authored
suitable for 3.0.5.3
1 parent 2210c31 commit e97a67c

File tree

1 file changed

+98
-9
lines changed

1 file changed

+98
-9
lines changed
Lines changed: 98 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,111 @@
11
<?php
2-
32
namespace Workshop\DemoBundle\Template;
43

5-
use Mapbender\CoreBundle\Template\Fullscreen;
4+
use Mapbender\CoreBundle\Component\Template;
65

76
/**
87
* Template DemoFullscreen
98
*
109
* @author Astrid Emde
1110
*/
12-
class DemoFullscreen extends Fullscreen
11+
class DemoFullscreen extends Template
1312
{
14-
protected static $title = 'Workshop Demo Fullscreen Template';
15-
protected static $css = array(
16-
'@MapbenderCoreBundle/Resources/public/sass/template/fullscreen.scss',
17-
'@WorkshopDemoBundle/Resources/public/demo_fullscreen.css',
18-
);
13+
/**
14+
* @inheritdoc
15+
*/
16+
public static function getRegionsProperties()
17+
{
18+
return array(
19+
'sidepane' => array(
20+
'tabs' => array(
21+
'name' => 'tabs',
22+
'label' => 'mb.manager.template.region.tabs.label'),
23+
'accordion' => array(
24+
'name' => 'accordion',
25+
'label' => 'mb.manager.template.region.accordion.label')
26+
)
27+
);
28+
}
29+
30+
/**
31+
* @inheritdoc
32+
*/
33+
public static function getTitle()
34+
{
35+
return 'DemoFullscreen';
36+
}
37+
38+
/**
39+
* @inheritdoc
40+
*/
41+
static public function listAssets()
42+
{
43+
$assets = array(
44+
'css' => array('@MapbenderCoreBundle/Resources/public/sass/template/fullscreen.scss','@WorkshopDemoBundle/Resources/public/demo_fullscreen.css'),
45+
'js' => array(
46+
'/components/underscore/underscore-min.js',
47+
'@FOMCoreBundle/Resources/public/js/widgets/popup.js',
48+
'@FOMCoreBundle/Resources/public/js/frontend/sidepane.js',
49+
'@FOMCoreBundle/Resources/public/js/frontend/tabcontainer.js',
50+
'@MapbenderCoreBundle/Resources/public/regional/vendor/notify.0.3.2.min.js',
51+
"/components/datatables/media/js/jquery.dataTables.min.js",
52+
'/components/jquerydialogextendjs/jquerydialogextendjs-built.js',
53+
"/components/vis-ui.js/vis-ui.js-built.js"
54+
55+
),
56+
'trans' => array()
57+
);
58+
return $assets;
59+
}
60+
61+
/**
62+
* @inheritdoc
63+
*/
64+
public function getLateAssets($type)
65+
{
66+
$assets = array(
67+
'css' => array(),
68+
'js' => array(),
69+
'trans' => array()
70+
);
71+
return $assets[$type];
72+
}
73+
74+
/**
75+
* @inheritdoc
76+
*/
77+
public function getAssets($type)
78+
{
79+
$assets = $this::listAssets();
80+
return $assets[$type];
81+
}
82+
83+
/**
84+
* @inheritdoc
85+
*/
86+
public static function getRegions()
87+
{
88+
return array('toolbar', 'sidepane', 'content', 'footer');
89+
}
90+
91+
/**
92+
* @inheritdoc
93+
*/
94+
public function render($format = 'html', $html = true, $css = true,$js = true)
95+
{
96+
$region_props = $this->application->getEntity()->getNamedRegionProperties();
97+
$default_region_props = $this->getRegionsProperties();
1998

20-
public $twigTemplate = 'WorkshopDemoBundle:Template:demo_fullscreen.html.twig';
99+
$templating = $this->container->get('templating');
100+
return $templating
101+
->render('WorkshopDemoBundle:Template:demo_fullscreen.html.twig',
102+
array(
103+
'html' => $html,
104+
'css' => $css,
105+
'js' => $js,
106+
'application' => $this->application,
107+
'region_props' => $region_props,
108+
'default_region_props' => $default_region_props));
109+
}
21110

22111
}

0 commit comments

Comments
 (0)