Project

General

Profile

Bug #17787 » optgroup-for-selectorboxes.patch

Administrator Admin, 2007-11-14 13:37

View differences:

t3lib/class.t3lib_tceforms.php (working copy)
// Compiling the <option> tag:
if (!($p[1] != $PA['itemFormElValue'] && is_array($uniqueIds) && in_array($p[1], $uniqueIds))) {
$opt[]= '<option value="'.htmlspecialchars($p[1]).'"'.
if(!strcmp($p[1],'--div--')) {
if($optGroupOpen) { // Closing last optgroup before next one starts
$opt[]='</optgroup>';
}
$opt[]= '<optgroup label="'.t3lib_div::deHSCentities(htmlspecialchars($p[0])).'"'.
($styleAttrValue ? ' style="'.htmlspecialchars($styleAttrValue).'"' : '').
' class="c-divider">';
$optGroupOpen = true;
} else {
$opt[]= '<option value="'.htmlspecialchars($p[1]).'"'.
$sM.
($styleAttrValue ? ' style="'.htmlspecialchars($styleAttrValue).'"' : '').
(!strcmp($p[1],'--div--') ? ' class="c-divider"' : '').
'>'.t3lib_div::deHSCentities(htmlspecialchars($p[0])).'</option>';
}
}
// If there is an icon for the selector box (rendered in table under)...:
......
$c++;
}
if($optGroupOpen) { // Closing optgroup if open
$opt[]='</optgroup>';
$optGroupOpen = false;
}
// No-matching-value:
if ($PA['itemFormElValue'] && $noMatchingValue && !$PA['fieldTSConfig']['disableNoMatchingValueElement'] && !$config['disableNoMatchingValueElement']) {
$nMV_label = @sprintf($nMV_label, $PA['itemFormElValue']);
typo3/stylesheet.css (working copy)
table.typo3-TCEforms tr.typo3-TCEforms-recHeaderRow, TABLE.typo3-TCEforms tr.typo3-TCEforms-recHeaderRow td { border: 0; }
TABLE.typo3-TCEforms SPAN.typo3-TCEforms-newToken { font-weight: bold; color: #990000; }
TABLE.typo3-TCEforms SPAN.typo3-TCEforms-helpText { color: #666; }
TABLE.typo3-TCEforms OPTION.c-divider { font-style: italic; color: #666; background-color: #eee; text-transform: uppercase; margin-top: 10px; border-bottom: 1px solid #666; }
TABLE.typo3-TCEforms OPTGROUP.c-divider { font-style: italic; color: #666; background-color: #eee; text-transform: uppercase; margin-top: 10px; padding: 0px; border-top: 1px solid #666; }
TABLE.typo3-TCEforms OPTGROUP OPTION { font-style: normal; color: black; background-color: white; text-transform: none; border-bottom: none; padding: 0px; margin: 0px; text-indent: 0px;}
TABLE.typo3-TCEforms TABLE.typo3-TCEforms-select-checkbox TR.c-selectedItem { background-color: #c5c1b5; }
TABLE.typo3-TCEforms TABLE.typo3-TCEforms-select-checkbox TR.c-invalidItem { background-color: #ff6600; }
TABLE.typo3-TCEforms TABLE.typo3-TCEforms-select-checkbox TR TD { border-bottom: 1px #999 dashed; padding: 1px 3px 1px 3px; }
(1-1/2)