mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-30 12:03:44 +01:00
Store layer relations in extra table.
This commit is contained in:
@@ -255,6 +255,12 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['layers'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'multiColumnWizard',
|
||||
'load_callback' => array(
|
||||
array('Netzmacht\Contao\Leaflet\Dca\Control', 'loadLayerRelations'),
|
||||
),
|
||||
'save_callback' => array(
|
||||
array('Netzmacht\Contao\Leaflet\Dca\Control', 'saveLayerRelations'),
|
||||
),
|
||||
'eval' => array
|
||||
(
|
||||
'tl_class' => 'clr',
|
||||
|
||||
43
module/dca/tl_leaflet_control_layer.php
Normal file
43
module/dca/tl_leaflet_control_layer.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
$GLOBALS['TL_DCA']['tl_leaflet_control_layer'] = array
|
||||
(
|
||||
'config' => array(
|
||||
'dataContainer' => 'Table',
|
||||
'sql' => array
|
||||
(
|
||||
'keys' => array
|
||||
(
|
||||
'id' => 'primary',
|
||||
'cid,lid' => 'unique',
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'fields' => array
|
||||
(
|
||||
'id' => array
|
||||
(
|
||||
'sql' => "int(10) unsigned NOT NULL auto_increment"
|
||||
),
|
||||
'tstamp' => array
|
||||
(
|
||||
'sql' => "int(10) unsigned NOT NULL default '0'"
|
||||
),
|
||||
'sorting' => array(
|
||||
'sql' => "int(10) unsigned NOT NULL default '0'"
|
||||
),
|
||||
'cid' => array
|
||||
(
|
||||
'sql' => "int(10) unsigned NOT NULL default '0'"
|
||||
),
|
||||
'lid' => array
|
||||
(
|
||||
'sql' => "int(10) unsigned NOT NULL default '0'"
|
||||
),
|
||||
'mode' => array
|
||||
(
|
||||
'sql' => "varchar(16) NOT NULL default ''"
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -163,9 +163,15 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array
|
||||
'exclude' => true,
|
||||
'inputType' => 'checkboxWizard',
|
||||
'options_callback' => array('Netzmacht\Contao\Leaflet\Dca\Leaflet', 'getLayers'),
|
||||
'default' => '',
|
||||
'load_callback' => array(
|
||||
array('Netzmacht\Contao\Leaflet\Dca\Map', 'loadLayerRelations'),
|
||||
),
|
||||
'save_callback' => array(
|
||||
array('Netzmacht\Contao\Leaflet\Dca\Map', 'saveLayerRelations'),
|
||||
),
|
||||
'eval' => array(
|
||||
'multiple' => true,
|
||||
'doNotSaveEmpty' => true,
|
||||
),
|
||||
'sql' => "mediumblob NULL"
|
||||
),
|
||||
|
||||
39
module/dca/tl_leaflet_map_layer.php
Normal file
39
module/dca/tl_leaflet_map_layer.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
$GLOBALS['TL_DCA']['tl_leaflet_map_layer'] = array
|
||||
(
|
||||
'config' => array(
|
||||
'dataContainer' => 'Table',
|
||||
'sql' => array
|
||||
(
|
||||
'keys' => array
|
||||
(
|
||||
'id' => 'primary',
|
||||
'mid,lid' => 'unique',
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'fields' => array
|
||||
(
|
||||
'id' => array
|
||||
(
|
||||
'sql' => "int(10) unsigned NOT NULL auto_increment"
|
||||
),
|
||||
'tstamp' => array
|
||||
(
|
||||
'sql' => "int(10) unsigned NOT NULL default '0'"
|
||||
),
|
||||
'sorting' => array(
|
||||
'sql' => "int(10) unsigned NOT NULL default '0'"
|
||||
),
|
||||
'mid' => array
|
||||
(
|
||||
'sql' => "int(10) unsigned NOT NULL default '0'"
|
||||
),
|
||||
'lid' => array
|
||||
(
|
||||
'sql' => "int(10) unsigned NOT NULL default '0'"
|
||||
),
|
||||
)
|
||||
);
|
||||
@@ -37,9 +37,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array
|
||||
),
|
||||
'global_operations' => array
|
||||
(
|
||||
'style' => array
|
||||
'styles' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['style'],
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['styles'],
|
||||
'href' => 'table=tl_leaflet_style',
|
||||
'icon' => 'system/modules/leaflet/assets/img/style.png',
|
||||
'attributes' => 'onclick="Backend.getScrollOffset();"'
|
||||
|
||||
@@ -20,6 +20,8 @@ $GLOBALS['TL_LANG']['tl_leaflet_vector']['cut'][0] = 'Move vector';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_vector']['cut'][1] = 'Move vector ID %s';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_vector']['toggle'][0] = 'Toggle activation';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_vector']['toggle'][1] = 'Toggle vector ID %s activation';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_vector']['styles'][0] = 'Manage styles';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_vector']['styles'][1] = 'Manage vector styles';
|
||||
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_vector']['title'][0] = 'Title';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_vector']['title'][1] = 'Title of the vector.';
|
||||
|
||||
Reference in New Issue
Block a user