class NodeTypeEnrichmentService (View source)

internal  
 

Take the node types after loading and replace i18n labels with the namespaced parts.

This happens BEFORE the node types are merged with the super types (in the node type management); but this is implemented as the last step of the {\Neos\ContentRepositoryRegistry\Configuration\NodeTypesLoader}.

Properties

protected ResourceManager $resourceManager

Methods

array
enrichNodeTypeLabelsConfiguration(array $fullConfiguration)

No description

void
addLabelsToNodeTypeConfiguration(string $nodeTypeName, array $configuration, SuperTypeConfigResolver $superTypeConfigResolver)

No description

void
setPropertyLabels(string $nodeTypeName, array $configuration, SuperTypeConfigResolver $superTypeConfigResolver)

No description

string
resolveHelpMessageThumbnail(string $nodeTypeName, string $configurationThumbnail)

Resolve help message thumbnail url

void
applyEditorLabels(string $nodeTypeLabelIdPrefix, string $propertyName, string $editorName, array $editorOptions, callable $translationIdGenerator)

No description

void
setGlobalUiElementLabels(string $nodeTypeName, array $configuration)

Sets labels for global NodeType elements like tabs and groups and the general label.

bool
shouldFetchTranslation(array $parentConfiguration, string $fieldName = 'label')

Should a label be generated for the given field or is there something configured?

string
getInspectorElementTranslationId(string $nodeTypeSpecificPrefix, string $elementType, string $elementName)

Generates a generic inspector element label with the given $nodeTypeSpecificPrefix.

string
getPropertyLabelTranslationId(string $nodeTypeSpecificPrefix, string $propertyName)

Generates a property label with the given $nodeTypeSpecificPrefix.

string
getPropertyConfigurationTranslationId(string $nodeTypeSpecificPrefix, string $propertyName, string $labelPath)

Generates a property configuration-label with the given $nodeTypeSpecificPrefix.

string
generateNodeTypeLabelIdPrefix(string $nodeTypeName)

Generates a label prefix for a specific node type with this format: "Vendor_Package:NodeTypes.NodeTypeName"

array<string,string>
splitIdentifier(string $id)

Splits an identifier string of the form PackageKey:id or PackageKey:Source:id into an array with the keys id, source and packageKey.

Details

array enrichNodeTypeLabelsConfiguration(array $fullConfiguration)

No description

Parameters

array $fullConfiguration

Return Value

array

protected void addLabelsToNodeTypeConfiguration(string $nodeTypeName, array $configuration, SuperTypeConfigResolver $superTypeConfigResolver)

No description

Parameters

string $nodeTypeName
array $configuration
SuperTypeConfigResolver $superTypeConfigResolver

Return Value

void

protected void setPropertyLabels(string $nodeTypeName, array $configuration, SuperTypeConfigResolver $superTypeConfigResolver)

No description

Parameters

string $nodeTypeName
array $configuration
SuperTypeConfigResolver $superTypeConfigResolver

Return Value

void

protected string resolveHelpMessageThumbnail(string $nodeTypeName, string $configurationThumbnail)

Resolve help message thumbnail url

Parameters

string $nodeTypeName
string $configurationThumbnail

Return Value

string

$thumbnailUrl

protected void applyEditorLabels(string $nodeTypeLabelIdPrefix, string $propertyName, string $editorName, array $editorOptions, callable $translationIdGenerator)

No description

Parameters

string $nodeTypeLabelIdPrefix
string $propertyName
string $editorName
array $editorOptions
callable $translationIdGenerator

Return Value

void

protected void setGlobalUiElementLabels(string $nodeTypeName, array $configuration)

Sets labels for global NodeType elements like tabs and groups and the general label.

Parameters

string $nodeTypeName
array $configuration

Return Value

void

protected bool shouldFetchTranslation(array $parentConfiguration, string $fieldName = 'label')

Should a label be generated for the given field or is there something configured?

Parameters

array $parentConfiguration
string $fieldName

Name of the possibly existing subfield

Return Value

bool

protected string getInspectorElementTranslationId(string $nodeTypeSpecificPrefix, string $elementType, string $elementName)

Generates a generic inspector element label with the given $nodeTypeSpecificPrefix.

Parameters

string $nodeTypeSpecificPrefix
string $elementType
string $elementName

Return Value

string

protected string getPropertyLabelTranslationId(string $nodeTypeSpecificPrefix, string $propertyName)

Generates a property label with the given $nodeTypeSpecificPrefix.

Parameters

string $nodeTypeSpecificPrefix
string $propertyName

Return Value

string

protected string getPropertyConfigurationTranslationId(string $nodeTypeSpecificPrefix, string $propertyName, string $labelPath)

Generates a property configuration-label with the given $nodeTypeSpecificPrefix.

Parameters

string $nodeTypeSpecificPrefix
string $propertyName
string $labelPath

Return Value

string

protected string generateNodeTypeLabelIdPrefix(string $nodeTypeName)

Generates a label prefix for a specific node type with this format: "Vendor_Package:NodeTypes.NodeTypeName"

Parameters

string $nodeTypeName

Return Value

string

protected array<string,string> splitIdentifier(string $id)

Splits an identifier string of the form PackageKey:id or PackageKey:Source:id into an array with the keys id, source and packageKey.

Parameters

string $id

translation id with possible package and source parts

Return Value

array<string,string>