Store layer relations in extra table.

This commit is contained in:
David Molineus
2015-01-09 22:33:57 +01:00
parent c7f37238d9
commit ff2c3fb8c3
12 changed files with 307 additions and 29 deletions

View File

@@ -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',

View 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 ''"
)
)
);

View File

@@ -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"
),

View 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'"
),
)
);

View File

@@ -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();"'

View File

@@ -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.';