From 884d33c1c372850fb7164edd38754472513858e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 7 Sep 2021 08:46:05 +0200 Subject: [PATCH] Apply best practice to form finisher registration --- .../Configuration/Forms/BaseSetup.yaml | 31 ++++++++++++++ .../{FormSetup.yaml => FormEditorSetup.yaml} | 40 +++++-------------- .../Configuration/Forms/FormEngineSetup.yaml | 9 +++++ .../TypoScript/Extensions/Form.typoscript | 7 +++- 4 files changed, 56 insertions(+), 31 deletions(-) create mode 100644 public/typo3conf/ext/ep_theme/Configuration/Forms/BaseSetup.yaml rename public/typo3conf/ext/ep_theme/Configuration/Forms/{FormSetup.yaml => FormEditorSetup.yaml} (59%) create mode 100644 public/typo3conf/ext/ep_theme/Configuration/Forms/FormEngineSetup.yaml diff --git a/public/typo3conf/ext/ep_theme/Configuration/Forms/BaseSetup.yaml b/public/typo3conf/ext/ep_theme/Configuration/Forms/BaseSetup.yaml new file mode 100644 index 00000000..29d08420 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Configuration/Forms/BaseSetup.yaml @@ -0,0 +1,31 @@ +TYPO3: + CMS: + Form: + persistenceManager: + allowedExtensionPaths: + 10: EXT:ep_theme/Resources/Private/Forms/ + + prototypes: + standard: + + formElementsDefinition: + Form: + renderingOptions: + templateRootPaths: + 1505042810: 'EXT:ep_theme/Resources/Private/Templates/Form/' + partialRootPaths: + 1505042810: 'EXT:ep_theme/Resources/Private/Partials/Form/' + layoutRootPaths: + 1505042810: 'EXT:ep_theme/Resources/Private/Layouts/Form/' + + finishersDefinition: + BpnApiFinisher: + implementationClassName: 'EP\EpTheme\Form\BpnApiFinisher' + + contactform: + __inheritances: + 10: 'TYPO3.CMS.Form.prototypes.standard' + + applicationform: + __inheritances: + 10: 'TYPO3.CMS.Form.prototypes.standard' diff --git a/public/typo3conf/ext/ep_theme/Configuration/Forms/FormSetup.yaml b/public/typo3conf/ext/ep_theme/Configuration/Forms/FormEditorSetup.yaml similarity index 59% rename from public/typo3conf/ext/ep_theme/Configuration/Forms/FormSetup.yaml rename to public/typo3conf/ext/ep_theme/Configuration/Forms/FormEditorSetup.yaml index 9289d142..77f4c4f3 100644 --- a/public/typo3conf/ext/ep_theme/Configuration/Forms/FormSetup.yaml +++ b/public/typo3conf/ext/ep_theme/Configuration/Forms/FormEditorSetup.yaml @@ -1,35 +1,24 @@ TYPO3: CMS: Form: - persistenceManager: - allowedExtensionPaths: - 10: EXT:ep_theme/Resources/Private/Forms/ - prototypes: standard: - finishersDefinition: - BpnApiFinisher: - implementationClassName: 'EP\EpTheme\Form\BpnApiFinisher' - formEditor: - iconIdentifier: 'form-finisher' - label: 'BusPro Finisher' - predefinedDefaults: - options: - mapping: 'lastName:text-1,firstName:text-2,gender:singleselect-1,email:email-1,street:text-3,zipCode:text-4,city:text-5,phone:telephone-1' formElementsDefinition: Form: formEditor: editors: 900: selectOptions: - 1848: + 1000: value: 'BpnApiFinisher' label: 'BusPro Finisher' propertyCollections: finishers: - 1848: + 1000: identifier: 'BpnApiFinisher' editors: + __inheritances: + 10: 'TYPO3.CMS.Form.mixins.formElementMixins.BaseCollectionEditorsMixin' 100: label: 'BusPro Finisher' 110: @@ -39,18 +28,11 @@ TYPO3: propertyPath: 'options.mapping' propertyValidators: 10: 'NotEmpty' - renderingOptions: - templateRootPaths: - 1505042810: 'EXT:ep_theme/Resources/Private/Templates/Form/' - partialRootPaths: - 1505042810: 'EXT:ep_theme/Resources/Private/Partials/Form/' - layoutRootPaths: - 1505042810: 'EXT:ep_theme/Resources/Private/Layouts/Form/' - contactform: - __inheritances: - 10: 'TYPO3.CMS.Form.prototypes.standard' - - applicationform: - __inheritances: - 10: 'TYPO3.CMS.Form.prototypes.standard' + finishersDefinition: + BpnApiFinisher: + formEditor: + iconIdentifier: 'form-finisher' + predefinedDefaults: + options: + mapping: 'lastName:text-1,firstName:text-2,gender:singleselect-1,email:email-1,street:text-3,zipCode:text-4,city:text-5,phone:telephone-1' diff --git a/public/typo3conf/ext/ep_theme/Configuration/Forms/FormEngineSetup.yaml b/public/typo3conf/ext/ep_theme/Configuration/Forms/FormEngineSetup.yaml new file mode 100644 index 00000000..fa8187f5 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Configuration/Forms/FormEngineSetup.yaml @@ -0,0 +1,9 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + finishersDefinition: + BpnApiFinisher: + FormEngine: + label: 'BusPro Finisher' diff --git a/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/Form.typoscript b/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/Form.typoscript index ec25712a..417b904c 100644 --- a/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/Form.typoscript +++ b/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/Form.typoscript @@ -6,9 +6,12 @@ plugin.tx_form.view { } plugin.tx_form.settings.yamlConfigurations { - 100 = EXT:ep_theme/Configuration/Forms/FormSetup.yaml + 1630994710 = EXT:ep_theme/Configuration/Forms/BaseSetup.yaml + 1630994711 = EXT:ep_theme/Configuration/Forms/FormEngineSetup.yaml } module.tx_form.settings.yamlConfigurations { - 100 = EXT:ep_theme/Configuration/Forms/FormSetup.yaml + 1630994710 = EXT:ep_theme/Configuration/Forms/BaseSetup.yaml + 1630994711 = EXT:ep_theme/Configuration/Forms/FormEditorSetup.yaml + 1630994712 = EXT:ep_theme/Configuration/Forms/FormEngineSetup.yaml }