Project

General

Profile

Bug #23547 » typo3core_bugfix_15725_trunk.patch

Administrator Admin, 2010-09-16 15:14

View differences:

t3lib/class.t3lib_tceforms_inline.php (Arbeitskopie)
// 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[]= '<option value="'.htmlspecialchars($p[1]).'"'.
' style="'.(in_array($p[1], $uniqueIds) ? '' : '').
($styleAttrValue ? ' style="'.htmlspecialchars($styleAttrValue) : '').'">'.
htmlspecialchars($p[0]).'</option>';
// Compiling the <option> tag:
if (!($p[1] != $PA['itemFormElValue'] && is_array($uniqueIds) && in_array($p[1], $uniqueIds))) {
if(!strcmp($p[1],'--div--')) {
$optGroupStart[0] = $p[0];
$optGroupStart[1] = $styleAttrValue;
} else {
if (count($optGroupStart)) {
if($optGroupOpen) { // Closing last optgroup before next one starts
$opt[]='</optgroup>' . LF;
}
$opt[]= '<optgroup label="'.t3lib_div::deHSCentities(htmlspecialchars($optGroupStart[0])).'"'.
($optGroupStart[1] ? ' style="'.htmlspecialchars($optGroupStart[1]).'"' : '').
' class="c-divider">' . LF;
$optGroupOpen = true;
$c--;
$optGroupStart = array();
}
$opt[]= '<option value="'.htmlspecialchars($p[1]).'"'.
$sM.
($styleAttrValue ? ' style="'.htmlspecialchars($styleAttrValue).'"' : '').
'>' . t3lib_div::deHSCentities(($p[0])) . '</option>' . 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 ? '<a href="#" onclick="'.htmlspecialchars($iOnClick).'">' : '').
'<img src="'.$selIconFile.'" '.$selIconInfo[3].' vspace="2" border="0" title="'.htmlspecialchars($p[0]).'" alt="'.htmlspecialchars($p[0]).'" />'.
(!$onlySelectedIconShown ? '</a>' : ''),
$c,$sM);
$onChangeIcon = 'this.style.backgroundImage=this.options[this.selectedIndex].style.backgroundImage;';
}
$c++;
}
// Put together the selector box:
(1-1/2)