TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools Class Reference
Inheritance diagram for TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools:
t3lib_flexformtools

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 = array()
 
 $traverseFlexFormXMLData_Data = array()
 
 $flexArray2Xml_options
 
 $callBackObj = NULL
 
 $cleanFlexFormXML = array()
 

Protected Member Functions

 executeCallBackMethod ($methodName, array $parameterArray)
 

Detailed Description

Contains functions for manipulating flex form data

Author
Kasper Skårhøj kaspe.nosp@m.rYYY.nosp@m.Y@typ.nosp@m.o3.c.nosp@m.om

Definition at line 24 of file FlexFormTools.php.

Member Function Documentation

◆ cleanFlexFormXML()

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

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.

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

Definition at line 293 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,
  $data,
  $PA,
  $path,
  $pObj 
)

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

Parameters
array$dsArrData structure for the current value
mixed$dataCurrent value
array$PAAdditional configuration used in calling function
string$pathPath of value in DS structure
object$pObjObject reference to caller
Returns
void
Todo:
Define visibility

Definition at line 315 of file FlexFormTools.php.

References $GLOBALS, and TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools\cleanFlexFormXML().

◆ executeCallBackMethod()

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

Execute method on callback object

Parameters
string$methodNameMethod name to call
array$parameterArrayParameters
Returns
mixed Result of callback object

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

Parameters
array$arrayArray to output in <T3FlexForms> XML
boolean$addPrologueIf set, the XML prologue is returned as well.
Returns
string XML content.
Todo:
Define visibility

Definition at line 399 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,
$array 
)

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

Parameters
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!
Returns
mixed Value returned
Todo:
Define visibility

Definition at line 340 of file FlexFormTools.php.

◆ getAvailableLanguages()

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

Returns an array of available languages to use for FlexForm operations

Returns
array
Todo:
Define visibility

Definition at line 251 of file FlexFormTools.php.

References $GLOBALS, TYPO3\CMS\Backend\Utility\BackendUtility\deleteClause(), and TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded().

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

◆ setArrayValueByPath()

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

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

Parameters
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
Returns
mixed Value returned
Todo:
Define visibility

Definition at line 369 of file FlexFormTools.php.

◆ traverseFlexFormXMLData()

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::traverseFlexFormXMLData (   $table,
  $field,
  $row,
  $callBackObj,
  $callBackMethod_value 
)

Handler for Flex Forms

Parameters
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 (passed by reference) in which the call back function is located
string$callBackMethod_valueMethod name of call back function in object for values
Returns
boolean If TRUE, error happened (error string returned)
Todo:
Define visibility

Definition at line 93 of file FlexFormTools.php.

References TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools\$callBackObj, $GLOBALS, TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools\getAvailableLanguages(), 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,
  $editData,
$PA,
  $path = '' 
)

Recursively traversing flexform data according to data structure and element data

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

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

Reference to object called

Todo:
Define visibility

Definition at line 74 of file FlexFormTools.php.

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

◆ $cleanFlexFormXML

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::$cleanFlexFormXML = array()
Todo:
Define visibility

Definition at line 80 of file FlexFormTools.php.

◆ $convertCharset

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::$convertCharset = FALSE
Todo:
Define visibility

Definition at line 30 of file FlexFormTools.php.

◆ $flexArray2Xml_options

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::$flexArray2Xml_options
Initial value:
= array(
'parentTagMap' => array(
'data' => 'sheet',
'sheet' => 'language',
'language' => 'field',
'el' => 'field',
'field' => 'value',
'field:el' => 'el',
'el:_IS_NUM' => 'section',
'section' => 'itemType'
),
'disableTypeAttrib' => 2
)
Todo:
Define visibility

Definition at line 55 of file FlexFormTools.php.

◆ $reNumberIndexesOfSectionData

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::$reNumberIndexesOfSectionData = FALSE
Todo:
Define visibility

Definition at line 36 of file FlexFormTools.php.

◆ $traverseFlexFormXMLData_Data

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::$traverseFlexFormXMLData_Data = array()
Todo:
Define visibility

Definition at line 48 of file FlexFormTools.php.

◆ $traverseFlexFormXMLData_DS

TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::$traverseFlexFormXMLData_DS = array()
Todo:
Define visibility

Definition at line 42 of file FlexFormTools.php.