TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools Class Reference

Public Member Functions

 traverseFlexFormXMLData ($table, $field, $row, $callBackObj, $callBackMethod_value)
 traverseFlexFormXMLData_recurse ($dataStruct, $editData, &$PA, $path='')
 getAvailableLanguages ()
 cleanFlexFormXML ($table, $field, $row)
 cleanFlexFormXML_callBackFunction ($dsArr, $data, $PA, $path, $pObj)
getArrayValueByPath ($pathArray, &$array)
 setArrayValueByPath ($pathArray, &$array, $value)
 flexArray2Xml ($array, $addPrologue=false)

Public Attributes

 $convertCharset = false
 $reNumberIndexesOfSectionData = false
 $traverseFlexFormXMLData_DS = []
 $traverseFlexFormXMLData_Data = []
 $callBackObj = null
 $cleanFlexFormXML = []

Protected Member Functions

 executeCallBackMethod ($methodName, array $parameterArray)

Detailed Description

Contains functions for manipulating flex form data

Definition at line 23 of file FlexFormTools.php.

Member Function Documentation

◆ cleanFlexFormXML()

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::cleanFlexFormXML (   $table,

Cleaning up FlexForm XML to hold only the values it may according to its Data Structure. Also the order of tags will follow that of the data structure. BE CAREFUL: DO not clean records in workspaces unless IN the workspace! The Data Structure might resolve falsely on a workspace record when cleaned from Live workspace.

string$tableTable name
string$fieldField name of the flex form field in which the XML is found that should be cleaned.
array$rowThe record
string Clean XML from FlexForm field

Definition at line 283 of file FlexFormTools.php.

References TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools\flexArray2Xml(), and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools\cleanFlexFormXML_callBackFunction().

◆ cleanFlexFormXML_callBackFunction()

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::cleanFlexFormXML_callBackFunction (   $dsArr,

Call back function for class Basically just setting the value in a new array (thus cleaning because only values that are valid are visited!)

array$dsArrData structure for the current value
mixed$dataCurrent value
array$PAAdditional configuration used in calling function
string$pathPath of value in DS structure

Definition at line 305 of file FlexFormTools.php.

References TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools\cleanFlexFormXML().

◆ executeCallBackMethod()

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::executeCallBackMethod (   $methodName,
array  $parameterArray 

Execute method on callback object

string$methodNameMethod name to call
mixed Result of callback object

Definition at line 220 of file FlexFormTools.php.

Referenced by TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools\traverseFlexFormXMLData_recurse().

◆ flexArray2Xml()

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::flexArray2Xml (   $array,
  $addPrologue = false 

Convert FlexForm data array to XML

array$arrayArray to output in <T3FlexForms> XML
bool$addPrologueIf set, the XML prologue is returned as well.
string XML content.

Definition at line 375 of file FlexFormTools.php.

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

Referenced by TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools\cleanFlexFormXML().

◆ getArrayValueByPath()

& TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::getArrayValueByPath (   $pathArray,

Get a value from a multi-dimensional array by giving a path "../../.." pointing to the element

string$pathArrayThe path pointing to the value field, eg. test/2/title to access $array['test'][2]['title']
array$arrayArray to get value from. Passed by reference so the value returned can be used to change the value in the array!
mixed Value returned

Definition at line 323 of file FlexFormTools.php.

◆ getAvailableLanguages()

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::getAvailableLanguages ( )

◆ setArrayValueByPath()

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::setArrayValueByPath (   $pathArray,

Set a value in a multi-dimensional array by giving a path "../../.." pointing to the element

string$pathArrayThe path pointing to the value field, eg. test/2/title to access $array['test'][2]['title']
array$arrayArray to set value in. Passed by reference so the value returned can be used to change the value in the array!
mixed$valueValue to set
mixed Value returned

Definition at line 348 of file FlexFormTools.php.

◆ traverseFlexFormXMLData()

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::traverseFlexFormXMLData (   $table,

Handler for Flex Forms

string$tableThe table name of the record
string$fieldThe field name of the flexform field to work on
array$rowThe record data array
object$callBackObjObject in which the call back function is located
string$callBackMethod_valueMethod name of call back function in object for values
bool|string If TRUE, error happened (error string returned)

Definition at line 97 of file FlexFormTools.php.

References TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools\$callBackObj, $GLOBALS, TYPO3\CMS\Backend\Utility\BackendUtility\getFlexFormDS(), TYPO3\CMS\Core\Utility\GeneralUtility\resolveSheetDefInDS(), TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools\traverseFlexFormXMLData_recurse(), TYPO3\CMS\Core\Utility\GeneralUtility\xml2array(), and TYPO3\CMS\Core\Utility\GeneralUtility\xmlGetHeaderAttribs().

◆ traverseFlexFormXMLData_recurse()

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::traverseFlexFormXMLData_recurse (   $dataStruct,
  $path = '' 

Recursively traversing flexform data according to data structure and element data

array$dataStruct(Part of) data structure array that applies to the sub section of the flexform data we are processing
array$editData(Part of) edit data array, reflecting current part of data structure
array$PAAdditional parameters passed.
string$pathTelling the "path" to the element in the flexform XML

Definition at line 161 of file FlexFormTools.php.

References TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools\executeCallBackMethod().

Referenced by TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools\traverseFlexFormXMLData().

Member Data Documentation

◆ $callBackObj

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::$callBackObj = null

◆ $cleanFlexFormXML

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::$cleanFlexFormXML = []

Definition at line 85 of file FlexFormTools.php.

◆ $convertCharset

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::$convertCharset = false

Definition at line 30 of file FlexFormTools.php.

◆ $flexArray2Xml_options

Initial value:
= [
'parentTagMap' => [
'data' => 'sheet'

Definition at line 59 of file FlexFormTools.php.

◆ $reNumberIndexesOfSectionData

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::$reNumberIndexesOfSectionData = false

Definition at line 37 of file FlexFormTools.php.

◆ $traverseFlexFormXMLData_Data

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::$traverseFlexFormXMLData_Data = []

Definition at line 51 of file FlexFormTools.php.

◆ $traverseFlexFormXMLData_DS

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::$traverseFlexFormXMLData_DS = []

Definition at line 44 of file FlexFormTools.php.