‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Form\InlineStackProcessor Class Reference

Public Member Functions

 initializeByGivenStructure (array $structure=[])
 initializeByParsingDomObjectIdString (string $domObjectId)
 setAjaxConfiguration (array $config)
array getStructure ()
 pushStableStructureItem (array $structureItem=[])
string getCurrentStructureFormPrefix ()
string getCurrentStructureDomObjectIdPrefix ($inlineFirstPid)
array false getStructureLevel ($level)
array getUnstableStructure ()
int getStructureDepth ()

Protected Member Functions

bool int calculateStructureLevel ($level)
string getStructurePath ($structureDepth=-1)
string getStructureItemName ($levelData, $disposal='Disposal_AttributeId')

Protected Attributes

array $inlineStructure = array( )

Detailed Description

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.

: This class may change any time or vanish altogether

Definition at line 31 of file InlineStackProcessor.php.

Member Function Documentation

◆ calculateStructureLevel()

bool int TYPO3\CMS\Backend\Form\InlineStackProcessor::calculateStructureLevel (   $level)

Calculates structure level.

int$level‪Which level to return

Definition at line 213 of file InlineStackProcessor.php.

References TYPO3\CMS\Backend\Form\InlineStackProcessor\getStructureDepth().

Referenced by TYPO3\CMS\Backend\Form\InlineStackProcessor\getStructureLevel(), and TYPO3\CMS\Backend\Form\InlineStackProcessor\setAjaxConfiguration().

◆ getCurrentStructureDomObjectIdPrefix()

string TYPO3\CMS\Backend\Form\InlineStackProcessor::getCurrentStructureDomObjectIdPrefix (   $inlineFirstPid)

DOM object-id for this inline level

int | string$inlineFirstPid‪Pid of top level inline element storage or "NEW..."

Definition at line 162 of file InlineStackProcessor.php.

References TYPO3\CMS\Backend\Form\InlineStackProcessor\getStructureLevel(), and TYPO3\CMS\Backend\Form\InlineStackProcessor\getStructurePath().

◆ getCurrentStructureFormPrefix()

string TYPO3\CMS\Backend\Form\InlineStackProcessor::getCurrentStructureFormPrefix ( )

◆ getStructure()

array TYPO3\CMS\Backend\Form\InlineStackProcessor::getStructure ( )

Get current structure stack

‪array Current structure stack

Definition at line 127 of file InlineStackProcessor.php.

References TYPO3\CMS\Backend\Form\InlineStackProcessor\$inlineStructure.

◆ getStructureDepth()

int TYPO3\CMS\Backend\Form\InlineStackProcessor::getStructureDepth ( )

Get the depth of the stable structure stack. (count($this->inlineStructure['stable'])

‪int The depth of the structure stack

Definition at line 252 of file InlineStackProcessor.php.

Referenced by TYPO3\CMS\Backend\Form\InlineStackProcessor\calculateStructureLevel(), and TYPO3\CMS\Backend\Form\InlineStackProcessor\getStructurePath().

◆ getStructureItemName()

string TYPO3\CMS\Backend\Form\InlineStackProcessor::getStructureItemName (   $levelData,
  $disposal = 'Disposal_AttributeId' 

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

array$levelData‪Array of a level of the structure stack (containing the keys table, uid and field)
string$disposal‪How the structure name is used (e.g. as
or <input name="..." >)
string The name/id of that level, to be used for HTML output

Definition at line 267 of file InlineStackProcessor.php.

References TYPO3\CMS\Backend\Form\InlineStackProcessor\getStructureLevel().

Referenced by TYPO3\CMS\Backend\Form\InlineStackProcessor\getCurrentStructureFormPrefix(), and TYPO3\CMS\Backend\Form\InlineStackProcessor\getStructurePath().

◆ getStructureLevel()

array false TYPO3\CMS\Backend\Form\InlineStackProcessor::getStructureLevel (   $level)

Get a level from the stack and return the data. 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

int$level‪Which level to return
‪array|false The item of the stack at the requested level, or false if not found.

Definition at line 182 of file InlineStackProcessor.php.

References TYPO3\CMS\Backend\Form\InlineStackProcessor\calculateStructureLevel().

Referenced by TYPO3\CMS\Backend\Form\InlineStackProcessor\getCurrentStructureDomObjectIdPrefix(), TYPO3\CMS\Backend\Form\InlineStackProcessor\getCurrentStructureFormPrefix(), TYPO3\CMS\Backend\Form\InlineStackProcessor\getStructureItemName(), and TYPO3\CMS\Backend\Form\InlineStackProcessor\getStructurePath().

◆ getStructurePath()

string TYPO3\CMS\Backend\Form\InlineStackProcessor::getStructurePath (   $structureDepth = -1)

Get the identifiers of a given depth of level, from the top of the stack to the bottom. An identifier looks like "<table>-<uid>-<field>".

int$structureDepth‪How much levels to output, beginning from the top of the stack
‪string The path of identifiers

Definition at line 233 of file InlineStackProcessor.php.

References TYPO3\CMS\Backend\Form\InlineStackProcessor\getStructureDepth(), TYPO3\CMS\Backend\Form\InlineStackProcessor\getStructureItemName(), and TYPO3\CMS\Backend\Form\InlineStackProcessor\getStructureLevel().

Referenced by TYPO3\CMS\Backend\Form\InlineStackProcessor\getCurrentStructureDomObjectIdPrefix().

◆ getUnstableStructure()

array TYPO3\CMS\Backend\Form\InlineStackProcessor::getUnstableStructure ( )

Get the "unstable" structure item from structure stack. This is typically initialized by initializeByParsingDomObjectIdString()

‪array Unstable structure item

Definition at line 199 of file InlineStackProcessor.php.

◆ initializeByGivenStructure()

TYPO3\CMS\Backend\Form\InlineStackProcessor::initializeByGivenStructure ( array  $structure = [])

One of two possible initialize methods setting a given structure.

Definition at line 42 of file InlineStackProcessor.php.

◆ initializeByParsingDomObjectIdString()

TYPO3\CMS\Backend\Form\InlineStackProcessor::initializeByParsingDomObjectIdString ( string  $domObjectId)

Convert the DOM object-id of an inline container to an array. 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)
string$domObjectId‪The DOM object-id

Definition at line 57 of file InlineStackProcessor.php.

References $GLOBALS, TYPO3\CMS\Backend\Form\Utility\FormEngineUtility\getTSconfigForTableRow(), and TYPO3\CMS\Backend\Form\Utility\FormEngineUtility\overrideFieldConf().

◆ pushStableStructureItem()

TYPO3\CMS\Backend\Form\InlineStackProcessor::pushStableStructureItem ( array  $structureItem = [])

Add a stable structure to the stack

Definition at line 135 of file InlineStackProcessor.php.

◆ setAjaxConfiguration()

TYPO3\CMS\Backend\Form\InlineStackProcessor::setAjaxConfiguration ( array  $config)

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

array$config‪Given config extracted from ajax call
‪: Review this construct - Why can't the ajax call fetch these data on its own and transfers it to client instead?

Definition at line 112 of file InlineStackProcessor.php.

References TYPO3\CMS\Backend\Form\InlineStackProcessor\calculateStructureLevel().

Member Data Documentation

◆ $inlineStructure

array TYPO3\CMS\Backend\Form\InlineStackProcessor::$inlineStructure = array( )

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

Definition at line 37 of file InlineStackProcessor.php.

Referenced by TYPO3\CMS\Backend\Form\InlineStackProcessor\getStructure().