InlineStackProcessor

readonly class \TYPO3\CMS\Backend\Form\InlineStackProcessor

Handle inline stack.

Code related to inline elements need to know their nesting level. This class takes care of the according handling and can return field prefixes to be used in DOM.

Tags

internal:

This class may change any time or vanish altogether

Table of Contents

Methods

addAjaxConfigurationToStructure()  : array
Injects configuration via AJAX calls.
getDomObjectIdPrefixFromStructure()  : string
DOM object-id for this inline level
getFormPrefixFromStructure()  : string
Prefix for inline form fields
getStructureFromString()  : array
Convert the DOM object-id of an inline container to an array.
getStructureLevelFromStructure()  : array|null
Get a level from the stack and return the data.
getUnstableStructureFromStructure()  : array
Get the "unstable" structure item from structure stack.

Methods

addAjaxConfigurationToStructure()

Injects configuration via AJAX calls.

public addAjaxConfigurationToStructure(array $structure, array $config) : array

This is used by inline ajax calls that transfer configuration options back to the stack for initialization.

Parameters

$structure : array
$config : array

Given config extracted from ajax call

Tags

todo:

Review this construct - Why can't the ajax call fetch these data on its own and transfers it to client instead?

Return values

array

getDomObjectIdPrefixFromStructure()

DOM object-id for this inline level

public getDomObjectIdPrefixFromStructure(array $structure, int|string $inlineFirstPid) : string

Parameters

$structure : array
$inlineFirstPid : int|string

Pid of top level inline element storage or "NEW..."

Return values

string

getFormPrefixFromStructure()

Prefix for inline form fields

public getFormPrefixFromStructure(array $structure) : string

Parameters

$structure : array

Return values

string

getStructureFromString()

Convert the DOM object-id of an inline container to an array.

public getStructureFromString(string $domObjectId, SchemaCollection $schemaCollection) : array

The object-id could look like 'data-bs-parentPageId-tx_mmftest_company-1-employees'. There are two keys:

  • 'stable': Containing full qualified identifiers (table, uid and field)
  • 'unstable': Containing partly filled data (e.g. only table and possibly field)

Parameters

$domObjectId : string

The DOM object-id

$schemaCollection : SchemaCollection

The TCA schemata collection

Return values

array

getStructureLevelFromStructure()

Get a level from the stack and return the data.

public getStructureLevelFromStructure(array $structure, int $level) : array|null

If the $level value is negative, this function works top-down, if the $level value is positive, this function works bottom-up. If -1 is given, the "current" - most bottom "stable" item is returned

Parameters

$structure : array
$level : int

Which level to return

Return values

array|null —

The item of the stack at the requested level, or null if not found

getUnstableStructureFromStructure()

Get the "unstable" structure item from structure stack.

public getUnstableStructureFromStructure(array $structure) : array

Parameters

$structure : array

Return values

array
On this page