Rework leaflet dca callbacks to a listener service.

This commit is contained in:
David Molineus
2017-10-06 13:56:46 +02:00
parent 5a4fd9b434
commit 6c7b136c0e
10 changed files with 49 additions and 46 deletions

View File

@@ -27,7 +27,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array
)
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
),
@@ -227,7 +227,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
),
'zoomInText' => array

View File

@@ -24,7 +24,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_icon'] = array
)
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
),
@@ -228,7 +228,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_icon'] = array
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
),
'iconImage' => array

View File

@@ -31,7 +31,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
},
],
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
],
'list' => [
@@ -294,7 +294,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
],
'tile_provider' => [
@@ -452,7 +452,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['disableClusteringAtZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'options_callback' => ['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'getZoomLevels'],
'default' => '',
'eval' => [
'maxlength' => 4,
@@ -541,7 +541,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['minZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'options_callback' => ['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'getZoomLevels'],
'eval' => [
'maxlength' => 4,
'rgxp' => 'digit',
@@ -555,7 +555,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['maxZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'options_callback' => ['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'getZoomLevels'],
'eval' => [
'maxlength' => 4,
'rgxp' => 'digit',
@@ -569,7 +569,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['maxNativeZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'options_callback' => ['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'getZoomLevels'],
'eval' => [
'maxlength' => 4,
'rgxp' => 'digit',

View File

@@ -30,7 +30,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array
}
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
),
@@ -194,7 +194,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateCoordinates'),
),
'wizard' => array(
Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getGeocoder')
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'getGeocoder']
),
'eval' => array(
'maxlength' => 255,
@@ -243,7 +243,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'options_callback' => ['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'getZoomLevels'],
'default' => '',
'eval' => array(
'maxlength' => 4,
@@ -268,7 +268,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['minZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'options_callback' => ['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'getZoomLevels'],
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',
@@ -283,7 +283,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['maxZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'options_callback' => ['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'getZoomLevels'],
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',
@@ -555,7 +555,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['locateMaxZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'options_callback' => ['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'getZoomLevels'],
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',

View File

@@ -29,7 +29,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array
['netzmacht.contao_leaflet_maps.listeners.dca.marker', 'initialize'],
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
),
@@ -199,7 +199,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array
array('netzmacht.contao_leaflet_maps.listeners.dca.marker', 'loadCoordinates')
),
'wizard' => array(
Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getGeocoder')
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'getGeocoder']
),
'eval' => array(
'maxlength' => 255,
@@ -243,7 +243,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
),
'tooltip' => array

View File

@@ -24,7 +24,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_popup'] = array
)
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
),
@@ -297,7 +297,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_popup'] = array
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
),
),

View File

@@ -24,7 +24,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_style'] = array
)
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
),
@@ -305,7 +305,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_style'] = array
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
),
),

View File

@@ -31,7 +31,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array
}
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
),
@@ -247,7 +247,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'clearCache'],
],
),
'addPopup' => array
@@ -322,7 +322,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateCoordinates')
),
'wizard' => array(
Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getGeocoder')
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'getGeocoder']
),
'eval' => array(
'maxlength' => 255,