Project

General

Profile

Bug #25111 ยป typo3-17680b-remove_checkbox.diff

Administrator Admin, 2011-02-20 14:02

View differences:

t3lib/class.t3lib_tceforms.php (Arbeitskopie)
$cssStyle = $classAndStyleAttributes['style'];
if (!isset($config['checkbox'])) {
$config['checkbox'] = '0';
$checkboxIsset = FALSE;
} else {
$checkboxIsset = TRUE;
t3lib_div::deprecationLog('The TCA configuration "checkbox" for input fields is not used any more since TYPO3 4.5. Every input field is now rendered with a clear button.');
}
if (in_array('date', $evalList) || in_array('datetime', $evalList)) {
......
} else {
$inputId = uniqid('tceforms-textfield-');
$cssClasses[] = 'tceforms-textfield';
if ($checkboxIsset === FALSE) {
$config['checkbox'] = '';
}
}
if (isset($config['wizards']['link'])) {
$inputId = uniqid('tceforms-linkfield-');
......
}
}
$paramsList = "'" . $PA['itemFormElName'] . "','" . implode(',', $evalList) . "','" . trim($config['is_in']) . "'," . (isset($config['checkbox']) ? 1 : 0) . ",'" . $config['checkbox'] . "'";
$paramsList = "'" . $PA['itemFormElName'] . "','" . implode(',', $evalList) . "','" . trim($config['is_in']) . "'";
if ((in_array('date', $evalList) || in_array('datetime', $evalList))) {
$item .= '<span class="t3-tceforms-input-wrapper-datetime" onmouseOver="if (document.getElementById(\'' .
$inputId . '\').value) {this.className=\'t3-tceforms-input-wrapper-datetime-hover\';} else {this.className=\'t3-tceforms-input-wrapper-datetime\';};" onmouseOut="this.className=\'t3-tceforms-input-wrapper-datetime\';">';
......
array('typo3form.fieldGet' => 'typo3form.fieldGet(' . $paramsList . ');'),
$PA['fieldChangeFunc']
);
// old function "checkbox" now the option to set the date / remove the date
if (isset($config['checkbox'])) {
$item .= t3lib_iconWorks::getSpriteIcon('actions-input-clear', array('tag' => 'a', 'class' => 't3-tceforms-input-clearer', 'onclick' => 'document.getElementById(\'' . $inputId . '\').value=\'\';document.getElementById(\'' . $inputId . '\').focus();' . implode('', $PA['fieldChangeFunc'])));
}
// render a clear button in input fields by default
$item .= t3lib_iconWorks::getSpriteIcon('actions-input-clear', array('tag' => 'a', 'class' => 't3-tceforms-input-clearer', 'onclick' => 'document.getElementById(\'' . $inputId . '\').value=\'\';document.getElementById(\'' . $inputId . '\').focus();' . implode('', $PA['fieldChangeFunc'])));
$mLgd = ($config['max'] ? $config['max'] : 256);
$iOnChange = implode('', $PA['fieldChangeFunc']);
t3lib/jsfunc.evalfield.js (Arbeitskopie)
case "password":
theString = (value) ? TS.passwordDummy : "";
break;
case "int":
theString = (FObj.checkbox && value==FObj.checkboxValue)?'':value;
break;
default:
theString = value;
}
......
var theTime = new Date(this.getYear(timeObj), timeObj.getUTCMonth(), timeObj.getUTCDate());
return this.getTimestamp(theTime);
}
function evalFunc_dummy (evallist,is_in,checkbox,checkboxValue) {
function evalFunc_dummy (evallist, is_in) {
this.evallist = evallist;
this.is_in = is_in;
this.checkboxValue = checkboxValue;
this.checkbox = checkbox;
}
function evalFunc_splitStr(theStr1, delim, index) {
var theStr = ''+theStr1;
typo3/jsfunc.tbe_editor.js (Arbeitskopie)
var typo3form = {
fieldSet: function(theField, evallist, is_in, checkbox, checkboxValue) {
fieldSet: function(theField, evallist, is_in) {
if (document[TBE_EDITOR.formname][theField]) {
var theFObj = new evalFunc_dummy (evallist,is_in, checkbox, checkboxValue);
var theFObj = new evalFunc_dummy (evallist, is_in);
var theValue = document[TBE_EDITOR.formname][theField].value;
if (checkbox && theValue==checkboxValue) {
document[TBE_EDITOR.formname][theField+"_hr"].value="";
if (document[TBE_EDITOR.formname][theField+"_cb"]) document[TBE_EDITOR.formname][theField+"_cb"].checked = "";
} else {
document[TBE_EDITOR.formname][theField+"_hr"].value = evalFunc.outputObjValue(theFObj, theValue);
if (document[TBE_EDITOR.formname][theField+"_cb"]) document[TBE_EDITOR.formname][theField+"_cb"].checked = "on";
}
document[TBE_EDITOR.formname][theField+"_hr"].value = evalFunc.outputObjValue(theFObj, theValue);
}
},
fieldGet: function(theField, evallist, is_in, checkbox, checkboxValue, checkbox_off, checkSetValue) {
fieldGet: function(theField, evallist, is_in) {
if (document[TBE_EDITOR.formname][theField]) {
var theFObj = new evalFunc_dummy (evallist,is_in, checkbox, checkboxValue);
if (checkbox_off) {
if (document[TBE_EDITOR.formname][theField+"_cb"].checked) {
var split = evallist.split(',');
for (var i = 0; split.length > i; i++) {
var el = split[i].replace(/ /g, '');
if (el == 'datetime' || el == 'date') {
var now = new Date();
checkSetValue = Date.parse(now)/1000 - now.getTimezoneOffset()*60;
break;
} else if (el == 'time' || el == 'timesec') {
checkSetValue = evalFunc_getTimeSecs(new Date());
break;
}
}
document[TBE_EDITOR.formname][theField].value=checkSetValue;
} else {
document[TBE_EDITOR.formname][theField].value=checkboxValue;
}
}else{
document[TBE_EDITOR.formname][theField].value = evalFunc.evalObjValue(theFObj, document[TBE_EDITOR.formname][theField+"_hr"].value);
}
typo3form.fieldSet(theField, evallist, is_in, checkbox, checkboxValue);
var theFObj = new evalFunc_dummy (evallist, is_in);
document[TBE_EDITOR.formname][theField].value = evalFunc.evalObjValue(theFObj, document[TBE_EDITOR.formname][theField+"_hr"].value);
typo3form.fieldSet(theField, evallist, is_in);
}
}
};
    (1-1/1)