Project

General

Profile

Feature #24019 » 16350_v1.patch

Administrator Admin, 2010-11-11 12:12

View differences:

t3lib/jsfunc.inline.js (Arbeitskopie)
if (this.isBelowMax(objectPrefix)) {
if (method == 'bottom')
new Insertion.Bottom(insertObject, htmlData);
else if (method == 'top') {
new Insertion.Top(insertObject, htmlData);
}
else if (method == 'after')
new Insertion.After(insertObject, htmlData);
}
......
}
},
memorizeAddRecord: function(objectPrefix, newUid, afterUid, selectedValue) {
memorizeAddRecord: function(objectPrefix, newUid, position, selectedValue) {
// default value for position
if (position === null) {
position = 'bottom';
}
if (this.isBelowMax(objectPrefix)) {
var objectName = this.prependFormFieldNames+this.parseObjectId('parts', objectPrefix, 3, 1, true);
var formObj = document.getElementsByName(objectName);
......
var records = new Array();
if (formObj[0].value.length) records = formObj[0].value.split(',');
if (afterUid) {
switch (position) {
case 'top':
records.unshift(newUid);
break;
case 'bottom':
records.push(newUid);
break;
default:
var newRecords = new Array();
for (var i=0; i<records.length; i++) {
if (records[i].length) newRecords.push(records[i]);
if (afterUid == records[i]) newRecords.push(newUid);
if (position == records[i]) newRecords.push(newUid);
}
records = newRecords;
} else {
records.push(newUid);
break;
}
formObj[0].value = records.join(',');
}
t3lib/class.t3lib_tceforms_inline.php (Arbeitskopie)
}
if (!$current['uid']) {
$position = 'bottom';
if ($config['appearance']['newRecordPosition'] === 'top') {
$position = 'top';
}
$jsonArray = array(
'data' => $item,
'scriptCall' => array(
"inline.domAddNewRecord('bottom','".$this->inlineNames['object']."_records','$objectPrefix',json.data);",
"inline.memorizeAddRecord('$objectPrefix','".$record['uid']."',null,'$foreignUid');"
"inline.domAddNewRecord('$position','" . $this->inlineNames['object'] . "_records', '$objectPrefix', json.data);",
"inline.memorizeAddRecord('$objectPrefix', '" . $record['uid'] . "', '$position', '$foreignUid');"
)
);
(1-1/2)