Support custom templates and map ids.

This commit is contained in:
David Molineus
2015-01-30 17:44:24 +01:00
parent 1bfd99746c
commit 31136afd42
8 changed files with 102 additions and 7 deletions

View File

@@ -11,7 +11,7 @@
$GLOBALS['TL_DCA']['tl_content']['metapalettes']['leaflet'] = array(
'type' => array('type', 'headline'),
'leaflet' => array('leaflet_map', 'leaflet_width', 'leaflet_height'),
'leaflet' => array('leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height', 'leaflet_template'),
'templates' => array(':hide', 'customTpl'),
'protected' => array(':hide', 'protected'),
'expert' => array(':hide', 'guests', 'cssID', 'space'),
@@ -33,6 +33,18 @@ $GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_map'] = array(
'sql' => "int(10) unsigned NOT NULL default '0'"
);
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_mapId'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_mapId'],
'inputType' => 'text',
'exclude' => true,
'eval' => array(
'tl_class' => 'w50',
'chosen' => true,
'maxlength' => 16,
),
'sql' => "varchar(16) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_width'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_width'],
'inputType' => 'inputUnit',
@@ -53,3 +65,15 @@ $GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_height'] = array(
'eval' => array('rgxp' => 'digit', 'tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_template'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_template'],
'inputType' => 'select',
'exclude' => true,
'options_callback' => \Netzmacht\Contao\Toolkit\Dca::createGetTemplatesCallback('leaflet_map_js'),
'eval' => array(
'tl_class' => 'w50',
'chosen' => true,
),
'sql' => "varchar(64) NOT NULL default ''"
);

View File

@@ -11,7 +11,7 @@
$GLOBALS['TL_DCA']['tl_module']['metapalettes']['leaflet'] = array(
'type' => array('name', 'type', 'headline'),
'leaflet' => array('leaflet_map', 'leaflet_width', 'leaflet_height'),
'leaflet' => array('leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height', 'leaflet_template'),
'templates' => array(':hide', 'customTpl'),
'protected' => array(':hide', 'protected'),
'expert' => array(':hide', 'guests', 'cssID', 'space'),
@@ -33,6 +33,18 @@ $GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_map'] = array(
'sql' => "int(10) unsigned NOT NULL default '0'"
);
$GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_mapId'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_module']['leaflet_mapId'],
'inputType' => 'text',
'exclude' => true,
'eval' => array(
'tl_class' => 'w50',
'chosen' => true,
'maxlength' => 16,
),
'sql' => "varchar(16) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_width'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_module']['leaflet_width'],
'inputType' => 'inputUnit',
@@ -53,3 +65,15 @@ $GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_height'] = array(
'eval' => array('rgxp' => 'digit', 'tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_template'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_module']['leaflet_template'],
'inputType' => 'select',
'exclude' => true,
'options_callback' => \Netzmacht\Contao\Toolkit\Dca::createGetTemplatesCallback('leaflet_map_js'),
'eval' => array(
'tl_class' => 'w50',
'chosen' => true,
),
'sql' => "varchar(64) NOT NULL default ''"
);

View File

@@ -14,3 +14,9 @@ $GLOBALS['TL_LANG']['MOD']['tl_leaflet_layer'] = 'Layers';
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_icon'] = 'Icons';
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_marker'] = 'Markers';
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_control'] = 'Controls';
$GLOBALS['TL_LANG']['FMD']['leaflet'][0] = 'Leaflet Map';
$GLOBALS['TL_LANG']['FMD']['leaflet'][1] = 'Integrate leaflet map as frontend module.';
$GLOBALS['TL_LANG']['CTE']['leaflet'][0] = 'Leaflet Map';
$GLOBALS['TL_LANG']['CTE']['leaflet'][1] = 'Integrate leaflet map as content element.';

View File

@@ -0,0 +1,12 @@
<?php
$GLOBALS['TL_LANG']['tl_content']['leaflet_map'][0] = 'Leaflet Map';
$GLOBALS['TL_LANG']['tl_content']['leaflet_map'][1] = 'Choose a Leaflet Map';
$GLOBALS['TL_LANG']['tl_content']['leaflet_mapId'][0] = 'Leaflet map id';
$GLOBALS['TL_LANG']['tl_content']['leaflet_mapId'][1] = 'You can force a specific map id which is used as HTML id. Otherwise the content element id is used to generate the id.';
$GLOBALS['TL_LANG']['tl_content']['leaflet_width'][0] = 'Map width';
$GLOBALS['TL_LANG']['tl_content']['leaflet_width'][1] = 'Define the width of the map.';
$GLOBALS['TL_LANG']['tl_content']['leaflet_height'][0] = 'Map height';
$GLOBALS['TL_LANG']['tl_content']['leaflet_height'][1] = 'Define the height of the map.';
$GLOBALS['TL_LANG']['tl_content']['leaflet_template'][0] = 'Map Template';
$GLOBALS['TL_LANG']['tl_content']['leaflet_template'][1] = 'Choose a template to generate the map. The template has to create javscript, not HTML!';

View File

@@ -0,0 +1,12 @@
<?php
$GLOBALS['TL_LANG']['tl_module']['leaflet_map'][0] = 'Leaflet Map';
$GLOBALS['TL_LANG']['tl_module']['leaflet_map'][1] = 'Choose a Leaflet Map';
$GLOBALS['TL_LANG']['tl_module']['leaflet_mapId'][0] = 'Leaflet map id';
$GLOBALS['TL_LANG']['tl_module']['leaflet_mapId'][1] = 'You can force a specific map id which is used as HTML id. Otherwise the content element id is used to generate the id.';
$GLOBALS['TL_LANG']['tl_module']['leaflet_width'][0] = 'Map width';
$GLOBALS['TL_LANG']['tl_module']['leaflet_width'][1] = 'Define the width of the map.';
$GLOBALS['TL_LANG']['tl_module']['leaflet_height'][0] = 'Map height';
$GLOBALS['TL_LANG']['tl_module']['leaflet_height'][1] = 'Define the height of the map.';
$GLOBALS['TL_LANG']['tl_module']['leaflet_template'][0] = 'Map Template';
$GLOBALS['TL_LANG']['tl_module']['leaflet_template'][1] = 'Choose a template to generate the map. The template has to create javscript, not HTML!';