Project

General

Profile

Feature #17745 » 6635_class.t3lib_transferdata_cleanup_with_userfunc.patch

Administrator Admin, 2007-11-22 15:49

View differences:

class.t3lib_transferdata.php 2007-11-22 15:20:47.000000000 +0100
// Default values as set in userTS:
$TCAdefaultOverride = $GLOBALS['BE_USER']->getTSConfigProp('TCAdefaults');
if (is_array($TCAdefaultOverride[$table.'.'])) {
foreach($TCAdefaultOverride[$table.'.'] as $theF => $theV) {
if (isset($TCA[$table]['columns'][$theF])) {
$newRow[$theF]=$theV;
// Allowing userFuncs in userTS TCAdefaults, see issue #6635 for details
if (is_array($theV)) {
$theF = substr($theF, 0, -1); // Remove trailing dot from fieldname
$funcName = $theV['userFunc'];
$params = Array(
'table' => $table,
'field' => $theF,
'value' => $newRow[$theF],
'conf' => $theV['userFunc.']
);
// Default values as set in pageTS
$pageTS = t3lib_beFunc::getPagesTSconfig($id, true);
$pageTS = (isset($pageTS['TCAdefaults.'])) ? $pageTS['TCAdefaults.'] : array();
$newRow[$theF] = t3lib_div::callUserFunction($funcName, $params, $this);
}
}
}
}
// Merge userTS and pageTS; pageTS overrules userTS
$TSconfig = t3lib_div::array_merge_recursive_overrule($TCAdefaultOverride,$pageTS);
$pageTS = t3lib_beFunc::getPagesTSconfig($id, true);
if (isset($pageTS['TCAdefaults.'])) {
$TCAPageTSOverride = $pageTS['TCAdefaults.'];
if (is_array($TCAPageTSOverride[$table.'.'])) {
foreach($TCAPageTSOverride[$table.'.'] as $theF => $theV) {
if (isset($TCA[$table]['columns'][$theF])) {
$newRow[$theF]=$theV;
if (is_array($TSconfig[$table.'.'])) {
foreach($TSconfig[$table.'.'] as $theF => $theV) {
if (isset($TCA[$table]['columns'][$theF])) {
$newRow[$theF]=$theV;
}
// Allowing userFuncs in pageTS TCAdefaults, see issue #6635 for details
if (is_array($theV)) {
$theF = substr($theF, 0, -1); // Remove trailing dot from fieldname
$funcName = $theV['userFunc'];
$params = Array(
'table' => $table,
'field' => $theF,
'value' => $newRow[$theF],
'conf' => $theV['userFunc.']
);
// Allowing userFuncs in pageTS TCAdefaults, see issue #6635 for details
if (is_array($theV)) {
$theF = substr($theF, 0, -1); // Remove trailing dot from fieldname
$funcName = $theV['userFunc'];
$params = Array(
'table' => $table,
'field' => $theF,
'value' => $newRow[$theF],
'conf' => $theV['userFunc.']
);
$newRow[$theF] = t3lib_div::callUserFunction($funcName, $params, $this);
}
}
$newRow[$theF] = t3lib_div::callUserFunction($funcName, $params, $this);
}
}
}
(4-4/4)