-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
98 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,111 @@ | ||
<?php | ||
|
||
namespace Workshop\DemoBundle\Template; | ||
|
||
use Mapbender\CoreBundle\Template\Fullscreen; | ||
use Mapbender\CoreBundle\Component\Template; | ||
|
||
/** | ||
* Template DemoFullscreen | ||
* | ||
* @author Astrid Emde | ||
*/ | ||
class DemoFullscreen extends Fullscreen | ||
class DemoFullscreen extends Template | ||
{ | ||
protected static $title = 'Workshop Demo Fullscreen Template'; | ||
protected static $css = array( | ||
'@MapbenderCoreBundle/Resources/public/sass/template/fullscreen.scss', | ||
'@WorkshopDemoBundle/Resources/public/demo_fullscreen.css', | ||
); | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public static function getRegionsProperties() | ||
{ | ||
return array( | ||
'sidepane' => array( | ||
'tabs' => array( | ||
'name' => 'tabs', | ||
'label' => 'mb.manager.template.region.tabs.label'), | ||
'accordion' => array( | ||
'name' => 'accordion', | ||
'label' => 'mb.manager.template.region.accordion.label') | ||
) | ||
); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public static function getTitle() | ||
{ | ||
return 'DemoFullscreen'; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
static public function listAssets() | ||
{ | ||
$assets = array( | ||
'css' => array('@MapbenderCoreBundle/Resources/public/sass/template/fullscreen.scss','@WorkshopDemoBundle/Resources/public/demo_fullscreen.css'), | ||
'js' => array( | ||
'/components/underscore/underscore-min.js', | ||
'@FOMCoreBundle/Resources/public/js/widgets/popup.js', | ||
'@FOMCoreBundle/Resources/public/js/frontend/sidepane.js', | ||
'@FOMCoreBundle/Resources/public/js/frontend/tabcontainer.js', | ||
'@MapbenderCoreBundle/Resources/public/regional/vendor/notify.0.3.2.min.js', | ||
"/components/datatables/media/js/jquery.dataTables.min.js", | ||
'/components/jquerydialogextendjs/jquerydialogextendjs-built.js', | ||
"/components/vis-ui.js/vis-ui.js-built.js" | ||
|
||
), | ||
'trans' => array() | ||
); | ||
return $assets; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getLateAssets($type) | ||
{ | ||
$assets = array( | ||
'css' => array(), | ||
'js' => array(), | ||
'trans' => array() | ||
); | ||
return $assets[$type]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getAssets($type) | ||
{ | ||
$assets = $this::listAssets(); | ||
return $assets[$type]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public static function getRegions() | ||
{ | ||
return array('toolbar', 'sidepane', 'content', 'footer'); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function render($format = 'html', $html = true, $css = true,$js = true) | ||
{ | ||
$region_props = $this->application->getEntity()->getNamedRegionProperties(); | ||
$default_region_props = $this->getRegionsProperties(); | ||
|
||
public $twigTemplate = 'WorkshopDemoBundle:Template:demo_fullscreen.html.twig'; | ||
$templating = $this->container->get('templating'); | ||
return $templating | ||
->render('WorkshopDemoBundle:Template:demo_fullscreen.html.twig', | ||
array( | ||
'html' => $html, | ||
'css' => $css, | ||
'js' => $js, | ||
'application' => $this->application, | ||
'region_props' => $region_props, | ||
'default_region_props' => $default_region_props)); | ||
} | ||
|
||
} |