class ContentElementWrappingService (View source)

The content element wrapping service adds the necessary markup around a content element such that it can be edited using the Content Module of the Neos Backend.

Properties

protected PrivilegeManagerInterface $privilegeManager
protected AuthorizationService $nodeAuthorizationService
protected HtmlAugmenter $htmlAugmenter
protected NodePropertyConverterService $nodePropertyConverterService

Methods

string
wrapContentObject(NodeInterface $node, string $content, string $fusionPath, array $additionalAttributes = [])

Wrap the $content identified by $node with the needed markup for the backend.

string
wrapCurrentDocumentMetadata(NodeInterface $node, string $content, string $fusionPath, array $additionalAttributes = [])

No description

array
addNodePropertyAttributes(array $attributes, NodeInterface $node)

Adds node properties to the given $attributes collection and returns the extended array

array
renderNodePropertyAttribute(NodeInterface $node, string $propertyName)

Renders data attributes needed for the given node property.

array
addCssClasses(array $attributes, NodeInterface $node, array $initialClasses = [])

Add required CSS classes to the attributes.

array
addDocumentMetadata(array $attributes, NodeInterface $node)

Collects metadata for the Neos backend specifically for document nodes.

array
addGenericEditingMetadata(array $attributes, NodeInterface $node)

Collects metadata attributes used to allow editing of the node in the Neos backend.

array
collectEditingClassNames(NodeInterface $node)

Collects CSS class names used for styling editable elements in the Neos backend.

bool
isInlineEditable(NodeInterface $node)

Determine if the Node or one of it's properties is inline editable.

bool
hasInlineEditableProperties(NodeInterface $node)

Checks if the given Node has any properties configured as 'inlineEditable'

bool
needsMetadata(NodeInterface $node, bool $renderCurrentDocumentMetadata)

No description

string
dasherize(string $value)

Converts camelCased strings to lower cased and non-camel-cased strings

Details

string wrapContentObject(NodeInterface $node, string $content, string $fusionPath, array $additionalAttributes = [])

Wrap the $content identified by $node with the needed markup for the backend.

Parameters

NodeInterface $node
string $content
string $fusionPath
array $additionalAttributes

additional attributes in the form ['' => '', ...] to be rendered in the element wrapping

Return Value

string

string wrapCurrentDocumentMetadata(NodeInterface $node, string $content, string $fusionPath, array $additionalAttributes = [])

No description

Parameters

NodeInterface $node
string $content
string $fusionPath
array $additionalAttributes

additional attributes in the form ['' => '', ...] to be rendered in the element wrapping

Return Value

string

protected array addNodePropertyAttributes(array $attributes, NodeInterface $node)

Adds node properties to the given $attributes collection and returns the extended array

Parameters

array $attributes
NodeInterface $node

Return Value

array

the merged attributes

protected array renderNodePropertyAttribute(NodeInterface $node, string $propertyName)

Renders data attributes needed for the given node property.

Parameters

NodeInterface $node
string $propertyName

Return Value

array

protected array addCssClasses(array $attributes, NodeInterface $node, array $initialClasses = [])

Add required CSS classes to the attributes.

Parameters

array $attributes
NodeInterface $node
array $initialClasses

Return Value

array

protected array addDocumentMetadata(array $attributes, NodeInterface $node)

Collects metadata for the Neos backend specifically for document nodes.

Parameters

array $attributes
NodeInterface $node

Return Value

array

protected array addGenericEditingMetadata(array $attributes, NodeInterface $node)

Collects metadata attributes used to allow editing of the node in the Neos backend.

Parameters

array $attributes
NodeInterface $node

Return Value

array

protected array collectEditingClassNames(NodeInterface $node)

Collects CSS class names used for styling editable elements in the Neos backend.

Parameters

NodeInterface $node

Return Value

array

protected bool isInlineEditable(NodeInterface $node)

Determine if the Node or one of it's properties is inline editable.

$parsedType = TypeHandling::parseType($dataType);

Parameters

NodeInterface $node

Return Value

bool

protected bool hasInlineEditableProperties(NodeInterface $node)

Checks if the given Node has any properties configured as 'inlineEditable'

Parameters

NodeInterface $node

Return Value

bool

protected bool needsMetadata(NodeInterface $node, bool $renderCurrentDocumentMetadata)

No description

Parameters

NodeInterface $node
bool $renderCurrentDocumentMetadata

Return Value

bool

protected string dasherize(string $value)

Converts camelCased strings to lower cased and non-camel-cased strings

Parameters

string $value

Return Value

string