Project

General

Profile

Bug #18517 » t3lib_tceforms-addIconToDropdownBox.patch

Administrator Admin, 2008-03-30 11:41

View differences:

t3lib/class.t3lib_tceforms.php (working copy)
$selicons = array();
$onlySelectedIconShown = 0;
$size = intval($config['size']);
$selectedStyle = ''; // Style set on <select/>
$disabled = '';
if($this->renderReadonly || $config['readOnly']) {
......
// Getting style attribute value (for icons):
if ($config['iconsInOptionTags']) {
$styleAttrValue = $this->optionTagStyle($p[2]);
if ($sM) {
list($selectIconFile,$selectIconInfo) = $this->getIcon($p[2]);
$selectedStyle = ' style="background-image: url('.$selectIconFile.'); background-repeat: no-repeat; background-position: 0% 50%; padding: 1px; padding-left: 22px;"';
}
}
// Compiling the <option> tag:
......
if(!$disabled) {
$item.= '<input type="hidden" name="'.$PA['itemFormElName'].'_selIconVal" value="'.htmlspecialchars($sI).'" />'; // MUST be inserted before the selector - else is the value of the hiddenfield here mysteriously submitted...
}
$item.= '<select name="'.$PA['itemFormElName'].'"'.
$item.= '<select'.$selectedStyle.' name="'.$PA['itemFormElName'].'"'.
$this->insertDefStyle('select').
($size?' size="'.$size.'"':'').
' onchange="'.htmlspecialchars($sOnChange).'"'.
(1-1/5)