Project

General

Profile

Feature #17125 » 0005242_v3.patch

Administrator Admin, 2008-02-01 14:20

View differences:

t3lib/class.t3lib_tceforms_inline.php (Arbeitskopie)
/**
* Determines the corrected pid to be used for a new record.
* The pid to be used can be defined by a Page TSconfig.
*
* @param string $table: The table name
* @param integer $parentPid: The pid of the parent record
* @return integer The corrected pid to be used for a new record
*/
protected function getNewRecordPid($table, $parentPid=null) {
$newRecordPid = $this->inlineFirstPid;
$pageTS = t3lib_beFunc::getPagesTSconfig($parentPid, true);
if (isset($pageTS['TCAdefaults.'][$table.'.']['pid']) && t3lib_div::testInt($pageTS['TCAdefaults.'][$table.'.']['pid'])) {
$newRecordPid = $pageTS['TCAdefaults.'][$table.'.']['pid'];
} elseif (isset($parentPid) && t3lib_div::testInt($parentPid)) {
$newRecordPid = $parentPid;
}
return $newRecordPid;
}
/**
* Get a single record row for a TCA table from the database.
* t3lib_transferData is used for "upgrading" the values, especially the relations.
*
......
function getRecord($pid, $table, $uid, $cmd='') {
$trData = t3lib_div::makeInstance('t3lib_transferData');
$trData->addRawData = TRUE;
# $trData->defVals = $this->defVals;
$trData->lockRecords=1;
$trData->disableRTE = $GLOBALS['SOBE']->MOD_SETTINGS['disableRTE'];
// if a new record should be created
$trData->fetchRecord($table, $uid, ($cmd === 'new' ? 'new' : ''));
reset($trData->regTableItems_data);
$rec = current($trData->regTableItems_data);
$rec['uid'] = $cmd == 'new' ? uniqid('NEW') : $uid;
if ($cmd=='new') $rec['pid'] = $pid;
return $rec;
}
......
* @return array A record row from the database post-processed by t3lib_transferData
*/
function getNewRecord($pid, $table) {
return $this->getRecord($pid, $table, $pid, 'new');
$rec = $this->getRecord($pid, $table, $pid, 'new');
$rec['uid'] = uniqid('NEW');
$rec['pid'] = $this->getNewRecordPid($table, $pid);
return $rec;
}
t3lib/class.t3lib_tcemain.php (Arbeitskopie)
if ($conf['type'] == 'inline') {
$foreign_table = $conf['foreign_table'];
$moveChildrenWithParent = (!isset($conf['behaviour']['moveChildrenWithParent']) || $conf['behaviour']['moveChildrenWithParent']);
if ($foreign_table) {
if ($foreign_table && $moveChildrenWithParent) {
$inlineType = $this->getInlineFieldType($conf);
if ($inlineType == 'list' || $inlineType == 'field') {
$moveTable = $foreign_table;
(1-1/2)