TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Backend\Form\Element\InlineElement Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Form\Element\InlineElement:
t3lib_TCEforms_inline

Public Member Functions

 init (&$formEngine)
 
 getSingleField_typeInline ($table, $field, $row, &$PA)
 
 renderForeignRecord ($parentUid, $rec, $config=array())
 
 renderForeignRecordHeader ($parentUid, $foreign_table, $rec, $config, $isVirtualRecord=FALSE)
 
 renderForeignRecordHeaderControl ($parentUid, $foreign_table, $rec, $config=array(), $isVirtualRecord=FALSE)
 
 renderCombinationTable (&$rec, $appendFormFieldNames, $config=array())
 
 renderPossibleRecordsSelector ($selItems, $conf, $uniqueIds=array())
 
 renderPossibleRecordsSelectorTypeSelect ($selItems, $conf, &$PA, $uniqueIds=array())
 
 renderPossibleRecordsSelectorTypeGroupDB ($conf, &$PA)
 
 addJavaScriptSortable ($objectId)
 
 processAjaxRequest ($_, $ajaxObj)
 
 createNewRecord ($domObjectId, $foreignUid=0)
 
 getRecordDetails ($domObjectId)
 
 setExpandedCollapsedState ($domObjectId, $expand, $collapse)
 
 getPossibleRecords ($table, $field, $row, $conf, $checkForConfField='foreign_selector')
 
 getUniqueIds ($records, $conf=array(), $splitValue=FALSE)
 
 getNewRecord ($pid, $table)
 
 pushStructure ($table, $uid, $field='', $config=array(), array $parameters=array())
 
 popStructure ()
 
 updateStructureNames ()
 
 getStructureItemName ($levelData, $disposal=self::Disposal_AttributeId)
 
 getStructureLevel ($level)
 
 getStructurePath ($structureDepth=-1)
 
 parseStructureString ($domObjectId, $loadConfig=TRUE)
 
 checkConfiguration (&$config)
 
 checkAccess ($cmd, $table, $theUid)
 
 compareStructureConfiguration ($compare)
 
 normalizeUid ($string)
 
 wrapFormsSection ($section, $styleAttrs=array(), $tableAttrs=array())
 
 isInlineChildAndLabelField ($table, $field)
 
 getStructureDepth ()
 
 arrayCompareComplex ($subjectArray, $searchArray, $type='')
 
 isAssociativeArray ($object)
 
 removeFromArray ($needle, $haystack, $strict=NULL)
 
 getPossibleRecordsFlat ($possibleRecords)
 
 getPossibleRecordsSelectorConfig ($conf, $field='')
 
 getPossibleRecordsSelectorType ($config)
 
 skipField ($table, $field, $row, $config)
 
 getExpandedCollapsedState ($table, $uid)
 
 getLevelMargin ()
 

Static Public Member Functions

static updateInlineView (&$uc, $tce)
 

Public Attributes

const Structure_Separator = '-'
 
const FlexForm_Separator = '---'
 
const FlexForm_Substitute = ':'
 
const Disposal_AttributeName = 'Disposal_AttributeName'
 
const Disposal_AttributeId = 'Disposal_AttributeId'
 
 $fObj
 
 $backPath
 
 $isAjaxCall = FALSE
 
 $inlineStructure = array()
 
 $inlineFirstPid
 
 $inlineNames = array()
 
 $inlineData = array()
 
 $inlineView = array()
 
 $inlineCount = 0
 
 $inlineStyles = array()
 
 $prependNaming = 'data'
 
 $prependFormFieldNames
 
 $prependCmdFieldNames
 

Protected Member Functions

 initHookObjects ()
 
 renderMainFields ($table, array $row, array $overruleTypesArray=array())
 
 getLevelInteractionLink ($type, $objectPrefix, $conf=array())
 
 injectAjaxConfiguration (array $ajaxArguments)
 
 processAjaxRequestConstruct (&$ajaxArguments)
 
 getCommonScriptCalls (&$jsonArray, $config)
 
 getErrorMessageForAJAX ($message)
 
 getExecuteChangesJsonArray ($oldItemList, $newItemList)
 
 getRelatedRecordsArray ($pid, $table, $itemList)
 
 getRelatedRecordsUidArray ($itemList)
 
 getLocalizationDifferences ($table, array $options, array $recordsOriginal, array $recordsLocalization)
 
 getNewRecordPid ($table, $parentPid=NULL)
 
 calculateStructureLevel ($level)
 
 getHeadTags ()
 
 wrapWithAnchor ($text, $link, $attributes=array())
 
 extractFlexFormParts ($formElementName)
 
 isMediaOnPages ($theUid)
 
 getLanguageService ()
 
 getDatabaseConnection ()
 

Protected Attributes

 $hookObjects = array()
 

Detailed Description

The Inline-Relational-Record-Editing (IRRE) functions as part of the FormEngine.

Author
Oliver Hader olive.nosp@m.r@ty.nosp@m.po3.o.nosp@m.rg

Definition at line 33 of file InlineElement.php.

Member Function Documentation

◆ addJavaScriptSortable()

TYPO3\CMS\Backend\Form\Element\InlineElement::addJavaScriptSortable (   $objectId)

Add Sortable functionality using script.acolo.us "Sortable".

Parameters
string$objectIdThe container id of the object - elements inside will be sortable
Returns
void
Todo:
Define visibility

Definition at line 1035 of file InlineElement.php.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\getSingleField_typeInline().

◆ arrayCompareComplex()

TYPO3\CMS\Backend\Form\Element\InlineElement::arrayCompareComplex (   $subjectArray,
  $searchArray,
  $type = '' 
)

Handles complex comparison requests on an array. A request could look like the following:

$searchArray = array( 'AND' => array( 'key1' => 'value1', 'key2' => 'value2', 'OR' => array( 'subarray' => array( 'subkey' => 'subvalue' ), 'key3' => 'value3', 'key4' => 'value4' ) ) );

It is possible to use the array keys 'AND.1', 'AND.2', etc. to prevent overwriting the sub-array. It could be necessary, if you use complex comparisons.

The example above means, key1 AND key2 (and their values) have to match with the $subjectArray and additional one OR key3 or key4 have to meet the same condition. It is also possible to compare parts of a sub-array (e.g. "subarray"), so this function recurses down one level in that sub-array.

Parameters
array$subjectArrayThe array to search in
array$searchArrayThe array with keys and values to search for
string$typeUse 'AND' or 'OR' for comparison
Returns
boolean The result of the comparison
Todo:
Define visibility

Definition at line 2312 of file InlineElement.php.

References TYPO3\CMS\Backend\Form\Element\InlineElement\isAssociativeArray().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\compareStructureConfiguration().

◆ calculateStructureLevel()

TYPO3\CMS\Backend\Form\Element\InlineElement::calculateStructureLevel (   $level)
protected

Calculates structure level.

Parameters
integer$levelWhich level to return
Returns
boolean|integer

Definition at line 1949 of file InlineElement.php.

References $result.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\getStructureLevel(), and TYPO3\CMS\Backend\Form\Element\InlineElement\injectAjaxConfiguration().

◆ checkAccess()

TYPO3\CMS\Backend\Form\Element\InlineElement::checkAccess (   $cmd,
  $table,
  $theUid 
)

Checks the page access rights (Code for access check mostly taken from alt_doc.php) as well as the table access rights of the user.

Parameters
string$cmdThe command that should be performed ('new' or 'edit')
string$tableThe table to check access for
string$theUidThe record uid of the table
Returns
boolean Returns TRUE is the user has access, or FALSE if not
Todo:
Define visibility

Definition at line 2101 of file InlineElement.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\GeneralUtility\callUserFunction(), TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), debug(), TYPO3\CMS\Backend\Utility\BackendUtility\fixVersioningPid(), TYPO3\CMS\Backend\Form\Element\InlineElement\isMediaOnPages(), and TYPO3\CMS\Backend\Utility\BackendUtility\isRootLevelRestrictionIgnored().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\renderForeignRecord().

◆ checkConfiguration()

TYPO3\CMS\Backend\Form\Element\InlineElement::checkConfiguration ( $config)

Does some checks on the TCA configuration of the inline field to render.

Parameters
array$configReference to the TCA field configuration
Returns
bool If critical configuration errors were found, FALSE is returned

Definition at line 2057 of file InlineElement.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\createNewRecord(), TYPO3\CMS\Backend\Form\Element\InlineElement\getRecordDetails(), and TYPO3\CMS\Backend\Form\Element\InlineElement\getSingleField_typeInline().

◆ compareStructureConfiguration()

TYPO3\CMS\Backend\Form\Element\InlineElement::compareStructureConfiguration (   $compare)

Check the keys and values in the $compare array against the ['config'] part of the top level of the stack. A boolean value is return depending on how the comparison was successful.

Parameters
array$compareKeys and values to compare to the ['config'] part of the top level of the stack
Returns
boolean Whether the comparison was successful
See also
arrayCompareComplex
Todo:
Define visibility

Definition at line 2199 of file InlineElement.php.

References $result, TYPO3\CMS\Backend\Form\Element\InlineElement\arrayCompareComplex(), and TYPO3\CMS\Backend\Form\Element\InlineElement\getStructureLevel().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\skipField().

◆ createNewRecord()

TYPO3\CMS\Backend\Form\Element\InlineElement::createNewRecord (   $domObjectId,
  $foreignUid = 0 
)

◆ extractFlexFormParts()

TYPO3\CMS\Backend\Form\Element\InlineElement::extractFlexFormParts (   $formElementName)
protected

Extracts FlexForm parts of a form element name like data[table][uid][field][sDEF][lDEF][FlexForm][vDEF]

Parameters
string$formElementNameThe form element name
Returns
array|NULL

Definition at line 2662 of file InlineElement.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\pushStructure().

◆ getCommonScriptCalls()

TYPO3\CMS\Backend\Form\Element\InlineElement::getCommonScriptCalls ( $jsonArray,
  $config 
)
protected

Determines and sets several script calls to a JSON array, that would have been executed if processed in non-AJAX mode.

Parameters
array&$jsonArrayReference of the array to be used for JSON
array$configThe configuration of the IRRE field of the parent record
Returns
void

Definition at line 1160 of file InlineElement.php.

References TYPO3\CMS\Backend\Form\Element\InlineElement\getHeadTags().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\createNewRecord().

◆ getDatabaseConnection()

TYPO3\CMS\Backend\Form\Element\InlineElement::getDatabaseConnection ( )
protected
Returns
DatabaseConnection

Definition at line 2702 of file InlineElement.php.

References $GLOBALS.

◆ getErrorMessageForAJAX()

TYPO3\CMS\Backend\Form\Element\InlineElement::getErrorMessageForAJAX (   $message)
protected

Generates an error message that transferred as JSON for AJAX calls

Parameters
string$messageThe error message to be shown
Returns
array The error message in a JSON array

Definition at line 1185 of file InlineElement.php.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\createNewRecord(), and TYPO3\CMS\Backend\Form\Element\InlineElement\getRecordDetails().

◆ getExecuteChangesJsonArray()

TYPO3\CMS\Backend\Form\Element\InlineElement::getExecuteChangesJsonArray (   $oldItemList,
  $newItemList 
)
protected

Generates a JSON array which executes the changes and thus updates the forms view.

Parameters
string$oldItemListList of related child records before changes were made (old)
string$newItemListList of related child records after changes where made (new)
Returns
array An array to be used for JSON

Definition at line 1393 of file InlineElement.php.

References TYPO3\CMS\Backend\Form\Element\InlineElement\renderForeignRecord().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\createNewRecord().

◆ getExpandedCollapsedState()

TYPO3\CMS\Backend\Form\Element\InlineElement::getExpandedCollapsedState (   $table,
  $uid 
)

Checks if a uid of a child table is in the inline view settings.

Parameters
string$tableName of the child table
integer$uiduid of the the child record
Returns
boolean TRUE=expand, FALSE=collapse
Todo:
Define visibility

Definition at line 2530 of file InlineElement.php.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\renderForeignRecord().

◆ getHeadTags()

TYPO3\CMS\Backend\Form\Element\InlineElement::getHeadTags ( )
protected

Parses the HTML tags that would have been inserted to the <head> of a HTML document and returns the found tags as multidimensional array.

Returns
array The parsed tags with their attributes and innerHTML parts

Definition at line 2596 of file InlineElement.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\getCommonScriptCalls().

◆ getLanguageService()

TYPO3\CMS\Backend\Form\Element\InlineElement::getLanguageService ( )
protected
Returns
LanguageService

Definition at line 2695 of file InlineElement.php.

References $GLOBALS.

◆ getLevelInteractionLink()

TYPO3\CMS\Backend\Form\Element\InlineElement::getLevelInteractionLink (   $type,
  $objectPrefix,
  $conf = array() 
)
protected

Creates the HTML code of a general link to be used on a level of inline children. The possible keys for the parameter $type are 'newRecord', 'localize' and 'synchronize'.

Parameters
string$typeThe link type, values are 'newRecord', 'localize' and 'synchronize'.
string$objectPrefixThe "path" to the child record to create (e.g. 'data-parentPageId-partenTable-parentUid-parentField-childTable]')
array$confTCA configuration of the parent(!) field
Returns
string The HTML code of the new link, wrapped in a div

Definition at line 981 of file InlineElement.php.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\getSingleField_typeInline().

◆ getLevelMargin()

TYPO3\CMS\Backend\Form\Element\InlineElement::getLevelMargin ( )

Returns the the margin in pixels, that is used for each new inline level.

Returns
integer A pixel value for the margin of each new inline level.
Todo:
Define visibility

Definition at line 2586 of file InlineElement.php.

◆ getLocalizationDifferences()

TYPO3\CMS\Backend\Form\Element\InlineElement::getLocalizationDifferences (   $table,
array  $options,
array  $recordsOriginal,
array  $recordsLocalization 
)
protected

Gets the difference between current localized structure and the original language structure. If there are records which once were localized but don't exist in the original version anymore, the record row is marked with '__remove'. If there are records which can be localized and exist only in the original version, the record row is marked with '__create' and '__virtual'.

Parameters
string$tableThe table name of the parent records
array$optionsOptions defining what kind of records to display
array$recordsOriginalThe uids of the child records of the original language
array$recordsLocalizationThe uids of the child records of the current localization
Returns
array Merged array of uids of the child records of both versions

Definition at line 1618 of file InlineElement.php.

References $GLOBALS, and $uid.

◆ getNewRecord()

TYPO3\CMS\Backend\Form\Element\InlineElement::getNewRecord (   $pid,
  $table 
)

Wrapper. Calls getRecord in case of a new record should be created.

Parameters
integer$pidThe pid of the page the record should be stored (only relevant for NEW records)
string$tableThe table to fetch data from (= foreign_table)
Returns
array A record row from the database post-processed by
Todo:
Define visibility

Definition at line 1801 of file InlineElement.php.

References TYPO3\CMS\Backend\Form\Element\InlineElement\getNewRecordPid().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\createNewRecord().

◆ getNewRecordPid()

TYPO3\CMS\Backend\Form\Element\InlineElement::getNewRecordPid (   $table,
  $parentPid = NULL 
)
protected

◆ getPossibleRecords()

TYPO3\CMS\Backend\Form\Element\InlineElement::getPossibleRecords (   $table,
  $field,
  $row,
  $conf,
  $checkForConfField = 'foreign_selector' 
)

Get possible records. Copied from FormEngine and modified.

Parameters
string$tableThe table name of the record
string$fieldThe field name which this element is supposed to edit
array$rowThe record data array where the value(s) for the field can be found
array$confAn array with additional configuration options.
string$checkForConfFieldFor which field in the foreign_table the possible records should be fetched
Returns
mixed Array of possible record items; FALSE if type is "group/db", then everything could be "possible
Todo:
Define visibility

Definition at line 1657 of file InlineElement.php.

References $GLOBALS, TYPO3\CMS\Backend\Form\Element\InlineElement\getPossibleRecordsSelectorConfig(), TYPO3\CMS\Core\Utility\GeneralUtility\inList(), TYPO3\CMS\Core\Utility\GeneralUtility\keepItemsInArray(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\getSingleField_typeInline().

◆ getPossibleRecordsFlat()

TYPO3\CMS\Backend\Form\Element\InlineElement::getPossibleRecordsFlat (   $possibleRecords)

Makes a flat array from the $possibleRecords array. The key of the flat array is the value of the record, the value of the flat array is the label of the record.

Parameters
array$possibleRecordsThe possibleRecords array (for select fields)
Returns
mixed A flat array with key=uid, value=label; if $possibleRecords isn't an array, FALSE is returned.
Todo:
Define visibility

Definition at line 2399 of file InlineElement.php.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\getSingleField_typeInline().

◆ getPossibleRecordsSelectorConfig()

TYPO3\CMS\Backend\Form\Element\InlineElement::getPossibleRecordsSelectorConfig (   $conf,
  $field = '' 
)

Determine the configuration and the type of a record selector.

Parameters
array$confTCA configuration of the parent(!) field
string$fieldField name
Returns
array Associative array with the keys 'PA' and 'type', both are FALSE if the selector was not valid.
Todo:
Define visibility

Definition at line 2418 of file InlineElement.php.

References $GLOBALS, TYPO3\CMS\Backend\Form\Element\InlineElement\getPossibleRecordsSelectorType(), and TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\createNewRecord(), TYPO3\CMS\Backend\Form\Element\InlineElement\getPossibleRecords(), TYPO3\CMS\Backend\Form\Element\InlineElement\getSingleField_typeInline(), and TYPO3\CMS\Backend\Form\Element\InlineElement\renderForeignRecordHeader().

◆ getPossibleRecordsSelectorType()

TYPO3\CMS\Backend\Form\Element\InlineElement::getPossibleRecordsSelectorType (   $config)

Determine the type of a record selector, e.g. select or group/db.

Parameters
array$configTCE configuration of the selector
Returns
mixed The type of the selector, 'select' or 'groupdb' - FALSE not valid
Todo:
Define visibility

Definition at line 2459 of file InlineElement.php.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\getPossibleRecordsSelectorConfig().

◆ getRecordDetails()

TYPO3\CMS\Backend\Form\Element\InlineElement::getRecordDetails (   $domObjectId)

Handle AJAX calls to dynamically load the form fields of a given record. (basically a copy of "createNewRecord") Normally this method is never called from inside TYPO3. Always from outside by AJAX.

Parameters
string$domObjectIdThe calling object in hierarchy, that requested a new record.
Returns
array An array to be used for JSON
Todo:
Define visibility

Definition at line 1342 of file InlineElement.php.

References TYPO3\CMS\Backend\Form\Element\InlineElement\checkConfiguration(), TYPO3\CMS\Backend\Form\Element\InlineElement\getErrorMessageForAJAX(), TYPO3\CMS\Backend\Form\Element\InlineElement\getStructureLevel(), and TYPO3\CMS\Backend\Form\Element\InlineElement\renderForeignRecord().

◆ getRelatedRecordsArray()

TYPO3\CMS\Backend\Form\Element\InlineElement::getRelatedRecordsArray (   $pid,
  $table,
  $itemList 
)
protected

Gets the related records of the embedding item, this could be 1:n, m:n.

Parameters
integer$pidThe pid of the parent record
string$tableThe table name of the record
string$itemListThe list of related child records
Returns
array The records related to the parent item

Definition at line 1575 of file InlineElement.php.

References $uid, and TYPO3\CMS\Backend\Form\Element\InlineElement\getRelatedRecordsUidArray().

◆ getRelatedRecordsUidArray()

TYPO3\CMS\Backend\Form\Element\InlineElement::getRelatedRecordsUidArray (   $itemList)
protected

Gets an array with the uids of related records out of a list of items. This list could contain more information than required. This methods just extracts the uids.

Parameters
string$itemListThe list of related child records
Returns
array An array with uids

Definition at line 1596 of file InlineElement.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\getRelatedRecordsArray().

◆ getSingleField_typeInline()

TYPO3\CMS\Backend\Form\Element\InlineElement::getSingleField_typeInline (   $table,
  $field,
  $row,
$PA 
)

Generation of FormEngine elements of the type "inline" This will render inline-relational-record sets. Relations.

Parameters
string$tableThe table name of the record
string$fieldThe field name which this element is supposed to edit
array$rowThe record data array where the value(s) for the field can be found
array$PAAn array with additional configuration options.
Returns
string The HTML code for the FormEngine field

Definition at line 188 of file InlineElement.php.

References $GLOBALS, TYPO3\CMS\Backend\Form\Element\InlineElement\$inlineView, $parameters, TYPO3\CMS\Backend\Form\Element\InlineElement\addJavaScriptSortable(), TYPO3\CMS\Core\Utility\GeneralUtility\callUserFunction(), TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), TYPO3\CMS\Backend\Form\Element\InlineElement\checkConfiguration(), TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange(), TYPO3\CMS\Backend\Form\Element\InlineElement\getLevelInteractionLink(), TYPO3\CMS\Backend\Utility\BackendUtility\getLiveVersionIdOfRecord(), TYPO3\CMS\Backend\Form\Element\InlineElement\getPossibleRecords(), TYPO3\CMS\Backend\Form\Element\InlineElement\getPossibleRecordsFlat(), TYPO3\CMS\Backend\Form\Element\InlineElement\getPossibleRecordsSelectorConfig(), TYPO3\CMS\Backend\Form\Element\InlineElement\getStructureDepth(), TYPO3\CMS\Backend\Form\Element\InlineElement\getStructureLevel(), TYPO3\CMS\Backend\Form\Element\InlineElement\getUniqueIds(), TYPO3\CMS\Core\Utility\GeneralUtility\hmac(), TYPO3\CMS\Backend\Utility\BackendUtility\isTableLocalizable(), TYPO3\CMS\Backend\Form\Element\InlineElement\popStructure(), TYPO3\CMS\Backend\Form\Element\InlineElement\pushStructure(), TYPO3\CMS\Backend\Form\Element\InlineElement\renderForeignRecord(), and TYPO3\CMS\Backend\Form\Element\InlineElement\renderPossibleRecordsSelector().

◆ getStructureDepth()

TYPO3\CMS\Backend\Form\Element\InlineElement::getStructureDepth ( )

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

Returns
integer The depth of the structure stack
Todo:
Define visibility

Definition at line 2275 of file InlineElement.php.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\getSingleField_typeInline(), and TYPO3\CMS\Backend\Form\Element\InlineElement\skipField().

◆ getStructureItemName()

TYPO3\CMS\Backend\Form\Element\InlineElement::getStructureItemName (   $levelData,
  $disposal = self::Disposal_AttributeId 
)

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
Todo:
Define visibility

Definition at line 1894 of file InlineElement.php.

References TYPO3\CMS\Backend\Form\Element\InlineElement\getStructureLevel().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\getStructurePath(), and TYPO3\CMS\Backend\Form\Element\InlineElement\updateStructureNames().

◆ getStructureLevel()

◆ getStructurePath()

TYPO3\CMS\Backend\Form\Element\InlineElement::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>".

Parameters
integer$structureDepthHow much levels to output, beginning from the top of the stack
Returns
string The path of identifiers
Todo:
Define visibility

Definition at line 1971 of file InlineElement.php.

References TYPO3\CMS\Backend\Form\Element\InlineElement\getStructureItemName(), and TYPO3\CMS\Backend\Form\Element\InlineElement\getStructureLevel().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\updateStructureNames().

◆ getUniqueIds()

TYPO3\CMS\Backend\Form\Element\InlineElement::getUniqueIds (   $records,
  $conf = array(),
  $splitValue = FALSE 
)

Gets the uids of a select/selector that should be unique an have already been used.

Parameters
array$recordsAll inline records on this level
array$confThe TCA field configuration of the inline field to be rendered
boolean$splitValueFor usage with group/db, values come like "tx_table_123|Title%20abc", but we need "tx_table" and "123
Returns
array The uids, that have been used already and should be used unique
Todo:
Define visibility

Definition at line 1716 of file InlineElement.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\getSingleField_typeInline().

◆ init()

TYPO3\CMS\Backend\Form\Element\InlineElement::init ( $formEngine)

Initialize

Parameters
\TYPO3\CMS\Backend\Form\FormEngine$formEngineReference to an FormEngine instance
Returns
void
Todo:
Define visibility

Definition at line 145 of file InlineElement.php.

References TYPO3\CMS\Backend\Form\Element\InlineElement\initHookObjects().

◆ initHookObjects()

TYPO3\CMS\Backend\Form\Element\InlineElement::initHookObjects ( )
protected

Initialized the hook objects for this class. Each hook object has to implement the interface

Returns
void

Definition at line 161 of file InlineElement.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\getUserObj().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\init().

◆ injectAjaxConfiguration()

TYPO3\CMS\Backend\Form\Element\InlineElement::injectAjaxConfiguration ( array  $ajaxArguments)
protected

Injects configuration via AJAX calls. The configuration is validated using HMAC to avoid hijacking.

Parameters
array$ajaxArguments
Returns
void

Definition at line 1090 of file InlineElement.php.

References TYPO3\CMS\Backend\Form\Element\InlineElement\calculateStructureLevel(), TYPO3\CMS\Backend\Utility\BackendUtility\getInlineLocalizationMode(), and TYPO3\CMS\Core\Utility\GeneralUtility\hmac().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\processAjaxRequest().

◆ isAssociativeArray()

TYPO3\CMS\Backend\Form\Element\InlineElement::isAssociativeArray (   $object)

Checks whether an object is an associative array.

Parameters
mixed$objectThe object to be checked
Returns
boolean Returns TRUE, if the object is an associative array
Todo:
Define visibility

Definition at line 2369 of file InlineElement.php.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\arrayCompareComplex().

◆ isInlineChildAndLabelField()

TYPO3\CMS\Backend\Form\Element\InlineElement::isInlineChildAndLabelField (   $table,
  $field 
)

Checks if the $table is the child of a inline type AND the $field is the label field of this table. This function is used to dynamically update the label while editing. This has no effect on labels, that were processed by a FormEngine-hook on saving.

Parameters
string$tableThe table to check
string$fieldThe field on this table to check
Returns
boolean Is inline child and field is responsible for the label
Todo:
Define visibility

Definition at line 2258 of file InlineElement.php.

References $GLOBALS, and TYPO3\CMS\Backend\Form\Element\InlineElement\getStructureLevel().

◆ isMediaOnPages()

TYPO3\CMS\Backend\Form\Element\InlineElement::isMediaOnPages (   $theUid)
protected

Check if the record is a media element on a page.

Parameters
string$theUidUid of the sys_file_reference record to be checked
Returns
bool TRUE if the record has media in the column 'fieldname' and pages in the column 'tablenames'

Definition at line 2684 of file InlineElement.php.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\checkAccess().

◆ normalizeUid()

TYPO3\CMS\Backend\Form\Element\InlineElement::normalizeUid (   $string)

Normalize a relation "uid" published by transferData, like "1|Company%201"

Parameters
string$stringA transferData reference string, containing the uid
Returns
string The normalized uid
Todo:
Define visibility

Definition at line 2212 of file InlineElement.php.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\renderForeignRecord().

◆ parseStructureString()

TYPO3\CMS\Backend\Form\Element\InlineElement::parseStructureString (   $domObjectId,
  $loadConfig = TRUE 
)

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'. The result is written to $this->inlineStructure. 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
boolean$loadConfigLoad the TCA configuration for that level (default: TRUE)
Returns
void
Todo:
Define visibility

Definition at line 1996 of file InlineElement.php.

References $GLOBALS, TYPO3\CMS\Backend\Utility\BackendUtility\getInlineLocalizationMode(), TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode(), and TYPO3\CMS\Backend\Form\Element\InlineElement\updateStructureNames().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\processAjaxRequest().

◆ popStructure()

TYPO3\CMS\Backend\Form\Element\InlineElement::popStructure ( )

Remove the item on top of the structure stack and return it.

Returns
array The top item of the structure stack - array(<table>,<uid>,<field>,<config>)
Todo:
Define visibility

Definition at line 1854 of file InlineElement.php.

References TYPO3\CMS\Backend\Form\Element\InlineElement\updateStructureNames().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\getSingleField_typeInline().

◆ processAjaxRequest()

TYPO3\CMS\Backend\Form\Element\InlineElement::processAjaxRequest (   $_,
  $ajaxObj 
)

General processor for AJAX requests concerning IRRE. (called by typo3/ajax.php)

Parameters
array$_Additional parameters (not used here)
\TYPO3\CMS\Core\Http\AjaxRequestHandler$ajaxObjThe AjaxRequestHandler object of this request
Returns
void

Definition at line 1054 of file InlineElement.php.

References $ajaxObj, $GLOBALS, TYPO3\CMS\Core\Utility\GeneralUtility\_GP(), TYPO3\CMS\Backend\Form\Element\InlineElement\injectAjaxConfiguration(), TYPO3\CMS\Backend\Form\Element\InlineElement\parseStructureString(), and TYPO3\CMS\Backend\Form\Element\InlineElement\processAjaxRequestConstruct().

◆ processAjaxRequestConstruct()

TYPO3\CMS\Backend\Form\Element\InlineElement::processAjaxRequestConstruct ( $ajaxArguments)
protected

Construct runtime environment for Inline Relational Record Editing.

  • creates an anonymous in $GLOBALS['SOBE']
  • creates a in $GLOBALS['SOBE']->tceforms
  • sets $this as reference to $GLOBALS['SOBE']->tceforms->inline
  • sets $GLOBALS['SOBE']->tceforms->RTEcounter to the current situation on client-side
Parameters
array&$ajaxArgumentsThe arguments to be processed by the AJAX request
Returns
void

Definition at line 1121 of file InlineElement.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\GeneralUtility\_GP(), TYPO3\CMS\Backend\Utility\BackendUtility\getModuleData(), and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\processAjaxRequest().

◆ pushStructure()

TYPO3\CMS\Backend\Form\Element\InlineElement::pushStructure (   $table,
  $uid,
  $field = '',
  $config = array(),
array  $parameters = array() 
)

Add a new level on top of the structure stack. Other functions can access the stack and determine, if there's possibly a endless loop.

Parameters
string$tableThe table name of the record
string$uidThe uid of the record that embeds the inline data
string$fieldThe field name which this element is supposed to edit
array$configThe TCA-configuration of the inline field
array$parametersThe full parameter array (PA)
Returns
void
Todo:
Define visibility

Definition at line 1825 of file InlineElement.php.

References $parameters, TYPO3\CMS\Backend\Form\Element\InlineElement\extractFlexFormParts(), TYPO3\CMS\Backend\Utility\BackendUtility\getInlineLocalizationMode(), and TYPO3\CMS\Backend\Form\Element\InlineElement\updateStructureNames().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\getSingleField_typeInline().

◆ removeFromArray()

TYPO3\CMS\Backend\Form\Element\InlineElement::removeFromArray (   $needle,
  $haystack,
  $strict = NULL 
)

Remove an element from an array.

Parameters
mixed$needleThe element to be removed.
array$haystackThe array the element should be removed from.
mixed$strictSearch elements strictly.
Returns
array The array $haystack without the $needle
Todo:
Define visibility

Definition at line 2382 of file InlineElement.php.

◆ renderCombinationTable()

TYPO3\CMS\Backend\Form\Element\InlineElement::renderCombinationTable ( $rec,
  $appendFormFieldNames,
  $config = array() 
)

Render a table with FormEngine, that occurs on a intermediate table but should be editable directly, so two tables are combined (the intermediate table with attributes and the sub-embedded table). -> This is a direct embedding over two levels!

Parameters
array$recThe table record of the child/embedded table (normaly post-processed by )
string$appendFormFieldNamesThe [
[<uid>] of the parent record (the intermediate table)
array$configcontent of $PA['fieldConf']['config']
Returns
string A HTML string with
around.
Todo:
Define visibility

Definition at line 779 of file InlineElement.php.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\renderForeignRecord().

◆ renderForeignRecord()

TYPO3\CMS\Backend\Form\Element\InlineElement::renderForeignRecord (   $parentUid,
  $rec,
  $config = array() 
)

◆ renderForeignRecordHeader()

TYPO3\CMS\Backend\Form\Element\InlineElement::renderForeignRecordHeader (   $parentUid,
  $foreign_table,
  $rec,
  $config,
  $isVirtualRecord = FALSE 
)

Renders the HTML header for a foreign record, such as the title, toggle-function, drag'n'drop, etc. Later on the command-icons are inserted here.

Parameters
string$parentUidThe uid of the parent (embedding) record (uid or NEW...)
string$foreign_tableThe foreign_table we create a header for
array$recThe current record of that foreign_table
array$configcontent of $PA['fieldConf']['config']
boolean$isVirtualRecord
Returns
string The HTML code of the header
Todo:
Define visibility

Definition at line 520 of file InlineElement.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\GeneralUtility\callUserFunction(), TYPO3\CMS\Core\Resource\ProcessedFile\CONTEXT_IMAGECROPSCALEMASK, TYPO3\CMS\Core\Resource\ResourceFactory\getInstance(), TYPO3\CMS\Backend\Utility\BackendUtility\getNoRecordTitle(), TYPO3\CMS\Backend\Form\Element\InlineElement\getPossibleRecordsSelectorConfig(), TYPO3\CMS\Backend\Utility\BackendUtility\getProcessedValueExtra(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecordIconAltText(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecordTitle(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecordTitlePrep(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecordWSOL(), TYPO3\CMS\Backend\Utility\IconUtility\getSpriteIconForRecord(), TYPO3\CMS\Core\Database\RelationHandler\isOnSymmetricSide(), TYPO3\CMS\Backend\Form\Element\InlineElement\renderForeignRecordHeaderControl(), TYPO3\CMS\Core\Utility\GeneralUtility\revExplode(), TYPO3\CMS\Backend\Utility\BackendUtility\splitTable_Uid(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\renderForeignRecord().

◆ renderForeignRecordHeaderControl()

TYPO3\CMS\Backend\Form\Element\InlineElement::renderForeignRecordHeaderControl (   $parentUid,
  $foreign_table,
  $rec,
  $config = array(),
  $isVirtualRecord = FALSE 
)

Render the control-icons for a record header (create new, sorting, delete, disable/enable). Most of the parts are copy&paste from TYPO3 and modified for the JavaScript calls here

Parameters
string$parentUidThe uid of the parent (embedding) record (uid or NEW...)
string$foreign_tableThe table (foreign_table) we create control-icons for
array$recThe current record of that foreign_table
array$config(modified) TCA configuration of the field
bool$isVirtualRecordTRUE if the current record is virtual, FALSE otherwise
Returns
string The HTML code with the control-icons
Todo:
Define visibility

Definition at line 650 of file InlineElement.php.

References $GLOBALS, $uid, TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), TYPO3\CMS\Backend\Utility\IconUtility\getSpriteIcon(), TYPO3\CMS\Core\Database\RelationHandler\isOnSymmetricSide(), and TYPO3\CMS\Backend\Utility\BackendUtility\readPageAccess().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\renderForeignRecordHeader().

◆ renderMainFields()

TYPO3\CMS\Backend\Form\Element\InlineElement::renderMainFields (   $table,
array  $row,
array  $overruleTypesArray = array() 
)
protected

Wrapper for FormEngine::getMainFields().

Parameters
string$tableThe table name
array$rowThe record to be rendered
array$overruleTypesArrayOverrule TCA [types] array, e.g to override [showitem] configuration of a particular type
Returns
string The rendered form

Definition at line 492 of file InlineElement.php.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\renderForeignRecord().

◆ renderPossibleRecordsSelector()

TYPO3\CMS\Backend\Form\Element\InlineElement::renderPossibleRecordsSelector (   $selItems,
  $conf,
  $uniqueIds = array() 
)

Get a selector as used for the select type, to select from all available records and to create a relation to the embedding record (e.g. like MM).

Parameters
array$selItemsArray of all possible records
array$confTCA configuration of the parent(!) field
array$uniqueIdsThe uids that have already been used and should be unique
Returns
string A HTML <select> box with all possible records
Todo:
Define visibility

Definition at line 821 of file InlineElement.php.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\getSingleField_typeInline().

◆ renderPossibleRecordsSelectorTypeGroupDB()

TYPO3\CMS\Backend\Form\Element\InlineElement::renderPossibleRecordsSelectorTypeGroupDB (   $conf,
$PA 
)

Generate a link that opens an element browser in a new window. For group/db there is no way to use a "selector" like a <select>|</select>-box.

Parameters
array$confTCA configuration of the parent(!) field
array$PAAn array with additional configuration options
Returns
string A HTML link that opens an element browser in a new window
Todo:
Define visibility

Definition at line 900 of file InlineElement.php.

◆ renderPossibleRecordsSelectorTypeSelect()

TYPO3\CMS\Backend\Form\Element\InlineElement::renderPossibleRecordsSelectorTypeSelect (   $selItems,
  $conf,
$PA,
  $uniqueIds = array() 
)

Get a selector as used for the select type, to select from all available records and to create a relation to the embedding record (e.g. like MM).

Parameters
array$selItemsArray of all possible records
array$confTCA configuration of the parent(!) field
array$PAAn array with additional configuration options
array$uniqueIdsThe uids that have already been used and should be unique
Returns
string A HTML <select> box with all possible records
Todo:
Define visibility

Definition at line 843 of file InlineElement.php.

◆ setExpandedCollapsedState()

TYPO3\CMS\Backend\Form\Element\InlineElement::setExpandedCollapsedState (   $domObjectId,
  $expand,
  $collapse 
)

Save the expanded/collapsed state of a child record in the BE_USER->uc.

Parameters
string$domObjectIdThe calling object in hierarchy, that requested a new record.
string$expandWhether this record is expanded.
string$collapseWhether this record is collapsed.
Returns
void
Todo:
Define visibility

Definition at line 1442 of file InlineElement.php.

◆ skipField()

TYPO3\CMS\Backend\Form\Element\InlineElement::skipField (   $table,
  $field,
  $row,
  $config 
)

Check, if a field should be skipped, that was defined to be handled as foreign_field or foreign_sortby of the parent record of the "inline"-type - if so, we have to skip this field - the rendering is done via "inline" as hidden field

Parameters
string$tableThe table name
string$fieldThe field name
array$rowThe record row from the database
array$configTCA configuration of the field
Returns
boolean Determines whether the field should be skipped.
Todo:
Define visibility

Definition at line 2480 of file InlineElement.php.

References TYPO3\CMS\Backend\Form\Element\InlineElement\compareStructureConfiguration(), TYPO3\CMS\Backend\Form\Element\InlineElement\getStructureDepth(), TYPO3\CMS\Backend\Form\Element\InlineElement\getStructureLevel(), and TYPO3\CMS\Core\Database\RelationHandler\isOnSymmetricSide().

◆ updateInlineView()

static TYPO3\CMS\Backend\Form\Element\InlineElement::updateInlineView ( $uc,
  $tce 
)
static

Update expanded/collapsed states on new inline records if any.

Parameters
array$ucThe uc array to be processed and saved (by reference)
\TYPO3\CMS\Core\DataHandling\DataHandler$tceInstance of FormEngine that saved data before
Returns
void
Todo:
Define visibility

Definition at line 2547 of file InlineElement.php.

References $GLOBALS, and TYPO3\CMS\Backend\Form\Element\InlineElement\$inlineView.

Referenced by TYPO3\CMS\Backend\Controller\EditDocumentController\doProcessData().

◆ updateStructureNames()

TYPO3\CMS\Backend\Form\Element\InlineElement::updateStructureNames ( )

For common use of DOM object-ids and form field names of a several inline-level, these names/identifiers are preprocessed and set to $this->inlineNames. This function is automatically called if a level is pushed to or removed from the inline structure stack.

Returns
void
Todo:
Define visibility

Definition at line 1873 of file InlineElement.php.

References TYPO3\CMS\Backend\Form\Element\InlineElement\getStructureItemName(), TYPO3\CMS\Backend\Form\Element\InlineElement\getStructureLevel(), and TYPO3\CMS\Backend\Form\Element\InlineElement\getStructurePath().

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\parseStructureString(), TYPO3\CMS\Backend\Form\Element\InlineElement\popStructure(), and TYPO3\CMS\Backend\Form\Element\InlineElement\pushStructure().

◆ wrapFormsSection()

TYPO3\CMS\Backend\Form\Element\InlineElement::wrapFormsSection (   $section,
  $styleAttrs = array(),
  $tableAttrs = array() 
)

Wrap the HTML code of a section with a table tag.

Parameters
string$sectionThe HTML code to be wrapped
array$styleAttrsAttributes for the style argument in the table tag
array$tableAttrsAttributes for the table tag (like width, border, etc.)
Returns
string The wrapped HTML code
Todo:
Define visibility

Definition at line 2226 of file InlineElement.php.

Referenced by TYPO3\CMS\Backend\Form\Element\InlineElement\renderForeignRecord().

◆ wrapWithAnchor()

TYPO3\CMS\Backend\Form\Element\InlineElement::wrapWithAnchor (   $text,
  $link,
  $attributes = array() 
)
protected

Wraps a text with an anchor and returns the HTML representation.

Parameters
string$textThe text to be wrapped by an anchor
string$linkThe link to be used in the anchor
array$attributesArray of attributes to be used in the anchor
Returns
string The wrapped text as HTML representation

Definition at line 2645 of file InlineElement.php.

References $result.

Member Data Documentation

◆ $backPath

TYPO3\CMS\Backend\Form\Element\InlineElement::$backPath

Definition at line 58 of file InlineElement.php.

◆ $fObj

TYPO3\CMS\Backend\Form\Element\InlineElement::$fObj

Definition at line 51 of file InlineElement.php.

◆ $hookObjects

TYPO3\CMS\Backend\Form\Element\InlineElement::$hookObjects = array()
protected

Definition at line 136 of file InlineElement.php.

◆ $inlineCount

TYPO3\CMS\Backend\Form\Element\InlineElement::$inlineCount = 0

Definition at line 107 of file InlineElement.php.

◆ $inlineData

TYPO3\CMS\Backend\Form\Element\InlineElement::$inlineData = array()

Definition at line 93 of file InlineElement.php.

◆ $inlineFirstPid

TYPO3\CMS\Backend\Form\Element\InlineElement::$inlineFirstPid

◆ $inlineNames

TYPO3\CMS\Backend\Form\Element\InlineElement::$inlineNames = array()

Definition at line 86 of file InlineElement.php.

◆ $inlineStructure

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

Definition at line 72 of file InlineElement.php.

◆ $inlineStyles

TYPO3\CMS\Backend\Form\Element\InlineElement::$inlineStyles = array()
Todo:
Define visibility

Definition at line 112 of file InlineElement.php.

◆ $inlineView

TYPO3\CMS\Backend\Form\Element\InlineElement::$inlineView = array()

◆ $isAjaxCall

TYPO3\CMS\Backend\Form\Element\InlineElement::$isAjaxCall = FALSE

Definition at line 65 of file InlineElement.php.

◆ $prependCmdFieldNames

TYPO3\CMS\Backend\Form\Element\InlineElement::$prependCmdFieldNames

Definition at line 133 of file InlineElement.php.

◆ $prependFormFieldNames

TYPO3\CMS\Backend\Form\Element\InlineElement::$prependFormFieldNames

Definition at line 126 of file InlineElement.php.

◆ $prependNaming

TYPO3\CMS\Backend\Form\Element\InlineElement::$prependNaming = 'data'

Definition at line 119 of file InlineElement.php.

◆ Disposal_AttributeId

const TYPO3\CMS\Backend\Form\Element\InlineElement::Disposal_AttributeId = 'Disposal_AttributeId'

Definition at line 43 of file InlineElement.php.

◆ Disposal_AttributeName

const TYPO3\CMS\Backend\Form\Element\InlineElement::Disposal_AttributeName = 'Disposal_AttributeName'

Definition at line 41 of file InlineElement.php.

◆ FlexForm_Separator

const TYPO3\CMS\Backend\Form\Element\InlineElement::FlexForm_Separator = '---'

Definition at line 37 of file InlineElement.php.

◆ FlexForm_Substitute

const TYPO3\CMS\Backend\Form\Element\InlineElement::FlexForm_Substitute = ':'

Definition at line 39 of file InlineElement.php.

◆ Structure_Separator

const TYPO3\CMS\Backend\Form\Element\InlineElement::Structure_Separator = '-'