[!!!][TASK] EXT:form - Refactor fluid rendering 42/51442/13
authorRalf Zimmermann <ralf.zimmermann@tritum.de>
Thu, 26 Jan 2017 22:52:51 +0000 (23:52 +0100)
committerSusanne Moog <susanne.moog@typo3.org>
Thu, 2 Feb 2017 12:48:44 +0000 (13:48 +0100)
This patch is a followup of issue #79439.

EXT:form uses "fluid" as the default rendering strategy.
Therefore, EXT:form has to work close with the concepts of fluid to
avoid current and future problems.
Until now, EXT:form tried to reuse a fluid view instance by
reconfiguring the instance on each nesting level, but fluid is not
intended for such a purpose.
Therefore, the templates have to be moved/ changed and some
configuration has to be changed.
The patch breaks EXT:form only for people who are using custom
configurations/ templates.

Resolves: #79464
Releases: master
Change-Id: I6346b888b47a52bcc995c7d4cd3acdc65a1396c8
Reviewed-on: https://review.typo3.org/51442
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Tested-by: Andreas Steiger <typo3@andreassteiger.de>
Tested-by: Tobi Kretschmann <tobi@tobishome.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
135 files changed:
typo3/sysext/core/Documentation/Changelog/master/Breaking-79464-ExtFormRefactorFluidRendering.rst [new file with mode: 0644]
typo3/sysext/form/Classes/Controller/FormEditorController.php
typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php
typo3/sysext/form/Classes/Domain/Model/FormDefinition.php
typo3/sysext/form/Classes/Domain/Model/FormElements/AbstractSection.php
typo3/sysext/form/Classes/Domain/Model/FormElements/UnknownFormElement.php
typo3/sysext/form/Classes/Domain/Model/Renderable/AbstractRenderable.php
typo3/sysext/form/Classes/Domain/Model/Renderable/RenderableInterface.php
typo3/sysext/form/Classes/Domain/Model/Renderable/RootRenderableInterface.php
typo3/sysext/form/Classes/Domain/Renderer/FluidFormRenderer.php
typo3/sysext/form/Classes/Domain/Renderer/RendererInterface.php
typo3/sysext/form/Classes/Domain/Renderer/UnknownFormElementRenderer.php [deleted file]
typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php
typo3/sysext/form/Classes/Mvc/View/FormView.php [deleted file]
typo3/sysext/form/Classes/Mvc/View/TemplatePaths.php [deleted file]
typo3/sysext/form/Classes/ViewHelpers/Form/DatePickerViewHelper.php
typo3/sysext/form/Classes/ViewHelpers/Form/TimePickerViewHelper.php
typo3/sysext/form/Classes/ViewHelpers/FormViewHelper.php
typo3/sysext/form/Classes/ViewHelpers/PlainTextMailViewHelper.php
typo3/sysext/form/Classes/ViewHelpers/RenderAllFormValuesViewHelper.php
typo3/sysext/form/Classes/ViewHelpers/RenderRenderableViewHelper.php
typo3/sysext/form/Classes/ViewHelpers/TranslateElementPropertyViewHelper.php
typo3/sysext/form/Configuration/Yaml/BaseSetup.yaml
typo3/sysext/form/Configuration/Yaml/FormEditorSetup.yaml
typo3/sysext/form/Resources/Private/Backend/Layouts/FormEditor.html
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/CheckboxEditor.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/CollectionElementHeaderEditor.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/FinishersEditor.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/FormElementHeaderEditor.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/PropertyGridEditor.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/RemoveElementEditor.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/RequiredValidatorEditor.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/SingleSelectEditor.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/TextEditor.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/TextareaEditor.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/Typo3WinBrowserEditor.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/ValidatorsEditor.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Modals/InsertElements.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Modals/InsertPages.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Modals/ValidationErrors.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/ContentElement.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/Fieldset.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/Page.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/StaticText.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/SummaryPage.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/_ElementToolbar.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/_UnknownElement.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/InlineTemplates.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/CheckboxEditor.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/CollectionElementHeaderEditor.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/FinishersEditor.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/FormElementHeaderEditor.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/PropertyGridEditor.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/RemoveElementEditor.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/RequiredValidatorEditor.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/SingleSelectEditor.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/TextEditor.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/TextareaEditor.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/Typo3WinBrowserEditor.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/ValidatorsEditor.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Modals/InsertElements.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Modals/InsertPages.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Modals/ValidationErrors.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/AdvancedPassword.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Checkbox.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/ContentElement.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/DatePicker.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Fieldset.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/FileUpload.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Hidden.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/ImageUpload.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/MultiCheckbox.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/MultiSelect.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Page.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Password.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/RadioButton.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/SingleSelect.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/StaticText.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/SummaryPage.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Text.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Textarea.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/_ElementToolbar.html [deleted file]
typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/_UnknownElement.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Layouts/FormElements/Field.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Partials/AdvancedPassword.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/Checkbox.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/ContentElement.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/DatePicker.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/Field/Field.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/Field/Required.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/Fieldset.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/FileUpload.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/Form/Navigation.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/FormElements/Field/Required.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Partials/FormElements/Form/Navigation.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Partials/Hidden.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/Honeypot.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/ImageUpload.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/MultiCheckbox.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/MultiSelect.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/Page.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/Password.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/RadioButton.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/SingleSelect.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/StaticText.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/SummaryPage.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/Text.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/Textarea.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Partials/UnknownElement.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Templates/Finishers/Email/Html.html
typo3/sysext/form/Resources/Private/Frontend/Templates/Finishers/Email/Plaintext.html
typo3/sysext/form/Resources/Private/Frontend/Templates/Form.html [new file with mode: 0644]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/AdvancedPassword.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Checkbox.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/ContentElement.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/DatePicker.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Fieldset.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/FileUpload.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Form.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Hidden.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Honeypot.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/ImageUpload.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/MultiCheckbox.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/MultiSelect.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Page.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Password.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/RadioButton.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/SingleSelect.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/StaticText.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/SummaryPage.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Text.html [deleted file]
typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Textarea.html [deleted file]
typo3/sysext/form/Tests/Unit/Controller/FormEditorControllerTest.php
typo3/sysext/form/Tests/Unit/Domain/FormElements/AbstractSectionTest.php [new file with mode: 0644]
typo3/sysext/form/Tests/Unit/Domain/Runtime/FormRuntimeTest.php [new file with mode: 0644]

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-79464-ExtFormRefactorFluidRendering.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-79464-ExtFormRefactorFluidRendering.rst
new file mode 100644 (file)
index 0000000..4ea2750
--- /dev/null
@@ -0,0 +1,133 @@
+.. include:: ../../Includes.txt
+
+======================================================
+Breaking: #51442 - EXT:form - Refactor fluid rendering
+======================================================
+
+See :issue:`79464`
+
+Description
+===========
+
+EXT:form uses "fluid" as the default rendering strategy.
+Therefore, EXT:form has to work close with the concepts of fluid to avoid current and future problems.
+Until now, EXT:form tried to reuse a fluid view instance by reconfiguring the instance on each nesting level, but fluid is not intended for such a purpose.
+This change reduces the complexity of the rendering process and works closer with the concepts of fluid.
+
+Impact
+======
+
+The configuration options 'renderingOptions.templateRootPaths', 'renderingOptions.partialRootPaths' and 'renderingOptions.layoutRootPaths' for form elements are
+from now on only rules for the root form element ('Form') and will be applied for all child form elements.
+If you configure 'renderingOptions.templateRootPaths' etc. for other form elements it will have no effect.
+
+The configuration option 'renderingOptions.templatePathAndFilename' for form elements was removed from the configuration and will have no effect.
+To define a template file name which should be used instead of a filename which is named like the form element type, there is a new option 'renderingOptions.templateName'.
+
+The internal setting 'renderingOptions.renderableNameInTemplate' for form elements was removed from the configuration and will have no effect.
+
+The setting 'rendererClassName' for form elements are from now on only rules for the root form element ('Form').
+If you define this option for other form elements, an 'invalid configuration' exception will be thrown.
+
+The configuration for the backend editor inline templates which are used by editor javascript has changed.
+The configuration path 'prototypes.<prototypeName>.formEditor.formEditorTemplates' was renamed and has no longer any effect.
+The fluid configuration part moved from 'prototypes.<prototypeName>.formEditor.formEditorTemplates' to a new section 'prototypes.<prototypeName>.formEditor.formEditorFluidConfiguration'.
+The backend editor inline template mapping moved to a new section 'prototypes.<prototypeName>.formEditor.formEditorPartials'.
+The inline template mapping for stage templates was condensed. If you define custom form editor stage templates which use a default stage template it could
+result in a javascript error within the form editor.
+
+The template files moved from 'Resources/Private/Frontend/Templates/FormElements/' to 'Resources/Private/Frontend/Partials'.
+The template structure has changed. Without adaptation of your overridden templates, no form elements are visible within the frontend.
+
+
+Affected Installations
+======================
+
+All installations since TYPO3 8.5 which use the new EXT:form extension and create or extend custom form elements through configuration and / or
+override EXT:form template files.
+
+Migration
+=========
+
+If you override/ extend
+
+    'TYPO3.CMS.Form.mixins.formElementMixins.BaseFormElementMixin.renderingOptions.templateRootPaths'
+    'TYPO3.CMS.Form.mixins.formElementMixins.BaseFormElementMixin.renderingOptions.partialRootPaths'
+    'TYPO3.CMS.Form.mixins.formElementMixins.BaseFormElementMixin.renderingOptions.layoutRootPaths'
+
+move it to
+
+    'TYPO3.CMS.Form.prototypes.<prototypeName>.formElementsDefinition.Form.renderingOptions.templateRootPaths'
+    'TYPO3.CMS.Form.prototypes.<prototypeName>.formElementsDefinition.Form.renderingOptions.partialRootPaths'
+    'TYPO3.CMS.Form.prototypes.<prototypeName>.formElementsDefinition.Form.renderingOptions.layoutRootPaths'
+
+
+If you override/ extend
+
+    'TYPO3.CMS.Form.mixins.formElementMixins.BaseFormElementMixin.renderingOptions.skipUnknownElements'
+
+move it to
+
+    'TYPO3.CMS.Form.prototypes.<prototypeName>.formElementsDefinition.Form.renderingOptions.skipUnknownElements'
+
+
+If you defined
+
+    'TYPO3.CMS.Form.prototypes.<prototypeName>.formElementsDefinition.<formElementType>.rendererClassName'
+
+for a <formElementType> which is *NOT* 'Form', you have to remove this setting.
+
+
+If you defined
+
+    'TYPO3.CMS.Form.prototypes.<prototypeName>.formElementsDefinition.Form.renderingOptions.renderableNameInTemplate'
+
+you have to use
+
+    'TYPO3.CMS.Form.prototypes.<prototypeName>.formElementsDefinition.Form.renderingOptions.templateName'
+
+'templateName' is the partial path, relative to 'TYPO3.CMS.Form.prototypes.<prototypeName>.formElementsDefinition.Form.renderingOptions.partialRootPaths'
+
+
+If you defined custom form editor templates within
+
+    'TYPO3.CMS.Form.prototypes.<prototypeName>.formEditor.formEditorTemplates'
+
+you have to move this to
+
+    'TYPO3.CMS.Form.prototypes.<prototypeName>.formEditor.formEditorPartials'
+
+
+If you defined a custom form editor stage template which depends on a default form editor stage template you have to redefine it:
+
+    Stage/Text => Stage/SimpleTemplate
+    Stage/Password => Stage/SimpleTemplate
+    Stage/AdvancedPassword => Stage/SimpleTemplate
+    Stage/Textarea => Stage/SimpleTemplate
+    Stage/Checkbox => Stage/SimpleTemplate
+    Stage/MultiCheckbox => Stage/SelectTemplate
+    Stage/MultiSelect => Stage/SelectTemplate
+    Stage/RadioButton => Stage/SelectTemplate
+    Stage/SingleSelect => Stage/SelectTemplate
+    Stage/DatePicker => Stage/SimpleTemplate
+    Stage/Hidden => Stage/SimpleTemplate
+    Stage/FileUpload => Stage/FileUploadTemplate
+    Stage/ImageUpload => Stage/FileUploadTemplate
+
+
+All form element templates except the template for the 'Form' element moved from templates to partials.
+You have to move this too, if you extended the fluid search paths.
+The 'Form' element is a template and will be found through 'TYPO3.CMS.Form.prototypes.<prototypeName>.formElementsDefinition.Form.renderingOptions.templateRootPaths'.
+All other form elements are partials and will be found through 'TYPO3.CMS.Form.prototypes.<prototypeName>.formElementsDefinition.Form.renderingOptions.partialRootPaths'.
+
+
+The template/ partial structure has changed. You have to adapt this to your custom templates.
+Please look at the files within EXT:form/Resources/Private/Frontend/Partials
+to see what has happened.
+The main change is that you have to wrap the markup with
+
+    <formvh:renderRenderable renderable="{element}">
+        some form element
+    </formvh:renderRenderable>
+
+.. index:: Backend, Frontend, ext:form
\ No newline at end of file
index efd711d..efdf27d 100644 (file)
@@ -22,7 +22,7 @@ use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Fluid\View\StandaloneView;
+use TYPO3\CMS\Fluid\View\TemplateView;
 use TYPO3\CMS\Form\Domain\Configuration\ConfigurationService;
 use TYPO3\CMS\Form\Domain\Exception\RenderingException;
 use TYPO3\CMS\Form\Domain\Factory\ArrayFormFactory;
@@ -99,10 +99,7 @@ class FormEditorController extends AbstractBackendController
 
         $this->view->assign('formEditorAppInitialData', json_encode($formEditorAppInitialData));
         $this->view->assign('stylesheets', $this->resolveResourcePaths($this->prototypeConfiguration['formEditor']['stylesheets']));
-        $this->view->assign('formEditorTemplates', $this->renderFormEditorTemplates(
-            $this->prototypeConfiguration['formEditor']['formEditorTemplates'],
-            $formEditorDefinitions
-        ));
+        $this->view->assign('formEditorTemplates', $this->renderFormEditorTemplates($formEditorDefinitions));
         $this->view->assign('dynamicRequireJsModules', $this->prototypeConfiguration['formEditor']['dynamicRequireJsModules']);
 
         $popupWindowWidth  = 700;
@@ -378,15 +375,23 @@ class FormEditorController extends AbstractBackendController
     /**
      * Render the "text/x-formeditor-template" templates.
      *
-     * @param array $formEditorTemplates
      * @param array $formEditorDefinitions
-     * @return array
+     * @return string
      */
-    protected function renderFormEditorTemplates(array $formEditorTemplates, array $formEditorDefinitions): array
+    protected function renderFormEditorTemplates(array $formEditorDefinitions): string
     {
+        $fluidConfiguration = $this->prototypeConfiguration['formEditor']['formEditorFluidConfiguration'];
+        $formEditorPartials = $this->prototypeConfiguration['formEditor']['formEditorPartials'];
+
+        if (!isset($fluidConfiguration['templatePathAndFilename'])) {
+            throw new RenderingException(
+                'The option templatePathAndFilename must be set.',
+                1485636499
+            );
+        }
         if (
-            !isset($formEditorTemplates['layoutRootPaths'])
-            || !is_array($formEditorTemplates['layoutRootPaths'])
+            !isset($fluidConfiguration['layoutRootPaths'])
+            || !is_array($fluidConfiguration['layoutRootPaths'])
         ) {
             throw new RenderingException(
                 'The option layoutRootPaths must be set.',
@@ -394,8 +399,8 @@ class FormEditorController extends AbstractBackendController
             );
         }
         if (
-            !isset($formEditorTemplates['partialRootPaths'])
-            || !is_array($formEditorTemplates['partialRootPaths'])
+            !isset($fluidConfiguration['partialRootPaths'])
+            || !is_array($fluidConfiguration['partialRootPaths'])
         ) {
             throw new RenderingException(
                 'The option partialRootPaths must be set.',
@@ -403,30 +408,18 @@ class FormEditorController extends AbstractBackendController
             );
         }
 
-        $layoutRootPaths = $formEditorTemplates['layoutRootPaths'];
-        $partialRootPaths = $formEditorTemplates['partialRootPaths'];
         $insertRenderablesPanelConfiguration = $this->getInsertRenderablesPanelConfiguration($formEditorDefinitions['formElements']);
 
-        unset($formEditorTemplates['layoutRootPaths']);
-        unset($formEditorTemplates['partialRootPaths']);
-
-        $renderedFormEditorTemplates = [];
-        foreach ($formEditorTemplates as $formEditorTemplateName => $formEditorTemplateTemplate) {
-            $fakeControllerItems = explode('-', $formEditorTemplateName);
-
-            $standaloneView = $this->objectManager->get(StandaloneView::class);
-            $standaloneView->getRenderingContext()->getTemplatePaths()->fillFromConfigurationArray([
-                'partialRootPaths' => $partialRootPaths,
-                'layoutRootPaths' => $layoutRootPaths
-            ]);
-            $standaloneView->assign('insertRenderablesPanelConfiguration', $insertRenderablesPanelConfiguration);
-            $standaloneView->getRenderingContext()->setControllerName($fakeControllerItems[0]);
-            $standaloneView->getRenderingContext()->setControllerAction($fakeControllerItems[1]);
-            $standaloneView->setTemplatePathAndFilename($formEditorTemplateTemplate);
-            $renderedFormEditorTemplates[$formEditorTemplateName] = $standaloneView->render();
-        }
+        $view = $this->objectManager->get(TemplateView::class);
+        $view->setControllerContext(clone $this->controllerContext);
+        $view->getRenderingContext()->getTemplatePaths()->fillFromConfigurationArray($fluidConfiguration);
+        $view->setTemplatePathAndFilename($fluidConfiguration['templatePathAndFilename']);
+        $view->assignMultiple([
+            'insertRenderablesPanelConfiguration' => $insertRenderablesPanelConfiguration,
+            'formEditorPartials' => $formEditorPartials,
+        ]);
 
-        return $renderedFormEditorTemplates;
+        return $view->render();
     }
 
     /**
index c2070b4..04d77d6 100644 (file)
@@ -20,7 +20,9 @@ use TYPO3\CMS\Extbase\Domain\Model\FileReference;
 use TYPO3\CMS\Fluid\View\StandaloneView;
 use TYPO3\CMS\Form\Domain\Finishers\Exception\FinisherException;
 use TYPO3\CMS\Form\Domain\Model\FormElements\FileUpload;
+use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
 use TYPO3\CMS\Form\Service\TranslationService;
+use TYPO3\CMS\Form\ViewHelpers\RenderRenderableViewHelper;
 
 /**
  * This finisher sends an email to one recipient
@@ -73,8 +75,7 @@ class EmailFinisher extends AbstractFinisher
     protected function executeInternal()
     {
         $formRuntime = $this->finisherContext->getFormRuntime();
-        $standaloneView = $this->initializeStandaloneView();
-        $standaloneView->assign('form', $formRuntime);
+        $standaloneView = $this->initializeStandaloneView($formRuntime);
 
         $translationService = TranslationService::getInstance();
         if (isset($this->options['translation']['language']) && !empty($this->options['translation']['language'])) {
@@ -153,10 +154,11 @@ class EmailFinisher extends AbstractFinisher
     }
 
     /**
+     * @param FormRuntime $formRuntime
      * @return StandaloneView
      * @throws FinisherException
      */
-    protected function initializeStandaloneView(): StandaloneView
+    protected function initializeStandaloneView(FormRuntime $formRuntime): StandaloneView
     {
         if (!isset($this->options['templatePathAndFilename'])) {
             throw new FinisherException('The option "templatePathAndFilename" must be set for the EmailFinisher.', 1327058829);
@@ -182,6 +184,12 @@ class EmailFinisher extends AbstractFinisher
         if (isset($this->options['variables'])) {
             $standaloneView->assignMultiple($this->options['variables']);
         }
+
+        $standaloneView->assign('form', $formRuntime);
+        $standaloneView->getRenderingContext()
+            ->getViewHelperVariableContainer()
+            ->addOrUpdate(RenderRenderableViewHelper::class, 'formRuntime', $formRuntime);
+
         return $standaloneView;
     }
 }
index d89eed0..2cb1034 100644 (file)
@@ -251,6 +251,13 @@ class FormDefinition extends AbstractCompositeRenderable
     protected $elementDefaultValues = [];
 
     /**
+     * Renderer class name to be used.
+     *
+     * @var string
+     */
+    protected $rendererClassName = null;
+
+    /**
      * @var array
      */
     protected $typeDefinitions;
@@ -399,10 +406,6 @@ class FormDefinition extends AbstractCompositeRenderable
             $page->setLabel($typeDefinition['label']);
         }
 
-        if (isset($typeDefinition['rendererClassName'])) {
-            $page->setRendererClassName($typeDefinition['rendererClassName']);
-        }
-
         if (isset($typeDefinition['renderingOptions'])) {
             foreach ($typeDefinition['renderingOptions'] as $key => $value) {
                 $page->setRenderingOption($key, $value);
@@ -411,7 +414,7 @@ class FormDefinition extends AbstractCompositeRenderable
 
         ArrayUtility::assertAllArrayKeysAreValid(
             $typeDefinition,
-            ['implementationClassName', 'label', 'rendererClassName', 'renderingOptions', 'formEditor']
+            ['implementationClassName', 'label', 'renderingOptions', 'formEditor']
         );
 
         $this->addPage($page);
@@ -702,4 +705,27 @@ class FormDefinition extends AbstractCompositeRenderable
     {
         return $this->persistenceIdentifier;
     }
+
+    /**
+     * Set the renderer class name
+     *
+     * @param string $rendererClassName
+     * @return void
+     * @api
+     */
+    public function setRendererClassName(string $rendererClassName)
+    {
+        $this->rendererClassName = $rendererClassName;
+    }
+
+    /**
+     * Get the classname of the renderer
+     *
+     * @return null|string
+     * @api
+     */
+    public function getRendererClassName()
+    {
+        return $this->rendererClassName;
+    }
 }
index 434e4b9..b00f276 100644 (file)
@@ -117,6 +117,12 @@ abstract class AbstractSection extends AbstractCompositeRenderable
         if (isset($typeDefinitions[$typeName])) {
             $typeDefinition = $typeDefinitions[$typeName];
         } else {
+            $renderingOptions = $formDefinition->getRenderingOptions();
+            $skipUnknownElements = isset($renderingOptions['skipUnknownElements']) && $renderingOptions['skipUnknownElements'] === true;
+            if (!$skipUnknownElements) {
+                throw new TypeDefinitionNotFoundException(sprintf('Type "%s" not found. Probably some configuration is missing.', $typeName), 1382364019);
+            }
+
             $element = GeneralUtility::makeInstance(ObjectManager::class)
                 ->get(UnknownFormElement::class, $identifier, $typeName);
             $this->addElement($element);
index 27a158a..ff29362 100644 (file)
@@ -19,7 +19,6 @@ namespace TYPO3\CMS\Form\Domain\Model\FormElements;
 
 use TYPO3\CMS\Form\Domain\Exception\IdentifierNotValidException;
 use TYPO3\CMS\Form\Domain\Model\Renderable\AbstractRenderable;
-use TYPO3\CMS\Form\Domain\Renderer\UnknownFormElementRenderer;
 use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
 
 /**
@@ -64,14 +63,14 @@ class UnknownFormElement extends AbstractRenderable implements FormElementInterf
     }
 
     /**
-     * Unknown Form Elements are rendered with the UnknownFormElementRenderer
+     * Get the template name of the renderable
      *
-     * @return string the renderer class name
-     * @internal
+     * @return string
+     * @api
      */
-    public function getRendererClassName(): string
+    public function getTemplateName(): string
     {
-        return UnknownFormElementRenderer::class;
+        return 'UnknownElement';
     }
 
     /**
index 178de7c..3e83248 100644 (file)
@@ -75,22 +75,18 @@ abstract class AbstractRenderable implements RenderableInterface
     protected $renderingOptions = [];
 
     /**
-     * Renderer class name to be used for this renderable.
-     *
-     * Is only set if a specific renderer should be used for this renderable,
-     * if it is NULL the caller needs to determine the renderer or take care
-     * of the rendering itself.
+     * The position of this renderable inside the parent renderable.
      *
-     * @var string
+     * @var int
      */
-    protected $rendererClassName = null;
+    protected $index = 0;
 
     /**
-     * The position of this renderable inside the parent renderable.
+     * The name of the template file of the renderable.
      *
-     * @var int
+     * @var string
      */
-    protected $index = 0;
+    protected $templateName = '';
 
     /**
      * Get the type of the renderable
@@ -139,10 +135,6 @@ abstract class AbstractRenderable implements RenderableInterface
             }
         }
 
-        if (isset($options['rendererClassName'])) {
-            $this->setRendererClassName($options['rendererClassName']);
-        }
-
         if (isset($options['renderingOptions'])) {
             foreach ($options['renderingOptions'] as $key => $value) {
                 if (is_array($value)) {
@@ -163,7 +155,7 @@ abstract class AbstractRenderable implements RenderableInterface
 
         ArrayUtility::assertAllArrayKeysAreValid(
             $options,
-            ['label', 'defaultValue', 'properties', 'rendererClassName', 'renderingOptions', 'validators', 'formEditor']
+            ['label', 'defaultValue', 'properties', 'renderingOptions', 'validators', 'formEditor']
         );
     }
 
@@ -233,26 +225,14 @@ abstract class AbstractRenderable implements RenderableInterface
     }
 
     /**
-     * Set the renderer class name
-     *
-     * @param string $rendererClassName
-     * @return void
-     * @api
-     */
-    public function setRendererClassName(string $rendererClassName)
-    {
-        $this->rendererClassName = $rendererClassName;
-    }
-
-    /**
      * Get the classname of the renderer
      *
-     * @return null|string
+     * @return string
      * @api
      */
-    public function getRendererClassName()
+    public function getRendererClassName(): string
     {
-        return $this->rendererClassName;
+        return $this->getRootForm()->getRendererClassName();
     }
 
     /**
@@ -402,6 +382,19 @@ abstract class AbstractRenderable implements RenderableInterface
     }
 
     /**
+     * Get the templateName name of the renderable
+     *
+     * @return string
+     * @api
+     */
+    public function getTemplateName(): string
+    {
+        return empty($this->renderingOptions['templateName'])
+            ? $this->type
+            : $this->renderingOptions['templateName'];
+    }
+
+    /**
      * Override this method in your custom Renderable if needed
      *
      * @param FormRuntime $formRuntime
index 041def4..1739817 100644 (file)
@@ -91,4 +91,12 @@ interface RenderableInterface extends RootRenderableInterface
      * @internal
      */
     public function registerInFormIfPossible();
+
+    /**
+     * Get the template name of the renderable
+     *
+     * @return string
+     * @api
+     */
+    public function getTemplateName(): string;
 }
index 69e2c86..6820c48 100644 (file)
@@ -66,13 +66,9 @@ interface RootRenderableInterface
     public function beforeRendering(FormRuntime $formRuntime);
 
     /**
-     * Get the renderer class name to be used to display this renderable;
+     * Get the renderer class name to be used to display this form;
      * must implement RendererInterface
      *
-     * Is only set if a specific renderer should be used for this renderable,
-     * if it is NULL the caller needs to determine the renderer or take care
-     * of the renderer itself.
-     *
      * @return null|string the renderer class name
      * @api
      */
index 2590f27..f8c2a10 100644 (file)
@@ -17,15 +17,102 @@ namespace TYPO3\CMS\Form\Domain\Renderer;
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
-use TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface;
-use TYPO3\CMS\Form\Mvc\View\FormView;
-use TYPO3\CMS\Form\Mvc\View\TemplatePaths;
+use TYPO3\CMS\Fluid\View\TemplateView;
+use TYPO3\CMS\Form\Domain\Exception\RenderingException;
+use TYPO3\CMS\Form\ViewHelpers\RenderRenderableViewHelper;
 
 /**
- * A renderer which render all renderables within the $formRuntime.
- * All the work is done within FormView::class.
- * This is just a proxy class to make the rendering process more clear.
- * See the documentation within FormView::class for additional information.
+ * A fluid RendererInterface implementation which used to render a *FormDefinition*.
+ *
+ * This renderer is called from {@link \TYPO3\CMS\Form\Domain\Runtime\FormRuntime::render()}.
+ *
+ * Options
+ * =======
+ *
+ * The FluidFormRenderer uses some rendering options which are of particular
+ * importance, as they determine how the form field is resolved to a path
+ * in the file system.
+ *
+ * All rendering options are retrieved from the FormDefinition,
+ * using the {@link \TYPO3\CMS\Form\Domain\Model\FormDefinition::getRenderingOptions()}
+ * method.
+ *
+ * templateRootPaths
+ * -----------------
+ *
+ * Used to define several paths for templates, which will be tried in reversed
+ * order (the paths are searched from bottom to top). The first folder where
+ * the desired layout is found, is used. If the array keys are numeric,
+ * they are first sorted and then tried in reversed order.
+ * Within this paths, fluid will search for a file which is named like the
+ * renderable *type*.
+ * For example:
+ *   templateRootPaths.10 = EXT:form/Resources/Private/Frontend/Templates/
+ *   $renderable->getType() = Form
+ *   Expected template file: EXT:form/Resources/Private/Frontend/Templates/Form.html
+ * There is a setting available to set a custom template name. Please read
+ * the section 'templateName'.
+ *
+ * Only the root renderable (FormDefinition) has to be a template file.
+ * All child renderables are partials. By default, the root renderable
+ * is called 'Form'.
+ *
+ * layoutRootPaths
+ * ---------------
+ *
+ * Used to define several paths for layouts, which will be tried in reversed
+ * order (the paths are searched from bottom to top). The first folder where
+ * the desired layout is found, is used. If the array keys are numeric,
+ * they are first sorted and then tried in reversed order.
+ *
+ * partialRootPaths
+ * ----------------
+ *
+ * Used to define several paths for partials, which will be tried in reversed
+ * order. The first folder where the desired partial is found, is used.
+ * The keys of the array define the order.
+ *
+ * Within this paths, fluid will search for a file which is named like the
+ * renderable *type*.
+ * For example:
+ *   templateRootPaths.10 = EXT:form/Resources/Private/Frontend/Partials/
+ *   $renderable->getType() = Text
+ *   Expected template file: EXT:form/Resources/Private/Frontend/Partials/Text.html
+ * There is a setting available to set a custom partial name. Please read
+ * the section 'templateName'.
+ *
+ * templateName
+ * -----------
+ * By default, the renderable type will be taken as the name for the
+ * template / partial.
+ * For example:
+ *   partialRootPaths.10 = EXT:form/Resources/Private/Frontend/Partials/
+ *   $renderable->getType() = Text
+ *   Expected partial file: EXT:form/Resources/Private/Frontend/Partials/Text.html
+ *
+ * Set 'templateName' to define a custom name which should be used instead.
+ * For example:
+ *   templateName = Foo
+ *   $renderable->getType() = Text
+ *   Expected partial file: EXT:form/Resources/Private/Frontend/Partials/Foo.html
+ *
+ * Rendering Child Renderables
+ * ===========================
+ *
+ * If a renderable wants to render child renderables, inside its template / partial,
+ * it can do that using the <code><formvh:renderRenderable></code> ViewHelper.
+ *
+ * A template example from Page shall demonstrate this:
+ *
+ * <pre>
+ *   <formvh:renderRenderable renderable="{page}">
+ *       <f:for each="{page.elements}" as="element">
+ *           <formvh:renderRenderable renderable="{element}">
+ *               <f:render partial="{element.templateName}" arguments="{element: element}" />
+ *           </formvh:renderRenderable>
+ *       </f:for>
+ *   </formvh:renderRenderable>
+ * </pre>
  *
  * Scope: frontend
  * **This class is NOT meant to be sub classed by developers.**
@@ -35,25 +122,59 @@ class FluidFormRenderer extends AbstractElementRenderer implements RendererInter
 {
 
     /**
-     * Initialize the FormView::class and render the this->formRuntime.
+     * Renders the FormDefinition.
+     *
      * This method is expected to invoke the beforeRendering() callback
-     * on each $renderable. This is done within FormView::class.
+     * on each renderable.
+     * This method invoke the beforeRendering() callback within the 'FormDefinition'.
+     * The callbacks for each other renderables will be triggered from the
+     * renderRenderable viewHelper.
+     * {@link \TYPO3\CMS\Form\ViewHelpers\RenderRenderableViewHelper::renderStatic()}
      *
-     * @param RootRenderableInterface $renderable
      * @return string the rendered $formRuntime
      * @internal
      */
-    public function render(RootRenderableInterface $renderable): string
+    public function render(): string
     {
-        $formView = GeneralUtility::makeInstance(ObjectManager::class)
-            ->get(FormView::class);
-
-        $formView->setFormRuntime($this->formRuntime);
-        $formView->setControllerContext($this->controllerContext);
-        $formView->getRenderingContext()->setTemplatePaths(
-            GeneralUtility::makeInstance(ObjectManager::class)
-                ->get(TemplatePaths::class)
-        );
-        return $formView->renderRenderable($renderable);
+        $formElementType = $this->formRuntime->getType();
+        $renderingOptions = $this->formRuntime->getRenderingOptions();
+
+        $view = GeneralUtility::makeInstance(ObjectManager::class)
+            ->get(TemplateView::class);
+        $view->setControllerContext($this->controllerContext);
+
+        if (!isset($renderingOptions['templateRootPaths'])) {
+            throw new RenderingException(
+                sprintf('The option templateRootPaths must be set for renderable "%s"', $formElementType),
+                1480293084
+            );
+        }
+        if (!isset($renderingOptions['layoutRootPaths'])) {
+            throw new RenderingException(
+                sprintf('The option layoutRootPaths must be set for renderable "%s"', $formElementType),
+                1480293085
+            );
+        }
+        if (!isset($renderingOptions['partialRootPaths'])) {
+            throw new RenderingException(
+                sprintf('The option partialRootPaths must be set for renderable "%s"', $formElementType),
+                1480293086
+            );
+        }
+
+        $view->assign('form', $this->formRuntime);
+
+        $view->getRenderingContext()
+            ->getViewHelperVariableContainer()
+            ->addOrUpdate(RenderRenderableViewHelper::class, 'formRuntime', $this->formRuntime);
+
+        // Configure the fluid TemplatePaths with the rendering options
+        // from the renderable
+        $view->getTemplatePaths()->fillFromConfigurationArray($renderingOptions);
+
+        // Invoke the beforeRendering callback on the renderable
+        $this->formRuntime->getFormDefinition()->beforeRendering($this->formRuntime);
+
+        return $view->render($this->formRuntime->getTemplateName());
     }
 }
index 28207fd..142b75f 100644 (file)
@@ -18,11 +18,10 @@ namespace TYPO3\CMS\Form\Domain\Renderer;
  */
 
 use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext;
-use TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface;
 use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
 
 /**
- * Base interface for Renderers. A Renderer is used to render a renderable.
+ * Base interface for Renderers. A Renderer is used to render a form.
  *
  * Scope: frontend
  * **This interface is meant to be implemented by developers, although often you
@@ -43,11 +42,10 @@ interface RendererInterface
      * Note: This method is expected to invoke the beforeRendering() callback
      * on each $renderable
      *
-     * @param RootRenderableInterface $renderable
      * @return string the rendered $formRuntime
      * @api
      */
-    public function render(RootRenderableInterface $renderable): string;
+    public function render(): string;
 
     /**
      * @param FormRuntime $formRuntime
diff --git a/typo3/sysext/form/Classes/Domain/Renderer/UnknownFormElementRenderer.php b/typo3/sysext/form/Classes/Domain/Renderer/UnknownFormElementRenderer.php
deleted file mode 100644 (file)
index 817d8dc..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-declare(strict_types=1);
-namespace TYPO3\CMS\Form\Domain\Renderer;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It originated from the Neos.Form package (www.neos.io)
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Form\Domain\Exception\TypeDefinitionNotFoundException;
-use TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface;
-
-/**
- * Renderer for unknown Form Elements
- * This is used to render Form Elements without definition depending on the context:
- * In "preview mode" (e.g. inside the FormEditor) a div with an error message is rendered
- * If previewMode is FALSE this will return an empty string if the rendering Option "skipUnknownElements" is TRUE for
- * the form, or throw an Exception otherwise.
- *
- * Scope: frontend
- */
-class UnknownFormElementRenderer extends AbstractElementRenderer
-{
-
-    /**
-     * This renders the given $renderable depending on the context:
-     * In preview Mode this returns an error message. Otherwise this throws an exception or returns an empty string
-     * depending on the "skipUnknownElements" rendering option
-     *
-     * @param RootRenderableInterface $renderable
-     * @return string the rendered $renderable
-     * @throws TypeDefinitionNotFoundException
-     * @internal
-     */
-    public function render(RootRenderableInterface $renderable): string
-    {
-        $renderingOptions = $this->formRuntime->getRenderingOptions();
-        $previewMode = isset($renderingOptions['previewMode']) && $renderingOptions['previewMode'] === true;
-        if ($previewMode) {
-            return sprintf('<div class="t3-form-unknown-element" data-element-identifier-path="%s"><em>Unknown Form Element "%s"</em></div>', htmlspecialchars($this->getRenderablePath($renderable)), htmlspecialchars($renderable->getType()));
-        }
-        $skipUnknownElements = isset($renderingOptions['skipUnknownElements']) && $renderingOptions['skipUnknownElements'] === true;
-        if (!$skipUnknownElements) {
-            throw new TypeDefinitionNotFoundException(sprintf('Type "%s" not found. Probably some configuration is missing.', $renderable->getType()), 1382364019);
-        }
-        return '';
-    }
-
-    /**
-     * Returns the path of a $renderable in the format <formIdentifier>/<sectionIdentifier>/<sectionIdentifier>/.../<elementIdentifier>
-     *
-     * @param RootRenderableInterface $renderable
-     * @return string
-     * @internal
-     */
-    protected function getRenderablePath(RootRenderableInterface $renderable): string
-    {
-        $path = $renderable->getIdentifier();
-        while ($renderable = $renderable->getParentRenderable()) {
-            $path = $renderable->getIdentifier() . '/' . $path;
-        }
-        return $path;
-    }
-}
index 18e0a2b..fa40a27 100644 (file)
@@ -69,7 +69,7 @@ use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
  *
  * The FormRuntime asks the FormDefinition about the configured Renderer
  * which should be used ({@link \TYPO3\CMS\Form\Domain\Model\FormDefinition::getRendererClassName}),
- * and then trigger render() on this element.
+ * and then trigger render() on this Renderer.
  *
  * This makes it possible to declaratively define how a form should be rendered.
  *
@@ -754,6 +754,17 @@ class FormRuntime implements RootRenderableInterface, \ArrayAccess
     }
 
     /**
+     * Get the template name of the renderable
+     *
+     * @return string
+     * @api
+     */
+    public function getTemplateName(): string
+    {
+        return $this->formDefinition->getTemplateName();
+    }
+
+    /**
      * Get the underlying form definition from the runtime
      *
      * @return FormDefinition
diff --git a/typo3/sysext/form/Classes/Mvc/View/FormView.php b/typo3/sysext/form/Classes/Mvc/View/FormView.php
deleted file mode 100644 (file)
index 7879975..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-<?php
-declare(strict_types=1);
-namespace TYPO3\CMS\Form\Mvc\View;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Extbase\Object\ObjectManager;
-use TYPO3\CMS\Fluid\View\AbstractTemplateView;
-use TYPO3\CMS\Form\Domain\Exception\RenderingException;
-use TYPO3\CMS\Form\Domain\Model\Renderable\RenderableInterface;
-use TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface;
-use TYPO3\CMS\Form\Domain\Renderer\RendererInterface;
-use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
-use TYPO3Fluid\Fluid\Core\Parser\ParsedTemplateInterface;
-
-/**
- * A fluid TemplateView implementation which used to render *Renderables*.
- *
- * The FormView is especially capable of rendering nested renderables
- * as well, i.e a form with a page, with all FormElements.
- *
- * Options
- * =======
- *
- * The FormView uses some rendering options which are of particular
- * importance, as they determine how the form field is resolved to a path
- * in the file system.
- *
- * All rendering options are retrieved from the renderable which shall be rendered,
- * using the {@link \TYPO3\CMS\Form\Domain\Model\Renderable\RenderableInterface::getRenderingOptions()}
- * method.
- *
- * templateRootPaths
- * -----------------
- *
- * Used to define several paths for templates, which will be tried in reversed
- * order (the paths are searched from bottom to top). The first folder where
- * the desired layout is found, is used. If the array keys are numeric,
- * they are first sorted and then tried in reversed order.
- *
- * layoutRootPaths
- * ---------------
- *
- * Used to define several paths for layouts, which will be tried in reversed
- * order (the paths are searched from bottom to top). The first folder where
- * the desired layout is found, is used. If the array keys are numeric,
- * they are first sorted and then tried in reversed order.
- *
- * partialRootPaths
- * ----------------
- *
- * Used to define several paths for partials, which will be tried in reversed
- * order. The first folder where the desired partial is found, is used.
- * The keys of the array define the order.
- *
- * renderableNameInTemplate
- * ------------------------
- *
- * This is a mostly-internal setting which controls the name under which the current
- * renderable is made available inside the template. For example, it controls that
- * inside the template of a "Page", the Page object is available using the variable
- * *page*.
- *
- * Rendering Child Renderables
- * ===========================
- *
- * If a renderable wants to render child renderables, inside its template,
- * it can do that using the <code><formvh:renderRenderable></code> ViewHelper.
- *
- * A template example from Page shall demonstrate this:
- *
- * <pre>
- * {namespace formvh=TYPO3\CMS\Form\ViewHelpers}
- * <f:for each="{page.elements}" as="element">
- *   <formvh:renderRenderable renderable="{element}" />
- * </f:for>
- * </pre>
- *
- * Rendering PHP Based Child Renderables
- * =====================================
- *
- * If a child renderable has a *rendererClassName* set (i.e. {@link \TYPO3\CMS\Form\Domain\Model\FormElements\FormElementInterface::getRendererClassName()}
- * returns a non-NULL string), this renderer is automatically instanciated
- * and the rendering for this element is delegated to this Renderer.
- *
- * Scope: frontend
- * **This class is NOT meant to be sub classed by developers.**
- * @internal
- */
-class FormView extends AbstractTemplateView
-{
-
-    /**
-     * @var \TYPO3\CMS\Form\Domain\Runtime\FormRuntime
-     */
-    protected $formRuntime;
-
-    /**
-     * @param FormRuntime $formRuntime
-     * @return void
-     * @internal
-     */
-    public function setFormRuntime(FormRuntime $formRuntime)
-    {
-        $this->formRuntime = $formRuntime;
-    }
-
-    /**
-     * @return FormRuntime
-     * @internal
-     */
-    public function getFormRuntime(): FormRuntime
-    {
-        return $this->formRuntime;
-    }
-
-    /**
-     * Render the $renderable and return the content.
-     *
-     * @param RootRenderableInterface $renderable
-     * @return string
-     * @throws RenderingException
-     * @internal
-     */
-    public function renderRenderable(RootRenderableInterface $renderable): string
-    {
-        // Invoke the beforeRendering callback on the renderable
-        $renderable->beforeRendering($this->formRuntime);
-
-        if (
-            $renderable->getRendererClassName() !== null
-            && $renderable->getRendererClassName() !== $this->formRuntime->getRendererClassName()
-        ) {
-            // If a child renderable has a *rendererClassName* set
-            // then render it with this foreign renderer.
-            $rendererClassName = $renderable->getRendererClassName();
-            $renderer = GeneralUtility::makeInstance(ObjectManager::class)->get($rendererClassName);
-            if (!($renderer instanceof RendererInterface)) {
-                throw new RenderingException(
-                    sprintf('The renderer class "%s" for "%s" does not implement RendererInterface.', $rendererClassName, $renderable->getType()),
-                    1480286138
-                );
-            }
-            $renderer->setControllerContext($this->controllerContext);
-            $renderer->setFormRuntime($this->formRuntime);
-            return $renderer->render($renderable);
-        }
-
-        $renderingOptions = $renderable->getRenderingOptions();
-
-        if (!isset($renderingOptions['templateRootPaths'])) {
-            throw new RenderingException(
-                sprintf('The option templateRootPaths must be set for renderable "%s"', $renderable->getType()),
-                1480293084
-            );
-        }
-        if (!isset($renderingOptions['layoutRootPaths'])) {
-            throw new RenderingException(
-                sprintf('The option layoutRootPaths must be set for renderable "%s"', $renderable->getType()),
-                1480293085
-            );
-        }
-        if (!isset($renderingOptions['partialRootPaths'])) {
-            throw new RenderingException(
-                sprintf('The option partialRootPaths must be set for renderable "%s"', $renderable->getType()),
-                1480293086
-            );
-        }
-        if (!isset($renderingOptions['renderableNameInTemplate'])) {
-            throw new RenderingException(
-                sprintf('The option renderableNameInTemplate must be set for renderable "%s"', $renderable->getType()),
-                1480293087
-            );
-        }
-
-        // Configure the fluid TemplatePaths with the rendering options
-        // from the renderable
-        $this->getTemplatePaths()->fillFromConfigurationArray([
-            'templateRootPaths' => $renderingOptions['templateRootPaths'],
-            'partialRootPaths' => $renderingOptions['partialRootPaths'],
-            'layoutRootPaths' => $renderingOptions['layoutRootPaths'],
-        ]);
-
-        // Add the renderable object to the template variables and use the
-        // configured variable name
-        $this->assign($renderingOptions['renderableNameInTemplate'], $renderable);
-
-        // Render the renderable.
-        if (isset($renderingOptions['templatePathAndFilename'])) {
-            $this->getTemplatePaths()->setTemplatePathAndFilename($renderingOptions['templatePathAndFilename']);
-            $output = $this->render();
-        } else {
-            // reset previously seted templatePathAndFilename
-            $this->getTemplatePaths()->clearTemplatePathAndFilename();
-            // Use the *type* of the renderable as template name
-            $output = $this->render($renderable->getType());
-        }
-
-        return $this->renderPreviewMode($output, $renderable);
-    }
-
-    /**
-     * Wrap every renderable with a span with a identifier path data attribute.
-     *
-     * @param string $output
-     * @param RootRenderableInterface $renderable
-     * @return string
-     * @internal
-     */
-    protected function renderPreviewMode(string $output, RootRenderableInterface $renderable): string
-    {
-        $renderingOptions = $this->formRuntime->getRenderingOptions();
-        $previewMode = isset($renderingOptions['previewMode']) && $renderingOptions['previewMode'] === true;
-        if ($previewMode) {
-            $path = $renderable->getIdentifier();
-            if ($renderable instanceof RenderableInterface) {
-                while ($renderable = $renderable->getParentRenderable()) {
-                    $path = $renderable->getIdentifier() . '/' . $path;
-                }
-            }
-            $output = sprintf('<span data-element-identifier-path="%s">%s</span>', $path, $output);
-        }
-        return $output;
-    }
-
-    /**
-     * Get the parsed template which is currently being rendered or compiled.
-     *
-     * @return ParsedTemplateInterface
-     */
-    protected function getCurrentParsedTemplate(): ParsedTemplateInterface
-    {
-        $renderingContext = $this->getCurrentRenderingContext();
-        $templatePaths = $renderingContext->getTemplatePaths();
-        $templateParser = $renderingContext->getTemplateParser();
-        $controllerName = $renderingContext->getControllerName();
-        $actionName = $renderingContext->getControllerAction();
-        $parsedTemplate = $templateParser->getOrParseAndStoreTemplate(
-            $templatePaths->getTemplateIdentifier($controllerName, $actionName),
-            function ($parent, TemplatePaths $paths) use ($controllerName, $actionName) {
-                return $paths->getTemplateSource($controllerName, $actionName);
-            }
-        );
-        if ($parsedTemplate->isCompiled()) {
-            $parsedTemplate->addCompiledNamespaces($this->baseRenderingContext);
-        }
-        $renderingContext->getTemplateCompiler()->reset();
-        return $parsedTemplate;
-    }
-}
diff --git a/typo3/sysext/form/Classes/Mvc/View/TemplatePaths.php b/typo3/sysext/form/Classes/Mvc/View/TemplatePaths.php
deleted file mode 100644 (file)
index 7d6c1ab..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-declare(strict_types=1);
-namespace TYPO3\CMS\Form\Mvc\View;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Fluid\View\TemplatePaths as FluidTemplatePaths;
-
-/**
- * Extend fluids TemplatePaths
- *
- * Scope: frontend
- * **This class is NOT meant to be sub classed by developers.**
- * @internal
- */
-class TemplatePaths extends FluidTemplatePaths
-{
-
-    /**
-     * Reset the templatePathAndFilename property to NULL.
-     * $this->setTemplatePathAndFilename(null) don't work
-     * because there is a (string) cast in setTemplatePathAndFilename
-     * and this results in "$this->templatePathAndFilename = '';"
-     *
-     * @param string $templatePathAndFilename
-     * @return void
-     */
-    public function clearTemplatePathAndFilename()
-    {
-        $this->templatePathAndFilename = null;
-    }
-}
index 307125b..ad27cde 100644 (file)
@@ -106,9 +106,9 @@ class DatePickerViewHelper extends AbstractFormFieldViewHelper
 
         if ($enableDatePicker) {
             $datePickerDateFormat = $this->convertDateFormatToDatePickerFormat($dateFormat);
-            $this->templateVariableContainer->add('datePickerDateFormat', $datePickerDateFormat);
+            $this->renderingContext->getVariableProvider()->add('datePickerDateFormat', $datePickerDateFormat);
             $content .= $this->renderChildren();
-            $this->templateVariableContainer->remove('datePickerDateFormat');
+            $this->renderingContext->getVariableProvider()->remove('datePickerDateFormat');
         }
         return $content;
     }
@@ -118,8 +118,11 @@ class DatePickerViewHelper extends AbstractFormFieldViewHelper
      */
     protected function getSelectedDate()
     {
-        $fluidFormRenderer = $this->viewHelperVariableContainer->getView();
-        $formRuntime = $fluidFormRenderer->getFormRuntime();
+        /** @var FormRuntime $formRuntime */
+        $formRuntime =  $this->renderingContext
+            ->getViewHelperVariableContainer()
+            ->get(RenderRenderableViewHelper::class, 'formRuntime');
+
         $formState = $formRuntime->getFormState();
 
         $date = $formRuntime[$this->arguments['property']];
index a63cd50..558afa9 100644 (file)
@@ -19,6 +19,7 @@ namespace TYPO3\CMS\Form\ViewHelpers\Form;
 
 use TYPO3\CMS\Extbase\Property\PropertyMapper;
 use TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper;
+use TYPO3\CMS\Form\ViewHelpers\RenderRenderableViewHelper;
 
 /**
  * Displays two select-boxes for hour and minute selection.
@@ -88,12 +89,14 @@ class TimePickerViewHelper extends AbstractFormFieldViewHelper
     }
 
     /**
-     * @return \DateTime
+     * @return null|\DateTime
      */
-    protected function getSelectedDate(): \DateTime
+    protected function getSelectedDate()
     {
-        $fluidFormRenderer = $this->viewHelperVariableContainer->getView();
-        $formRuntime = $fluidFormRenderer->getFormRuntime();
+        /** @var FormRuntime $formRuntime */
+        $formRuntime =  $this->renderingContext
+            ->getViewHelperVariableContainer()
+            ->get(RenderRenderableViewHelper::class, 'formRuntime');
 
         $date = $formRuntime[$this->arguments['property']];
         if ($date instanceof \DateTime) {
@@ -122,7 +125,7 @@ class TimePickerViewHelper extends AbstractFormFieldViewHelper
         $hourSelector->addAttribute('name', sprintf('%s[hour]', $this->getName()));
         $options = '';
         foreach (range(0, 23) as $hour) {
-            $hour = str_pad($hour, 2, '0', STR_PAD_LEFT);
+            $hour = str_pad((string)$hour, 2, '0', STR_PAD_LEFT);
             $selected = $hour === $value ? ' selected="selected"' : '';
             $options .= '<option value="' . $hour . '"' . $selected . '>' . $hour . '</option>';
         }
@@ -144,7 +147,7 @@ class TimePickerViewHelper extends AbstractFormFieldViewHelper
         $minuteSelector->addAttribute('name', sprintf('%s[minute]', $this->getName()));
         $options = '';
         foreach (range(0, 59) as $minute) {
-            $minute = str_pad($minute, 2, '0', STR_PAD_LEFT);
+            $minute = str_pad((string)$minute, 2, '0', STR_PAD_LEFT);
             $selected = $minute === $value ? ' selected="selected"' : '';
             $options .= '<option value="' . $minute . '"' . $selected . '>' . $minute . '</option>';
         }
index cb8cc7b..7db7d69 100644 (file)
@@ -57,8 +57,6 @@ class FormViewHelper extends FluidFormViewHelper
      */
     protected function getFormObjectName()
     {
-        $fluidFormRenderer = $this->viewHelperVariableContainer->getView();
-        $formRuntime = $fluidFormRenderer->getFormRuntime();
-        return $formRuntime->getFormDefinition()->getIdentifier();
+        return $this->arguments['object']->getFormDefinition()->getIdentifier();
     }
 }
index 0b8e0f4..30d9d73 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Form\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
 
@@ -39,7 +38,6 @@ class PlainTextMailViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractV
     {
         parent::initializeArguments();
         $this->registerArgument('formValue', 'array', 'The values from a form element', true);
-        $this->registerArgument('formRuntime', FormRuntime::class, 'A FormRuntime instance', true);
     }
 
     /**
@@ -52,11 +50,10 @@ class PlainTextMailViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractV
     public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
     {
         $formValue = $arguments['formValue'];
-        $formRuntime = $arguments['formRuntime'];
 
         $label = $formValue['element']->getLabel();
         $label = TranslateElementPropertyViewHelper::renderStatic(
-            ['element' => $formValue['element'], 'property' => 'label', 'formRuntime' => $formRuntime],
+            ['element' => $formValue['element'], 'property' => 'label'],
             $renderChildrenClosure,
             $renderingContext
         );
index b68b9f0..248d773 100644 (file)
@@ -23,8 +23,9 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3\CMS\Form\Domain\Model\FormElements\FormElementInterface;
 use TYPO3\CMS\Form\Domain\Model\Renderable\CompositeRenderableInterface;
 use TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface;
-use TYPO3\CMS\Form\Domain\Renderer\RendererInterface;
 use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
+use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
+use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
 
 /**
  * Renders the values of a form
@@ -34,6 +35,7 @@ use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
  */
 class RenderAllFormValuesViewHelper extends AbstractViewHelper
 {
+    use CompileWithRenderStatic;
 
     /**
      * @var bool
@@ -51,18 +53,21 @@ class RenderAllFormValuesViewHelper extends AbstractViewHelper
         parent::initializeArguments();
         $this->registerArgument('renderable', RootRenderableInterface::class, 'A RootRenderableInterface instance', true);
         $this->registerArgument('as', 'string', 'The name within the template', false, 'formValue');
-        $this->registerArgument('formRuntime', FormRuntime::class, 'A FormRuntime instance', false, null);
     }
 
     /**
+     * Return array element by key.
+     *
+     * @param array $arguments
+     * @param \Closure $renderChildrenClosure
+     * @param RenderingContextInterface $renderingContext
      * @return string the rendered form values
      * @api
      */
-    public function render()
+    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
     {
-        $renderable = $this->arguments['renderable'];
-        $as = $this->arguments['as'];
-        $formRuntime = $this->arguments['formRuntime'];
+        $renderable = $arguments['renderable'];
+        $as = $arguments['as'];
 
         if ($renderable instanceof CompositeRenderableInterface) {
             $elements = $renderable->getRenderablesRecursively();
@@ -70,11 +75,9 @@ class RenderAllFormValuesViewHelper extends AbstractViewHelper
             $elements = [$renderable];
         }
 
-        if ($formRuntime === null) {
-            /** @var RendererInterface $fluidFormRenderer */
-            $fluidFormRenderer = $this->viewHelperVariableContainer->getView();
-            $formRuntime = $fluidFormRenderer->getFormRuntime();
-        }
+        $formRuntime =  $renderingContext
+            ->getViewHelperVariableContainer()
+            ->get(RenderRenderableViewHelper::class, 'formRuntime');
 
         $output = '';
         foreach ($elements as $element) {
@@ -86,12 +89,12 @@ class RenderAllFormValuesViewHelper extends AbstractViewHelper
             $formValue = [
                 'element' => $element,
                 'value' => $value,
-                'processedValue' => $this->processElementValue($element, $value, $formRuntime),
+                'processedValue' => self::processElementValue($element, $value, $renderChildrenClosure, $renderingContext),
                 'isMultiValue' => is_array($value) || $value instanceof \Iterator
             ];
-            $this->templateVariableContainer->add($as, $formValue);
-            $output .= $this->renderChildren();
-            $this->templateVariableContainer->remove($as);
+            $renderingContext->getTemplateVariableContainer()->add($as, $formValue);
+            $output .= $renderChildrenClosure();
+            $renderingContext->getTemplateVariableContainer()->remove($as);
         }
         return $output;
     }
@@ -101,26 +104,31 @@ class RenderAllFormValuesViewHelper extends AbstractViewHelper
      *
      * @param FormElementInterface $element
      * @param mixed $value
-     * @param FormRuntime $formRuntime
+     * @param \Closure $renderChildrenClosure
+     * @param RenderingContextInterface $renderingContext
      * @return mixed
      */
-    protected function processElementValue(FormElementInterface $element, $value, FormRuntime $formRuntime)
-    {
+    public static function processElementValue(
+        FormElementInterface $element,
+        $value,
+        \Closure $renderChildrenClosure,
+        RenderingContextInterface $renderingContext
+    ) {
         $properties = $element->getProperties();
         if (isset($properties['options']) && is_array($properties['options'])) {
             $properties['options'] = TranslateElementPropertyViewHelper::renderStatic(
-                ['element' => $element, 'property' => 'options', 'formRuntime' => $formRuntime],
-                $this->buildRenderChildrenClosure(),
-                $this->renderingContext
+                ['element' => $element, 'property' => 'options'],
+                $renderChildrenClosure,
+                $renderingContext
             );
             if (is_array($value)) {
-                return $this->mapValuesToOptions($value, $properties['options']);
+                return self::mapValuesToOptions($value, $properties['options']);
             } else {
-                return $this->mapValueToOption($value, $properties['options']);
+                return self::mapValueToOption($value, $properties['options']);
             }
         }
         if (is_object($value)) {
-            return $this->processObject($element, $value);
+            return self::processObject($element, $value);
         }
         return $value;
     }
@@ -133,11 +141,11 @@ class RenderAllFormValuesViewHelper extends AbstractViewHelper
      * @param array $options
      * @return array
      */
-    protected function mapValuesToOptions(array $value, array $options): array
+    public static function mapValuesToOptions(array $value, array $options): array
     {
         $result = [];
         foreach ($value as $key) {
-            $result[] = $this->mapValueToOption($key, $options);
+            $result[] = self::mapValueToOption($key, $options);
         }
         return $result;
     }
@@ -150,7 +158,7 @@ class RenderAllFormValuesViewHelper extends AbstractViewHelper
      * @param array $options
      * @return mixed
      */
-    protected function mapValueToOption($value, array $options)
+    public static function mapValueToOption($value, array $options)
     {
         return isset($options[$value]) ? $options[$value] : $value;
     }
@@ -162,7 +170,7 @@ class RenderAllFormValuesViewHelper extends AbstractViewHelper
      * @param object $object
      * @return string
      */
-    protected function processObject(FormElementInterface $element, $object): string
+    public static function processObject(FormElementInterface $element, $object): string
     {
         $properties = $element->getProperties();
         if ($object instanceof \DateTime) {
index af69228..080afa6 100644 (file)
@@ -19,6 +19,8 @@ namespace TYPO3\CMS\Form\ViewHelpers;
 
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3\CMS\Form\Domain\Model\Renderable\RenderableInterface;
+use TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface;
+use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
 
@@ -49,7 +51,7 @@ class RenderRenderableViewHelper extends AbstractViewHelper
     public function initializeArguments()
     {
         parent::initializeArguments();
-        $this->registerArgument('renderable', RenderableInterface::class, 'A RenderableInterface instance', true);
+        $this->registerArgument('renderable', RootRenderableInterface::class, 'A RenderableInterface instance', true);
     }
 
     /**
@@ -61,8 +63,49 @@ class RenderRenderableViewHelper extends AbstractViewHelper
      */
     public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
     {
-        /** @var \TYPO3\CMS\Form\Mvc\View\FormView $view */
-        $view = $renderingContext->getViewHelperVariableContainer()->getView();
-        return $view->renderRenderable($arguments['renderable']);
+        /** @var FormRuntime $formRuntime */
+        $formRuntime =  $renderingContext
+            ->getViewHelperVariableContainer()
+            ->get(self::class, 'formRuntime');
+
+        // Invoke the beforeRendering callback on the renderable
+        $arguments['renderable']->beforeRendering($formRuntime);
+
+        $renderable = $arguments['renderable'];
+        $content = $renderChildrenClosure();
+        if (!empty($content)) {
+            $content = static::renderPreviewMode($content, $renderable, $renderingContext, $formRuntime);
+        }
+        return $content;
+    }
+
+    /**
+     * Wrap every renderable with a span with a identifier path data attribute.
+     *
+     * @param string $content
+     * @param RootRenderableInterface $renderable
+     * @param RenderingContextInterface $renderingContext
+     * @param FormRuntime $formRuntime
+     * @return string
+     * @internal
+     */
+    public static function renderPreviewMode(
+        string $content,
+        RootRenderableInterface $renderable,
+        RenderingContextInterface $renderingContext,
+        FormRuntime $formRuntime
+    ): string {
+        $renderingOptions = $formRuntime->getRenderingOptions();
+        $previewMode = isset($renderingOptions['previewMode']) && $renderingOptions['previewMode'] === true;
+        if ($previewMode) {
+            $path = $renderable->getIdentifier();
+            if ($renderable instanceof RenderableInterface) {
+                while ($renderable = $renderable->getParentRenderable()) {
+                    $path = $renderable->getIdentifier() . '/' . $path;
+                }
+            }
+            $content = sprintf('<span data-element-identifier-path="%s">%s</span>', $path, $content);
+        }
+        return $content;
     }
 }
index 5abb18b..a263e05 100644 (file)
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Form\ViewHelpers;
 
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface;
-use TYPO3\CMS\Form\Domain\Renderer\RendererInterface;
 use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
 use TYPO3\CMS\Form\Service\TranslationService;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
@@ -45,7 +44,6 @@ class TranslateElementPropertyViewHelper extends AbstractViewHelper
         $this->registerArgument('element', RootRenderableInterface::class, 'Form Element to translate', true);
         $this->registerArgument('property', 'string', 'Property to translate', false);
         $this->registerArgument('renderingOptionProperty', 'string', 'Property to translate', false);
-        $this->registerArgument('formRuntime', FormRuntime::class, 'The form runtime', false);
     }
 
     /**
@@ -60,7 +58,6 @@ class TranslateElementPropertyViewHelper extends AbstractViewHelper
     public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
     {
         $element = $arguments['element'];
-        $formRuntime = $arguments['formRuntime'];
 
         $property = null;
         if (!empty($arguments['property'])) {
@@ -69,11 +66,10 @@ class TranslateElementPropertyViewHelper extends AbstractViewHelper
             $property = $arguments['renderingOptionProperty'];
         }
 
-        if ($formRuntime === null) {
-            /** @var RendererInterface $fluidFormRenderer */
-            $fluidFormRenderer = $renderingContext->getViewHelperVariableContainer()->getView();
-            $formRuntime = $fluidFormRenderer->getFormRuntime();
-        }
+        /** @var FormRuntime $formRuntime */
+        $formRuntime =  $renderingContext
+            ->getViewHelperVariableContainer()
+            ->get(RenderRenderableViewHelper::class, 'formRuntime');
 
         return TranslationService::getInstance()->translateFormElementValue($element, $property, $formRuntime);
     }
index 9a06c9b..252b6b9 100644 (file)
@@ -21,19 +21,26 @@ TYPO3:
                 10: 'TYPO3.CMS.Form.mixins.formElementMixins.BaseFormElementMixin'
               rendererClassName: 'TYPO3\CMS\Form\Domain\Renderer\FluidFormRenderer'
               renderingOptions:
-                renderableNameInTemplate: 'form'
+                templateRootPaths:
+                  10: 'EXT:form/Resources/Private/Frontend/Templates/'
+                partialRootPaths:
+                  10: 'EXT:form/Resources/Private/Frontend/Partials/'
+                layoutRootPaths:
+                  10: 'EXT:form/Resources/Private/Frontend/Layouts/'
+
                 honeypot:
                   enable: true
                   formElementToUse: 'Honeypot'
 
+                # set this to TRUE if you want to avoid exceptions for FormElements without definitions
+                skipUnknownElements: true
+
             ### FORM ELEMENTS: CONTAINER ###
             Page:
               __inheritances:
                 10: 'TYPO3.CMS.Form.mixins.formElementMixins.BaseFormElementMixin'
               implementationClassName: 'TYPO3\CMS\Form\Domain\Model\FormElements\Page'
-              renderingOptions:
-                renderableNameInTemplate: 'page'
-
             SummaryPage:
               __inheritances:
                 10: 'TYPO3.CMS.Form.prototypes.standard.formElementsDefinition.Page'
@@ -42,8 +49,6 @@ TYPO3:
               __inheritances:
                 10: 'TYPO3.CMS.Form.mixins.formElementMixins.FormElementMixin'
               implementationClassName: 'TYPO3\CMS\Form\Domain\Model\FormElements\Section'
-              renderingOptions:
-                renderableNameInTemplate: 'section'
 
             ### FORM ELEMENTS: INPUT ###
             Text:
@@ -265,26 +270,14 @@ TYPO3:
               __inheritances:
                 10: 'TYPO3.CMS.Form.mixins.translationSettingsMixin'
 
-              templateRootPaths:
-                10: 'EXT:form/Resources/Private/Frontend/Templates/FormElements/'
-              partialRootPaths:
-                10: 'EXT:form/Resources/Private/Frontend/Partials/FormElements/'
-              layoutRootPaths:
-                10: 'EXT:form/Resources/Private/Frontend/Layouts/FormElements/'
-
-              # It is possible to set a full path to a template e.g. for custom elements
-              # In this case 'templateRootPaths' will be ignored
-              # templatePathAndFilename: 'EXT:form/Resources/Private/Frontend/Templates/FormElements/RadioButton.html'
-
-              # set this to TRUE if you want to avoid exceptions for FormElements without definitions
-              skipUnknownElements: true
+              # The form element type is chosen as the template name by default.
+              # If you want another name you can set it with 'templateName'
+              #templateName: 'CustomTemplateName'
 
           ReadOnlyFormElementMixin:
             __inheritances:
               10: 'TYPO3.CMS.Form.mixins.formElementMixins.BaseFormElementMixin'
             implementationClassName: 'TYPO3\CMS\Form\Domain\Model\FormElements\GenericFormElement'
-            renderingOptions:
-              renderableNameInTemplate: 'element'
 
           FormElementMixin:
             __inheritances:
@@ -294,8 +287,6 @@ TYPO3:
               containerClassAttribute: 'input'
               elementClassAttribute: ''
               elementErrorClassAttribute: 'error'
-            renderingOptions:
-              renderableNameInTemplate: 'element'
 
           TextMixin:
             __inheritances:
index 57b08c0..a9313bf 100644 (file)
@@ -44,50 +44,54 @@ TYPO3:
               # @toDo: move form.less to the TYPO3 Build folder
               200: 'EXT:form/Resources/Public/Css/form.css'
 
-            formEditorTemplates:
+            formEditorFluidConfiguration:
+              templatePathAndFilename: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/InlineTemplates.html'
               partialRootPaths:
                 10: 'EXT:form/Resources/Private/Backend/Partials/FormEditor/'
               layoutRootPaths:
                 10: 'EXT:form/Resources/Private/Backend/Layouts/FormEditor/'
 
-              # Element options editors
-              FormElement-_ElementToolbar: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/_ElementToolbar.html'
-              FormElement-_UnknownElement: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/_UnknownElement.html'
-              FormElement-Page: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/Page.html'
-              FormElement-SummaryPage: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/SummaryPage.html'
-              FormElement-Fieldset: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/Fieldset.html'
-              FormElement-Text: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/Text.html'
-              FormElement-Password: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/Password.html'
-              FormElement-AdvancedPassword: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/AdvancedPassword.html'
-              FormElement-Textarea: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/Textarea.html'
-              FormElement-Checkbox: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/Checkbox.html'
-              FormElement-MultiCheckbox: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/MultiCheckbox.html'
-              FormElement-MultiSelect: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/MultiSelect.html'
-              FormElement-RadioButton: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/RadioButton.html'
-              FormElement-SingleSelect: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/SingleSelect.html'
-              FormElement-DatePicker: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/DatePicker.html'
-              FormElement-StaticText: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/StaticText.html'
-              FormElement-Hidden: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/Hidden.html'
-              FormElement-ContentElement: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/ContentElement.html'
-              FormElement-FileUpload: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/FileUpload.html'
-              FormElement-ImageUpload: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Stage/ImageUpload.html'
-
-              Modal-InsertElements: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Modals/InsertElements.html'
-              Modal-InsertPages: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Modals/InsertPages.html'
-              Modal-ValidationErrors: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Modals/ValidationErrors.html'
-
-              Inspector-FormElementHeaderEditor: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Inspector/FormElementHeaderEditor.html'
-              Inspector-CollectionElementHeaderEditor: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Inspector/CollectionElementHeaderEditor.html'
-              Inspector-TextEditor: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Inspector/TextEditor.html'
-              Inspector-PropertyGridEditor: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Inspector/PropertyGridEditor.html'
-              Inspector-SingleSelectEditor: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Inspector/SingleSelectEditor.html'
-              Inspector-TextareaEditor: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Inspector/TextareaEditor.html'
-              Inspector-RemoveElementEditor: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Inspector/RemoveElementEditor.html'
-              Inspector-FinishersEditor: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Inspector/FinishersEditor.html'
-              Inspector-ValidatorsEditor: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Inspector/ValidatorsEditor.html'
-              Inspector-RequiredValidatorEditor: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Inspector/RequiredValidatorEditor.html'
-              Inspector-CheckboxEditor: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Inspector/CheckboxEditor.html'
-              Inspector-Typo3WinBrowserEditor: 'EXT:form/Resources/Private/Backend/Templates/FormEditor/Inspector/Typo3WinBrowserEditor.html'
+            formEditorPartials:
+              # abstract form element partials
+              FormElement-_ElementToolbar: 'Stage/_ElementToolbar'
+              FormElement-_UnknownElement: 'Stage/_UnknownElement'
+              FormElement-Page: 'Stage/Page'
+              FormElement-SummaryPage: 'Stage/SummaryPage'
+              FormElement-Fieldset: 'Stage/Fieldset'
+              FormElement-Text: 'Stage/SimpleTemplate'
+              FormElement-Password: 'Stage/SimpleTemplate'
+              FormElement-AdvancedPassword: 'Stage/SimpleTemplate'
+              FormElement-Textarea: 'Stage/SimpleTemplate'
+              FormElement-Checkbox: 'Stage/SimpleTemplate'
+              FormElement-MultiCheckbox: 'Stage/SelectTemplate'
+              FormElement-MultiSelect: 'Stage/SelectTemplate'
+              FormElement-RadioButton: 'Stage/SelectTemplate'
+              FormElement-SingleSelect: 'Stage/SelectTemplate'
+              FormElement-DatePicker: 'Stage/SimpleTemplate'
+              FormElement-StaticText: 'Stage/StaticText'
+              FormElement-Hidden: 'Stage/SimpleTemplate'
+              FormElement-ContentElement: 'Stage/ContentElement'
+              FormElement-FileUpload: 'Stage/FileUploadTemplate'
+              FormElement-ImageUpload: 'Stage/FileUploadTemplate'
+
+              # modals
+              Modal-InsertElements: 'Modals/InsertElements'
+              Modal-InsertPages: 'Modals/InsertPages'
+              Modal-ValidationErrors: 'Modals/ValidationErrors'
+
+              # inspector editors
+              Inspector-FormElementHeaderEditor: 'Inspector/FormElementHeaderEditor'
+              Inspector-CollectionElementHeaderEditor: 'Inspector/CollectionElementHeaderEditor'
+              Inspector-TextEditor: 'Inspector/TextEditor'
+              Inspector-PropertyGridEditor: 'Inspector/PropertyGridEditor'
+              Inspector-SingleSelectEditor: 'Inspector/SingleSelectEditor'
+              Inspector-TextareaEditor: 'Inspector/TextareaEditor'
+              Inspector-RemoveElementEditor: 'Inspector/RemoveElementEditor'
+              Inspector-FinishersEditor: 'Inspector/FinishersEditor'
+              Inspector-ValidatorsEditor: 'Inspector/ValidatorsEditor'
+              Inspector-RequiredValidatorEditor: 'Inspector/RequiredValidatorEditor'
+              Inspector-CheckboxEditor: 'Inspector/CheckboxEditor'
+              Inspector-Typo3WinBrowserEditor: 'Inspector/Typo3WinBrowserEditor'
 
             formElementPropertyValidatorsDefinition:
               NotEmpty:
index 9fcdc28..67c504b 100644 (file)
 </div>
 
 <div data-identifier="moduleWrapper" class="hidden">
-    <f:for each="{formEditorTemplates}" key="formEditorTemplateName" as="formEditorTemplate">
-        <script type="text/x-formeditor-template" data-template-name="{formEditorTemplateName}">
-            <f:format.raw>{formEditorTemplate}</f:format.raw>
-        </script>
-    </f:for>
+    <f:format.raw>{formEditorTemplates}</f:format.raw>
 
     <section id="t3-form-navigation-component" class="t3-form-x-component" data-identifier="structureSection">
         <div id="t3-form-structure-panel">
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/CheckboxEditor.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/CheckboxEditor.html
new file mode 100644 (file)
index 0000000..40f29ea
--- /dev/null
@@ -0,0 +1,10 @@
+<div class="form-editor">
+    <div class="t3-form-control-group form-group">
+        <label>
+            <span data-template-property="label" />
+            <div class="t3-form-controls" data-identifier="inspectorEditorControlsWrapper">
+                <input type="checkbox" />
+            </div>
+        </label>
+    </div>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/CollectionElementHeaderEditor.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/CollectionElementHeaderEditor.html
new file mode 100644 (file)
index 0000000..5c2c464
--- /dev/null
@@ -0,0 +1,5 @@
+<div class="t3-form-validator-editor">
+    <h4 data-template-property="header-label">
+        <span data-template-property="label" />
+    </h4>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/FinishersEditor.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/FinishersEditor.html
new file mode 100644 (file)
index 0000000..1c0b4cb
--- /dev/null
@@ -0,0 +1,8 @@
+<div class="form-editor">
+    <h3><span data-template-property="label" /></h3>
+    <div id="t3-form-add-finisher" class="t3-form-add-collection-element">
+        <select data-template-property="selectOptions" class="form-control" />
+    </div>
+</div>
+<div id="t3-form-inspector-finishers" class="t3-form-collection-container" data-identifier="inspectorFinishers">
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/FormElementHeaderEditor.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/FormElementHeaderEditor.html
new file mode 100644 (file)
index 0000000..fd3b226
--- /dev/null
@@ -0,0 +1,3 @@
+<div class="form-editor">
+    <h2 class="t3-form-inspector-formelement-header-editor" data-template-property="header-label" data-identifier="inspectorFormElementHeaderEditor"></h2>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/PropertyGridEditor.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/PropertyGridEditor.html
new file mode 100644 (file)
index 0000000..287b32d
--- /dev/null
@@ -0,0 +1,47 @@
+{namespace core = TYPO3\CMS\Core\ViewHelpers}
+
+<div class="form-editor">
+    <div class="t3-form-control-group form-group property-grid">
+        <label><span data-template-property="label" /></label>
+        <div data-editor="new-property-grid" data-template-property="newPropertyPath">
+
+            <table class="table table-hover" data-identifier="propertyGridContainer">
+                <thead>
+                    <tr>
+                        <th></th>
+                        <th>Label</th>
+                        <th>Value</th>
+                        <th>Selected</th>
+                        <th></th>
+                    </tr>
+                </thead>
+                <tbody>
+                    <tr data-identifier="rowItem">
+                        <td><span class="sort-row-field" data-identifier="sortRow"><core:icon identifier="actions-move-move" /></span></td>
+                        <td><input type="text" class="form-control" value="" data-identifier="label" /></td>
+                        <td><input type="text" class="form-control" value="" data-identifier="value" /></td>
+                        <td><input type="checkbox" data-identifier="selectValue" /></td>
+                        <td>
+                            <div class="btn-group btn-group-sm" role="group">
+                                <button class="btn btn-default" title="Remove this row" data-identifier="deleteRow"><core:icon identifier="actions-delete" /></button>
+                            </div>
+                        </td>
+                    </tr>
+                    <tr data-identifier="addRowItem">
+                        <td>
+                            <div class="btn-group btn-group-sm" role="group">
+                                <button class="btn btn-default" title="Add a new row" data-identifier="addRow"><core:icon identifier="actions-add" /></button>
+                            </div>
+                        </td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                </tbody>
+            </table>
+
+        </div>
+        <div data-editor="property-grid" data-template-property="propertyPath" class="t3-form-grid" />
+    </div>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/RemoveElementEditor.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/RemoveElementEditor.html
new file mode 100644 (file)
index 0000000..afa20c4
--- /dev/null
@@ -0,0 +1,5 @@
+{namespace core = TYPO3\CMS\Core\ViewHelpers}
+
+<div class="t3-form-control-group form-group btn-group-sm">
+    <button class="btn btn-default" title="Remove this Element"><core:icon identifier="actions-delete" alternativeMarkupIdentifier="inline"/></button>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/RequiredValidatorEditor.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/RequiredValidatorEditor.html
new file mode 100644 (file)
index 0000000..40f29ea
--- /dev/null
@@ -0,0 +1,10 @@
+<div class="form-editor">
+    <div class="t3-form-control-group form-group">
+        <label>
+            <span data-template-property="label" />
+            <div class="t3-form-controls" data-identifier="inspectorEditorControlsWrapper">
+                <input type="checkbox" />
+            </div>
+        </label>
+    </div>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/SingleSelectEditor.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/SingleSelectEditor.html
new file mode 100644 (file)
index 0000000..f1f9653
--- /dev/null
@@ -0,0 +1,6 @@
+<div class="t3-form-control-group form-group">
+    <label><span data-template-property="label" /></label>
+    <div class="t3-form-controls" data-identifier="inspectorEditorControlsWrapper">
+        <select data-template-property="selectOptions" class="form-control" />
+    </div>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/TextEditor.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/TextEditor.html
new file mode 100644 (file)
index 0000000..9513d88
--- /dev/null
@@ -0,0 +1,25 @@
+{namespace core = TYPO3\CMS\Core\ViewHelpers}
+
+<div class="form-editor">
+    <div class="t3-form-control-group form-group">
+        <label><span data-template-property="label" /></label>
+        <div class="input-group" data-identifier="inspectorEditorControlsGroup">
+            <div class="t3-form-controls" data-identifier="inspectorEditorControlsWrapper">
+                <input type="text" value="" data-template-property="propertyPath" class="form-control">
+            </div>
+
+            <span class="input-group-btn" role="group" data-identifier="inspectorEditorFormElementSelectorControlsWrapper">
+                <span class="btn-group t3-form-dropdown-buttons" data-identifier="inspectorEditorFormElementSelectorSplitButtonContainer">
+                   <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false" title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.inspector.editor.formelement_selector.title')}">
+                       <core:icon identifier="t3-form-icon-form-element-selector" />
+                       <span class="caret"></span>
+                       <span class="sr-only">Toggle Dropdown</span>
+                   </button>
+                   <ul class="dropdown-menu dropdown-menu-right" data-identifier="inspectorEditorFormElementSelectorSplitButtonListContainer"></ul>
+                </span>
+            </span>
+        </div>
+        <span data-template-property="fieldExplanationText" />
+        <span data-template-property="validationErrors" />
+    </div>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/TextareaEditor.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/TextareaEditor.html
new file mode 100644 (file)
index 0000000..31e261e
--- /dev/null
@@ -0,0 +1,8 @@
+<div class="form-editor">
+    <div class="t3-form-control-group form-group">
+        <label><span data-template-property="label" /></label>
+        <div class="t3-form-controls" data-identifier="inspectorEditorControlsWrapper">
+            <textarea data-template-property="propertyPath" class="form-control" />
+        </div>
+    </div>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/Typo3WinBrowserEditor.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/Typo3WinBrowserEditor.html
new file mode 100644 (file)
index 0000000..66dd258
--- /dev/null
@@ -0,0 +1,17 @@
+<div class="form-editor">
+    <div class="t3-form-control-group form-group">
+        <label><span data-template-property="label" /></label>
+        <div class="t3-form-controls" data-identifier="inspectorEditorControlsWrapper">
+            <input type="text" value="" data-template-property="propertyPath" class="form-control" data-insert-target="">
+            <div class="help-block">
+                <a href="#" data-template-property="onclick" class="btn btn-default">
+                    <span class="t3js-icon icon icon-size-small icon-state-default icon-mimetypes-x-content-text" data-identifier="mimetypes-x-content-text">
+                        <span class="icon-markup" data-template-property="image" />
+                    </span> <span data-template-property="buttonLabel" />
+                </a>
+            </div>
+            <span data-template-property="fieldExplanationText" />
+            <span data-template-property="validationErrors" />
+        </div>
+    </div>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/ValidatorsEditor.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/ValidatorsEditor.html
new file mode 100644 (file)
index 0000000..6d61b5b
--- /dev/null
@@ -0,0 +1,8 @@
+<div class="form-editor">
+    <h3><span data-template-property="label" /></h3>
+    <div id="t3-form-add-validator" class="t3-form-add-collection-element">
+        <select data-template-property="selectOptions" class="form-control" />
+    </div>
+</div>
+<div id="t3-form-inspector-validators" class="t3-form-collection-container" data-identifier="inspectorValidators">
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Modals/InsertElements.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Modals/InsertElements.html
new file mode 100644 (file)
index 0000000..1d3c65f
--- /dev/null
@@ -0,0 +1,30 @@
+{namespace core = TYPO3\CMS\Core\ViewHelpers}
+
+<div id="t3-form-insert-elements-panel">
+    <div class="t3-form-x-component-inner-wrapper">
+        <f:for each="{insertRenderablesPanelConfiguration}" as="insertRenderablePanelConfiguration">
+            <f:if condition="{insertRenderablePanelConfiguration.key} != 'page'">
+                <div class="row">
+                    <div class="col-sm-12">
+                        <h4 class="t3-form-group-{insertRenderablePanelConfiguration.key}">
+                            <span>{insertRenderablePanelConfiguration.label}</span>
+                        </h4>
+                    </div>
+                    <f:for each="{insertRenderablePanelConfiguration.elements}" as="element">
+                        <div class="col-sm-4 btn-group">
+                            <a class="t3-form-group-{insertRenderablePanelConfiguration.key} t3-form-type-{element.cssKey} btn btn-default btn-block" title="{element.key}" data-element-type="{element.key}">
+                                <span class="pull-left">
+                                    <core:icon identifier="{element.iconIdentifier}" alternativeMarkupIdentifier="inline" />
+                                    <span>{element.label}</span>
+                                </span>
+                                <span class="clearfix"></span>
+                            </a>
+                            <hr />
+                        </div>
+                    </f:for>
+                </div>
+                <hr />
+            </f:if>
+        </f:for>
+    </div>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Modals/InsertPages.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Modals/InsertPages.html
new file mode 100644 (file)
index 0000000..ddba751
--- /dev/null
@@ -0,0 +1,28 @@
+{namespace core = TYPO3\CMS\Core\ViewHelpers}
+
+<div id="t3-form-insert-pages-panel">
+    <div class="t3-form-x-component-inner-wrapper">
+        <f:for each="{insertRenderablesPanelConfiguration}" as="insertRenderablePanelConfiguration">
+            <f:if condition="{insertRenderablePanelConfiguration.key} == 'page'">
+                <div class="row">
+                    <div class="col-sm-12">
+                        <h3 class="t3-form-group-{insertRenderablePanelConfiguration.key}">
+                            <span>{insertRenderablePanelConfiguration.label}</span>
+                        </h3>
+                    </div>
+                    <f:for each="{insertRenderablePanelConfiguration.elements}" as="element">
+                        <div class="col-sm-4 btn-group">
+                            <a class="t3-form-group-{insertRenderablePanelConfiguration.key} t3-form-type-{element.cssKey} btn btn-default btn-block" title="{element.key}" data-element-type="{element.key}">
+                                <span class="pull-left">
+                                    <core:icon identifier="{element.iconIdentifier}" alternativeMarkupIdentifier="inline" />
+                                    <span>{element.label}</span>
+                                 </span>
+                                <span class="clearfix"></span>
+                            </a>
+                            <hr />
+                        </div>
+                    </f:for>
+            </f:if>
+        </f:for>
+    </div>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Modals/ValidationErrors.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Modals/ValidationErrors.html
new file mode 100644 (file)
index 0000000..24867aa
--- /dev/null
@@ -0,0 +1,17 @@
+<div id="t3-form-validation-errors-panel">
+    <div class="t3-form-x-component-inner-wrapper">
+        <div class="row">
+            <div class="col-sm-12">
+                <p><f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.modals.validationErrors.dialogMessage" /></p>
+            </div>
+
+            <div class="col-sm-12">
+                <dl class="t3-overview-list" data-identifier="rowsContainer">
+                    <dt data-identifier="rowItem">
+                        <i class="fa fa-exclamation-triangle text-danger" aria-hidden="true"></i>&nbsp;<a data-identifier="rowLink"></a>
+                    </dt>
+                </dl>
+            </div>
+        </div>
+    </div>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/ContentElement.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/ContentElement.html
new file mode 100644 (file)
index 0000000..ac4e0dd
--- /dev/null
@@ -0,0 +1,30 @@
+<div class="meta-label">
+    <span data-template-property="_type"></span>: <span data-template-property="_identifier"></span>
+</div>
+
+<div class="t3-form-form-element-body">
+    <div class="t3-form-icon-container">
+        <span data-identifier="elementIcon"></span>
+    </div>
+
+    <div class="t3-form-element-info">
+        <div class="element-label-container">
+            <div class="element-label">
+                <span data-template-property="label"></span>
+                <span data-template-property="_required"></span>
+            </div>
+        </div>
+        <div class="element-content">
+            <div data-template-property="properties.contentElementUid" />
+        </div>
+    </div>
+
+    <div class="t3-form-validator-info" data-identifier="validators">
+        <span data-identifier="validatorIcon"></span>
+        <div class="t3-form-validator-list">
+            <div data-identifier="validatorsContainer">
+                <div class="validator-label" data-template-property="_label"></div>
+            </div>
+        </div>
+    </div>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/Fieldset.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/Fieldset.html
new file mode 100644 (file)
index 0000000..b4e6dcf
--- /dev/null
@@ -0,0 +1,18 @@
+<div class="meta-label">
+    <span data-template-property="_type"></span>: <span data-template-property="_identifier"></span>
+</div>
+
+<div class="t3-form-form-element-body">
+    <div class="t3-form-icon-container">
+        <span data-identifier="elementIcon"></span>
+    </div>
+
+    <div class="t3-form-element-info">
+        <div class="element-label-container">
+            <div class="element-label">
+                <span data-template-property="label"></span>
+                <span data-template-property="_required"></span>
+            </div>
+        </div>
+    </div>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/Page.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/Page.html
new file mode 100644 (file)
index 0000000..aa5e881
--- /dev/null
@@ -0,0 +1 @@
+<h2 class="t3-form-page-title" data-template-property="label"></h2>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/StaticText.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/StaticText.html
new file mode 100644 (file)
index 0000000..b9520b1
--- /dev/null
@@ -0,0 +1,30 @@
+<div class="meta-label">
+    <span data-template-property="_type"></span>: <span data-template-property="_identifier"></span>
+</div>
+
+<div class="t3-form-form-element-body">
+    <div class="t3-form-icon-container">
+        <span data-identifier="elementIcon"></span>
+    </div>
+
+    <div class="t3-form-element-info">
+        <div class="element-label-container">
+            <div class="element-label">
+                <span data-template-property="label"></span>
+                <span data-template-property="_required"></span>
+            </div>
+        </div>
+        <div class="element-content">
+            <div data-template-property="properties.text" />
+        </div>
+    </div>
+
+    <div class="t3-form-validator-info" data-identifier="validators">
+        <span data-identifier="validatorIcon"></span>
+        <div class="t3-form-validator-list">
+            <div data-identifier="validatorsContainer">
+                <div class="validator-label" data-template-property="_label"></div>
+            </div>
+        </div>
+    </div>
+</div>
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/SummaryPage.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/SummaryPage.html
new file mode 100644 (file)
index 0000000..ccd6afd
--- /dev/null
@@ -0,0 +1 @@
+<h2 data-template-property="label"></h2>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/_ElementToolbar.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/_ElementToolbar.html
new file mode 100644 (file)
index 0000000..cc9fafd
--- /dev/null
@@ -0,0 +1,35 @@
+{namespace core = TYPO3\CMS\Core\ViewHelpers}
+
+<div class="btn-toolbar-container" data-identifier="elementToolbar">
+    <div class="btn-toolbar" data-identifier="elementToolbarButtons">
+        <div class="btn-group btn-group-sm" role="group">
+            <a class="btn btn-default" href="#" title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.stage.toolbar.new_element')}" data-identifier="stageElementToolbarNewElement"><core:icon identifier="actions-document-new" alternativeMarkupIdentifier="inline" /></a>
+        </div>
+        <div class="btn-group btn-group-sm" role="group">
+            <div class="btn-group t3-form-dropdown-buttons" data-identifier="stageElementToolbarNewElementSplitButton">
+               <button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false" title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.stage.toolbar.new_element')}">
+                   <core:icon identifier="actions-document-new" alternativeMarkupIdentifier="inline" />
+                   <span class="caret"></span>
+                   <span class="sr-only">Toggle Dropdown</span>
+               </button>
+               <ul class="dropdown-menu dropdown-menu-right">
+                  <li data-no-sorting>
+                     <a href="#" data-identifier="stageElementToolbarNewElementSplitButtonInside">
+                         <core:icon identifier="t3-form-icon-insert-in" alternativeMarkupIdentifier="inline" />
+                         <f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.stage.toolbar.new_element.inside" />
+                     </a>
+                  </li>
+                  <li data-no-sorting>
+                     <a href="#" data-identifier="stageElementToolbarNewElementSplitButtonAfter">
+                         <core:icon identifier="t3-form-icon-insert-after" alternativeMarkupIdentifier="inline" />
+                         <f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.stage.toolbar.new_element.after" />
+                     </a>
+                  </li>
+               </ul>
+            </div>
+        </div>
+        <div class="btn-group btn-group-sm" role="group">
+            <a class="btn btn-default" href="#" title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.stage.toolbar.remove')}" data-identifier="stageElementToolbarRemoveElement"><core:icon identifier="actions-edit-delete" alternativeMarkupIdentifier="inline" /></a>
+        </div>
+    </div>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/_UnknownElement.html b/typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/_UnknownElement.html
new file mode 100644 (file)
index 0000000..31d9a2e
--- /dev/null
@@ -0,0 +1 @@
+<span><f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.elements.UnknownElement" /></span>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/InlineTemplates.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/InlineTemplates.html
new file mode 100644 (file)
index 0000000..9a16007
--- /dev/null
@@ -0,0 +1,5 @@
+<f:for each="{formEditorPartials}" key="formEditorTemplateName" as="formEditorPartial">
+    <script type="text/x-formeditor-template" data-template-name="{formEditorTemplateName}">
+        <f:render partial="{formEditorPartial}" arguments="{insertRenderablesPanelConfiguration: insertRenderablesPanelConfiguration}" />
+    </script>
+</f:for>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/CheckboxEditor.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/CheckboxEditor.html
deleted file mode 100644 (file)
index 40f29ea..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="form-editor">
-    <div class="t3-form-control-group form-group">
-        <label>
-            <span data-template-property="label" />
-            <div class="t3-form-controls" data-identifier="inspectorEditorControlsWrapper">
-                <input type="checkbox" />
-            </div>
-        </label>
-    </div>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/CollectionElementHeaderEditor.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/CollectionElementHeaderEditor.html
deleted file mode 100644 (file)
index 5c2c464..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="t3-form-validator-editor">
-    <h4 data-template-property="header-label">
-        <span data-template-property="label" />
-    </h4>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/FinishersEditor.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/FinishersEditor.html
deleted file mode 100644 (file)
index 1c0b4cb..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="form-editor">
-    <h3><span data-template-property="label" /></h3>
-    <div id="t3-form-add-finisher" class="t3-form-add-collection-element">
-        <select data-template-property="selectOptions" class="form-control" />
-    </div>
-</div>
-<div id="t3-form-inspector-finishers" class="t3-form-collection-container" data-identifier="inspectorFinishers">
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/FormElementHeaderEditor.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/FormElementHeaderEditor.html
deleted file mode 100644 (file)
index fd3b226..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<div class="form-editor">
-    <h2 class="t3-form-inspector-formelement-header-editor" data-template-property="header-label" data-identifier="inspectorFormElementHeaderEditor"></h2>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/PropertyGridEditor.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/PropertyGridEditor.html
deleted file mode 100644 (file)
index 287b32d..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-{namespace core = TYPO3\CMS\Core\ViewHelpers}
-
-<div class="form-editor">
-    <div class="t3-form-control-group form-group property-grid">
-        <label><span data-template-property="label" /></label>
-        <div data-editor="new-property-grid" data-template-property="newPropertyPath">
-
-            <table class="table table-hover" data-identifier="propertyGridContainer">
-                <thead>
-                    <tr>
-                        <th></th>
-                        <th>Label</th>
-                        <th>Value</th>
-                        <th>Selected</th>
-                        <th></th>
-                    </tr>
-                </thead>
-                <tbody>
-                    <tr data-identifier="rowItem">
-                        <td><span class="sort-row-field" data-identifier="sortRow"><core:icon identifier="actions-move-move" /></span></td>
-                        <td><input type="text" class="form-control" value="" data-identifier="label" /></td>
-                        <td><input type="text" class="form-control" value="" data-identifier="value" /></td>
-                        <td><input type="checkbox" data-identifier="selectValue" /></td>
-                        <td>
-                            <div class="btn-group btn-group-sm" role="group">
-                                <button class="btn btn-default" title="Remove this row" data-identifier="deleteRow"><core:icon identifier="actions-delete" /></button>
-                            </div>
-                        </td>
-                    </tr>
-                    <tr data-identifier="addRowItem">
-                        <td>
-                            <div class="btn-group btn-group-sm" role="group">
-                                <button class="btn btn-default" title="Add a new row" data-identifier="addRow"><core:icon identifier="actions-add" /></button>
-                            </div>
-                        </td>
-                        <td></td>
-                        <td></td>
-                        <td></td>
-                        <td></td>
-                    </tr>
-                </tbody>
-            </table>
-
-        </div>
-        <div data-editor="property-grid" data-template-property="propertyPath" class="t3-form-grid" />
-    </div>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/RemoveElementEditor.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/RemoveElementEditor.html
deleted file mode 100644 (file)
index afa20c4..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-{namespace core = TYPO3\CMS\Core\ViewHelpers}
-
-<div class="t3-form-control-group form-group btn-group-sm">
-    <button class="btn btn-default" title="Remove this Element"><core:icon identifier="actions-delete" alternativeMarkupIdentifier="inline"/></button>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/RequiredValidatorEditor.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/RequiredValidatorEditor.html
deleted file mode 100644 (file)
index 40f29ea..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="form-editor">
-    <div class="t3-form-control-group form-group">
-        <label>
-            <span data-template-property="label" />
-            <div class="t3-form-controls" data-identifier="inspectorEditorControlsWrapper">
-                <input type="checkbox" />
-            </div>
-        </label>
-    </div>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/SingleSelectEditor.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/SingleSelectEditor.html
deleted file mode 100644 (file)
index f1f9653..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<div class="t3-form-control-group form-group">
-    <label><span data-template-property="label" /></label>
-    <div class="t3-form-controls" data-identifier="inspectorEditorControlsWrapper">
-        <select data-template-property="selectOptions" class="form-control" />
-    </div>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/TextEditor.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/TextEditor.html
deleted file mode 100644 (file)
index 9513d88..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-{namespace core = TYPO3\CMS\Core\ViewHelpers}
-
-<div class="form-editor">
-    <div class="t3-form-control-group form-group">
-        <label><span data-template-property="label" /></label>
-        <div class="input-group" data-identifier="inspectorEditorControlsGroup">
-            <div class="t3-form-controls" data-identifier="inspectorEditorControlsWrapper">
-                <input type="text" value="" data-template-property="propertyPath" class="form-control">
-            </div>
-
-            <span class="input-group-btn" role="group" data-identifier="inspectorEditorFormElementSelectorControlsWrapper">
-                <span class="btn-group t3-form-dropdown-buttons" data-identifier="inspectorEditorFormElementSelectorSplitButtonContainer">
-                   <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false" title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.inspector.editor.formelement_selector.title')}">
-                       <core:icon identifier="t3-form-icon-form-element-selector" />
-                       <span class="caret"></span>
-                       <span class="sr-only">Toggle Dropdown</span>
-                   </button>
-                   <ul class="dropdown-menu dropdown-menu-right" data-identifier="inspectorEditorFormElementSelectorSplitButtonListContainer"></ul>
-                </span>
-            </span>
-        </div>
-        <span data-template-property="fieldExplanationText" />
-        <span data-template-property="validationErrors" />
-    </div>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/TextareaEditor.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/TextareaEditor.html
deleted file mode 100644 (file)
index 31e261e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="form-editor">
-    <div class="t3-form-control-group form-group">
-        <label><span data-template-property="label" /></label>
-        <div class="t3-form-controls" data-identifier="inspectorEditorControlsWrapper">
-            <textarea data-template-property="propertyPath" class="form-control" />
-        </div>
-    </div>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/Typo3WinBrowserEditor.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/Typo3WinBrowserEditor.html
deleted file mode 100644 (file)
index 66dd258..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<div class="form-editor">
-    <div class="t3-form-control-group form-group">
-        <label><span data-template-property="label" /></label>
-        <div class="t3-form-controls" data-identifier="inspectorEditorControlsWrapper">
-            <input type="text" value="" data-template-property="propertyPath" class="form-control" data-insert-target="">
-            <div class="help-block">
-                <a href="#" data-template-property="onclick" class="btn btn-default">
-                    <span class="t3js-icon icon icon-size-small icon-state-default icon-mimetypes-x-content-text" data-identifier="mimetypes-x-content-text">
-                        <span class="icon-markup" data-template-property="image" />
-                    </span> <span data-template-property="buttonLabel" />
-                </a>
-            </div>
-            <span data-template-property="fieldExplanationText" />
-            <span data-template-property="validationErrors" />
-        </div>
-    </div>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/ValidatorsEditor.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Inspector/ValidatorsEditor.html
deleted file mode 100644 (file)
index 6d61b5b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="form-editor">
-    <h3><span data-template-property="label" /></h3>
-    <div id="t3-form-add-validator" class="t3-form-add-collection-element">
-        <select data-template-property="selectOptions" class="form-control" />
-    </div>
-</div>
-<div id="t3-form-inspector-validators" class="t3-form-collection-container" data-identifier="inspectorValidators">
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Modals/InsertElements.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Modals/InsertElements.html
deleted file mode 100644 (file)
index 1d3c65f..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-{namespace core = TYPO3\CMS\Core\ViewHelpers}
-
-<div id="t3-form-insert-elements-panel">
-    <div class="t3-form-x-component-inner-wrapper">
-        <f:for each="{insertRenderablesPanelConfiguration}" as="insertRenderablePanelConfiguration">
-            <f:if condition="{insertRenderablePanelConfiguration.key} != 'page'">
-                <div class="row">
-                    <div class="col-sm-12">
-                        <h4 class="t3-form-group-{insertRenderablePanelConfiguration.key}">
-                            <span>{insertRenderablePanelConfiguration.label}</span>
-                        </h4>
-                    </div>
-                    <f:for each="{insertRenderablePanelConfiguration.elements}" as="element">
-                        <div class="col-sm-4 btn-group">
-                            <a class="t3-form-group-{insertRenderablePanelConfiguration.key} t3-form-type-{element.cssKey} btn btn-default btn-block" title="{element.key}" data-element-type="{element.key}">
-                                <span class="pull-left">
-                                    <core:icon identifier="{element.iconIdentifier}" alternativeMarkupIdentifier="inline" />
-                                    <span>{element.label}</span>
-                                </span>
-                                <span class="clearfix"></span>
-                            </a>
-                            <hr />
-                        </div>
-                    </f:for>
-                </div>
-                <hr />
-            </f:if>
-        </f:for>
-    </div>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Modals/InsertPages.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Modals/InsertPages.html
deleted file mode 100644 (file)
index ddba751..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-{namespace core = TYPO3\CMS\Core\ViewHelpers}
-
-<div id="t3-form-insert-pages-panel">
-    <div class="t3-form-x-component-inner-wrapper">
-        <f:for each="{insertRenderablesPanelConfiguration}" as="insertRenderablePanelConfiguration">
-            <f:if condition="{insertRenderablePanelConfiguration.key} == 'page'">
-                <div class="row">
-                    <div class="col-sm-12">
-                        <h3 class="t3-form-group-{insertRenderablePanelConfiguration.key}">
-                            <span>{insertRenderablePanelConfiguration.label}</span>
-                        </h3>
-                    </div>
-                    <f:for each="{insertRenderablePanelConfiguration.elements}" as="element">
-                        <div class="col-sm-4 btn-group">
-                            <a class="t3-form-group-{insertRenderablePanelConfiguration.key} t3-form-type-{element.cssKey} btn btn-default btn-block" title="{element.key}" data-element-type="{element.key}">
-                                <span class="pull-left">
-                                    <core:icon identifier="{element.iconIdentifier}" alternativeMarkupIdentifier="inline" />
-                                    <span>{element.label}</span>
-                                 </span>
-                                <span class="clearfix"></span>
-                            </a>
-                            <hr />
-                        </div>
-                    </f:for>
-            </f:if>
-        </f:for>
-    </div>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Modals/ValidationErrors.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Modals/ValidationErrors.html
deleted file mode 100644 (file)
index 24867aa..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<div id="t3-form-validation-errors-panel">
-    <div class="t3-form-x-component-inner-wrapper">
-        <div class="row">
-            <div class="col-sm-12">
-                <p><f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.modals.validationErrors.dialogMessage" /></p>
-            </div>
-
-            <div class="col-sm-12">
-                <dl class="t3-overview-list" data-identifier="rowsContainer">
-                    <dt data-identifier="rowItem">
-                        <i class="fa fa-exclamation-triangle text-danger" aria-hidden="true"></i>&nbsp;<a data-identifier="rowLink"></a>
-                    </dt>
-                </dl>
-            </div>
-        </div>
-    </div>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/AdvancedPassword.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/AdvancedPassword.html
deleted file mode 100644 (file)
index ececec8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<f:render partial="Stage/SimpleTemplate" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Checkbox.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Checkbox.html
deleted file mode 100644 (file)
index ececec8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<f:render partial="Stage/SimpleTemplate" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/ContentElement.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/ContentElement.html
deleted file mode 100644 (file)
index ac4e0dd..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<div class="meta-label">
-    <span data-template-property="_type"></span>: <span data-template-property="_identifier"></span>
-</div>
-
-<div class="t3-form-form-element-body">
-    <div class="t3-form-icon-container">
-        <span data-identifier="elementIcon"></span>
-    </div>
-
-    <div class="t3-form-element-info">
-        <div class="element-label-container">
-            <div class="element-label">
-                <span data-template-property="label"></span>
-                <span data-template-property="_required"></span>
-            </div>
-        </div>
-        <div class="element-content">
-            <div data-template-property="properties.contentElementUid" />
-        </div>
-    </div>
-
-    <div class="t3-form-validator-info" data-identifier="validators">
-        <span data-identifier="validatorIcon"></span>
-        <div class="t3-form-validator-list">
-            <div data-identifier="validatorsContainer">
-                <div class="validator-label" data-template-property="_label"></div>
-            </div>
-        </div>
-    </div>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/DatePicker.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/DatePicker.html
deleted file mode 100644 (file)
index ececec8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<f:render partial="Stage/SimpleTemplate" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Fieldset.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Fieldset.html
deleted file mode 100644 (file)
index b4e6dcf..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<div class="meta-label">
-    <span data-template-property="_type"></span>: <span data-template-property="_identifier"></span>
-</div>
-
-<div class="t3-form-form-element-body">
-    <div class="t3-form-icon-container">
-        <span data-identifier="elementIcon"></span>
-    </div>
-
-    <div class="t3-form-element-info">
-        <div class="element-label-container">
-            <div class="element-label">
-                <span data-template-property="label"></span>
-                <span data-template-property="_required"></span>
-            </div>
-        </div>
-    </div>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/FileUpload.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/FileUpload.html
deleted file mode 100644 (file)
index e476819..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<f:render partial="Stage/FileUploadTemplate" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Hidden.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Hidden.html
deleted file mode 100644 (file)
index ececec8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<f:render partial="Stage/SimpleTemplate" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/ImageUpload.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/ImageUpload.html
deleted file mode 100644 (file)
index e476819..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<f:render partial="Stage/FileUploadTemplate" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/MultiCheckbox.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/MultiCheckbox.html
deleted file mode 100644 (file)
index fbdd4da..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<f:render partial="Stage/SelectTemplate" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/MultiSelect.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/MultiSelect.html
deleted file mode 100644 (file)
index fbdd4da..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<f:render partial="Stage/SelectTemplate" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Page.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Page.html
deleted file mode 100644 (file)
index aa5e881..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<h2 class="t3-form-page-title" data-template-property="label"></h2>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Password.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Password.html
deleted file mode 100644 (file)
index ececec8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<f:render partial="Stage/SimpleTemplate" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/RadioButton.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/RadioButton.html
deleted file mode 100644 (file)
index fbdd4da..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<f:render partial="Stage/SelectTemplate" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/SingleSelect.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/SingleSelect.html
deleted file mode 100644 (file)
index fbdd4da..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<f:render partial="Stage/SelectTemplate" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/StaticText.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/StaticText.html
deleted file mode 100644 (file)
index b9520b1..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<div class="meta-label">
-    <span data-template-property="_type"></span>: <span data-template-property="_identifier"></span>
-</div>
-
-<div class="t3-form-form-element-body">
-    <div class="t3-form-icon-container">
-        <span data-identifier="elementIcon"></span>
-    </div>
-
-    <div class="t3-form-element-info">
-        <div class="element-label-container">
-            <div class="element-label">
-                <span data-template-property="label"></span>
-                <span data-template-property="_required"></span>
-            </div>
-        </div>
-        <div class="element-content">
-            <div data-template-property="properties.text" />
-        </div>
-    </div>
-
-    <div class="t3-form-validator-info" data-identifier="validators">
-        <span data-identifier="validatorIcon"></span>
-        <div class="t3-form-validator-list">
-            <div data-identifier="validatorsContainer">
-                <div class="validator-label" data-template-property="_label"></div>
-            </div>
-        </div>
-    </div>
-</div>
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/SummaryPage.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/SummaryPage.html
deleted file mode 100644 (file)
index ccd6afd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<h2 data-template-property="label"></h2>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Text.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Text.html
deleted file mode 100644 (file)
index ececec8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<f:render partial="Stage/SimpleTemplate" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Textarea.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/Textarea.html
deleted file mode 100644 (file)
index ececec8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<f:render partial="Stage/SimpleTemplate" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/_ElementToolbar.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/_ElementToolbar.html
deleted file mode 100644 (file)
index cc9fafd..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-{namespace core = TYPO3\CMS\Core\ViewHelpers}
-
-<div class="btn-toolbar-container" data-identifier="elementToolbar">
-    <div class="btn-toolbar" data-identifier="elementToolbarButtons">
-        <div class="btn-group btn-group-sm" role="group">
-            <a class="btn btn-default" href="#" title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.stage.toolbar.new_element')}" data-identifier="stageElementToolbarNewElement"><core:icon identifier="actions-document-new" alternativeMarkupIdentifier="inline" /></a>
-        </div>
-        <div class="btn-group btn-group-sm" role="group">
-            <div class="btn-group t3-form-dropdown-buttons" data-identifier="stageElementToolbarNewElementSplitButton">
-               <button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false" title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.stage.toolbar.new_element')}">
-                   <core:icon identifier="actions-document-new" alternativeMarkupIdentifier="inline" />
-                   <span class="caret"></span>
-                   <span class="sr-only">Toggle Dropdown</span>
-               </button>
-               <ul class="dropdown-menu dropdown-menu-right">
-                  <li data-no-sorting>
-                     <a href="#" data-identifier="stageElementToolbarNewElementSplitButtonInside">
-                         <core:icon identifier="t3-form-icon-insert-in" alternativeMarkupIdentifier="inline" />
-                         <f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.stage.toolbar.new_element.inside" />
-                     </a>
-                  </li>
-                  <li data-no-sorting>
-                     <a href="#" data-identifier="stageElementToolbarNewElementSplitButtonAfter">
-                         <core:icon identifier="t3-form-icon-insert-after" alternativeMarkupIdentifier="inline" />
-                         <f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.stage.toolbar.new_element.after" />
-                     </a>
-                  </li>
-               </ul>
-            </div>
-        </div>
-        <div class="btn-group btn-group-sm" role="group">
-            <a class="btn btn-default" href="#" title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.stage.toolbar.remove')}" data-identifier="stageElementToolbarRemoveElement"><core:icon identifier="actions-edit-delete" alternativeMarkupIdentifier="inline" /></a>
-        </div>
-    </div>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/_UnknownElement.html b/typo3/sysext/form/Resources/Private/Backend/Templates/FormEditor/Stage/_UnknownElement.html
deleted file mode 100644 (file)
index 31d9a2e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<span><f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.elements.UnknownElement" /></span>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Layouts/FormElements/Field.html b/typo3/sysext/form/Resources/Private/Frontend/Layouts/FormElements/Field.html
deleted file mode 100644 (file)
index 76af7ba..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<f:form.validationResults for="{element.identifier}">
-    <div class="form-group{f:if(condition: '{validationResults.errors.0}', then: ' has-error')}">
-        <label class="control-label" for="{element.uniqueIdentifier}">{formvh:translateElementProperty(element: element, property: 'label')}<f:if condition="{element.required}"><f:render partial="Field/Required" /></f:if></label>
-        <div class="{element.properties.containerClassAttribute}">
-            <f:render section="field" />
-            <f:format.raw>
-                <f:if condition="{validationResults.flattenedErrors}">
-                    <span class="error help-block" role="alert">
-                        <f:for each="{validationResults.errors}" as="error">
-                            {error -> f:translate(key: 'LLL:{element.renderingOptions.translation.translationFile}:validation.error.{error.code}', arguments: error.arguments)}
-                            <br />
-                        </f:for>
-                    </span>
-                </f:if>
-            </f:format.raw>
-            <f:if condition="{element.properties.elementDescription}">
-                <span class="help-block">{formvh:translateElementProperty(element: element, property: 'elementDescription')}</span>
-            </f:if>
-        </div>
-    </div>
-</f:form.validationResults>
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/AdvancedPassword.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/AdvancedPassword.html
new file mode 100644 (file)
index 0000000..c56b4b6
--- /dev/null
@@ -0,0 +1,29 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <f:render partial="Field/Field" arguments="{element: element}" contentAs="elementContent">
+        <div class="form-group">
+            <f:form.password
+                    property="{element.identifier}.password"
+                    id="{element.uniqueIdentifier}"
+                    class="{element.properties.elementClassAttribute} form-control"
+                    errorClass="{element.properties.elementErrorClassAttribute}"
+                    additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\', placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}', else: '{placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}')}"
+            />
+            <f:if condition="{formvh:translateElementProperty(element: element, property: 'passwordDescription')}">
+                <span class="help-block">{formvh:translateElementProperty(element: element, property: 'passwordDescription')}</span>
+            </f:if>
+        </div>
+        <div class="form-group">
+            <f:if condition="{formvh:translateElementProperty(element: element, property: 'confirmationLabel')}">
+                <label for="{element.uniqueIdentifier}-confirmation">{formvh:translateElementProperty(element: element, property: 'confirmationLabel')}<f:if condition="{element.required}"><f:render partial="Field/Required" /></f:if></label>
+            </f:if>
+            <f:form.password
+                    property="{element.identifier}.confirmation"
+                    id="{element.uniqueIdentifier}-confirmation"
+                    class="{element.properties.confirmationClassAttribute} form-control"
+                    errorClass="{element.properties.elementErrorClassAttribute}"
+                    additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\', placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}', else: '{placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}')}"
+            />
+        </div>
+    </f:render>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/Checkbox.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/Checkbox.html
new file mode 100644 (file)
index 0000000..7610cab
--- /dev/null
@@ -0,0 +1,17 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <f:render partial="Field/Field" arguments="{element: element}" contentAs="elementContent">
+        <div class="form-check">
+            <label class="{element.properties.elementClassAttribute} form-check-label">
+                <f:form.checkbox
+                        property="{element.identifier}"
+                        id="{element.uniqueIdentifier}"
+                        class="{element.properties.elementClassAttribute}"
+                        value="{element.properties.value}"
+                        errorClass="{element.properties.elementErrorClassAttribute}"
+                        additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\'}')}"
+                />
+            </label>
+        </div>
+    </f:render>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/ContentElement.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/ContentElement.html
new file mode 100644 (file)
index 0000000..7dc9fae
--- /dev/null
@@ -0,0 +1,24 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <f:if condition="{element.rootForm.renderingOptions.previewMode}">
+        <f:then>
+            <div class="clearfix">
+                <f:if condition="{element.properties.contentElementUid}">
+                    <f:then>
+                        <formvh:be.renderContentElementPreview contentElementUid="{element.properties.contentElementUid}" />
+                    </f:then>
+                    <f:else>
+                        <f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.elements.ContentElement.selectContentElement" />
+                    </f:else>
+                </f:if>
+            </div>
+        </f:then>
+        <f:else>
+            <f:if condition="{element.properties.contentElementUid}">
+                <div class="clearfix{f:if(condition: element.properties.elementClassAttribute, then: ' {element.properties.elementClassAttribute}')}">
+                    <f:cObject typoscriptObjectPath="lib.tx_form.contentElementRendering">{element.properties.contentElementUid}</f:cObject>
+                </div>
+            </f:if>
+        </f:else>
+    </f:if>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/DatePicker.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/DatePicker.html
new file mode 100644 (file)
index 0000000..e4687e5
--- /dev/null
@@ -0,0 +1,48 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <f:render partial="Field/Field" arguments="{element: element}" contentAs="elementContent">
+        <formvh:form.datePicker
+            id="{element.uniqueIdentifier}"
+            property="{element.identifier}"
+            placeholder="{formvh:translateElementProperty(element: element, property: 'placeholder')}"
+            dateFormat="{element.properties.dateFormat}"
+            initialDate="{element.properties.initialDate}"
+            enableDatePicker="{element.properties.enableDatePicker}"
+            class="{element.properties.elementClassAttribute}"
+            errorClass="{element.properties.elementErrorClassAttribute}"
+            additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\'}')}"
+        >
+            <f:if condition="{element.rootForm.renderingOptions.previewMode}">
+                <f:else>
+                    <f:if condition="{element.properties.enableDatePicker}">
+                        <script type="text/javascript">
+                            if ("undefined" !== typeof $) {
+                                $(function() {
+                                    $("#<f:format.raw>{element.uniqueIdentifier}</f:format.raw>").datepicker({
+                                        dateFormat: "<f:format.raw>{datePickerDateFormat}</f:format.raw>"
+                                    }).on("keydown", function(e) {
+                                        // By using "backspace" or "delete", you can clear the datepicker again.
+                                        if(e.keyCode == 8 || e.keyCode == 46) {
+                                            e.preventDefault();
+                                            $.datepicker._clearDate(this);
+                                        }
+                                    });
+                                });
+                            }
+                        </script>
+                    </f:if>
+                </f:else>
+            </f:if>
+        </formvh:form.datePicker>
+
+        <f:if condition="{element.properties.displayTimeSelector}">
+            <formvh:form.timePicker
+                    id="{element.uniqueIdentifier}-time"
+                    property="{element.identifier}"
+                    initialDate="{element.properties.initialDate}"
+                    class="{element.properties.timeSelectorClassAttribute} form-control"
+                    errorClass="{element.properties.elementErrorClassAttribute}"
+            />
+        </f:if>
+    </f:render>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/Field/Field.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/Field/Field.html
new file mode 100644 (file)
index 0000000..f6bbbac
--- /dev/null
@@ -0,0 +1,22 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<f:form.validationResults for="{element.identifier}">
+    <div class="form-group{f:if(condition: '{validationResults.errors.0}', then: ' has-error')}">
+        <label class="control-label" for="{element.uniqueIdentifier}">{formvh:translateElementProperty(element: element, property: 'label')}<f:if condition="{element.required}"><f:render partial="Field/Required" /></f:if></label>
+        <div class="{element.properties.containerClassAttribute}">
+            <f:format.raw>
+                {elementContent}
+                <f:if condition="{validationResults.flattenedErrors}">
+                    <span class="error help-block" role="alert">
+                        <f:for each="{validationResults.errors}" as="error">
+                            {error -> f:translate(key: 'LLL:{element.renderingOptions.translation.translationFile}:validation.error.{error.code}', arguments: error.arguments)}
+                            <br />
+                        </f:for>
+                    </span>
+                </f:if>
+            </f:format.raw>
+            <f:if condition="{element.properties.elementDescription}">
+                <span class="help-block">{formvh:translateElementProperty(element: element, property: 'elementDescription')}</span>
+            </f:if>
+        </div>
+    </div>
+</f:form.validationResults>
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/Field/Required.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/Field/Required.html
new file mode 100644 (file)
index 0000000..b8618a8
--- /dev/null
@@ -0,0 +1 @@
+<span class="required">*</span>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/Fieldset.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/Fieldset.html
new file mode 100644 (file)
index 0000000..71ccc55
--- /dev/null
@@ -0,0 +1,11 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <fieldset id="{element.uniqueIdentifier}" class="form-group{f:if(condition: element.properties.elementClassAttribute, then: ' {element.properties.elementClassAttribute}')}">
+        <f:if condition="{element.label}">
+            <legend>{formvh:translateElementProperty(element: element, property: 'label')}</legend>
+        </f:if>
+        <f:for each="{element.elements}" as="element">
+            <f:render partial="{element.templateName}" arguments="{element: element}" />
+        </f:for>
+    </fieldset>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/FileUpload.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/FileUpload.html
new file mode 100644 (file)
index 0000000..d5d719a
--- /dev/null
@@ -0,0 +1,12 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <f:render partial="Field/Field" arguments="{element: element}" contentAs="elementContent">
+        <formvh:form.uploadedResource property="{element.identifier}" as="resource" additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\'}')}" accept="{element.properties.allowedMimeTypes}">
+            <f:if condition="{resource}">
+                <div id="{element.uniqueIdentifier}-preview">
+                    {resource.originalResource.originalFile.name}
+                </div>
+            </f:if>
+        </formvh:form.uploadedResource>
+    </f:render>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/Form/Navigation.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/Form/Navigation.html
new file mode 100644 (file)
index 0000000..46eacd2
--- /dev/null
@@ -0,0 +1,25 @@
+<nav class="form-navigation">
+    <div class="btn-toolbar" role="toolbar">
+        <div class="btn-group" role="group">
+            <f:if condition="{form.previousPage}">
+                <span class="previous">
+                    <f:form.button property="__currentPage" value="{form.previousPage.index}" class="btn btn-cancel" formnovalidate="formnovalidate">{formvh:translateElementProperty(element: form.currentPage, renderingOptionProperty: 'previousButtonLabel')}</f:form.button>
+                </span>
+            </f:if>
+            <f:if condition="{form.nextPage}">
+                <f:then>
+                    <span class="next">
+                        <f:form.button property="__currentPage" value="{form.nextPage.index}" class="btn btn-primary">{formvh:translateElementProperty(element: form.currentPage, renderingOptionProperty: 'nextButtonLabel')}</f:form.button>
+                    </span>
+                </f:then>
+                <f:else>
+                    <span class="next submit">
+                        <f:form.button property="__currentPage" value="{form.pages -> f:count()}" class="btn btn-primary">
+                            {formvh:translateElementProperty(element: form, renderingOptionProperty: 'submitButtonLabel')}
+                        </f:form.button>
+                    </span>
+                </f:else>
+            </f:if>
+        </div>
+    </div>
+</nav>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/FormElements/Field/Required.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/FormElements/Field/Required.html
deleted file mode 100644 (file)
index b8618a8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<span class="required">*</span>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/FormElements/Form/Navigation.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/FormElements/Form/Navigation.html
deleted file mode 100644 (file)
index 46eacd2..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<nav class="form-navigation">
-    <div class="btn-toolbar" role="toolbar">
-        <div class="btn-group" role="group">
-            <f:if condition="{form.previousPage}">
-                <span class="previous">
-                    <f:form.button property="__currentPage" value="{form.previousPage.index}" class="btn btn-cancel" formnovalidate="formnovalidate">{formvh:translateElementProperty(element: form.currentPage, renderingOptionProperty: 'previousButtonLabel')}</f:form.button>
-                </span>
-            </f:if>
-            <f:if condition="{form.nextPage}">
-                <f:then>
-                    <span class="next">
-                        <f:form.button property="__currentPage" value="{form.nextPage.index}" class="btn btn-primary">{formvh:translateElementProperty(element: form.currentPage, renderingOptionProperty: 'nextButtonLabel')}</f:form.button>
-                    </span>
-                </f:then>
-                <f:else>
-                    <span class="next submit">
-                        <f:form.button property="__currentPage" value="{form.pages -> f:count()}" class="btn btn-primary">
-                            {formvh:translateElementProperty(element: form, renderingOptionProperty: 'submitButtonLabel')}
-                        </f:form.button>
-                    </span>
-                </f:else>
-            </f:if>
-        </div>
-    </div>
-</nav>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/Hidden.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/Hidden.html
new file mode 100644 (file)
index 0000000..0d4b716
--- /dev/null
@@ -0,0 +1 @@
+<f:form.hidden property="{element.identifier}" id="{element.uniqueIdentifier}" value="{element.properties.value}" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/Honeypot.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/Honeypot.html
new file mode 100644 (file)
index 0000000..6f26f34
--- /dev/null
@@ -0,0 +1,8 @@
+<f:if condition="{element.properties.renderAsHiddenField}">
+    <f:then>
+        <f:form.hidden property="{element.identifier}" id="{element.uniqueIdentifier}" additionalAttributes="{autocomplete: 'off'}" />
+    </f:then>
+    <f:else>
+        <f:form.textfield property="{element.identifier}" id="{element.uniqueIdentifier}" class="{element.properties.elementClassAttribute}" additionalAttributes="{autocomplete: 'off'}" style="{element.properties.styleAttribute}" />
+    </f:else>
+</f:if>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/ImageUpload.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/ImageUpload.html
new file mode 100644 (file)
index 0000000..85561c7
--- /dev/null
@@ -0,0 +1,14 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <f:render partial="Field/Field" arguments="{element: element}" contentAs="elementContent">
+        <formvh:form.uploadedResource property="{element.identifier}" as="image" additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\'}')}" accept="{element.properties.allowedMimeTypes}">
+            <f:if condition="{image}">
+                <div id="{element.uniqueIdentifier}-preview">
+                    <a href="{f:uri.image(image: image, maxWidth: element.properties.imageLinkMaxWidth)}" class="{element.properties.elementClassAttribute}">
+                        <f:image image="{image}" maxWidth="{element.properties.imageMaxWidth}" maxHeight="{element.properties.imageMaxHeight}" alt="{formvh:translateElementProperty(element: element, property: 'altText')}" />
+                    </a>
+                </div>
+            </f:if>
+        </formvh:form.uploadedResource>
+    </f:render>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/MultiCheckbox.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/MultiCheckbox.html
new file mode 100644 (file)
index 0000000..fc55d14
--- /dev/null
@@ -0,0 +1,21 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <f:render partial="Field/Field" arguments="{element: element}" contentAs="elementContent">
+        <div id="{element.uniqueIdentifier}" class="inputs-list">
+            <f:for each="{element.properties.options}" as="label" key="value">
+                <div class="form-check">
+                    <label class="form-check-label">
+                        <formvh:form.checkbox
+                                property="{element.identifier}"
+                                multiple="1"
+                                class="{element.properties.elementClassAttribute}"
+                                value="{value}"
+                                errorClass="{element.properties.elementErrorClassAttribute}"
+                        />
+                        <span>{formvh:translateElementProperty(element: element, property: 'options.{value}')}</span>
+                    </label>
+                </div>
+            </f:for>
+        </div>
+    </f:render>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/MultiSelect.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/MultiSelect.html
new file mode 100644 (file)
index 0000000..1eb53fb
--- /dev/null
@@ -0,0 +1,13 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <f:render partial="Field/Field" arguments="{element: element}" contentAs="elementContent">
+        <f:form.select
+                property="{element.identifier}"
+                id="{element.uniqueIdentifier}"
+                class="{element.properties.elementClassAttribute} form-control"
+                options="{formvh:translateElementProperty(element: element, property: 'options')}"
+                multiple="multiple"
+                errorClass="{element.properties.elementErrorClassAttribute}"
+        />
+    </f:render>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/Page.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/Page.html
new file mode 100644 (file)
index 0000000..a6360ea
--- /dev/null
@@ -0,0 +1,9 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{page}">
+    <f:if condition="{page.label}">
+        <h2>{formvh:translateElementProperty(element: page, property: 'label')}</h2>
+    </f:if>
+    <f:for each="{page.elements}" as="element">
+        <f:render partial="{element.templateName}" arguments="{element: element}" />
+    </f:for>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/Password.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/Password.html
new file mode 100644 (file)
index 0000000..61f6014
--- /dev/null
@@ -0,0 +1,12 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <f:render partial="Field/Field" arguments="{element: element}" contentAs="elementContent">
+        <f:form.password
+                property="{element.identifier}"
+                id="{element.uniqueIdentifier}"
+                class="{element.properties.elementClassAttribute} form-control"
+                additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\', placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}', else: '{placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}')}"
+                errorClass="{element.properties.elementErrorClassAttribute}"
+        />
+    </f:render>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/RadioButton.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/RadioButton.html
new file mode 100644 (file)
index 0000000..f355f10
--- /dev/null
@@ -0,0 +1,23 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <f:render partial="Field/Field" arguments="{element: element}" contentAs="elementContent">
+        <div id="{element.uniqueIdentifier}" class="inputs-list">
+            <div class="form-group">
+                <f:for each="{element.properties.options}" as="label" key="value">
+                    <div class="form-check">
+                        <label class="form-check-label">
+                            <f:form.radio
+                                    property="{element.identifier}"
+                                    class="{element.properties.elementClassAttribute} form-check-input"
+                                    value="{value}"
+                                    errorClass="{element.properties.elementErrorClassAttribute}"
+                                    additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\'}')}"
+                            />
+                            <span>{formvh:translateElementProperty(element: element, property: 'options.{value}')}</span>
+                        </label>
+                    </div>
+                </f:for>
+            </div>
+        </div>
+    </f:render>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/SingleSelect.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/SingleSelect.html
new file mode 100644 (file)
index 0000000..f668ffb
--- /dev/null
@@ -0,0 +1,13 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <f:render partial="Field/Field" arguments="{element: element}" contentAs="elementContent">
+        <f:form.select
+                property="{element.identifier}"
+                id="{element.uniqueIdentifier}"
+                options="{formvh:translateElementProperty(element: element, property: 'options')}"
+                class="{element.properties.elementClassAttribute} form-control"
+                errorClass="{element.properties.elementErrorClassAttribute}"
+                additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\'}')}"
+        />
+    </f:render>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/StaticText.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/StaticText.html
new file mode 100644 (file)
index 0000000..44676d5
--- /dev/null
@@ -0,0 +1,11 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <div class="clearfix">
+        <f:if condition="{element.label}">
+            <h2>{formvh:translateElementProperty(element: element, property: 'label')}</h2>
+        </f:if>
+        <f:if condition="{element.properties.text}">
+            <p{f:if(condition: element.properties.elementClassAttribute, then: ' class="{element.properties.elementClassAttribute}"')}>{formvh:translateElementProperty(element: element, property: 'text') -> f:format.nl2br()}</p>
+        </f:if>
+    </div>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/SummaryPage.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/SummaryPage.html
new file mode 100644 (file)
index 0000000..82ba495
--- /dev/null
@@ -0,0 +1,45 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{page}">
+    <fieldset class="form-group">
+        <f:if condition="{page.label}">
+            <legend>{formvh:translateElementProperty(element: page, property: 'label')}</legend>
+        </f:if>
+        <div class="table-responsive">
+            <table class="table">
+                <formvh:renderAllFormValues renderable="{page.rootForm}">
+                    <tr>
+                        <td class="summary-table-first-col">{formvh:translateElementProperty(element: formValue.element, property: 'label')}</td>
+                        <td>
+                            <f:if condition="{formValue.value}">
+                                <f:then>
+                                    <f:if condition="{0: formValue.element.type} == {0: 'ImageUpload'}">
+                                        <f:then>
+                                            <f:image image="{formValue.value}" maxWidth="{formValue.element.properties.imageMaxWidth}" maxHeight="{formValue.element.properties.imageMaxHeight}" alt="{formvh:translateElementProperty(element: formValue.element, property: 'altText')}" />
+                                        </f:then>
+                                        <f:else>
+                                            <f:if condition="{formValue.isMultiValue}">
+                                                <f:then>
+                                                    <ul>
+                                                        <f:for each="{formValue.processedValue}" as="value">
+                                                            <li>{value}</li>
+                                                        </f:for>
+                                                    </ul>
+                                                </f:then>
+                                                <f:else>
+                                                    {formValue.processedValue}
+                                                </f:else>
+                                            </f:if>
+                                        </f:else>
+                                    </f:if>
+                                </f:then>
+                                <f:else>
+                                    -
+                                </f:else>
+                            </f:if>
+                        </td>
+                    </tr>
+                </formvh:renderAllFormValues>
+            </table>
+        </div>
+    </fieldset>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/Text.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/Text.html
new file mode 100644 (file)
index 0000000..4141bcc
--- /dev/null
@@ -0,0 +1,13 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <f:render partial="Field/Field" arguments="{element: element}" contentAs="elementContent">
+        <f:form.textfield
+                property="{element.identifier}"
+                id="{element.uniqueIdentifier}"
+                class="{element.properties.elementClassAttribute} form-control"
+                placeholder="{formvh:translateElementProperty(element: element, property: 'placeholder')}"
+                errorClass="{element.properties.elementErrorClassAttribute}"
+                required="{element.required}"
+        />
+    </f:render>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/Textarea.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/Textarea.html
new file mode 100644 (file)
index 0000000..7ed587f
--- /dev/null
@@ -0,0 +1,14 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}">
+    <f:render partial="Field/Field" arguments="{element: element}" contentAs="elementContent">
+        <f:form.textarea
+                property="{element.identifier}"
+                id="{element.uniqueIdentifier}"
+                class="{element.properties.elementClassAttribute} form-control"
+                rows="{element.properties.rows}"
+                cols="{element.properties.cols}"
+                errorClass="{element.properties.elementErrorClassAttribute}"
+                additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\', placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}', else: '{placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}')}"
+        />
+    </f:render>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/UnknownElement.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/UnknownElement.html
new file mode 100644 (file)
index 0000000..d8bc3a7
--- /dev/null
@@ -0,0 +1,2 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{element}"> </formvh:renderRenderable>
\ No newline at end of file
index dce25de..0ca28d7 100644 (file)
@@ -11,9 +11,9 @@
 
 <body>
     <table width="600" cellpadding="0" cellspacing="0" border="0">
-        <formvh:renderAllFormValues renderable="{form.formDefinition}" formRuntime="{form}">
+        <formvh:renderAllFormValues renderable="{form.formDefinition}">
             <tr>
-                <td width="600" valign="top" align="left">{formvh:translateElementProperty(element: formValue.element, property: 'label', formRuntime: form)}</td>
+                <td width="600" valign="top" align="left">{formvh:translateElementProperty(element: formValue.element, property: 'label')}</td>
                 <td width="600" valign="top" align="left">
                     <f:if condition="{formValue.value}">
                         <f:then>
index 05cde5a..436543c 100644 (file)
@@ -1,3 +1,3 @@
 {namespace formvh=TYPO3\CMS\Form\ViewHelpers}
 
-<formvh:renderAllFormValues renderable="{form.formDefinition}" formRuntime="{form}"><formvh:plainTextMail formValue="{formValue}" formRuntime="{form}" /></formvh:renderAllFormValues>
\ No newline at end of file
+<formvh:renderAllFormValues renderable="{form.formDefinition}"><formvh:plainTextMail formValue="{formValue}" /></formvh:renderAllFormValues>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/Form.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/Form.html
new file mode 100644 (file)
index 0000000..70d0f4d
--- /dev/null
@@ -0,0 +1,10 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+<formvh:renderRenderable renderable="{form}">
+    <formvh:form object="{form}" action="perform" method="post" id="{form.identifier}" section="{form.identifier}" enctype="multipart/form-data">
+        <f:render partial="{form.currentPage.templateName}" arguments="{page: form.currentPage}" />
+
+        <div class="actions">
+            <f:render partial="Form/Navigation" arguments="{form: form}" />
+        </div>
+    </formvh:form>
+</formvh:renderRenderable>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/AdvancedPassword.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/AdvancedPassword.html
deleted file mode 100644 (file)
index 05a9f1d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<f:layout name="Field" />
-<f:section name="field">
-    <div class="form-group">
-        <f:form.password
-                property="{element.identifier}.password"
-                id="{element.uniqueIdentifier}"
-                class="{element.properties.elementClassAttribute} form-control"
-                errorClass="{element.properties.elementErrorClassAttribute}"
-                additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\', placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}', else: '{placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}')}"
-        />
-        <f:if condition="{formvh:translateElementProperty(element: element, property: 'passwordDescription')}">
-            <span class="help-block">{formvh:translateElementProperty(element: element, property: 'passwordDescription')}</span>
-        </f:if>
-    </div>
-    <div class="form-group">
-        <f:if condition="{formvh:translateElementProperty(element: element, property: 'confirmationLabel')}">
-            <label for="{element.uniqueIdentifier}-confirmation">{formvh:translateElementProperty(element: element, property: 'confirmationLabel')}<f:if condition="{element.required}"><f:render partial="Field/Required" /></f:if></label>
-        </f:if>
-        <f:form.password
-                property="{element.identifier}.confirmation"
-                id="{element.uniqueIdentifier}-confirmation"
-                class="{element.properties.confirmationClassAttribute} form-control"
-                errorClass="{element.properties.elementErrorClassAttribute}"
-                additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\', placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}', else: '{placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}')}"
-        />
-    </div>
-</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Checkbox.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Checkbox.html
deleted file mode 100644 (file)
index 61e96d2..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<f:layout name="Field" />
-<f:section name="field">
-    <div class="form-check">
-        <label class="{element.properties.elementClassAttribute} form-check-label">
-            <f:form.checkbox
-                    property="{element.identifier}"
-                    id="{element.uniqueIdentifier}"
-                    class="{element.properties.elementClassAttribute}"
-                    value="{element.properties.value}"
-                    errorClass="{element.properties.elementErrorClassAttribute}"
-                    additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\'}')}"
-            />
-        </label>
-    </div>
-</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/ContentElement.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/ContentElement.html
deleted file mode 100644 (file)
index 9d1b2d4..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<f:if condition="{element.rootForm.renderingOptions.previewMode}">
-    <f:then>
-        <div class="clearfix">
-            <f:if condition="{element.properties.contentElementUid}">
-                <f:then>
-                    <formvh:be.renderContentElementPreview contentElementUid="{element.properties.contentElementUid}" />
-                </f:then>
-                <f:else>
-                    <f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.elements.ContentElement.selectContentElement" />
-                </f:else>
-            </f:if>
-        </div>
-    </f:then>
-    <f:else>
-        <f:if condition="{element.properties.contentElementUid}">
-            <div class="clearfix{f:if(condition: element.properties.elementClassAttribute, then: ' {element.properties.elementClassAttribute}')}">
-                <f:cObject typoscriptObjectPath="lib.tx_form.contentElementRendering">{element.properties.contentElementUid}</f:cObject>
-            </div>
-        </f:if>
-    </f:else>
-</f:if>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/DatePicker.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/DatePicker.html
deleted file mode 100644 (file)
index b1a4e4d..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<f:layout name="Field" />
-<f:section name="field">
-    <formvh:form.datePicker
-        id="{element.uniqueIdentifier}"
-        property="{element.identifier}"
-        placeholder="{formvh:translateElementProperty(element: element, property: 'placeholder')}"
-        dateFormat="{element.properties.dateFormat}"
-        initialDate="{element.properties.initialDate}"
-        enableDatePicker="{element.properties.enableDatePicker}"
-        class="{element.properties.elementClassAttribute}"
-        errorClass="{element.properties.elementErrorClassAttribute}"
-        additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\'}')}"
-    >
-        <f:if condition="{element.rootForm.renderingOptions.previewMode}">
-            <f:else>
-                <f:if condition="{element.properties.enableDatePicker}">
-                    <script type="text/javascript">
-                        if ("undefined" !== typeof $) {
-                            $(function() {
-                                $("#<f:format.raw>{element.uniqueIdentifier}</f:format.raw>").datepicker({
-                                    dateFormat: "<f:format.raw>{datePickerDateFormat}</f:format.raw>"
-                                }).on("keydown", function(e) {
-                                    // By using "backspace" or "delete", you can clear the datepicker again.
-                                    if(e.keyCode == 8 || e.keyCode == 46) {
-                                        e.preventDefault();
-                                        $.datepicker._clearDate(this);
-                                    }
-                                });
-                            });
-                        }
-                    </script>
-                </f:if>
-            </f:else>
-        </f:if>
-    </formvh:form.datePicker>
-
-    <f:if condition="{element.properties.displayTimeSelector}">
-        <formvh:form.timePicker
-                id="{element.uniqueIdentifier}-time"
-                property="{element.identifier}"
-                initialDate="{element.properties.initialDate}"
-                class="{element.properties.timeSelectorClassAttribute} form-control"
-                errorClass="{element.properties.elementErrorClassAttribute}"
-        />
-    </f:if>
-</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Fieldset.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Fieldset.html
deleted file mode 100644 (file)
index 89c64c4..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<fieldset id="{section.uniqueIdentifier}" class="form-group{f:if(condition: section.properties.elementClassAttribute, then: ' {section.properties.elementClassAttribute}')}">
-    <f:if condition="{section.label}">
-        <legend>{formvh:translateElementProperty(element: section, property: 'label')}</legend>
-    </f:if>
-    <f:for each="{section.elements}" as="element">
-        <formvh:renderRenderable renderable="{element}" />
-    </f:for>
-</fieldset>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/FileUpload.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/FileUpload.html
deleted file mode 100644 (file)
index d2774be..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<f:layout name="Field" />
-<f:section name="field">
-    <formvh:form.uploadedResource property="{element.identifier}" as="resource" additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\'}')}" accept="{element.properties.allowedMimeTypes}">
-        <f:if condition="{resource}">
-            <div id="{element.uniqueIdentifier}-preview">
-                {resource.originalResource.originalFile.name}
-            </div>
-        </f:if>
-    </formvh:form.uploadedResource>
-</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Form.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Form.html
deleted file mode 100644 (file)
index e4c950a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<formvh:form object="{form}" action="perform" method="post" id="{form.identifier}" section="{form.identifier}" enctype="multipart/form-data">
-    <formvh:renderRenderable renderable="{form.currentPage}" />
-    <div class="actions">
-        <f:render partial="Form/Navigation" arguments="{form: form}" />
-    </div>
-</formvh:form>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Hidden.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Hidden.html
deleted file mode 100644 (file)
index 0d4b716..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<f:form.hidden property="{element.identifier}" id="{element.uniqueIdentifier}" value="{element.properties.value}" />
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Honeypot.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Honeypot.html
deleted file mode 100644 (file)
index 6f26f34..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<f:if condition="{element.properties.renderAsHiddenField}">
-    <f:then>
-        <f:form.hidden property="{element.identifier}" id="{element.uniqueIdentifier}" additionalAttributes="{autocomplete: 'off'}" />
-    </f:then>
-    <f:else>
-        <f:form.textfield property="{element.identifier}" id="{element.uniqueIdentifier}" class="{element.properties.elementClassAttribute}" additionalAttributes="{autocomplete: 'off'}" style="{element.properties.styleAttribute}" />
-    </f:else>
-</f:if>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/ImageUpload.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/ImageUpload.html
deleted file mode 100644 (file)
index 3c6798a..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<f:layout name="Field" />
-<f:section name="field">
-    <formvh:form.uploadedResource property="{element.identifier}" as="image" additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\'}')}" accept="{element.properties.allowedMimeTypes}">
-        <f:if condition="{image}">
-            <div id="{element.uniqueIdentifier}-preview">
-                <a href="{f:uri.image(image: image, maxWidth: element.properties.imageLinkMaxWidth)}" class="{element.properties.elementClassAttribute}">
-                    <f:image image="{image}" maxWidth="{element.properties.imageMaxWidth}" maxHeight="{element.properties.imageMaxHeight}" alt="{formvh:translateElementProperty(element: element, property: 'altText')}" />
-                </a>
-            </div>
-        </f:if>
-    </formvh:form.uploadedResource>
-</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/MultiCheckbox.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/MultiCheckbox.html
deleted file mode 100644 (file)
index 642dcdf..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<f:layout name="Field" />
-<f:section name="field">
-    <div id="{element.uniqueIdentifier}" class="inputs-list">
-        <f:for each="{element.properties.options}" as="label" key="value">
-            <div class="form-check">
-                <label class="form-check-label">
-                    <formvh:form.checkbox
-                            property="{element.identifier}"
-                            multiple="1"
-                            class="{element.properties.elementClassAttribute}"
-                            value="{value}"
-                            errorClass="{element.properties.elementErrorClassAttribute}"
-                    />
-                    <span>{formvh:translateElementProperty(element: element, property: 'options.{value}')}</span>
-                </label>
-            </div>
-        </f:for>
-    </div>
-</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/MultiSelect.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/MultiSelect.html
deleted file mode 100644 (file)
index c845942..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<f:layout name="Field" />
-<f:section name="field">
-    <f:form.select
-            property="{element.identifier}"
-            id="{element.uniqueIdentifier}"
-            class="{element.properties.elementClassAttribute} form-control"
-            options="{formvh:translateElementProperty(element: element, property: 'options')}"
-            multiple="multiple"
-            errorClass="{element.properties.elementErrorClassAttribute}"
-    />
-</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Page.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Page.html
deleted file mode 100644 (file)
index 7ad0090..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<f:if condition="{page.label}">
-    <h2>{formvh:translateElementProperty(element: page, property: 'label')}</h2>
-</f:if>
-<f:for each="{page.elements}" as="element">
-    <formvh:renderRenderable renderable="{element}" />
-</f:for>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Password.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Password.html
deleted file mode 100644 (file)
index 89f7780..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<f:layout name="Field" />
-<f:section name="field">
-    <f:form.password
-            property="{element.identifier}"
-            id="{element.uniqueIdentifier}"
-            class="{element.properties.elementClassAttribute} form-control"
-            additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\', placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}', else: '{placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}')}"
-            errorClass="{element.properties.elementErrorClassAttribute}"
-    />
-</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/RadioButton.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/RadioButton.html
deleted file mode 100644 (file)
index 7434e45..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<f:layout name="Field" />
-<f:section name="field">
-    <div id="{element.uniqueIdentifier}" class="inputs-list">
-        <div class="form-group">
-            <f:for each="{element.properties.options}" as="label" key="value">
-                <div class="form-check">
-                    <label class="form-check-label">
-                        <f:form.radio
-                                property="{element.identifier}"
-                                class="{element.properties.elementClassAttribute} form-check-input"
-                                value="{value}"
-                                errorClass="{element.properties.elementErrorClassAttribute}"
-                                additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\'}')}"
-                        />
-                        <span>{formvh:translateElementProperty(element: element, property: 'options.{value}')}</span>
-                    </label>
-                </div>
-            </f:for>
-        </div>
-    </div>
-</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/SingleSelect.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/SingleSelect.html
deleted file mode 100644 (file)
index bb125dc..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<f:layout name="Field" />
-<f:section name="field">
-    <f:form.select
-            property="{element.identifier}"
-            id="{element.uniqueIdentifier}"
-            options="{formvh:translateElementProperty(element: element, property: 'options')}"
-            class="{element.properties.elementClassAttribute} form-control"
-            errorClass="{element.properties.elementErrorClassAttribute}"
-            additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\'}')}"
-    />
-</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/StaticText.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/StaticText.html
deleted file mode 100644 (file)
index 9fe0a2a..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<div class="clearfix">
-    <f:if condition="{element.label}">
-        <h2>{formvh:translateElementProperty(element: element, property: 'label')}</h2>
-    </f:if>
-    <f:if condition="{element.properties.text}">
-        <p{f:if(condition: element.properties.elementClassAttribute, then: ' class="{element.properties.elementClassAttribute}"')}>{formvh:translateElementProperty(element: element, property: 'text') -> f:format.nl2br()}</p>
-    </f:if>
-</div>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/SummaryPage.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/SummaryPage.html
deleted file mode 100644 (file)
index 3afa995..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<fieldset class="form-group">
-    <f:if condition="{page.label}">
-        <legend>{formvh:translateElementProperty(element: page, property: 'label')}</legend>
-    </f:if>
-    <div class="table-responsive">
-        <table class="table">
-            <formvh:renderAllFormValues renderable="{page.rootForm}">
-                <tr>
-                    <td class="summary-table-first-col">{formvh:translateElementProperty(element: formValue.element, property: 'label')}</td>
-                    <td>
-                        <f:if condition="{formValue.value}">
-                            <f:then>
-                                <f:if condition="{0: formValue.element.type} == {0: 'ImageUpload'}">
-                                    <f:then>
-                                        <f:image image="{formValue.value}" maxWidth="{formValue.element.properties.imageMaxWidth}" maxHeight="{formValue.element.properties.imageMaxHeight}" alt="{formvh:translateElementProperty(element: formValue.element, property: 'altText')}" />
-                                    </f:then>
-                                    <f:else>
-                                        <f:if condition="{formValue.isMultiValue}">
-                                            <f:then>
-                                                <ul>
-                                                    <f:for each="{formValue.processedValue}" as="value">
-                                                        <li>{value}</li>
-                                                    </f:for>
-                                                </ul>
-                                            </f:then>
-                                            <f:else>
-                                                {formValue.processedValue}
-                                            </f:else>
-                                        </f:if>
-                                    </f:else>
-                                </f:if>
-                            </f:then>
-                            <f:else>
-                                -
-                            </f:else>
-                        </f:if>
-                    </td>
-                </tr>
-            </formvh:renderAllFormValues>
-        </table>
-    </div>
-</fieldset>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Text.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Text.html
deleted file mode 100644 (file)
index 0eb10c2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<f:layout name="Field" />
-<f:section name="field">
-    <f:form.textfield
-            property="{element.identifier}"
-            id="{element.uniqueIdentifier}"
-            class="{element.properties.elementClassAttribute} form-control"
-            placeholder="{formvh:translateElementProperty(element: element, property: 'placeholder')}"
-            errorClass="{element.properties.elementErrorClassAttribute}"
-            required="{element.required}"
-    />
-</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Textarea.html b/typo3/sysext/form/Resources/Private/Frontend/Templates/FormElements/Textarea.html
deleted file mode 100644 (file)
index c0badde..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
-<f:layout name="Field" />
-<f:section name="field">
-    <f:form.textarea
-            property="{element.identifier}"
-            id="{element.uniqueIdentifier}"
-            class="{element.properties.elementClassAttribute} form-control"
-            rows="{element.properties.rows}"
-            cols="{element.properties.cols}"
-            errorClass="{element.properties.elementErrorClassAttribute}"
-            additionalAttributes="{f:if(condition: '{element.required}', then: '{required: \'required\', placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}', else: '{placeholder: \'{formvh:translateElementProperty(element: element, property: \"placeholder\")}\'}')}"
-    />
-</f:section>
\ No newline at end of file
index 105ffc5..0c7112d 100644 (file)
@@ -325,10 +325,15 @@ class FormEditorControllerTest extends \TYPO3\CMS\Components\TestingFramework\Co
             'dummy'
         ], [], '', false);
 
-        $input = [
-            'templateRootPaths' => [],
-        ];
-        $mockController->_call('renderFormEditorTemplates', $input, []);
+        $mockController->_set('prototypeConfiguration', [
+            'formEditor' => [
+                'formEditorFluidConfiguration' => [
+                    'templatePathAndFilename' => '',
+                ],
+            ],
+        ]);
+
+        $mockController->_call('renderFormEditorTemplates', []);
     }
 
     /**
@@ -343,11 +348,16 @@ class FormEditorControllerTest extends \TYPO3\CMS\Components\TestingFramework\Co
             'dummy'
         ], [], '', false);
 
-        $input = [
-            'templateRootPaths' => [],
-            'layoutRootPaths' => '',
-        ];
-        $mockController->_call('renderFormEditorTemplates', $input, []);
+        $mockController->_set('prototypeConfiguration', [
+            'formEditor' => [
+                'formEditorFluidConfiguration' => [
+                    'templatePathAndFilename' => '',
+                    'layoutRootPaths' => '',
+                ],
+            ],
+        ]);
+
+        $mockController->_call('renderFormEditorTemplates', []);
     }
 
     /**
@@ -362,11 +372,16 @@ class FormEditorControllerTest extends \TYPO3\CMS\Components\TestingFramework\Co
             'dummy'
         ], [], '', false);
 
-        $input = [
-            'templateRootPaths' => [],
-            'layoutRootPaths' => [],
-        ];
-        $mockController->_call('renderFormEditorTemplates', $input, []);
+        $mockController->_set('prototypeConfiguration', [
+            'formEditor' => [
+                'formEditorFluidConfiguration' => [
+                    'templatePathAndFilename' => '',
+                    'layoutRootPaths' => [],
+                ],
+            ],
+        ]);
+
+        $mockController->_call('renderFormEditorTemplates', []);
     }
 
     /**
@@ -381,10 +396,36 @@ class FormEditorControllerTest extends \TYPO3\CMS\Components\TestingFramework\Co
             'dummy'
         ], [], '', false);
 
-        $input = [
-            'templateRootPaths' => [],
-            'layoutRootPaths' => [],
-        ];
-        $mockController->_call('renderFormEditorTemplates', $input, []);
+        $mockController->_set('prototypeConfiguration', [
+            'formEditor' => [
+                'formEditorFluidConfiguration' => [
+                    'templatePathAndFilename' => '',
+                    'layoutRootPaths' => [],
+                ],
+            ],
+        ]);
+
+        $mockController->_call('renderFormEditorTemplates', []);
+    }
+
+    /**
+     * @test
+     */
+    public function renderFormEditorTemplatesThrowsExceptionIftemplatePathAndFilenameNotSet()
+    {
+        $this->expectException(RenderingException::class);
+        $this->expectExceptionCode(1485636499);
+
+        $mockController = $this->getAccessibleMock(FormEditorController::class, [
+            'dummy'
+        ], [], '', false);
+
+        $mockController->_set('prototypeConfiguration', [
+            'formEditor' => [
+                'formEditorFluidConfiguration' => [],
+            ],
+        ]);
+
+        $mockController->_call('renderFormEditorTemplates', []);
     }
 }
diff --git a/typo3/sysext/form/Tests/Unit/Domain/FormElements/AbstractSectionTest.php b/typo3/sysext/form/Tests/Unit/Domain/FormElements/AbstractSectionTest.php
new file mode 100644 (file)
index 0000000..753836d
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+namespace TYPO3\CMS\Form\Tests\Unit\Domain\FormElements;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Form\Domain\Exception\TypeDefinitionNotFoundException;
+use TYPO3\CMS\Form\Domain\Model\FormDefinition;
+use TYPO3\CMS\Form\Domain\Model\FormElements\AbstractSection;
+
+/**
+ * Test case
+ */
+class AbstractSectionTest extends \TYPO3\CMS\Components\TestingFramework\Core\UnitTestCase
+{
+
+    /**
+     * @test
+     */
+    public function createElementThrowsExceptionIfTypeDefinitionNotFound()
+    {
+        $mockAbstractSection = $this->getAccessibleMockForAbstractClass(AbstractSection::class,
+            [], '', false, true, true, [
+                'getRootForm',
+            ]
+        );
+
+        $mockFormDefinition = $this->getAccessibleMock(FormDefinition::class, [
+            'getTypeDefinitions',
+            'getRenderingOptions'
+        ], [], '', false);
+
+        $mockFormDefinition
+            ->expects($this->any())
+            ->method('getTypeDefinitions')
+            ->willReturn([]);
+
+        $mockFormDefinition
+            ->expects($this->any())
+            ->method('getRenderingOptions')
+            ->willReturn(['skipUnknownElements' => false]);
+
+        $mockAbstractSection
+            ->expects($this->any())
+            ->method('getRootForm')
+            ->willReturn($mockFormDefinition);
+
+        $this->expectException(TypeDefinitionNotFoundException::class);
+        $this->expectExceptionCode(1382364019);
+
+        $mockAbstractSection->_call('createElement', '', '');
+    }
+}
diff --git a/typo3/sysext/form/Tests/Unit/Domain/Runtime/FormRuntimeTest.php b/typo3/sysext/form/Tests/Unit/Domain/Runtime/FormRuntimeTest.php
new file mode 100644 (file)
index 0000000..be17ef6
--- /dev/null
@@ -0,0 +1,164 @@
+<?php
+namespace TYPO3\CMS\Form\Tests\Unit\Domain\Runtime;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Object\ObjectManager;
+use TYPO3\CMS\Form\Domain\Exception\RenderingException;
+use TYPO3\CMS\Form\Domain\Model\FormDefinition;
+use TYPO3\CMS\Form\Domain\Model\FormElements\Page;
+use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
+use TYPO3\CMS\Form\Domain\Runtime\FormState;
+
+/**
+ * Test case
+ */
+class FormRuntimeTest extends \TYPO3\CMS\Components\TestingFramework\Core\UnitTestCase
+{
+
+    /**
+     * @var array A backup of registered singleton instances
+     */
+    protected $singletonInstances = [];
+
+    /**
+     * Set up
+     */
+    public function setUp()
+    {
+        $this->singletonInstances = GeneralUtility::getSingletonInstances();
+    }
+
+    /**
+     * Tear down
+     */
+    public function tearDown()
+    {
+        GeneralUtility::resetSingletonInstances($this->singletonInstances);
+        parent::tearDown();
+    }
+
+    /**
+     * @test
+     */
+    public function renderThrowsExceptionIfFormDefinitionReturnsNoRendererClassName()
+    {
+        $mockFormRuntime = $this->getAccessibleMock(FormRuntime::class, [
+            'isAfterLastPage'
+        ], [], '', false);
+
+        $mockPage = $this->getAccessibleMock(Page::class, [
+            'getIndex'
+        ], [], '', false);
+
+        $mockFormState = $this->getAccessibleMock(FormState::class, [
+            'dummy'
+        ], [], '', false);
+
+        $mockFormDefinition = $this->getAccessibleMock(FormDefinition::class, [
+            'getRendererClassName',
+            'getIdentifier'
+        ], [], '', false);
+
+        $mockPage
+            ->expects($this->any())
+            ->method('getIndex')
+            ->willReturn(1);
+
+        $mockFormDefinition
+            ->expects($this->any())
+            ->method('getRendererClassName')
+            ->willReturn(null);
+
+        $mockFormDefinition
+            ->expects($this->any())
+            ->method('getIdentifier')
+            ->willReturn('text-1');
+
+        $mockFormRuntime
+            ->expects($this->any())
+            ->method('isAfterLastPage')
+            ->willReturn(false);
+
+        $mockFormRuntime->_set('formState', $mockFormState);
+        $mockFormRuntime->_set('currentPage', $mockPage);
+        $mockFormRuntime->_set('formDefinition', $mockFormDefinition);
+
+        $this->expectException(RenderingException::class);
+        $this->expectExceptionCode(1326095912);
+
+        $mockFormRuntime->_call('render');
+    }
+
+    /**
+     * @test
+     */
+    public function renderThrowsExceptionIfRendererClassNameInstanceDoesNotImplementRendererInterface()
+    {
+        $objectManagerProphecy = $this->prophesize(ObjectManager::class);
+        GeneralUtility::setSingletonInstance(ObjectManager::class, $objectManagerProphecy->reveal());
+
+        $mockFormRuntime = $this->getAccessibleMock(FormRuntime::class, [
+            'isAfterLastPage'
+        ], [], '', false);
+
+        $mockPage = $this->getAccessibleMock(Page::class, [
+            'getIndex'
+        ], [], '', false);
+
+        $mockFormState = $this->getAccessibleMock(FormState::class, [
+            'dummy'
+        ], [], '', false);
+
+        $mockFormDefinition = $this->getAccessibleMock(FormDefinition::class, [
+            'getRendererClassName',
+            'getIdentifier'
+        ], [], '', false);
+
+        $mockPage
+            ->expects($this->any())
+            ->method('getIndex')
+            ->willReturn(1);
+
+        $mockFormDefinition
+            ->expects($this->any())
+            ->method('getRendererClassName')
+            ->willReturn('fooRenderer');
+
+        $mockFormDefinition
+            ->expects($this->any())
+            ->method('getIdentifier')
+            ->willReturn('text-1');
+
+        $mockFormRuntime
+            ->expects($this->any())
+            ->method('isAfterLastPage')
+            ->willReturn(false);
+
+        $objectManagerProphecy
+            ->get('fooRenderer')
+            ->willReturn(new \stdClass);
+
+        $mockFormRuntime->_set('formState', $mockFormState);
+        $mockFormRuntime->_set('currentPage', $mockPage);
+        $mockFormRuntime->_set('formDefinition', $mockFormDefinition);
+        $mockFormRuntime->_set('objectManager', $objectManagerProphecy->reveal());
+
+        $this->expectException(RenderingException::class);
+        $this->expectExceptionCode(1326096024);
+
+        $mockFormRuntime->_call('render');
+    }
+}