Index: t3lib/class.t3lib_tceforms.php =================================================================== --- t3lib/class.t3lib_tceforms.php (revision 5734) +++ t3lib/class.t3lib_tceforms.php (working copy) @@ -1063,6 +1063,41 @@ $size = t3lib_div::intInRange($config['size']?$config['size']:30,5,$this->maxInputWidth); $evalList = t3lib_div::trimExplode(',',$config['eval'],1); + // cssclass and id will show the kind of field + if (in_array('date', $evalList)) { + $inputId = uniqid('datefield-'); + $cssClass = 'tceforms-textfield tceforms-datefield'; + } elseif (in_array('datetime', $evalList)) { + $inputId = uniqid('datetimefield-'); + $cssClass = 'tceforms-textfield tceforms-datetimefield'; + } elseif (in_array('timesec', $evalList)) { + $inputId = uniqid('timesecfield-'); + $cssClass = 'tceforms-textfield tceforms-timesecfield'; + } elseif (in_array('year', $evalList)) { + $inputId = uniqid('yearfield-'); + $cssClass = 'tceforms-textfield tceforms-yearfield'; + } elseif (in_array('time', $evalList)) { + $inputId = uniqid('timefield-'); + $cssClass = 'tceforms-textfield tceforms-timefield'; + } elseif (in_array('int', $evalList)) { + $inputId = uniqid('intfield-'); + $cssClass = 'tceforms-textfield tceforms-intfield'; + } elseif (in_array('double2', $evalList)) { + $inputId = uniqid('double2field-'); + $cssClass = 'tceforms-textfield tceforms-double2field'; + } else { + $inputId = uniqid('textfield-'); + $cssClass = 'tceforms-textfield'; + } + if (isset($config['wizards']['link'])) { + $inputId = uniqid('linkfield-'); + $cssClass = 'tceforms-textfield tceforms-linkfield'; + } elseif (isset($config['wizards']['color'])) { + $inputId = uniqid('colorfield-'); + $cssClass = 'tceforms-textfield tceforms-colorfield'; + } + + if($this->renderReadonly || $config['readOnly']) { $itemFormElValue = $PA['itemFormElValue']; if (in_array('date',$evalList)) { @@ -1114,7 +1149,7 @@ $checkSetValue = gmdate('Y'); } $cOnClick = 'typo3form.fieldGet('.$paramsList.',1,\''.$checkSetValue.'\');'.implode('',$PA['fieldChangeFunc']); - $item .= ''; + $item .= ''; } if ((in_array('date',$evalList) || in_array('datetime',$evalList)) && $PA['itemFormElValue']>0){ // Add server timezone offset to UTC to our stored date @@ -1124,7 +1159,8 @@ $PA['fieldChangeFunc'] = array_merge(array('typo3form.fieldGet'=>'typo3form.fieldGet('.$paramsList.');'), $PA['fieldChangeFunc']); $mLgd = ($config['max']?$config['max']:256); $iOnChange = implode('',$PA['fieldChangeFunc']); - $item.='formWidth($size).' maxlength="'.$mLgd.'" onchange="'.htmlspecialchars($iOnChange).'"'.$PA['onFocus'].' />'; // This is the EDITABLE form field. + + $item.='formWidth($size).' maxlength="'.$mLgd.'" onchange="'.htmlspecialchars($iOnChange).'"'.$PA['onFocus'].' />'; // 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. $this->extJSCODE.='typo3form.fieldSet('.$paramsList.');'; @@ -1254,8 +1290,8 @@ } if (count($classes)) { - $class = ' class="'.implode(' ',$classes).'"'; - } else $class=''; + $class = ' class="tceforms-textarea '.implode(' ',$classes).'"'; + } else $class='tceforms-textarea'; $evalList = t3lib_div::trimExplode(',',$config['eval'],1); foreach ($evalList as $func) { @@ -1280,7 +1316,7 @@ $iOnChange = implode('',$PA['fieldChangeFunc']); $item.= ' - '; $item = $this->renderWizards(array($item,$altItem),$config['wizards'],$table,$row,$field,$PA,$PA['itemFormElName'],$specConf,$RTEwouldHaveBeenLoaded); @@ -1614,7 +1650,7 @@ if(!$disabled) { $item.= ''; // MUST be inserted before the selector - else is the value of the hiddenfield here mysteriously submitted... } - $item .= 'insertDefStyle('select', 'icon-select') : $this->insertDefStyle('select')) . ($size ? ' size="' . $size . '"' : '') . ' onchange="' . htmlspecialchars($onChangeIcon . $sOnChange) . '"' . @@ -1871,8 +1907,8 @@ $selector_itemListStyle = isset($config['itemListStyle']) ? ' style="'.htmlspecialchars($config['itemListStyle']).'"' : ' style="'.$this->defaultMultipleSelectorStyle.'"'; $size = intval($config['size']); $size = $config['autoSizeMax'] ? t3lib_div::intInRange(count($selItems)+1,t3lib_div::intInRange($size,1),$config['autoSizeMax']) : $size; - $selectBox = 'insertDefStyle('select', 'tceforms-multiselect'). ($size ? ' size="'.$size.'"' : ''). ' multiple="multiple" onchange="'.htmlspecialchars($sOnChange).'"'. $PA['onFocus']. @@ -1993,8 +2029,8 @@ } $sOnChange .= implode('',$PA['fieldChangeFunc']); $itemsToSelect = ' - insertDefStyle('select', 'tceforms-multiselect tceforms-itemstoselect'). ($size ? ' size="'.$size.'"' : ''). ' onchange="'.htmlspecialchars($sOnChange).'"'. $PA['onFocus']. @@ -2459,7 +2495,7 @@ $opt[]=''; } - $output = ''; + $output = ''; return $output; } @@ -3481,7 +3517,7 @@ // Create selector box of the options $sSize = $params['autoSizeMax'] ? t3lib_div::intInRange($itemArrayC+1,t3lib_div::intInRange($params['size'],1),$params['autoSizeMax']) : $params['size']; if (!$selector) { - $selector = ''; + $selector = ''; } @@ -3804,7 +3840,7 @@ $assignValue = $this->elName($itemName).'.value=this.options[this.selectedIndex].value'; } $sOnChange = $assignValue.';this.blur();this.selectedIndex=0;'.implode('',$fieldChangeFunc); - $outArr[] = ''; + $outArr[] = ''; break; }