Index: class.t3lib_tceforms.php =================================================================== --- class.t3lib_tceforms.php (revision 10404) +++ class.t3lib_tceforms.php (working copy) @@ -4170,19 +4170,21 @@ * @return string Style attribute content, if any */ function optionTagStyle($iconString) { + $styleAttr = ''; if ($iconString) { list($selIconFile, $selIconInfo) = $this->getIcon($iconString); + if(is_file(t3lib_div::resolveBackPath(PATH_typo3 . selIconFile)) { + $padLeft = $selIconInfo[0] + 4; - $padLeft = $selIconInfo[0] + 4; + if ($padLeft >= 18 && $padLeft <= 24) { + $padLeft = 22; // In order to get the same padding for all option tags even if icon sizes differ a little, set it to 22 if it was between 18 and 24 pixels + } - if ($padLeft >= 18 && $padLeft <= 24) { - $padLeft = 22; // In order to get the same padding for all option tags even if icon sizes differ a little, set it to 22 if it was between 18 and 24 pixels + $padTop = t3lib_div::intInRange(($selIconInfo[1] - 12) / 2, 0); + $styleAttr = 'background: #fff url(' . $selIconFile . ') 0% 50% no-repeat; height: ' . t3lib_div::intInRange(($selIconInfo[1] + 2) - $padTop, 0) . 'px; padding-top: ' . $padTop . 'px; padding-left: ' . $padLeft . 'px;'; } - - $padTop = t3lib_div::intInRange(($selIconInfo[1] - 12) / 2, 0); - $styleAttr = 'background: #fff url(' . $selIconFile . ') 0% 50% no-repeat; height: ' . t3lib_div::intInRange(($selIconInfo[1] + 2) - $padTop, 0) . 'px; padding-top: ' . $padTop . 'px; padding-left: ' . $padLeft . 'px;'; - return $styleAttr; } + return $styleAttr; } /** @@ -4192,20 +4194,25 @@ * @return string Style attribute content, if any */ function optgroupTagStyle($iconString) { + $styleAttr = ''; if ($iconString) { list($selIconFile, $selIconInfo) = $this->getIcon($iconString); - $padLeft = $selIconInfo[0] + 4; + if(is_file(t3lib_div::resolveBackPath(PATH_typo3 . selIconFile)) { + + $padLeft = $selIconInfo[0] + 4; - if($padLeft >= 18 && $padLeft <= 24) { - // In order to get the same padding for all option tags even if icon sizes differ a little, - // set it to 22, if it was between 18 and 24 pixels. - $padLeft = 22; + if($padLeft >= 18 && $padLeft <= 24) { + // In order to get the same padding for all option tags even if icon sizes differ a little, + // set it to 22, if it was between 18 and 24 pixels. + $padLeft = 22; + } + $padTop = t3lib_div::intInRange(($selIconInfo[1] - 12) / 2, 0); + + $styleAttr = 'background: #ffffff url(' . $selIconFile . ') 0 0 no-repeat; padding-top: ' . $padTop . 'px; padding-left: ' . $padLeft . 'px;'; } - $padTop = t3lib_div::intInRange(($selIconInfo[1] - 12) / 2, 0); - - return 'background: #ffffff url(' . $selIconFile . ') 0 0 no-repeat; padding-top: ' . $padTop . 'px; padding-left: ' . $padLeft . 'px;'; } + return $styleAttr; } /**