|
<?php
|
|
|
|
/**
|
|
* Class for getting and transforming data for display in backend forms (TCEforms)
|
|
*
|
|
* @author Kasper Skaarhoj <kasperYYYY@typo3.com>
|
|
* @package TYPO3
|
|
* @subpackage t3lib
|
|
*/
|
|
class ux_t3lib_transferData extends t3lib_transferData {
|
|
|
|
/**
|
|
* Traverse data array / structure
|
|
*
|
|
* @param array Data array passed by reference.
|
|
* @param array Data structure
|
|
* @param array Various parameters pass-through.
|
|
* @return void
|
|
* @see renderRecord_flexProc_procInData(), t3lib_TCEmain::checkValue_flex_procInData_travDS()
|
|
*/
|
|
function renderRecord_flexProc_procInData_travDS(&$dataValues,$DSelements,$pParams) {
|
|
if (is_array($DSelements)) {
|
|
|
|
// For each DS element:
|
|
foreach($DSelements as $key => $dsConf) {
|
|
|
|
// Array/Section:
|
|
if ($DSelements[$key]['type']=='array') {
|
|
if (is_array($dataValues[$key]['el'])) {
|
|
if ($DSelements[$key]['section']) {
|
|
foreach($dataValues[$key]['el'] as $ik => $el) {
|
|
$theKey = key($el);
|
|
if (is_array($dataValues[$key]['el'][$ik][$theKey]['el'])) {
|
|
$this->renderRecord_flexProc_procInData_travDS(
|
|
$dataValues[$key]['el'][$ik][$theKey]['el'],
|
|
$DSelements[$key]['el'][$theKey]['el'],
|
|
$pParams
|
|
);
|
|
}
|
|
}
|
|
} else {
|
|
if (!isset($dataValues[$key]['el'])) $dataValues[$key]['el']=array();
|
|
$this->renderRecord_flexProc_procInData_travDS(
|
|
$dataValues[$key]['el'],
|
|
$DSelements[$key]['el'],
|
|
$pParams
|
|
);
|
|
}
|
|
}
|
|
} else {
|
|
if (is_array($dsConf['TCEforms']['config']) && is_array($dataValues[$key])) {
|
|
foreach($dataValues[$key] as $vKey => $data) {
|
|
|
|
// $data,$fieldConfig,$TSconfig,$table,$row,$field
|
|
list(,,$CVTSconfig,$CVtable,$CVrow,$CVfield) = $pParams;
|
|
|
|
// Set default value:
|
|
if (!isset($dataValues[$key][$vKey])) {
|
|
$dataValues[$key][$vKey] = $dsConf['TCEforms']['config']['default'];
|
|
}
|
|
|
|
// Process value:
|
|
$dataValues[$key][$vKey] = $this->renderRecord_SW($dataValues[$key][$vKey],$dsConf['TCEforms'],$CVTSconfig,$CVtable,$CVrow,'pi_flexform');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
?>
|