Index: typo3/sysext/t3skin/stylesheets/visual/main_content.css =================================================================== --- typo3/sysext/t3skin/stylesheets/visual/main_content.css (revision 9080) +++ typo3/sysext/t3skin/stylesheets/visual/main_content.css (working copy) @@ -314,6 +314,15 @@ cursor: pointer; } +.input-wrapper, +.input-wrapper-hover, +.input-wrapper-datetime, +.input-wrapper-datetime-hover { + display:block; + float:left; + position:relative; +} + .checkbox, .checkbox:hover, input[type="checkbox"] { @@ -321,3 +330,38 @@ border: none; cursor: pointer; } + +.input-wrapper .input-clearer, +.input-wrapper-hover .input-clearer { + position: absolute; + right: 4px; + top: 6px; + z-index: 1000; + cursor: pointer; +} + +.input-wrapper-datetime .input-clearer, +.input-wrapper-datetime-hover .input-clearer { + position: absolute; + right: 24px; + top: 6px; + z-index: 1000; + cursor: pointer; +} + +.input-wrapper .tceforms-textfield, +.input-wrapper-hover .tceforms-textfield, +.input-wrapper .tceforms-datetimefield, +.input-wrapper-hover .tceforms-datetimefield, +.input-wrapper-datetime .tceforms-textfield, +.input-wrapper-datetime-hover .tceforms-textfield, +.input-wrapper-datetime .tceforms-datetimefield, +.input-wrapper-datetime-hover .tceforms-datetimefield { + position:relative; + z-index:2000; + min-height:14px; +} + +.input-wrapper-hover .input-clearer, .input-wrapper-datetime-hover .input-clearer { + z-index:3000; +} \ No newline at end of file Index: t3lib/class.t3lib_tceforms.php =================================================================== --- t3lib/class.t3lib_tceforms.php (revision 9080) +++ t3lib/class.t3lib_tceforms.php (working copy) @@ -1173,31 +1173,28 @@ } $paramsList = "'".$PA['itemFormElName']."','".implode(',',$evalList)."','".trim($config['is_in'])."',".(isset($config['checkbox'])?1:0).",'".$config['checkbox']."'"; - if (isset($config['checkbox'])) { - // Setting default "click-checkbox" values for eval types "date" and "datetime": - $thisMidnight = gmmktime(0,0,0); - if (in_array('date',$evalList)) { - $checkSetValue = $thisMidnight; - } elseif (in_array('datetime',$evalList)) { - $checkSetValue = $GLOBALS['EXEC_TIME']; - } elseif (in_array('year',$evalList)) { - $checkSetValue = gmdate('Y'); + if ((in_array('date',$evalList) || in_array('datetime',$evalList))){ + $item .= ''; + + // Add server timezone offset to UTC to our stored date + if($PA['itemFormElValue']>0) { + $PA['itemFormElValue'] += date('Z', $PA['itemFormElValue']); } - $cOnClick = 'typo3form.fieldGet('.$paramsList.',1,\''.$checkSetValue.'\');'.implode('',$PA['fieldChangeFunc']); - $item .= ''; + } else { + $item .= ''; } - if ((in_array('date',$evalList) || in_array('datetime',$evalList)) && $PA['itemFormElValue']>0){ - // Add server timezone offset to UTC to our stored date - $PA['itemFormElValue'] += date('Z', $PA['itemFormElValue']); + + if (isset($config['checkbox'])) { + $item .= t3lib_iconWorks::getSpriteIcon('actions-input-clear',array('tag'=>'a','class'=>'input-clearer','onclick'=>'document.getElementById(\''.$inputId.'\').value=\'\';'.implode('',$PA['fieldChangeFunc']))); } - + $PA['fieldChangeFunc'] = array_merge(array('typo3form.fieldGet'=>'typo3form.fieldGet('.$paramsList.');'), $PA['fieldChangeFunc']); $mLgd = ($config['max']?$config['max']:256); $iOnChange = implode('',$PA['fieldChangeFunc']); $item.=''; // This is the EDITABLE form field. $item.=''; // This is the ACTUAL form field - values from the EDITABLE field must be transferred to this field which is the one that is written to the database. - $item .= $fieldAppendix; + $item .= $fieldAppendix.''; $this->extJSCODE.='typo3form.fieldSet('.$paramsList.');'; // going through all custom evaluations configured for this field