FormEditorEnrichmentService

Read onlyYes

Service to enrich form editor definitions with additional runtime data.

This service processes form editor definitions and enriches them with additional configuration data that is needed for the form editor UI. Currently, it handles the enrichment of textarea editors with RTE options.

Internal
Attributes
#[Autoconfigure]
$public: true

Table of Contents

Methods

__construct()  : mixed
enrichFormEditorDefinitions()  : array
Enrich form editor definitions with RTE options and other runtime data.
enrichDefinitionWithRichTextOptions()  : void
Enrich a single definition with RTE options for its editors and property collections.
enrichEditorsWithRichTextOptions()  : void
Enrich editors array with RTE options if enableRichtext is set.
enrichPropertyCollectionsWithRichTextOptions()  : void
Enrich property collections (e.g., finishers, validators) with RTE options.
resolveRichTextOptions()  : array
Resolve CKEditor configuration options for the given editor.
shouldEnrichEditorWithRichText()  : bool
Check if an editor should be enriched with RTE options.

Methods

enrichFormEditorDefinitions()

Enrich form editor definitions with RTE options and other runtime data.

public enrichFormEditorDefinitions(array $formEditorDefinitions) : array

Processes all form editor definitions and adds CKEditor configuration to textarea editors that have enableRichtext enabled.

Parameters
$formEditorDefinitions : array

The form editor definitions to enrich

Return values
array —

The enriched form editor definitions

enrichDefinitionWithRichTextOptions()

Enrich a single definition with RTE options for its editors and property collections.

protected enrichDefinitionWithRichTextOptions(array &$definition) : void
Parameters
$definition : array

enrichEditorsWithRichTextOptions()

Enrich editors array with RTE options if enableRichtext is set.

protected enrichEditorsWithRichTextOptions(array &$editors) : void

Iterates through all editors and adds RTE configuration options to textarea editors that have rich text enabled.

Parameters
$editors : array

enrichPropertyCollectionsWithRichTextOptions()

Enrich property collections (e.g., finishers, validators) with RTE options.

protected enrichPropertyCollectionsWithRichTextOptions(array &$propertyCollections) : void

Property collections have an additional numeric level in their structure: propertyCollections -> collectionName (e.g., 'finishers') -> numeric index -> editors

Parameters
$propertyCollections : array

resolveRichTextOptions()

Resolve CKEditor configuration options for the given editor.

protected resolveRichTextOptions(array $editor) : array

Retrieves the RTE preset configuration and resolves it into a complete CKEditor configuration that can be used in the form editor.

Parameters
$editor : array
Return values
array

shouldEnrichEditorWithRichText()

Check if an editor should be enriched with RTE options.

protected shouldEnrichEditorWithRichText(array $editor) : bool

An editor qualifies for RTE enrichment if it is a textarea editor and has the enableRichtext flag set to true.

Parameters
$editor : array
Return values
bool
On this page

Search results