|
1 | 1 | <?php
|
2 |
| - |
3 | 2 | namespace Workshop\DemoBundle\Template;
|
4 | 3 |
|
5 |
| -use Mapbender\CoreBundle\Template\Fullscreen; |
| 4 | +use Mapbender\CoreBundle\Component\Template; |
6 | 5 |
|
7 | 6 | /**
|
8 | 7 | * Template DemoFullscreen
|
9 | 8 | *
|
10 | 9 | * @author Astrid Emde
|
11 | 10 | */
|
12 |
| -class DemoFullscreen extends Fullscreen |
| 11 | +class DemoFullscreen extends Template |
13 | 12 | {
|
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(); |
19 | 98 |
|
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 | + } |
21 | 110 |
|
22 | 111 | }
|
0 commit comments