TYPO3  7.6
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
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 = 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

Definition at line 23 of file FlexFormTools.php.

Member Function Documentation

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

Definition at line 283 of file FlexFormTools.php.

References FlexFormTools\flexArray2Xml(), and GeneralUtility\makeInstance().

Referenced by FlexFormTools\cleanFlexFormXML_callBackFunction().

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
FlexFormTools$pObjcaller
Returns
void

Definition at line 305 of file FlexFormTools.php.

References FlexFormTools\cleanFlexFormXML().

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 220 of file FlexFormTools.php.

Referenced by FlexFormTools\traverseFlexFormXMLData_recurse().

flexArray2Xml (   $array,
  $addPrologue = false 
)

Convert FlexForm data array to XML

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

Definition at line 375 of file FlexFormTools.php.

References $GLOBALS, and GeneralUtility\array2xml().

Referenced by FlexFormTools\cleanFlexFormXML().

& 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

Definition at line 323 of file FlexFormTools.php.

getAvailableLanguages ( )

Returns an array of available languages to use for FlexForm operations

Returns
array
Deprecated:
since TYPO3 CMS 7, will be removed with TYPO3 CMS 8

Definition at line 231 of file FlexFormTools.php.

References $GLOBALS, BackendUtility\deleteClause(), elseif, BackendUtility\getRecord(), and GeneralUtility\logDeprecatedFunction().

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

Definition at line 348 of file FlexFormTools.php.

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 in which the call back function is located
string$callBackMethod_valueMethod name of call back function in object for values
Returns
bool|string If TRUE, error happened (error string returned)

Definition at line 97 of file FlexFormTools.php.

References FlexFormTools\$callBackObj, $GLOBALS, BackendUtility\getFlexFormDS(), GeneralUtility\resolveSheetDefInDS(), FlexFormTools\traverseFlexFormXMLData_recurse(), GeneralUtility\xml2array(), and GeneralUtility\xmlGetHeaderAttribs().

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

Definition at line 161 of file FlexFormTools.php.

References elseif, and FlexFormTools\executeCallBackMethod().

Referenced by FlexFormTools\traverseFlexFormXMLData().

Member Data Documentation

$callBackObj = null

Definition at line 78 of file FlexFormTools.php.

Referenced by FlexFormTools\traverseFlexFormXMLData().

$cleanFlexFormXML = array()

Definition at line 85 of file FlexFormTools.php.

$convertCharset = false

Definition at line 30 of file FlexFormTools.php.

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

Definition at line 59 of file FlexFormTools.php.

$reNumberIndexesOfSectionData = false

Definition at line 37 of file FlexFormTools.php.

$traverseFlexFormXMLData_Data = array()

Definition at line 51 of file FlexFormTools.php.

$traverseFlexFormXMLData_DS = array()

Definition at line 44 of file FlexFormTools.php.