Index: typo3/sysext/cms/tslib/class.tslib_content.php =================================================================== RCS file: /cvsroot/typo3/TYPO3core/typo3/sysext/cms/tslib/class.tslib_content.php,v retrieving revision 1.96 diff -u -r1.96 class.tslib_content.php --- typo3/sysext/cms/tslib/class.tslib_content.php 27 Dec 2005 20:26:14 -0000 1.96 +++ typo3/sysext/cms/tslib/class.tslib_content.php 28 Dec 2005 23:25:16 -0000 @@ -1663,6 +1663,7 @@ } $typeParts = explode('=',$fParts[0]); $confData['type'] = trim(strtolower(end($typeParts))); + $confData['typeUpper'] = strtoupper($confData['type']); if (count($typeParts)==1) { $confData['fieldname'] = $this->cleanFormName($parts[0]); if (strtolower(ereg_replace('[^[:alnum:]]','',$confData['fieldname']))=='email') {$confData['fieldname']='email';} @@ -1691,7 +1692,10 @@ // Additional parameters if (trim($confData['type'])) { $addParams=trim($conf['params']); - if (is_array($conf['params.']) && isset($conf['params.'][$confData['type']])) { + if ($conf[$confData['typeUpper'].'.']['addParams']) { + $addParams = trim($conf[$confData['typeUpper'].'.']['addParams']); + } else if (is_array($conf['params.']) && isset($conf['params.'][$confData['type']])) { + // Backwards compatibility $addParams=trim($conf['params.'][$confData['type']]); } if (strcmp('',$addParams)) $addParams=' '.$addParams; @@ -1702,13 +1706,9 @@ } else { $fName = md5($confData['fieldname']); } + $id = $prefix.$fName; - // Accessibility: Set id = fieldname attribute: - if ($conf['accessibility'] || $xhtmlStrict) { - $elementIdAttribute = ' id="'.$prefix.$fName.'"'; - } else { - $elementIdAttribute = ''; - } + $addParams = str_replace('###ID###',$id,$addParams); // Create form field based on configuration/type: switch($confData['type']) { @@ -1726,7 +1726,7 @@ $wrap = $wrap ? ' wrap="'.$wrap.'"' : ' wrap="virtual"'; } $default = $this->getFieldDefaultValue($conf['noValueInsert'], $confData['fieldname'], str_replace('\n',chr(10),trim($parts[2]))); - $fieldCode=sprintf('', + $fieldCode=sprintf('', $confData['fieldname'], $cols, $rows, $wrap, t3lib_div::formatForTextarea($default)); break; case 'input': @@ -1744,20 +1744,20 @@ $max=trim($fParts[2]) ? ' maxlength="'.t3lib_div::intInRange($fParts[2],1,1000).'"' : ""; $theType = $confData['type']=='input' ? 'text' : 'password'; - $fieldCode=sprintf('', + $fieldCode=sprintf('', $confData['fieldname'], $size, $max, htmlspecialchars($default)); break; case 'file': $size=trim($fParts[1]) ? t3lib_div::intInRange($fParts[1],1,60) : 20; - $fieldCode=sprintf('', + $fieldCode=sprintf('', $confData['fieldname'], $size); break; case 'check': // alternative default value: $default = $this->getFieldDefaultValue($conf['noValueInsert'], $confData['fieldname'], trim($parts[2])); $checked = $default ? ' checked="checked"' : ''; - $fieldCode=sprintf('', + $fieldCode=sprintf('', 1, $confData['fieldname'], $checked); break; case 'select': @@ -1795,14 +1795,11 @@ } if ($multiple) $confData['fieldname'].='[]'; // The fieldname must be prepended '[]' if multiple select. And the reason why it's prepended is, because the required-field list later must also have [] prepended. - $fieldCode=sprintf('', + $fieldCode=sprintf('', $confData['fieldname'], $size, $multiple, $option); //RTF break; case 'radio': $option=''; - if ($conf['accessibility']) { - $option.='
'; - } $fieldCode = $option; break; case 'hidden': @@ -1849,7 +1850,7 @@ if (strlen($value) && t3lib_div::inList('recipient_copy,recipient',$confData['fieldname'])) { $value = $GLOBALS['TSFE']->codeString($value); } - $hiddenfields.=sprintf('', + $hiddenfields.=sprintf('', $confData['fieldname'], htmlspecialchars($value)); break; case 'property': @@ -1868,13 +1869,13 @@ if($image) { $fieldCode = str_replace('', + $fieldCode=sprintf('', $confData['fieldname'], t3lib_div::deHSCentities(htmlspecialchars($value))); } break; case 'reset': $value=trim($parts[2]); - $fieldCode=sprintf('', + $fieldCode=sprintf('', $confData['fieldname'], t3lib_div::deHSCentities(htmlspecialchars($value))); break; case 'label': @@ -1920,38 +1921,41 @@ // Field: $fieldLabel = $confData['label']; - if ($conf['accessibility'] && $confData['type']!='radio' && $confData['type'] != 'label') { - $fieldLabel = ''; - } // Getting template code: $fieldCode = $this->stdWrap($fieldCode, $conf['fieldWrap.']); - $labelCode = $this->stdWrap($fieldLabel, $conf['labelWrap.']); + if (is_array($conf[$confData['typeUpper'].'.']['labelWrap.'])) { + $labelCode = $this->stdWrap($fieldLabel, $conf[$confData['typeUpper'].'.']['labelWrap.']); + } else { + $labelCode = $this->stdWrap($fieldLabel, $conf['labelWrap.']); + } + $labelCode = str_replace('###ID###',$id,$labelCode); + $commentCode = $this->stdWrap($confData['label'], $conf['commentWrap.']); // RTF $result = $conf['layout']; + if (isset($conf[$confData['typeUpper'].'.']['layout'])) { + $result = $conf[$confData['typeUpper'].'.']['layout']; + } if ($conf['REQ'] && $confData['required']) { - if (is_array($conf['REQ.']['fieldWrap.'])) + if (is_array($conf[$confData['typeUpper'].'.']['REQ.']['fieldWrap.'])) + $fieldCode = $this->stdWrap($fieldCode, $conf[$confData['typeUpper'].'.']['REQ.']['fieldWrap.']); + else if (is_array($conf['REQ.']['fieldWrap.'])) $fieldCode = $this->stdWrap($fieldCode, $conf['REQ.']['fieldWrap.']); - if (is_array($conf['REQ.']['labelWrap.'])) + + if (is_array($conf[$confData['typeUpper'].'.']['REQ.']['labelWrap.'])) + $labelCode = $this->stdWrap($fieldLabel, $conf[$confData['typeUpper'].'.']['REQ.']['labelWrap.']); + else if (is_array($conf['REQ.']['labelWrap.'])) $labelCode = $this->stdWrap($fieldLabel, $conf['REQ.']['labelWrap.']); - if ($conf['REQ.']['layout']) { + + if (is_array($conf[$confData['typeUpper'].'.']['REQ.']['layout'])) + $result = $conf[$confData['typeUpper'].'.']['REQ.']['layout']; + else if (is_array($conf['REQ.']['layout'])) $result = $conf['REQ.']['layout']; - } - } - if ($confData['type']=='comment' && $conf['COMMENT.']['layout']) { - $result = $conf['COMMENT.']['layout']; - } - if ($confData['type']=='check' && $conf['CHECK.']['layout']) { - $result = $conf['CHECK.']['layout']; - } - if ($confData['type']=='radio' && $conf['RADIO.']['layout']) { - $result = $conf['RADIO.']['layout']; - } - if ($confData['type']=='label' && $conf['LABEL.']['layout']) { - $result = $conf['LABEL.']['layout']; } $result = str_replace('###FIELD###',$fieldCode,$result); $result = str_replace('###LABEL###',$labelCode,$result); + $result = str_replace('###RAWLABEL###',$confData['label'],$result); + $result = str_replace('###ID###',$id,$result); $result = str_replace('###COMMENT###',$commentCode,$result); //RTF $content.= $result; } Index: typo3/sysext/css_styled_content/static/setup.txt =================================================================== RCS file: /cvsroot/typo3/TYPO3core/typo3/sysext/css_styled_content/static/setup.txt,v retrieving revision 1.5 diff -u -r1.5 setup.txt --- typo3/sysext/css_styled_content/static/setup.txt 26 Dec 2005 23:59:37 -0000 1.5 +++ typo3/sysext/css_styled_content/static/setup.txt 28 Dec 2005 23:25:16 -0000 @@ -1120,23 +1120,56 @@ # change mailform to accesssible mode tt_content.mailform.20 { - accessibility = 1 - noWrapAttr=1 + noWrapAttr = 1 formName = mailform dontMd5FieldNames = 1 - REQ = 1 layout =