TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
InlineStackProcessor Class Reference

Public Member Functions

 initializeByGivenStructure (array $structure=array())
 
 initializeByParsingDomObjectIdString ($domObjectId)
 
 injectAjaxConfiguration ($contextString= '')
 
 getStructure ()
 
 pushStableStructureItem (array $structureItem=array())
 
 getCurrentStructureFormPrefix ()
 
 getCurrentStructureDomObjectIdPrefix ($inlineFirstPid)
 
 getStructureLevel ($level)
 
 getUnstableStructure ()
 
 getStructureDepth ()
 

Protected Member Functions

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

Protected Attributes

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

Definition at line 29 of file InlineStackProcessor.php.

Member Function Documentation

calculateStructureLevel (   $level)
protected

Calculates structure level.

Parameters
int$levelWhich level to return
Returns
bool|int

Definition at line 230 of file InlineStackProcessor.php.

Referenced by InlineStackProcessor\getStructureLevel(), and InlineStackProcessor\injectAjaxConfiguration().

getCurrentStructureDomObjectIdPrefix (   $inlineFirstPid)

DOM object-id for this inline level

Parameters
int$inlineFirstPidPid of top level inline element storage
Returns
string

Definition at line 178 of file InlineStackProcessor.php.

References InlineStackProcessor\getStructureLevel(), and InlineStackProcessor\getStructurePath().

getCurrentStructureFormPrefix ( )

Prefix for inline form fields

Returns
string

Definition at line 161 of file InlineStackProcessor.php.

References InlineStackProcessor\getStructureItemName(), and InlineStackProcessor\getStructureLevel().

getStructure ( )

Get current structure stack

Returns
array Current structure stack

Definition at line 140 of file InlineStackProcessor.php.

References InlineStackProcessor\$inlineStructure.

getStructureDepth ( )

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

Returns
int The depth of the structure stack

Definition at line 269 of file InlineStackProcessor.php.

Referenced by InlineStackProcessor\getStructurePath().

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$levelDataArray of a level of the structure stack (containing the keys table, uid and field)
string$disposalHow 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 281 of file InlineStackProcessor.php.

References InlineStackProcessor\getStructureLevel().

Referenced by InlineStackProcessor\getCurrentStructureFormPrefix(), and InlineStackProcessor\getStructurePath().

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$levelWhich level to return
Returns
array The item of the stack at the requested level

Definition at line 198 of file InlineStackProcessor.php.

References InlineStackProcessor\calculateStructureLevel().

Referenced by InlineStackProcessor\getCurrentStructureDomObjectIdPrefix(), InlineStackProcessor\getCurrentStructureFormPrefix(), InlineStackProcessor\getStructureItemName(), and InlineStackProcessor\getStructurePath().

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$structureDepthHow much levels to output, beginning from the top of the stack
Returns
string The path of identifiers

Definition at line 250 of file InlineStackProcessor.php.

References InlineStackProcessor\getStructureDepth(), InlineStackProcessor\getStructureItemName(), and InlineStackProcessor\getStructureLevel().

Referenced by InlineStackProcessor\getCurrentStructureDomObjectIdPrefix().

getUnstableStructure ( )

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

Returns
array Unstable structure item
Exceptions
\RuntimeException

Definition at line 216 of file InlineStackProcessor.php.

initializeByGivenStructure ( array  $structure = array())

One of two possible initialize methods setting a given structure.

Parameters
array$structure

Definition at line 43 of file InlineStackProcessor.php.

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$domObjectIdThe DOM object-id
Returns
void

Definition at line 59 of file InlineStackProcessor.php.

References $GLOBALS, BackendUtility\getInlineLocalizationMode(), FormEngineUtility\getTSconfigForTableRow(), FormEngineUtility\overrideFieldConf(), and GeneralUtility\trimExplode().

injectAjaxConfiguration (   $contextString = '')

Injects configuration via AJAX calls. This is used by inline ajax calls that transfer configuration options back to the stack for initialization The configuration is validated using HMAC to avoid hijacking.

Parameters
string$contextStringGiven context string from ajax call
Returns
void
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 117 of file InlineStackProcessor.php.

References InlineStackProcessor\calculateStructureLevel(), BackendUtility\getInlineLocalizationMode(), and GeneralUtility\hmac().

pushStableStructureItem ( array  $structureItem = array())

Add a stable structure to the stack

Parameters
array$structureItem
Returns
void

Definition at line 151 of file InlineStackProcessor.php.

Member Data Documentation

$inlineStructure = array()
protected

Definition at line 36 of file InlineStackProcessor.php.

Referenced by InlineStackProcessor\getStructure().