Project

General

Profile

Bug #50785 ยป class.t3lib_tceform.php_forge-50785.patch

View differences:

t3lib/class.t3lib_tceforms.php~forge-50787 2013-08-09 18:02:04.000000000 +0200
$specConf = $this->getSpecConfFromString($PA['extra'], $PA['fieldConf']['defaultExtras']);
// Getting the selector box items from the system
$selItems = $this->addSelectOptionsToItemArray(
$this->initItemArray($PA['fieldConf']),
$PA['fieldConf'],
$this->setTSconfig($table, $row),
$field
);
// Patch to implement FlexForms being accessible using _THIS_ROW (f.e. ###REC_FIELD_ in foreign_table_where)
// Gabriel Kaufmann <info@typoworx.de>
$TSconfig = $this->setTSconfig($table, $row);
if($this->dataStructParent=='flex') {
// Parse FlexForm-Data to one-dimensional Array
$lDEF = 'lDEF';
if(
$GLOBALS['TSFE']->config['config']['sys_language_uid']>0 &&
!empty($GLOBALS['TSFE']->config['config']['language'])
) {
$lDEF = strtoupper($GLOBALS['TSFE']->config['config']['language']);
}
$flexArr = null;
if( ($flexArr = t3lib_div::xml2array($row[ $field ])) ) {
$flexArr = current($flexArr['data']);
$flexArr = isset($flexArr[ $lDEF ]) ? $flexArr[ $lDEF ] : $flexArr['lDEF'];
foreach($flexArr as $k => $v) {
$TSconfig['_THIS_ROW'][ $field.'.'.$k ] = current($v);
}
}
if($config['type']=='select' || $config['group']) {
$TSconfig['_THIS_ROW'][ $field.'.'.$k ] = current(t3lib_div::trimExplode('|', $TSconfig['_THIS_ROW'][ $field.'.'.$k ], 1));
}
}
$selItems = $this->addSelectOptionsToItemArray(
$this->initItemArray($PA['fieldConf']),
$PA['fieldConf'],
$TSconfig,
$field
);
// Possibly filter some items:
$keepItemsFunc = create_function('$value', 'return $value[1];');
$selItems = t3lib_div::keepItemsInArray($selItems, $PA['fieldTSConfig']['keepItems'], $keepItemsFunc);
......
// Data Structure array must be ... and array of course...
if (is_array($dataStruct)) {
// Set this flag to let sub-processing know if we are in FlexForm-processing
// Gabriel Kaufmann <info@typoworx.de>
$this->dataStructParent = 'flex';
foreach ($dataStruct as $key => $value) { // Traversing fields in structure:
if (is_array($value)) { // The value of each entry must be an array.
......
}
}
}
// Reset flag after leaving FlexForm-processing
// Gabriel Kaufmann <info@typoworx.de>
$this->dataStructParent = '';
return $output;
}
    (1-1/1)