Project

General

Profile

Bug #24591 » 24591_v4.diff

Andreas Wolf, 2011-09-29 22:28

View differences:

t3lib/class.t3lib_tceforms.php
* @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) {
// 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) {
$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_utility_Math::forceIntegerInRange(($selIconInfo[1] - 12) / 2, 0);
$styleAttr = 'background: #fff url(' . $selIconFile . ') 0% 50% no-repeat; height: '
. t3lib_utility_Math::forceIntegerInRange(($selIconInfo[1] + 2) - $padTop, 0) . 'px; padding-top: '
. $padTop . 'px; padding-left: ' . $padLeft . 'px;';
}
$padTop = t3lib_utility_Math::forceIntegerInRange(($selIconInfo[1] - 12) / 2, 0);
$styleAttr = 'background: #fff url(' . $selIconFile . ') 0% 50% no-repeat; height: ' . t3lib_utility_Math::forceIntegerInRange(($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))) {
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_utility_Math::forceIntegerInRange(($selIconInfo[1] - 12) / 2, 0);
$padLeft = $selIconInfo[0] + 4;
return 'background: #ffffff url(' . $selIconFile . ') 0 0 no-repeat; padding-top: ' . $padTop . 'px; padding-left: ' . $padLeft . 'px;';
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_utility_Math::forceIntegerInRange(($selIconInfo[1] - 12) / 2, 0);
$styleAttr = 'background: #ffffff url(' . $selIconFile . ') 0 0 no-repeat; padding-top: ' . $padTop
. 'px; padding-left: ' . $padLeft . 'px;';
}
}
return $styleAttr;
}
/**
(6-6/6)