DataStructureIdentifierListener

readonly class \TYPO3\CMS\Form\EventListener\DataStructureIdentifierListener

Event listener extending the flex form handling for tt_content form elements (CType: form_formframework):

  • Adds existing forms to flex form drop down list
  • Adds finisher settings if Option "Override finisher settings" is active

Scope: backend

Attributes

#[Autoconfigure]
$public: true

Table of Contents

Properties

$configurationService  : ConfigurationService
$extbaseConfigurationManager  : ConfigurationManagerInterface
$extFormConfigurationManager  : ConfigurationManagerInterface
$flashMessageService  : FlashMessageService
$formPersistenceManager  : FormPersistenceManagerInterface
$languageServiceFactory  : LanguageServiceFactory
$translationService  : TranslationService

Methods

__construct()  : mixed
Some dependencies are declared lazy since they otherwise collide with early instance creations of FE PageRepository when called in sitations where DB does not yet exist (especially acceptance test setup)
modifyDataStructure()  : void
Adds the list of existing form definitions to the form selection drop down and adds sheets to override finisher settings if requested.
modifyDataStructureIdentifier()  : void
The data structure depends on a current form selection (persistenceIdentifier) and if the field "overrideFinishers" is active. Add both to the identifier to hand these information over to parseDataStructureByIdentifierPostProcess() hook.
addInvalidFrameworkConfigurationFlashMessage()  : void
addSelectedPersistenceIdentifier()  : array
buildFlexformSheetIdentifier()  : string
getAdditionalFinisherSheets()  : array
Returns additional flexform sheets with finisher fields
getLanguageService()  : LanguageService
Data structures are not only parsed in the backend: Record->toArray() does so in the frontend as well, where $GLOBALS['LANG'] is only set up while a backend user is logged in.
initializeNewSheetArray()  : array
Boilerplate XML array of a new sheet.
translateFormEngineConfiguration()  : FormEngineDefinition

Properties

Methods

__construct()

Some dependencies are declared lazy since they otherwise collide with early instance creations of FE PageRepository when called in sitations where DB does not yet exist (especially acceptance test setup)

public __construct(FormPersistenceManagerInterface $formPersistenceManager, ConfigurationService $configurationService, TranslationService $translationService, FlashMessageService $flashMessageService, ConfigurationManagerInterface $extbaseConfigurationManager, ConfigurationManagerInterface $extFormConfigurationManager, LanguageServiceFactory $languageServiceFactory) : mixed

Parameters

$formPersistenceManager : FormPersistenceManagerInterface
$configurationService : ConfigurationService
$translationService : TranslationService
$flashMessageService : FlashMessageService
$extbaseConfigurationManager : ConfigurationManagerInterface
$extFormConfigurationManager : ConfigurationManagerInterface
$languageServiceFactory : LanguageServiceFactory

Tags

todo:

Clean up __construct() / init() of PageRepository!

modifyDataStructureIdentifier()

The data structure depends on a current form selection (persistenceIdentifier) and if the field "overrideFinishers" is active. Add both to the identifier to hand these information over to parseDataStructureByIdentifierPostProcess() hook.

public modifyDataStructureIdentifier(AfterFlexFormDataStructureIdentifierInitializedEvent $event) : void

Parameters

$event : AfterFlexFormDataStructureIdentifierInitializedEvent

Attributes

#[AsEventListener]
'form-framework/modify-data-structure-identifier'

addInvalidFrameworkConfigurationFlashMessage()

protected addInvalidFrameworkConfigurationFlashMessage(Exception $e[, string $identifier = '' ]) : void

Parameters

$e : Exception
$identifier : string = ''

addSelectedPersistenceIdentifier()

protected addSelectedPersistenceIdentifier(string $persistenceIdentifier, array $dataStructure) : array

Parameters

$persistenceIdentifier : string
$dataStructure : array

Return values

array

buildFlexformSheetIdentifier()

protected buildFlexformSheetIdentifier(string $persistenceIdentifier, string $prototypeName, string $formIdentifier, string $finisherIdentifier) : string

Parameters

$persistenceIdentifier : string
$prototypeName : string
$formIdentifier : string
$finisherIdentifier : string

Return values

string

getAdditionalFinisherSheets()

Returns additional flexform sheets with finisher fields

protected getAdditionalFinisherSheets(string $persistenceIdentifier, array $formDefinition, string $prototypeName, PrototypeConfiguration $prototypeConfiguration) : array

Parameters

$persistenceIdentifier : string

Current persistence identifier

$formDefinition : array

The form definition

$prototypeName : string
$prototypeConfiguration : PrototypeConfiguration

Return values

array

getLanguageService()

Data structures are not only parsed in the backend: Record->toArray() does so in the frontend as well, where $GLOBALS['LANG'] is only set up while a backend user is logged in.

protected getLanguageService() : LanguageService

Return values

LanguageService

initializeNewSheetArray()

Boilerplate XML array of a new sheet.

protected initializeNewSheetArray(string $sheetIdentifier, string $finisherName) : array

Parameters

$sheetIdentifier : string
$finisherName : string

Return values

array
On this page