Project

General

Profile

Bug #17468 » 0005956.patch

Administrator Admin, 2007-08-03 17:48

View differences:

t3lib/class.t3lib_tceforms.php (Arbeitskopie)
var $palettesRendered=array(); // During rendering of forms this will keep track of which palettes has already been rendered (so they are not rendered twice by mistake)
var $hiddenFieldListArr = array(); // This array of fields will be set as hidden-fields instead of rendered normally! For instance palette fields edited in the top frame are set as hidden fields since the main form has to submit the values. The top frame actually just sets the value in the main form!
var $requiredFields=array(); // Used to register input-field names, which are required. (Done during rendering of the fields). This information is then used later when the JavaScript is made.
var $requiredDataTimeFields=array(); // Used to register input-field names, which are required an have a date/time as requirement. The information of this array is merged with $this->requiredFields later.
var $requiredElements=array(); // Used to register the min and max number of elements for selectorboxes where that apply (in the "group" type for instance)
var $renderDepth=0; // Keeps track of the rendering depth of nested records.
var $savedSchemes=array(); // Color scheme buffer.
......
$size = t3lib_div::intInRange($config['size']?$config['size']:30,5,$this->maxInputWidth);
$evalList = t3lib_div::trimExplode(',',$config['eval'],1);
if($this->renderReadonly || $config['readOnly']) {
$itemFormElValue = $PA['itemFormElValue'];
if (in_array('date',$evalList)) {
......
if (in_array('required',$evalList)) {
$this->requiredFields[$table.'_'.$row['uid'].'_'.$field]=$PA['itemFormElName'];
// Mark this field for date/time disposal:
foreach ($evalList as $evalItem) {
if ($evalItem == 'date' || $evalItem == 'datetime' || $evalItem == 'time') {
$this->requiredDataTimeFields[$PA['itemFormElName']] = true;
break;
}
}
}
$paramsList = "'".$PA['itemFormElName']."','".implode(',',$evalList)."','".trim($config['is_in'])."',".(isset($config['checkbox'])?1:0).",'".$config['checkbox']."'";
......
$field = $match[2];
$elements[$record][$field]['required'] = 1;
$elements[$record][$field]['requiredImg'] = $itemImgName;
if ($this->requiredDataTimeFields[$itemName]) {
$elements[$record][$field]['isDateTime'] = 1;
}
}
}
// range:
t3lib/jsfunc.evalfield.js (Arbeitskopie)
var index=1;
var theEvalType = this.split(evallist, ",", index);
var newValue=value;
while (theEvalType) {
while (theEvalType && theEvalType != 'required') {
newValue = evalFunc.output(theEvalType, value, FObj);
index++;
theEvalType = this.split(evallist, ",", index);
typo3/jsfunc.tbe_editor.js (Arbeitskopie)
'requiredImg': ''
}
}
},
*/
elements: {},
recentUpdatedElements: {},
actionChecks: { submit: [] },
formname: '',
formnameUENC: '',
loadTime: 0,
......
prependFormFieldNames: 'data',
prependFormFieldNamesUENC: 'data',
prependFormFieldNamesCnt: 0,
isPalettedoc: null,
doSaveFieldName: 0,
labels: {},
images: {
req: new Image(),
......
getElement: function(record, field, type) {
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 (type) {
......
result = element;
}
}
return result;
},
checkElements: function(type, recentUpdated, record, field) {
......
if (elementData) {
if (!TBE_EDITOR.checkElementByType(type, elementName, elementData)) result = 0;
}
} else {
var elementFieldList, elRecIndex, elRecCnt, elFldIndex, elFldCnt;
var elementRecordList = $H(source).keys();
......
}
}
}
return result;
},
checkElementByType: function(type, elementName, elementData) {
var result = 1;
if (type) {
if (type == 'required') {
if (!document[TBE_EDITOR.formname][elementName].value) {
var value = document[TBE_EDITOR.formname][elementName].value;
if (!value || value == '0' && elementData.isDateTime) {
result = 0;
TBE_EDITOR.setImage('req_'+elementData.requiredImg, TBE_EDITOR.images.req);
}
......
}
}
}
return result;
},
addActionChecks: function(type, checks) {
TBE_EDITOR.actionChecks[type].push(checks);
},
// Regular TCEforms JSbottom scripts:
loginRefreshed: function() {
var date = new Date();
......
TBE_EDITOR.setImage(imgReqObjName,TBE_EDITOR.images.req);
}
}
if (TBE_EDITOR.isPalettedoc) { TBE_EDITOR.setOriginalFormFieldValue(theField) };
},
setOriginalFormFieldValue: function(theField) {
......
if (!TBE_EDITOR.checkElements('required', false)) { OK = 0; }
// $reqRangeCheck
if (!TBE_EDITOR.checkElements('range', false)) { OK = 0; }
if (OK || sendAlert==-1) {
return true;
} else {
(1-1/5)