From ad6a4e938403cd82d949d6d645588061349f54a6 Mon Sep 17 00:00:00 2001 From: David Molineus Date: Fri, 6 Oct 2017 14:14:39 +0200 Subject: [PATCH] Replace old alias generator callback definition with toolkit 3.0 compatible ones. --- src/Resources/contao/dca/tl_leaflet_control.php | 13 +++++++------ src/Resources/contao/dca/tl_leaflet_icon.php | 13 +++++++------ src/Resources/contao/dca/tl_leaflet_layer.php | 13 +++++++------ src/Resources/contao/dca/tl_leaflet_map.php | 13 +++++++------ src/Resources/contao/dca/tl_leaflet_marker.php | 13 +++++++------ src/Resources/contao/dca/tl_leaflet_popup.php | 13 +++++++------ src/Resources/contao/dca/tl_leaflet_style.php | 13 +++++++------ src/Resources/contao/dca/tl_leaflet_vector.php | 13 +++++++------ 8 files changed, 56 insertions(+), 48 deletions(-) diff --git a/src/Resources/contao/dca/tl_leaflet_control.php b/src/Resources/contao/dca/tl_leaflet_control.php index 7be201e..da68fe9 100644 --- a/src/Resources/contao/dca/tl_leaflet_control.php +++ b/src/Resources/contao/dca/tl_leaflet_control.php @@ -171,12 +171,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array 'inputType' => 'text', 'search' => true, 'save_callback' => array( - \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator( - 'tl_leaflet_control', - 'alias', - ['title'], - \Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::PARENT_ALIAS_GENERATOR - ), + ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_leaflet_maps.listeners.dca.validator', 'validateAlias'], ), 'eval' => array( @@ -185,6 +180,12 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array 'tl_class' => 'w50', 'nullIfEmpty' => true, ), + 'toolkit' => [ + 'alias_generator' => [ + 'factory' => 'netzmacht.contao_leaflet_maps.definition.alias_generator.factory_parent', + 'fields' => ['title'] + ], + ], 'sql' => 'varchar(255) NULL' ), 'type' => array diff --git a/src/Resources/contao/dca/tl_leaflet_icon.php b/src/Resources/contao/dca/tl_leaflet_icon.php index c205c9c..69b6980 100644 --- a/src/Resources/contao/dca/tl_leaflet_icon.php +++ b/src/Resources/contao/dca/tl_leaflet_icon.php @@ -193,15 +193,16 @@ $GLOBALS['TL_DCA']['tl_leaflet_icon'] = array 'exclude' => true, 'inputType' => 'text', 'save_callback' => array( - \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator( - 'tl_leaflet_icon', - 'alias', - ['title'], - \Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::ALIAS_GENERATOR - ), + ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_leaflet_maps.listeners.dca.validator', 'validateAlias'], ), 'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true), + 'toolkit' => [ + 'alias_generator' => [ + 'factory' => 'netzmacht.contao_leaflet_maps.definition.alias_generator.factory_default', + 'fields' => ['title'] + ], + ], 'sql' => 'varchar(255) NULL' ), 'type' => array diff --git a/src/Resources/contao/dca/tl_leaflet_layer.php b/src/Resources/contao/dca/tl_leaflet_layer.php index 670faa7..5f8a2c0 100644 --- a/src/Resources/contao/dca/tl_leaflet_layer.php +++ b/src/Resources/contao/dca/tl_leaflet_layer.php @@ -258,15 +258,16 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [ 'inputType' => 'text', 'search' => true, 'save_callback' => [ - \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator( - 'tl_leaflet_layer', - 'alias', - ['title'], - \Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::ALIAS_GENERATOR - ), + ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_leaflet_maps.listeners.dca.validator', 'validateAlias'], ], 'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true], + 'toolkit' => [ + 'alias_generator' => [ + 'factory' => 'netzmacht.contao_leaflet_maps.definition.alias_generator.factory_default', + 'fields' => ['title'] + ], + ], 'sql' => 'varchar(255) NULL', ], 'type' => [ diff --git a/src/Resources/contao/dca/tl_leaflet_map.php b/src/Resources/contao/dca/tl_leaflet_map.php index 39e5f68..173c0ed 100644 --- a/src/Resources/contao/dca/tl_leaflet_map.php +++ b/src/Resources/contao/dca/tl_leaflet_map.php @@ -174,15 +174,16 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array 'inputType' => 'text', 'search' => true, 'save_callback' => array( - \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator( - 'tl_leaflet_map', - 'alias', - ['title'], - \Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::ALIAS_GENERATOR - ), + ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_leaflet_maps.listeners.dca.validator', 'validateAlias'] ), 'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true), + 'toolkit' => [ + 'alias_generator' => [ + 'factory' => 'netzmacht.contao_leaflet_maps.definition.alias_generator.factory_default', + 'fields' => ['title'] + ] + ], 'sql' => 'varchar(255) NULL' ), 'center' => array diff --git a/src/Resources/contao/dca/tl_leaflet_marker.php b/src/Resources/contao/dca/tl_leaflet_marker.php index 2af6606..1b7f999 100644 --- a/src/Resources/contao/dca/tl_leaflet_marker.php +++ b/src/Resources/contao/dca/tl_leaflet_marker.php @@ -175,15 +175,16 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array 'inputType' => 'text', 'search' => true, 'save_callback' => array( - \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator( - 'tl_leaflet_marker', - 'alias', - ['title'], - \Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::ALIAS_GENERATOR - ), + ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_leaflet_maps.listeners.dca.validator', 'validateAlias'], ), 'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true), + 'toolkit' => [ + 'alias_generator' => [ + 'factory' => 'netzmacht.contao_leaflet_maps.definition.alias_generator.factory_default', + 'fields' => ['title'] + ], + ], 'sql' => 'varchar(255) NULL' ), 'coordinates' => array diff --git a/src/Resources/contao/dca/tl_leaflet_popup.php b/src/Resources/contao/dca/tl_leaflet_popup.php index a492b15..b96dccf 100644 --- a/src/Resources/contao/dca/tl_leaflet_popup.php +++ b/src/Resources/contao/dca/tl_leaflet_popup.php @@ -165,15 +165,16 @@ $GLOBALS['TL_DCA']['tl_leaflet_popup'] = array 'exclude' => true, 'inputType' => 'text', 'save_callback' => array( - \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator( - 'tl_leaflet_popup', - 'alias', - ['title'], - \Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::ALIAS_GENERATOR - ), + ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_leaflet_maps.listeners.dca.validator', 'validateAlias'], ), 'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true), + 'toolkit' => [ + 'alias_generator' => [ + 'factory' => 'netzmacht.contao_leaflet_maps.definition.alias_generator.factory_default', + 'fields' => ['title'] + ], + ], 'sql' => 'varchar(255) NULL' ), 'maxWidth' => array diff --git a/src/Resources/contao/dca/tl_leaflet_style.php b/src/Resources/contao/dca/tl_leaflet_style.php index 827f06c..5c662fc 100644 --- a/src/Resources/contao/dca/tl_leaflet_style.php +++ b/src/Resources/contao/dca/tl_leaflet_style.php @@ -159,15 +159,16 @@ $GLOBALS['TL_DCA']['tl_leaflet_style'] = array 'exclude' => true, 'inputType' => 'text', 'save_callback' => array( - \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator( - 'tl_leaflet_style', - 'alias', - ['title'], - \Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::ALIAS_GENERATOR - ), + ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_leaflet_maps.listeners.dca.validator', 'validateAlias'], ), 'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true), + 'toolkit' => [ + 'alias_generator' => [ + 'factory' => 'netzmacht.contao_leaflet_maps.definition.alias_generator.factory_default', + 'fields' => ['title'] + ], + ], 'sql' => 'varchar(255) NULL' ), 'type' => array diff --git a/src/Resources/contao/dca/tl_leaflet_vector.php b/src/Resources/contao/dca/tl_leaflet_vector.php index ca0b799..b10982f 100644 --- a/src/Resources/contao/dca/tl_leaflet_vector.php +++ b/src/Resources/contao/dca/tl_leaflet_vector.php @@ -203,15 +203,16 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array 'inputType' => 'text', 'search' => true, 'save_callback' => array( - \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator( - 'tl_leaflet_vector', - 'alias', - ['title'], - \Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::ALIAS_GENERATOR - ), + ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_leaflet_maps.listeners.dca.validator', 'validateAlias'], ), 'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true), + 'toolkit' => [ + 'alias_generator' => [ + 'factory' => 'netzmacht.contao_leaflet_maps.definition.alias_generator.factory_default', + 'fields' => ['title'] + ], + ], 'sql' => 'varchar(255) NULL' ), 'type' => array