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

Properties

$inlineStructure  : array<string|int, mixed>
The structure/hierarchy where working in, e.g. cascading inline tables

Methods

getCurrentStructureDomObjectIdPrefix()  : string
DOM object-id for this inline level
getCurrentStructureFormPrefix()  : string
Prefix for inline form fields
getStructure()  : array<string|int, mixed>
Get current structure stack
getStructureDepth()  : int
Get the depth of the stable structure stack.
getStructureLevel()  : array<string|int, mixed>|false
Get a level from the stack and return the data.
getUnstableStructure()  : array<string|int, mixed>
Get the "unstable" structure item from structure stack.
initializeByGivenStructure()  : mixed
One of two possible initialize methods setting a given structure.
initializeByParsingDomObjectIdString()  : mixed
Convert the DOM object-id of an inline container to an array.
pushStableStructureItem()  : mixed
Add a stable structure to the stack
setAjaxConfiguration()  : mixed
Injects configuration via AJAX calls.
calculateStructureLevel()  : bool|int
Calculates structure level.
getStructureItemName()  : string
Create a name/id for usage in HTML output of a level of the structure stack to be used in form names.
getStructurePath()  : string
Get the identifiers of a given depth of level, from the top of the stack to the bottom.

Properties

$inlineStructure

The structure/hierarchy where working in, e.g. cascading inline tables

protected array<string|int, mixed> $inlineStructure = []

Methods

getCurrentStructureDomObjectIdPrefix()

DOM object-id for this inline level

public getCurrentStructureDomObjectIdPrefix(int|string $inlineFirstPid) : string
Parameters
$inlineFirstPid : int|string

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

Return values
string

getCurrentStructureFormPrefix()

Prefix for inline form fields

public getCurrentStructureFormPrefix() : string
Return values
string

getStructure()

Get current structure stack

public getStructure() : array<string|int, mixed>
Return values
array<string|int, mixed>

Current structure stack

getStructureDepth()

Get the depth of the stable structure stack.

public getStructureDepth() : int

(count($this->inlineStructure['stable'])

Return values
int

The depth of the structure stack

getStructureLevel()

Get a level from the stack and return the data.

public getStructureLevel(int $level) : array<string|int, mixed>|false

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

Parameters
$level : int

Which level to return

Return values
array<string|int, mixed>|false

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

getUnstableStructure()

Get the "unstable" structure item from structure stack.

public getUnstableStructure() : array<string|int, mixed>

This is typically initialized by initializeByParsingDomObjectIdString()

Tags
throws
RuntimeException
Return values
array<string|int, mixed>

Unstable structure item

initializeByGivenStructure()

One of two possible initialize methods setting a given structure.

public initializeByGivenStructure([array<string|int, mixed> $structure = [] ]) : mixed
Parameters
$structure : array<string|int, mixed> = []

initializeByParsingDomObjectIdString()

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

public initializeByParsingDomObjectIdString(string $domObjectId) : mixed

The object-id could look like 'data-bs-parentPageId-tx_mmftest_company-1-employees'. This initializes $this->inlineStructure - used by AJAX entry points 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

pushStableStructureItem()

Add a stable structure to the stack

public pushStableStructureItem([array<string|int, mixed> $structureItem = [] ]) : mixed
Parameters
$structureItem : array<string|int, mixed> = []

setAjaxConfiguration()

Injects configuration via AJAX calls.

public setAjaxConfiguration(array<string|int, mixed> $config) : mixed

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

Parameters
$config : array<string|int, mixed>

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?

calculateStructureLevel()

Calculates structure level.

protected calculateStructureLevel(int $level) : bool|int
Parameters
$level : int

Which level to return

Return values
bool|int

getStructureItemName()

Create a name/id for usage in HTML output of a level of the structure stack to be used in form names.

protected getStructureItemName(array<string|int, mixed> $levelData[, string $disposal = 'Disposal_AttributeId' ]) : string
Parameters
$levelData : array<string|int, mixed>

Array of a level of the structure stack (containing the keys table, uid and field)

$disposal : string = 'Disposal_AttributeId'

How the structure name is used (e.g. as

or )

Return values
string

The name/id of that level, to be used for HTML output

getStructurePath()

Get the identifiers of a given depth of level, from the top of the stack to the bottom.

protected getStructurePath([int $structureDepth = -1 ]) : string

An identifier looks like "

--".

Parameters
$structureDepth : int = -1

How much levels to output, beginning from the top of the stack

Return values
string

The path of identifiers


        
On this page

Search results