[FEATURE] Introduce conditional variants for form elements 82/54982/64
authorRalf Zimmermann <ralf.zimmermann@tritum.de>
Fri, 8 Dec 2017 08:03:38 +0000 (09:03 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Mon, 9 Jul 2018 13:51:11 +0000 (15:51 +0200)
commit0dcb8970178d2e6c6656d988980bfb625c4d2e86
tree666429a12cf5ffbde9fc6eb8cd66e61b4e32e1e6
parentc7bab3e18019132ed6f2824ee5f802f42b415f49
[FEATURE] Introduce conditional variants for form elements

Variants allow you to change properties of a form element.

Variants can contain conditions. If a concrete condition
is TRUE the variant is applied. If no condition exists the
variant will be ignored.

Variants make it possible to manipulate form element values,
validator options, and finisher options based on conditions.
This allows you among other things:

* translation of form element values depending on the frontend
  language
* set and remove validators of one form element depending on the
  value of another form element
* hide entire pages depending on the value of a form element
* set finisher values depending on the value of a form element
* hiding a form element in certain finishers and on the
  summary page

This feature implements variants for the frontend rendering and
the ability to define variants in the formDefinition. The
implementation to define variants in the form editor is out of
scope of this patchset.

Releases: master
Resolves: #84133
Change-Id: I9efeeea5af67df2d2f9252339c26baf8a03cf9c8
Reviewed-on: https://review.typo3.org/54982
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Björn Jacob <bjoern.jacob@tritum.de>
Tested-by: Björn Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
27 files changed:
composer.json
composer.lock
typo3/sysext/core/Documentation/Changelog/master/Deprecation-84133-Deprecate_isHiddenFormElementAnd_isReadOnlyFormElement.rst [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Feature-84133-IntroduceVariants.rst [new file with mode: 0644]
typo3/sysext/form/Classes/Controller/FormEditorController.php
typo3/sysext/form/Classes/Domain/Condition/ConditionContext.php [new file with mode: 0644]
typo3/sysext/form/Classes/Domain/Condition/ConditionResolver.php [new file with mode: 0644]
typo3/sysext/form/Classes/Domain/Condition/ExpressionLanguageVariableProviderInterface.php [new file with mode: 0644]
typo3/sysext/form/Classes/Domain/Model/FormDefinition.php
typo3/sysext/form/Classes/Domain/Model/Renderable/AbstractRenderable.php
typo3/sysext/form/Classes/Domain/Model/Renderable/RenderableVariant.php [new file with mode: 0644]
typo3/sysext/form/Classes/Domain/Model/Renderable/RenderableVariantInterface.php [new file with mode: 0644]
typo3/sysext/form/Classes/Domain/Model/Renderable/VariableRenderableInterface.php [new file with mode: 0644]
typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php
typo3/sysext/form/Classes/ViewHelpers/RenderAllFormValuesViewHelper.php
typo3/sysext/form/Configuration/Yaml/BaseSetup.yaml
typo3/sysext/form/Documentation/Config/configuration/Index.rst
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/ContentElement.rst
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/ContentElement/renderingOptions/_isReadOnlyFormElement.rst [deleted file]
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/Hidden.rst
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/Hidden/renderingOptions/_isHiddenFormElement.rst [deleted file]
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/Honeypot.rst
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/Honeypot/renderingOptions/_isHiddenFormElement.rst [deleted file]
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/StaticText.rst
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/StaticText/renderingOptions/_isReadOnlyFormElement.rst [deleted file]
typo3/sysext/form/Tests/Unit/Domain/Runtime/FormRuntimeTest.php
typo3/sysext/form/composer.json