Rework leaflet state button callbacks to be compatible with toolkit 3.0.

This commit is contained in:
David Molineus
2017-10-06 14:24:55 +02:00
parent ad6a4e9384
commit 594b10b0cf
7 changed files with 63 additions and 28 deletions

View File

@@ -86,10 +86,15 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::stateButton(
'tl_leaflet_control',
'active'
)
'button_callback' => [
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
'handleButtonCallback'
],
'toolkit' => [
'state_button' => [
'stateColumn' => ['active']
]
],
),
'show' => array
(

View File

@@ -101,10 +101,15 @@ $GLOBALS['TL_DCA']['tl_leaflet_icon'] = array
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::stateButton(
'tl_leaflet_icon',
'active'
)
'button_callback' => [
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
'handleButtonCallback'
],
'toolkit' => [
'state_button' => [
'stateColumn' => ['active']
]
],
),
'show' => array
(

View File

@@ -114,10 +114,15 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::stateButton(
'tl_leaflet_layer',
'active'
),
'button_callback' => [
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
'handleButtonCallback'
],
'toolkit' => [
'state_button' => [
'stateColumn' => ['active']
]
],
],
'show' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['show'],

View File

@@ -100,10 +100,15 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::stateButton(
'tl_leaflet_marker',
'active'
)
'button_callback' => [
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
'handleButtonCallback'
],
'toolkit' => [
'state_button' => [
'stateColumn' => ['active']
]
],
),
'show' => array
(

View File

@@ -101,10 +101,15 @@ $GLOBALS['TL_DCA']['tl_leaflet_popup'] = array
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::stateButton(
'tl_leaflet_popup',
'active'
)
'button_callback' => [
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
'handleButtonCallback'
],
'toolkit' => [
'state_button' => [
'stateColumn' => ['active']
]
],
),
'show' => array
(

View File

@@ -101,10 +101,15 @@ $GLOBALS['TL_DCA']['tl_leaflet_style'] = array
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::stateButton(
'tl_leaflet_style',
'active'
)
'button_callback' => [
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
'handleButtonCallback'
],
'toolkit' => [
'state_button' => [
'stateColumn' => ['active']
]
],
),
'show' => array
(

View File

@@ -109,10 +109,15 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::stateButton(
'tl_leaflet_vector',
'active'
)
'button_callback' => [
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
'handleButtonCallback'
],
'toolkit' => [
'state_button' => [
'stateColumn' => ['active']
]
],
),
'show' => array
(