‪TYPO3CMS  ‪main
TYPO3\CMS\Form\Controller\FormEditorController Class Reference
Inheritance diagram for TYPO3\CMS\Form\Controller\FormEditorController:
TYPO3\CMS\Form\Controller\AbstractBackendController TYPO3\CMS\Extbase\Mvc\Controller\ActionController TYPO3\CMS\Extbase\Mvc\Controller\ControllerInterface

Public Member Functions

 __construct (protected readonly ModuleTemplateFactory $moduleTemplateFactory, protected readonly PageRenderer $pageRenderer, protected readonly IconFactory $iconFactory, protected readonly FormDefinitionConversionService $formDefinitionConversionService,)
 
 indexAction (string $formPersistenceIdentifier, string $prototypeName=null)
 
 initializeSaveFormAction ()
 
 saveFormAction (string $formPersistenceIdentifier, FormDefinitionArray $formDefinition)
 
 renderFormPageAction (FormDefinitionArray $formDefinition, int $pageIndex, string $prototypeName=null)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Form\Controller\AbstractBackendController
 injectFormPersistenceManager (FormPersistenceManagerInterface $formPersistenceManager)
 
 initializeObject ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController
 injectResponseFactory (ResponseFactoryInterface $responseFactory)
 
 injectStreamFactory (StreamFactoryInterface $streamFactory)
 
 injectConfigurationManager (ConfigurationManagerInterface $configurationManager)
 
 injectValidatorResolver (ValidatorResolver $validatorResolver)
 
 injectViewResolver (ViewResolverInterface $viewResolver)
 
 injectReflectionService (ReflectionService $reflectionService)
 
 injectHashService (HashService $hashService)
 
 injectMvcPropertyMappingConfigurationService (MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService)
 
 injectEventDispatcher (EventDispatcherInterface $eventDispatcher)
 
 injectPropertyMapper (PropertyMapper $propertyMapper)
 
 injectInternalFlashMessageService (FlashMessageService $flashMessageService)
 
 injectInternalExtensionService (ExtensionService $extensionService)
 
 initializeControllerArgumentsBaseValidators ()
 
 processRequest (RequestInterface $request)
 
 addFlashMessage (string $messageBody, string $messageTitle='', ContextualFeedbackSeverity $severity=ContextualFeedbackSeverity::OK, bool $storeInSession=true)
 
 throwStatus (int $statusCode, string $statusMessage='', ?string $content=null)
 

Protected Member Functions

 buildFakeSiteLanguage (int $pageId, int $languageId)
 
 getInsertRenderablesPanelConfiguration (array $formElementsDefinition)
 
 getFormEditorDefinitions ()
 
 initializeModuleTemplate (RequestInterface $request)
 
 renderFormEditorTemplates (array $formEditorDefinitions)
 
 transformFormDefinitionForFormEditor (array $formDefinition)
 
 transformMultiValuePropertiesForFormEditor (array $formDefinition, string $identifierProperty, array $multiValueProperties)
 
 filterEmptyArrays (array $array)
 
 migrateEmailFinisherRecipients (array $formDefinition)
 
 getBackendUser ()
 
 getLanguageService ()
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController
 initializeAction ()
 
 initializeActionMethodArguments ()
 
 initializeActionMethodValidators ()
 
 renderAssetsForRequest (RequestInterface $request)
 
 resolveActionMethodName ()
 
 callActionMethod (RequestInterface $request)
 
 resolveView ()
 
 setViewConfiguration (ViewInterface $view)
 
 errorAction ()
 
 addErrorFlashMessage ()
 
 getErrorFlashMessage ()
 
 forwardToReferringRequest ()
 
 getFlattenedValidationErrorMessage ()
 
 getFlashMessageQueue (string $identifier=null)
 
 redirect (?string $actionName, ?string $controllerName=null, ?string $extensionName=null, ?array $arguments=null, ?int $pageUid=null, $_=null, int $statusCode=303)
 
 redirectToUri (string|UriInterface $uri, $_=null, int $statusCode=303)
 
 addBaseUriIfNecessary (string $uri)
 
 mapRequestArgumentsToControllerArguments ()
 
 htmlResponse (string $html=null)
 
 jsonResponse (string $json=null)
 

Protected Attributes

const JS_MODULE_NAMES = ['app', 'mediator', 'viewModel']
 
array $prototypeConfiguration
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Form\Controller\AbstractBackendController
array $formSettings
 
FormPersistenceManagerInterface $formPersistenceManager
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController
ResponseFactoryInterface $responseFactory
 
StreamFactoryInterface $streamFactory
 
HashService $hashService
 
ReflectionService $reflectionService
 
ViewInterface $view
 
string $defaultViewObjectName = TemplateView::class
 
string $actionMethodName = 'indexAction'
 
string $errorMethodName = 'errorAction'
 
MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService
 
EventDispatcherInterface $eventDispatcher
 
RequestInterface $request
 
UriBuilder $uriBuilder
 
array $settings
 
ValidatorResolver $validatorResolver
 
Arguments $arguments
 
ConfigurationManagerInterface $configurationManager
 

Detailed Description

The form editor controller

Scope: backend

Definition at line 54 of file FormEditorController.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Form\Controller\FormEditorController::__construct ( protected readonly ModuleTemplateFactory  $moduleTemplateFactory,
protected readonly PageRenderer  $pageRenderer,
protected readonly IconFactory  $iconFactory,
protected readonly FormDefinitionConversionService  $formDefinitionConversionService 
)

Definition at line 60 of file FormEditorController.php.

Member Function Documentation

◆ buildFakeSiteLanguage()

TYPO3\CMS\Form\Controller\FormEditorController::buildFakeSiteLanguage ( int  $pageId,
int  $languageId 
)
protected

Build a SiteLanguage object to render the form preview with a specific language.

Definition at line 255 of file FormEditorController.php.

Referenced by TYPO3\CMS\Form\Controller\FormEditorController\renderFormPageAction().

◆ filterEmptyArrays()

TYPO3\CMS\Form\Controller\FormEditorController::filterEmptyArrays ( array  $array)
protected

Remove keys from an array if the key value is an empty array

Definition at line 621 of file FormEditorController.php.

Referenced by TYPO3\CMS\Form\Controller\FormEditorController\transformFormDefinitionForFormEditor().

◆ getBackendUser()

TYPO3\CMS\Form\Controller\FormEditorController::getBackendUser ( )
protected

Definition at line 685 of file FormEditorController.php.

References $GLOBALS.

◆ getFormEditorDefinitions()

TYPO3\CMS\Form\Controller\FormEditorController::getFormEditorDefinitions ( )
protected

Reduce the YAML settings by the 'formEditor' keyword.

Definition at line 333 of file FormEditorController.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\reIndexNumericArrayKeysRecursive().

Referenced by TYPO3\CMS\Form\Controller\FormEditorController\indexAction().

◆ getInsertRenderablesPanelConfiguration()

TYPO3\CMS\Form\Controller\FormEditorController::getInsertRenderablesPanelConfiguration ( array  $formElementsDefinition)
protected

Prepare the formElements.*.formEditor section from the YAML settings. Sort all formElements into groups and add additional data.

Definition at line 278 of file FormEditorController.php.

Referenced by TYPO3\CMS\Form\Controller\FormEditorController\renderFormEditorTemplates().

◆ getLanguageService()

TYPO3\CMS\Form\Controller\FormEditorController::getLanguageService ( )
protected

◆ indexAction()

◆ initializeModuleTemplate()

◆ initializeSaveFormAction()

TYPO3\CMS\Form\Controller\FormEditorController::initializeSaveFormAction ( )

Initialize the save action. This action uses the Fluid JsonView::class as view.

Definition at line 176 of file FormEditorController.php.

◆ migrateEmailFinisherRecipients()

TYPO3\CMS\Form\Controller\FormEditorController::migrateEmailFinisherRecipients ( array  $formDefinition)
protected

Migrate single recipient options to their list successors

Definition at line 643 of file FormEditorController.php.

Referenced by TYPO3\CMS\Form\Controller\FormEditorController\transformFormDefinitionForFormEditor().

◆ renderFormEditorTemplates()

TYPO3\CMS\Form\Controller\FormEditorController::renderFormEditorTemplates ( array  $formEditorDefinitions)
protected

◆ renderFormPageAction()

TYPO3\CMS\Form\Controller\FormEditorController::renderFormPageAction ( FormDefinitionArray  $formDefinition,
int  $pageIndex,
string  $prototypeName = null 
)

Render a page from the formDefinition which was build by the form editor. Use the frontend rendering and set the form framework to preview mode.

Definition at line 233 of file FormEditorController.php.

References TYPO3\CMS\Form\Controller\FormEditorController\buildFakeSiteLanguage(), and TYPO3\CMS\Extbase\Mvc\Controller\ActionController\htmlResponse().

◆ saveFormAction()

TYPO3\CMS\Form\Controller\FormEditorController::saveFormAction ( string  $formPersistenceIdentifier,
FormDefinitionArray  $formDefinition 
)

◆ transformFormDefinitionForFormEditor()

◆ transformMultiValuePropertiesForFormEditor()

TYPO3\CMS\Form\Controller\FormEditorController::transformMultiValuePropertiesForFormEditor ( array  $formDefinition,
string  $identifierProperty,
array  $multiValueProperties 
)
protected

Some data needs a transformation before it can be used by the form editor. This rules for multivalue elements like select elements. To ensure the right sorting if the data goes into javascript, we need to do transformations:

[ '5' => '5', '4' => '4', '3' => '3' ]

This method transform this into:

[ [ _label => '5' _value => 5 ], [ _label => '4' _value => 4 ], [ _label => '3' _value => 3 ], ]

Parameters
array<string,list<string>>‪$multiValueProperties

Definition at line 568 of file FormEditorController.php.

References TYPO3\CMS\Webhooks\Message\$identifier, $output, TYPO3\CMS\Core\Utility\ArrayUtility\getValueByPath(), TYPO3\CMS\Core\Utility\ArrayUtility\isValidPath(), and TYPO3\CMS\Core\Utility\ArrayUtility\setValueByPath().

Referenced by TYPO3\CMS\Form\Controller\FormEditorController\transformFormDefinitionForFormEditor().

Member Data Documentation

◆ $prototypeConfiguration

array TYPO3\CMS\Form\Controller\FormEditorController::$prototypeConfiguration
protected

Definition at line 58 of file FormEditorController.php.

◆ JS_MODULE_NAMES

const TYPO3\CMS\Form\Controller\FormEditorController::JS_MODULE_NAMES = ['app', 'mediator', 'viewModel']
protected

Definition at line 56 of file FormEditorController.php.