‪TYPO3CMS  11.5
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 (ModuleTemplateFactory $moduleTemplateFactory, PageRenderer $pageRenderer, IconFactory $iconFactory, FormDefinitionConversionService $formDefinitionConversionService)
 
ResponseInterface indexAction (string $formPersistenceIdentifier, string $prototypeName=null)
 
 initializeSaveFormAction ()
 
ResponseInterface saveFormAction (string $formPersistenceIdentifier, FormDefinitionArray $formDefinition)
 
ResponseInterface 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)
 
 injectObjectManager (ObjectManagerInterface $objectManager)
 
 injectSignalSlotDispatcher (Dispatcher $signalSlotDispatcher)
 
 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 ()
 
ResponseInterface processRequest (RequestInterface $request)
 
ControllerContext getControllerContext ()
 
 addFlashMessage ($messageBody, $messageTitle='', $severity=AbstractMessage::OK, $storeInSession=true)
 
never forward ($actionName, $controllerName=null, $extensionName=null, array $arguments=null)
 
never throwStatus ($statusCode, $statusMessage=null, $content=null)
 

Protected Member Functions

SiteLanguage buildFakeSiteLanguage (int $pageId, int $languageId)
 
array getInsertRenderablesPanelConfiguration (array $formElementsDefinition)
 
array getFormEditorDefinitions ()
 
 initializeModuleTemplate (ServerRequestInterface $request)
 
string renderFormEditorTemplates (array $formEditorDefinitions)
 
array transformFormDefinitionForFormEditor (array $formDefinition)
 
array transformMultiValuePropertiesForFormEditor (array $formDefinition, string $identifierProperty, array $multiValueProperties)
 
array filterEmptyArrays (array $array)
 
array migrateEmailFinisherRecipients (array $formDefinition)
 
BackendUserAuthentication getBackendUser ()
 
LanguageService getLanguageService ()
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Form\Controller\AbstractBackendController
 resolveResourcePaths (array $resourcePaths)
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController
 initializeView (ViewInterface $view)
 
 initializeAction ()
 
 initializeActionMethodArguments ()
 
 initializeActionMethodValidators ()
 
 renderAssetsForRequest ($request)
 
string resolveActionMethodName ()
 
 callActionMethod (RequestInterface $request)
 
ViewInterface resolveView ()
 
 setViewConfiguration (ViewInterface $view)
 
array getViewProperty ($extbaseFrameworkConfiguration, $setting)
 
ResponseInterface errorAction ()
 
 addErrorFlashMessage ()
 
string bool getErrorFlashMessage ()
 
ResponseInterface null forwardToReferringRequest ()
 
string getFlattenedValidationErrorMessage ()
 
 getFlashMessageQueue (string $identifier=null)
 
ControllerContext buildControllerContext ()
 
never redirect ($actionName, $controllerName=null, $extensionName=null, array $arguments=null, $pageUid=null, $_=null, $statusCode=303)
 
never redirectToUri ($uri, $_=null, $statusCode=303)
 
string addBaseUriIfNecessary ($uri)
 
 mapRequestArgumentsToControllerArguments ()
 
ResponseInterface htmlResponse (string $html=null)
 
ResponseInterface jsonResponse (string $json=null)
 

Protected Attributes

const JS_MODULE_NAMES = ['app', 'mediator', 'viewModel']
 
ModuleTemplateFactory $moduleTemplateFactory
 
PageRenderer $pageRenderer
 
IconFactory $iconFactory
 
FormDefinitionConversionService $formDefinitionConversionService
 
array $prototypeConfiguration
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Form\Controller\AbstractBackendController
array $formSettings
 
TYPO3 CMS Form Mvc Persistence FormPersistenceManagerInterface $formPersistenceManager
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController
ResponseFactoryInterface $responseFactory
 
StreamFactoryInterface $streamFactory
 
TYPO3 CMS Extbase Reflection ReflectionService $reflectionService
 
HashService $hashService
 
ViewInterface $view
 
string $defaultViewObjectName = TemplateView::class
 
string $actionMethodName = 'indexAction'
 
string $errorMethodName = 'errorAction'
 
TYPO3 CMS Extbase Mvc Controller MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService
 
EventDispatcherInterface $eventDispatcher
 
Request $request
 
TYPO3 CMS Extbase SignalSlot Dispatcher $signalSlotDispatcher
 
ObjectManagerInterface $objectManager
 
TYPO3 CMS Extbase Mvc Web Routing UriBuilder $uriBuilder
 
array $settings
 
TYPO3 CMS Extbase Validation ValidatorResolver $validatorResolver
 
TYPO3 CMS Extbase Mvc Controller Arguments $arguments
 
ControllerContext $controllerContext
 
ConfigurationManagerInterface $configurationManager
 

Detailed Description

The form editor controller

Scope: backend

Definition at line 54 of file FormEditorController.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ buildFakeSiteLanguage()

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

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

Parameters
int$pageId
int$languageId
Returns
‪SiteLanguage

Definition at line 281 of file FormEditorController.php.

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

◆ filterEmptyArrays()

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

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

Parameters
array$array
Returns
‪array

Definition at line 666 of file FormEditorController.php.

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

◆ getBackendUser()

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

Returns the current BE user.

Returns
‪BackendUserAuthentication

Definition at line 738 of file FormEditorController.php.

References $GLOBALS.

◆ getFormEditorDefinitions()

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

Reduce the YAML settings by the 'formEditor' keyword.

Returns
‪array

Definition at line 369 of file FormEditorController.php.

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

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

◆ getInsertRenderablesPanelConfiguration()

array 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.

Parameters
array$formElementsDefinition
Returns
‪array

Definition at line 311 of file FormEditorController.php.

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

◆ getLanguageService()

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

Returns the language service

Returns
‪LanguageService

Definition at line 748 of file FormEditorController.php.

References $GLOBALS.

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

◆ 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 187 of file FormEditorController.php.

◆ migrateEmailFinisherRecipients()

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

Migrate single recipient options to their list successors

Parameters
array$formDefinition
Returns
‪array

Definition at line 691 of file FormEditorController.php.

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

◆ renderFormEditorTemplates()

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

◆ renderFormPageAction()

ResponseInterface 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.

Parameters
FormDefinitionArray$formDefinition
int$pageIndex
string$prototypeName
Returns
‪ResponseInterface

Definition at line 255 of file FormEditorController.php.

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

◆ saveFormAction()

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

Save a formDefinition which was build by the form editor.

Parameters
string$formPersistenceIdentifier
FormDefinitionArray$formDefinition
Returns
‪ResponseInterface

Definition at line 200 of file FormEditorController.php.

References $GLOBALS, TYPO3\CMS\Extbase\Mvc\Controller\ActionController\jsonResponse(), and TYPO3\CMS\Form\Controller\FormEditorController\transformFormDefinitionForFormEditor().

◆ transformFormDefinitionForFormEditor()

◆ transformMultiValuePropertiesForFormEditor()

array 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$formDefinition
string$identifierProperty
array$multiValueProperties
Returns
‪array

Definition at line 610 of file FormEditorController.php.

References $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

◆ $formDefinitionConversionService

FormDefinitionConversionService TYPO3\CMS\Form\Controller\FormEditorController::$formDefinitionConversionService
protected

◆ $iconFactory

IconFactory TYPO3\CMS\Form\Controller\FormEditorController::$iconFactory
protected

◆ $moduleTemplateFactory

ModuleTemplateFactory TYPO3\CMS\Form\Controller\FormEditorController::$moduleTemplateFactory
protected

◆ $pageRenderer

PageRenderer TYPO3\CMS\Form\Controller\FormEditorController::$pageRenderer
protected

◆ $prototypeConfiguration

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

Definition at line 65 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.