Project

General

Profile

Bug #24591 » rfc0017056_v3.diff

Administrator Admin, 2011-02-07 12:15

View differences:

class.t3lib_tceforms.php (working copy)
* @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;
}
/**
......
* @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;
}
/**
(5-5/6)