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

Public Member Functions

 initializeByGivenStructure (array $structure=[])
 
 initializeByParsingDomObjectIdString ($domObjectId)
 
 injectAjaxConfiguration (array $config)
 
array getStructure ()
 
 pushStableStructureItem (array $structureItem=[])
 
string getCurrentStructureFormPrefix ()
 
string getCurrentStructureDomObjectIdPrefix ($inlineFirstPid)
 
array 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 29 of file InlineStackProcessor.php.

Member Function Documentation

◆ calculateStructureLevel()

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

Calculates structure level.

Parameters
int$level‪Which level to return
Returns
‪bool|int

Definition at line 215 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\injectAjaxConfiguration().

◆ getCurrentStructureDomObjectIdPrefix()

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

DOM object-id for this inline level

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

Definition at line 164 of file InlineStackProcessor.php.

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

Referenced by TYPO3\CMS\Backend\Form\Container\InlineRecordContainer\render(), and TYPO3\CMS\Backend\Form\Container\InlineControlContainer\render().

◆ getCurrentStructureFormPrefix()

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

◆ getStructure()

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

Get current structure stack

Returns
‪array Current structure stack

Definition at line 127 of file InlineStackProcessor.php.

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

Referenced by TYPO3\CMS\Backend\Form\Container\InlineControlContainer\render().

◆ getStructureDepth()

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

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

Returns
‪int The depth of the structure stack

Definition at line 254 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' 
)
protected

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

Parameters
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="..." >)
Returns
string The name/id of that level, to be used for HTML output

Definition at line 269 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 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

Parameters
int$level‪Which level to return
Returns
‪array The item of the stack at the requested level

Definition at line 184 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(), TYPO3\CMS\Backend\Form\InlineStackProcessor\getStructurePath(), and TYPO3\CMS\Backend\Form\Container\InlineControlContainer\render().

◆ getStructurePath()

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

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>".

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

Definition at line 235 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()

Returns
‪array Unstable structure item
Exceptions

Definition at line 201 of file InlineStackProcessor.php.

◆ initializeByGivenStructure()

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

One of two possible initialize methods setting a given structure.

Parameters
array$structure

Definition at line 42 of file InlineStackProcessor.php.

Referenced by TYPO3\CMS\Backend\Form\Container\InlineRecordContainer\render(), and TYPO3\CMS\Backend\Form\Container\InlineControlContainer\render().

◆ initializeByParsingDomObjectIdString()

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

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

Definition at line 57 of file InlineStackProcessor.php.

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

◆ injectAjaxConfiguration()

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

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

Parameters
array$config‪Given config extracted from ajax call
Todo:
‪: 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().

◆ pushStableStructureItem()

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

Add a stable structure to the stack

Parameters
array$structureItem

Definition at line 137 of file InlineStackProcessor.php.

Referenced by TYPO3\CMS\Backend\Form\Container\InlineControlContainer\render().

Member Data Documentation

◆ $inlineStructure

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

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

Definition at line 35 of file InlineStackProcessor.php.

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