diff --git a/Classes/Form/AbstractModelDecorator.php b/Classes/Form/AbstractModelDecorator.php index 72a63ad..a7178c1 100644 --- a/Classes/Form/AbstractModelDecorator.php +++ b/Classes/Form/AbstractModelDecorator.php @@ -4,10 +4,9 @@ namespace Remind\Headless\Form; -use FriendsOfTYPO3\Headless\Form\Decorator\AbstractFormDefinitionDecorator; use Psr\Http\Message\ServerRequestInterface; -abstract class AbstractModelDecorator extends AbstractFormDefinitionDecorator +abstract class AbstractModelDecorator extends FormDefinitionDecorator { protected string $actionName = ''; protected string $controllerName = ''; @@ -15,6 +14,8 @@ abstract class AbstractModelDecorator extends AbstractFormDefinitionDecorator protected function overrideDefinition(array $decorated, array $definition, int $currentPage): array { + $decorated = parent::overrideDefinition($decorated, $definition, $currentPage); + $request = $this->getRequest(); /** @var \TYPO3\CMS\Core\Routing\PageArguments $pageArguments */ diff --git a/Classes/Form/FormDefinitionDecorator.php b/Classes/Form/FormDefinitionDecorator.php new file mode 100644 index 0000000..ff4d315 --- /dev/null +++ b/Classes/Form/FormDefinitionDecorator.php @@ -0,0 +1,67 @@ +cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class); + } + + protected function overrideDefinition(array $decorated, array $definition, int $currentPage): array + { + foreach ($decorated['elements'] as &$element) { + $this->setNotEmptyValidationErrorMessages($element); + $this->setCheckboxLinks($element); + } + return $decorated; + } + + private function setNotEmptyValidationErrorMessages(array &$element): void + { + $notEmptyValidators = array_filter($element['validators'] ?? [], function (array $validator) { + return $validator['identifier'] === 'NotEmpty'; + }); + if ($notEmptyValidators) { + foreach ($element['properties']['validationErrorMessages'] ?? [] as $validationErrorMessageKey => $validationErrorMessage) { + if (in_array($validationErrorMessage['code'], self::NOT_EMPTY_ERROR_CODES)) { + foreach (array_keys($notEmptyValidators) as $validatorKey) { + $element['validators'][$validatorKey]['customErrorMessage'] = $validationErrorMessage['customMessage']; + } + unset($element['properties']['validationErrorMessages'][$validationErrorMessageKey]); + } + } + if (empty($element['properties']['validationErrorMessages'])) { + unset($element['properties']['validationErrorMessages']); + } + } + unset($element['properties']['fluidAdditionalAttributes']); + } + + private function setCheckboxLinks(array &$element): void + { + if ($element['type'] === 'Checkbox' && isset($element['properties']['links'])) { + foreach ($element['properties']['links'] as $pageUid => $label) { + $link = $this->cObj->createLink($label, ['parameter' => $pageUid])->getHtml(); + $element['label'] = sprintf($element['label'], $link); + } + unset($element['properties']['links']); + } + } +} diff --git a/Configuration/Form/BaseSetup.yaml b/Configuration/Form/BaseSetup.yaml index 775213f..7b6937d 100644 --- a/Configuration/Form/BaseSetup.yaml +++ b/Configuration/Form/BaseSetup.yaml @@ -1,3 +1,24 @@ +imports: + - { resource: './FormElements/AdvancedPassword.yaml' } + - { resource: './FormElements/Checkbox.yaml' } + - { resource: './FormElements/Date.yaml' } + - { resource: './FormElements/Email.yaml' } + - { resource: './FormElements/GridRow.yaml' } + - { resource: './FormElements/Fieldset.yaml' } + - { resource: './FormElements/MultiCheckbox.yaml' } + - { resource: './FormElements/MultiSelect.yaml' } + - { resource: './FormElements/Number.yaml' } + - { resource: './FormElements/Password.yaml' } + - { resource: './FormElements/RadioButton.yaml' } + - { resource: './FormElements/SingleSelect.yaml' } + - { resource: './FormElements/StaticText.yaml' } + - { resource: './FormElements/Telephone.yaml' } + - { resource: './FormElements/Text.yaml' } + - { resource: './FormElements/Textarea.yaml' } + - { resource: './FormElements/Url.yaml' } + + - { resource: './Finishers/JsonRedirectFinisher.yaml' } + TYPO3: CMS: Form: @@ -10,12 +31,16 @@ TYPO3: translationFiles: 20: "EXT:rmnd_headless/Resources/Private/Language/locallang_form.xlf" formElementsDefinition: - DatePicker: null + DatePicker: + formEditor: + group: null Form: formEditor: predefinedDefaults: i18n: identifier: i18n + renderingOptions: + formDecorator: Remind\Headless\Form\FormDefinitionDecorator editors: # Overwrite submitButtonLabel propertyPath to be included in json output 300: diff --git a/Configuration/Form/JsonRedirectFinisher.yaml b/Configuration/Form/Finishers/JsonRedirectFinisher.yaml similarity index 100% rename from Configuration/Form/JsonRedirectFinisher.yaml rename to Configuration/Form/Finishers/JsonRedirectFinisher.yaml diff --git a/Configuration/Form/FormElementSize.yaml b/Configuration/Form/FormElementSize.yaml deleted file mode 100644 index dc4df14..0000000 --- a/Configuration/Form/FormElementSize.yaml +++ /dev/null @@ -1,75 +0,0 @@ -TYPO3: - CMS: - Form: - prototypes: - standard: - formElementsDefinition: - AdvancedPassword: &size - formEditor: - editors: - # Remove default Grid viewport configuration - 700: null - 701: - identifier: size - templateName: Inspector-SingleSelectEditor - label: formEditor.elements.FormElement.editor.size.label - propertyPath: properties.size - selectOptions: - 10: - value: "" - label: formEditor.elements.FormElement.editor.size.default.label - 20: - value: 25 - label: 1/4 - 30: - value: 33 - label: 1/3 - 40: - value: 50 - label: 1/2 - 50: - value: 66 - label: 2/3 - 60: - value: 75 - label: 3/4 - Checkbox: - <<: *size - ContentElement: - <<: *size - Date: - <<: *size - Email: - <<: *size - Fieldset: - <<: *size - FileUpload: - <<: *size - GridRow: - <<: *size - Hidden: - <<: *size - ImageUpload: - <<: *size - MultiCheckbox: - <<: *size - MultiSelect: - <<: *size - Number: - <<: *size - Password: - <<: *size - RadioButton: - <<: *size - SingleSelect: - <<: *size - StaticText: - <<: *size - Telephone: - <<: *size - Url: - <<: *size - Text: - <<: *size - Textarea: - <<: *size diff --git a/Configuration/Form/FormElements/AdvancedPassword.yaml b/Configuration/Form/FormElements/AdvancedPassword.yaml new file mode 100644 index 0000000..8295f73 --- /dev/null +++ b/Configuration/Form/FormElements/AdvancedPassword.yaml @@ -0,0 +1,95 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + AdvancedPassword: + formEditor: + editors: + 400: + propertyPath: properties.placeholder + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label + propertyCollections: + validators: + 10: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 20: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 30: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 40: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 50: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 60: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 70: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 80: + editors: + 300: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true diff --git a/Configuration/Form/FormElements/Checkbox.yaml b/Configuration/Form/FormElements/Checkbox.yaml new file mode 100644 index 0000000..9ae1421 --- /dev/null +++ b/Configuration/Form/FormElements/Checkbox.yaml @@ -0,0 +1,49 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + Checkbox: + formEditor: + editors: + 300: + identifier: links + templateName: Inspector-PropertyGridEditor + label: formEditor.elements.FormElement.editor.links.label + propertyPath: properties.links + isSortable: true + enableAddRow: true + enableDeleteRow: true + useLabelAsFallbackValue: false + gridColumns: + - name: label + title: formEditor.elements.FormElement.editor.links.linkText + - name: value + title: formEditor.elements.FormElement.editor.links.pageUid + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label diff --git a/Configuration/Form/FormElements/Date.yaml b/Configuration/Form/FormElements/Date.yaml new file mode 100644 index 0000000..5b34db1 --- /dev/null +++ b/Configuration/Form/FormElements/Date.yaml @@ -0,0 +1,97 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + Date: + formEditor: + editors: + 550: + propertyPath: properties.step + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label + predefinedDefaults: + properties: null + propertyCollections: + validators: + 10: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 250: + additionalElementPropertyPaths: null + 20: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 30: + editors: + 250: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 40: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 50: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 60: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 70: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 80: + editors: + 300: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true diff --git a/Configuration/Form/FormElements/Email.yaml b/Configuration/Form/FormElements/Email.yaml new file mode 100644 index 0000000..5227f47 --- /dev/null +++ b/Configuration/Form/FormElements/Email.yaml @@ -0,0 +1,95 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + Email: + formEditor: + editors: + 400: + propertyPath: properties.placeholder + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label + propertyCollections: + validators: + 10: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 20: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 30: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 40: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 50: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 60: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 70: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 80: + editors: + 300: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true diff --git a/Configuration/Form/FormElements/Fieldset.yaml b/Configuration/Form/FormElements/Fieldset.yaml new file mode 100644 index 0000000..8d1f5d9 --- /dev/null +++ b/Configuration/Form/FormElements/Fieldset.yaml @@ -0,0 +1,35 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + Fieldset: + formEditor: + editors: + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label diff --git a/Configuration/Form/FormElements/GridRow.yaml b/Configuration/Form/FormElements/GridRow.yaml new file mode 100644 index 0000000..b8808a4 --- /dev/null +++ b/Configuration/Form/FormElements/GridRow.yaml @@ -0,0 +1,35 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + GridRow: + formEditor: + editors: + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label diff --git a/Configuration/Form/FormElements/MultiCheckbox.yaml b/Configuration/Form/FormElements/MultiCheckbox.yaml new file mode 100644 index 0000000..17b1445 --- /dev/null +++ b/Configuration/Form/FormElements/MultiCheckbox.yaml @@ -0,0 +1,43 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + MultiCheckbox: + formEditor: + editors: + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label + propertyCollections: + validators: + 10: + editors: + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true diff --git a/Configuration/Form/FormElements/MultiSelect.yaml b/Configuration/Form/FormElements/MultiSelect.yaml new file mode 100644 index 0000000..49b90ea --- /dev/null +++ b/Configuration/Form/FormElements/MultiSelect.yaml @@ -0,0 +1,43 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + MultiSelect: + formEditor: + editors: + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label + propertyCollections: + validators: + 10: + editors: + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true diff --git a/Configuration/Form/FormElements/Number.yaml b/Configuration/Form/FormElements/Number.yaml new file mode 100644 index 0000000..fefc8ff --- /dev/null +++ b/Configuration/Form/FormElements/Number.yaml @@ -0,0 +1,99 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + Number: + formEditor: + editors: + 400: + propertyPath: properties.placeholder + 550: + propertyPath: properties.step + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label + predefinedDefaults: + properties: null + propertyCollections: + validators: + 10: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 20: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 30: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 40: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 50: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 60: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 70: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 80: + editors: + 300: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true \ No newline at end of file diff --git a/Configuration/Form/FormElements/Password.yaml b/Configuration/Form/FormElements/Password.yaml new file mode 100644 index 0000000..1497054 --- /dev/null +++ b/Configuration/Form/FormElements/Password.yaml @@ -0,0 +1,95 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + Password: + formEditor: + editors: + 400: + propertyPath: properties.placeholder + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label + propertyCollections: + validators: + 10: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 20: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 30: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 40: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 50: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 60: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 70: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 80: + editors: + 300: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true diff --git a/Configuration/Form/FormElements/RadioButton.yaml b/Configuration/Form/FormElements/RadioButton.yaml new file mode 100644 index 0000000..02b6fae --- /dev/null +++ b/Configuration/Form/FormElements/RadioButton.yaml @@ -0,0 +1,35 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + RadioButton: + formEditor: + editors: + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label diff --git a/Configuration/Form/FormElements/SingleSelect.yaml b/Configuration/Form/FormElements/SingleSelect.yaml new file mode 100644 index 0000000..1bfc15e --- /dev/null +++ b/Configuration/Form/FormElements/SingleSelect.yaml @@ -0,0 +1,35 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + SingleSelect: + formEditor: + editors: + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label diff --git a/Configuration/Form/FormElements/StaticText.yaml b/Configuration/Form/FormElements/StaticText.yaml new file mode 100644 index 0000000..cede22d --- /dev/null +++ b/Configuration/Form/FormElements/StaticText.yaml @@ -0,0 +1,35 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + StaticText: + formEditor: + editors: + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label diff --git a/Configuration/Form/FormElements/Telephone.yaml b/Configuration/Form/FormElements/Telephone.yaml new file mode 100644 index 0000000..10deb1c --- /dev/null +++ b/Configuration/Form/FormElements/Telephone.yaml @@ -0,0 +1,95 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + Telephone: + formEditor: + editors: + 400: + propertyPath: properties.placeholder + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label + propertyCollections: + validators: + 10: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 20: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 30: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 40: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 50: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 60: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 70: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 80: + editors: + 300: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true diff --git a/Configuration/Form/FormElements/Text.yaml b/Configuration/Form/FormElements/Text.yaml new file mode 100644 index 0000000..8af3c93 --- /dev/null +++ b/Configuration/Form/FormElements/Text.yaml @@ -0,0 +1,95 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + Text: + formEditor: + editors: + 400: + propertyPath: properties.placeholder + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label + propertyCollections: + validators: + 10: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 20: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 30: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 40: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 50: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 60: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 70: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 80: + editors: + 300: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true diff --git a/Configuration/Form/FormElements/Textarea.yaml b/Configuration/Form/FormElements/Textarea.yaml new file mode 100644 index 0000000..663e7af --- /dev/null +++ b/Configuration/Form/FormElements/Textarea.yaml @@ -0,0 +1,95 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + Textarea: + formEditor: + editors: + 400: + propertyPath: properties.placeholder + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label + propertyCollections: + validators: + 10: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 20: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 30: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 40: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 50: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 60: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 70: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 80: + editors: + 300: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true diff --git a/Configuration/Form/FormElements/Url.yaml b/Configuration/Form/FormElements/Url.yaml new file mode 100644 index 0000000..9400936 --- /dev/null +++ b/Configuration/Form/FormElements/Url.yaml @@ -0,0 +1,95 @@ +TYPO3: + CMS: + Form: + prototypes: + standard: + formElementsDefinition: + Url: + formEditor: + editors: + 400: + propertyPath: properties.placeholder + # Remove default Grid viewport configuration + 700: null + 701: + identifier: size + templateName: Inspector-SingleSelectEditor + label: formEditor.elements.FormElement.editor.size.label + propertyPath: properties.size + selectOptions: + 10: + value: "" + label: formEditor.elements.FormElement.editor.size.default.label + 20: + value: xs + label: formEditor.elements.FormElement.editor.size.xs.label + 30: + value: sm + label: formEditor.elements.FormElement.editor.size.sm.label + 40: + value: md + label: formEditor.elements.FormElement.editor.size.md.label + 50: + value: lg + label: formEditor.elements.FormElement.editor.size.lg.label + 60: + value: xl + label: formEditor.elements.FormElement.editor.size.xl.label + propertyCollections: + validators: + 10: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 20: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 30: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 40: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 50: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 60: + editors: + 200: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 70: + editors: + 200: + additionalElementPropertyPaths: null + 300: + additionalElementPropertyPaths: null + 400: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true + 80: + editors: + 300: + templateName: Inspector-TextEditor + propertyPath: customErrorMessage + doNotSetIfPropertyValueIsEmpty: true diff --git a/Configuration/TypoScript/Extensions/tx_form.typoscript b/Configuration/TypoScript/Extensions/tx_form.typoscript index 5c4bd13..a6d4102 100644 --- a/Configuration/TypoScript/Extensions/tx_form.typoscript +++ b/Configuration/TypoScript/Extensions/tx_form.typoscript @@ -2,8 +2,6 @@ plugin.tx_form { settings { yamlConfigurations { 100 = EXT:rmnd_headless/Configuration/Form/BaseSetup.yaml - 101 = EXT:rmnd_headless/Configuration/Form/FormElementSize.yaml - 102 = EXT:rmnd_headless/Configuration/Form/JsonRedirectFinisher.yaml } } } @@ -12,8 +10,6 @@ module.tx_form { settings { yamlConfigurations { 100 = EXT:rmnd_headless/Configuration/Form/BaseSetup.yaml - 101 = EXT:rmnd_headless/Configuration/Form/FormElementSize.yaml - 102 = EXT:rmnd_headless/Configuration/Form/JsonRedirectFinisher.yaml } } } \ No newline at end of file diff --git a/Resources/Private/Language/de.locallang_form.xlf b/Resources/Private/Language/de.locallang_form.xlf index a8e1e5b..12b1262 100644 --- a/Resources/Private/Language/de.locallang_form.xlf +++ b/Resources/Private/Language/de.locallang_form.xlf @@ -12,12 +12,36 @@ Pflichtfeld Hinweis + + Links + + + Link Text + + + Seite + Größe Gesamte Breite + + Sehr klein + + + Klein + + + Mittel + + + Groß + + + Sehr groß + \ No newline at end of file diff --git a/Resources/Private/Language/locallang_form.xlf b/Resources/Private/Language/locallang_form.xlf index 18eaea3..7f3b871 100644 --- a/Resources/Private/Language/locallang_form.xlf +++ b/Resources/Private/Language/locallang_form.xlf @@ -12,12 +12,36 @@ Required field hint + + Links + + + Link Text + + + Page + Size Full Width + + Extra small + + + Small + + + Medium + + + Large + + + Extra large + \ No newline at end of file