Index: t3lib/class.t3lib_tceforms_inline.php =================================================================== --- t3lib/class.t3lib_tceforms_inline.php (Revision 8737) +++ t3lib/class.t3lib_tceforms_inline.php (Arbeitskopie) @@ -831,16 +831,64 @@ // Create option tags: $opt = array(); $styleAttrValue = ''; + foreach($selItems as $p) { + $sM = (!strcmp($PA['itemFormElValue'],$p[1])?' selected="selected"':''); + if ($sM) { + $sI = $c; + $noMatchingValue = 0; + } + + // Getting style attribute value (for icons): if ($config['iconsInOptionTags']) { - $styleAttrValue = $this->fObj->optionTagStyle($p[2]); + $styleAttrValue = $this->optionTagStyle($p[2]); + if ($sM) { + list($selectIconFile,$selectIconInfo) = $this->getIcon($p[2]); + if (!empty($selectIconInfo)) { + $selectedStyle = ' style="background: #fff url(' . $selectIconFile . ') 0% 50% no-repeat; padding: 1px 1px 1px 24px; -webkit-background-size: 0;"'; + } + } } - if (!in_array($p[1], $uniqueIds)) { - $opt[]= ''; + + // Compiling the ' . LF; + $optGroupOpen = true; + $c--; + $optGroupStart = array(); + } + $opt[]= '' . LF; + } } + + // If there is an icon for the selector box (rendered in table under)...: + if ($p[2] && !$suppressIcons && (!$onlySelectedIconShown || $sM)) { + list($selIconFile,$selIconInfo)=$this->getIcon($p[2]); + $iOnClick = $this->elName($PA['itemFormElName']) . '.selectedIndex=' . $c . '; ' . + $this->elName($PA['itemFormElName']) . '.style.backgroundImage=' . $this->elName($PA['itemFormElName']) . '.options[' . $c .'].style.backgroundImage; ' . + implode('',$PA['fieldChangeFunc']).$this->blur().'return false;'; + $selicons[]=array( + (!$onlySelectedIconShown ? '' : ''). + ''.htmlspecialchars($p[0]).''. + (!$onlySelectedIconShown ? '' : ''), + $c,$sM); + $onChangeIcon = 'this.style.backgroundImage=this.options[this.selectedIndex].style.backgroundImage;'; + } + $c++; } // Put together the selector box: