Project

General

Profile

Bug #20422 » 11087_v3.diff

Administrator Admin, 2010-10-17 16:18

View differences:

t3lib/class.t3lib_tceforms.php (Arbeitskopie)
browserWin.focus();
}
function setFormValueFromBrowseWin(fName,value,label,exclusiveValues) { //
var formObj = setFormValue_getFObj(fName)
var formObj = setFormValue_getFObj(fName);
if (formObj && value!="--div--") {
fObj = formObj[fName+"_list"];
var len = fObj.length;
......
var m = new RegExp("(^|,)"+value+"($|,)");
if (exclusiveValues.match(m)) {
// the new value is exclusive
for (a=len-1;a>=0;a--) fObj[a] = null;
for (a=len-1; a>=0; a--) {
fObj[a] = null;
}
len = 0;
} else if (len == 1) {
m = new RegExp("(^|,)"+fObj.options[0].value+"($|,)");
......
}
// Inserting element
var setOK = 1;
if (!formObj[fName+"_mul"] || formObj[fName+"_mul"].value==0) {
if (!formObj[fName + "_mul"] || formObj[fName + "_mul"].value === 0) {
for (a=0;a<len;a++) {
if (fObj.options[a].value==value) {
setOK = 0;
}
}
}
if (setOK) {
// remove the existing option element if there is only one element allowed
var elementData = TBE_EDITOR.getElementFromFieldName(fName);
var range = String(elementData.range);
range = range.split(",");
if (range[1] == "1") {
setFormValueManipulate(fName, "Remove");
len = 0;
}
fObj.length++;
fObj.options[len].value = value;
fObj.options[len].text = unescape(label);
typo3/jsfunc.tbe_editor.js (Arbeitskopie)
var result = null;
var element;
if (TBE_EDITOR.elements && TBE_EDITOR.elements[record] && TBE_EDITOR.elements[record][field]) {
element = TBE_EDITOR.elements[record][field];
if (TBE_EDITOR.elements) {
if (TBE_EDITOR.elements[record] && TBE_EDITOR.elements[record][field]) {
element = TBE_EDITOR.elements[record][field];
} else if (TBE_EDITOR.elements[record + field]) {
element = TBE_EDITOR.elements[record + field];
}
if (type) {
if (element[type]) result = element;
if (element[type]) result = element[type];
} else {
result = element;
}
......
document[TBE_EDITOR.formname][theField].value = RTEcontent;
alert(document[TBE_EDITOR.formname][theField].value);
},
// strips the "table", the "field" and the "uid" from the fName
extractDataFromFieldName: function(fName) {
var idx = 2 + TBE_EDITOR.prependFormFieldNamesCnt;
var table = TBE_EDITOR.split(fName, '[', idx);
table = table.substr(0, table.length-1);
var uid = TBE_EDITOR.split(fName, '[', ++idx);
uid = uid.substr(0, uid.length-1);
var field = TBE_EDITOR.split(fName, '[', ++idx);
field = field.substr(0, field.length-1);
var type = '';
var totalFieldNamesCount = fName.split('[').length;
// get the field value for special flexforms
// in flexforms, the field is everything except the last [vDEF]
// [..][..] in flexforms
if (totalFieldNamesCount > idx) {
field = '[' + field + ']';
while (totalFieldNamesCount-1 > idx) {
field += '[' + TBE_EDITOR.split(fName, '[', ++idx);
}
type = TBE_EDITOR.split(fName, '[', ++idx);
type = type.substr(0, type.length-1);
}
return { table: table, uid: uid, field: field, type: type };
},
getElementFromFieldName: function(fName) {
var data = TBE_EDITOR.extractDataFromFieldName(fName);
return TBE_EDITOR.getElement('data[' + data.table + '][' + data.uid + ']', data.field, data.type);
},
fieldChanged_fName: function(fName,el) {
var idx=2+TBE_EDITOR.prependFormFieldNamesCnt;
var table = TBE_EDITOR.split(fName, "[", idx);
var uid = TBE_EDITOR.split(fName, "[", idx+1);
var field = TBE_EDITOR.split(fName, "[", idx+2);
table = table.substr(0,table.length-1);
uid = uid.substr(0,uid.length-1);
field = field.substr(0,field.length-1);
TBE_EDITOR.fieldChanged(table,uid,field,el);
var data = TBE_EDITOR.extractDataFromFieldName(fName);
TBE_EDITOR.fieldChanged(data.table, data.uid, data.field, el);
},
fieldChanged: function(table,uid,field,el) {
var theField = TBE_EDITOR.prependFormFieldNames+'['+table+']['+uid+']['+field+']';
(3-3/3)