diff --git a/assets/libs/contao/contao-leaflet.js b/assets/libs/contao/contao-leaflet.js index 7ce9143..a12a7da 100644 --- a/assets/libs/contao/contao-leaflet.js +++ b/assets/libs/contao/contao-leaflet.js @@ -166,6 +166,9 @@ L.Contao = L.Class.extend({ if (feature.properties) { L.Util.setOptions(layer, feature.properties.options); + console.log(feature); + console.log(layer); + this.bindPopupFromFeature(layer, feature); this.fire('feature:added', { feature: feature, layer: layer}); diff --git a/module/dca/tl_leaflet_control.php b/module/dca/tl_leaflet_control.php index df64eee..167da75 100644 --- a/module/dca/tl_leaflet_control.php +++ b/module/dca/tl_leaflet_control.php @@ -26,6 +26,8 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array 'fields' => array('sorting'), 'headerFields' => array('title'), 'flag' => 1, + 'sorting' => 2, + 'panelLayout' => 'filter,sort;search,limit', 'child_record_callback' => array('Netzmacht\Contao\Leaflet\Dca\Control', 'generateRow'), ), 'label' => array @@ -130,13 +132,17 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array ), 'sorting' => array ( - 'sql' => "int(10) unsigned NOT NULL default '0'" + 'sql' => "int(10) unsigned NOT NULL default '0'", + 'sorting' => true, ), 'title' => array ( 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['title'], 'exclude' => true, 'inputType' => 'text', + 'sorting' => true, + 'search' => true, + 'flag' => 1, 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''" ), @@ -145,6 +151,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['alias'], 'exclude' => true, 'inputType' => 'text', + 'search' => true, 'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''" ), @@ -153,6 +160,8 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['type'], 'exclude' => true, 'inputType' => 'select', + 'filter' => true, + 'sorting' => true, 'eval' => array( 'mandatory' => true, 'tl_class' => 'w50', @@ -170,6 +179,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['position'], 'exclude' => true, 'inputType' => 'select', + 'filter' => true, 'options' => array('topleft', 'topright', 'bottomleft', 'bottomright'), 'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_control'], 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50', 'helpwizard' => true), @@ -180,6 +190,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['active'], 'exclude' => true, 'inputType' => 'checkbox', + 'filter' => true, 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''" ), diff --git a/module/dca/tl_leaflet_icon.php b/module/dca/tl_leaflet_icon.php index 30debed..cc9a69e 100644 --- a/module/dca/tl_leaflet_icon.php +++ b/module/dca/tl_leaflet_icon.php @@ -21,6 +21,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_icon'] = array 'mode' => 1, 'fields' => array('title'), 'flag' => 1, + 'panelLayout' => 'limit', 'headerFields' => array('title', 'type'), ), 'label' => array diff --git a/module/dca/tl_leaflet_layer.php b/module/dca/tl_leaflet_layer.php index 99b60a0..5aa7474 100644 --- a/module/dca/tl_leaflet_layer.php +++ b/module/dca/tl_leaflet_layer.php @@ -23,6 +23,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array 'fields' => array('title'), 'flag' => 1, 'icon' => 'system/modules/leaflet/assets/img/layers.png', + 'panelLayout' => 'filter;search,limit', 'paste_button_callback' => array('Netzmacht\Contao\Leaflet\Dca\Layer', 'getPasteButtons'), ), 'label' => array @@ -158,7 +159,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array ), 'sorting' => array ( - 'sql' => "int(10) unsigned NOT NULL default '0'" + 'sql' => "int(10) unsigned NOT NULL default '0'", ), 'tstamp' => array ( @@ -169,6 +170,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['title'], 'exclude' => true, 'inputType' => 'text', + 'search' => true, 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''" ), @@ -177,6 +179,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['alias'], 'exclude' => true, 'inputType' => 'text', + 'search' => true, 'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''" ), @@ -185,6 +188,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['type'], 'exclude' => true, 'inputType' => 'select', + 'filter' => true, 'eval' => array( 'mandatory' => true, 'tl_class' => 'w50', @@ -202,6 +206,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['active'], 'exclude' => true, 'inputType' => 'checkbox', + 'filter' => true, 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''" ), diff --git a/module/dca/tl_leaflet_map.php b/module/dca/tl_leaflet_map.php index 6851c8e..2fb7864 100644 --- a/module/dca/tl_leaflet_map.php +++ b/module/dca/tl_leaflet_map.php @@ -21,6 +21,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array ( 'mode' => 1, 'fields' => array('title'), + 'panelLayout' => 'search,limit', 'flag' => 1, ), 'label' => array @@ -135,6 +136,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['title'], 'exclude' => true, 'inputType' => 'text', + 'search' => true, 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''" ), @@ -143,6 +145,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['alias'], 'exclude' => true, 'inputType' => 'text', + 'search' => true, 'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''" ), diff --git a/module/dca/tl_leaflet_marker.php b/module/dca/tl_leaflet_marker.php index 8f26502..f67aea6 100644 --- a/module/dca/tl_leaflet_marker.php +++ b/module/dca/tl_leaflet_marker.php @@ -25,6 +25,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array 'mode' => 4, 'fields' => array('sorting'), 'flag' => 1, + 'panelLayout' => 'sort,filter;search,limit', 'headerFields' => array('title', 'type'), 'child_record_callback' => array('Netzmacht\Contao\Leaflet\Dca\Marker', 'generateRow'), ), @@ -125,7 +126,8 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array ), 'sorting' => array ( - 'sql' => "int(10) unsigned NOT NULL default '0'" + 'sql' => "int(10) unsigned NOT NULL default '0'", + 'sorting' => true, ), 'pid' => array ( @@ -135,6 +137,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array ( 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['title'], 'exclude' => true, + 'search' => true, + 'sorting' => true, + 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''" @@ -144,6 +149,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['alias'], 'exclude' => true, 'inputType' => 'text', + 'search' => true, 'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''" ), @@ -169,6 +175,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array ( 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['active'], 'exclude' => true, + 'filter' => true, + 'sorting' => true, + 'flag' => 12, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''" @@ -194,6 +203,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['addPopup'], 'exclude' => true, 'inputType' => 'checkbox', + 'filter' => true, 'eval' => array('tl_class' => 'w50', 'submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''" ), diff --git a/module/dca/tl_leaflet_vector.php b/module/dca/tl_leaflet_vector.php index 4aba4db..1187927 100644 --- a/module/dca/tl_leaflet_vector.php +++ b/module/dca/tl_leaflet_vector.php @@ -24,6 +24,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array 'mode' => 4, 'fields' => array('sorting'), 'flag' => 1, + 'panelLayout' => 'sort,filter;search,limit', 'headerFields' => array('title', 'type'), 'child_record_callback' => array('Netzmacht\Contao\Leaflet\Dca\Vector', 'generateRow'), ), @@ -149,13 +150,18 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array ), 'sorting' => array ( - 'sql' => "int(10) unsigned NOT NULL default '0'" + 'sql' => "int(10) unsigned NOT NULL default '0'", + 'sorting' => true, ), 'title' => array ( 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['title'], 'exclude' => true, 'inputType' => 'text', + 'filter' => false, + 'sorting' => true, + 'search' => true, + 'flag' => 1, 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''" ), @@ -164,6 +170,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['alias'], 'exclude' => true, 'inputType' => 'text', + 'search' => true, 'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''" ), @@ -172,6 +179,10 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['type'], 'exclude' => true, 'inputType' => 'select', + 'filter' => true, + 'sorting' => true, + 'search' => false, + 'flag' => 1, 'eval' => array( 'mandatory' => true, 'tl_class' => 'w50', @@ -189,6 +200,10 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['active'], 'exclude' => true, 'inputType' => 'checkbox', + 'filter' => true, + 'sorting' => true, + 'search' => false, + 'flag' => 12, 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''" ), @@ -197,6 +212,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['addPopup'], 'exclude' => true, 'inputType' => 'checkbox', + 'filter' => true, 'eval' => array('tl_class' => 'w50', 'submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''" ), diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/UI/MarkerMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/UI/MarkerMapper.php index 9e8cf15..a11a9ce 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/UI/MarkerMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/UI/MarkerMapper.php @@ -55,6 +55,7 @@ class MarkerMapper extends AbstractMapper $this ->addConditionalOption('tooltip', 'title', 'tooltip') ->addConditionalOption('alt') + ->addConditionalOption('zIndexOffset') ->addOptions('clickable', 'keyboard', 'draggable'); }