Bug #20388 ยป 11025-alternating-rows-typo3-TCEForms-select-checkbox.diff

Administrator Admin, 2009-05-03 15:50

View differences:

t3lib/class.t3lib_tceforms.php (working copy)
1722 1722
					}
1723 1723

  
1724 1724
						// Compile row:
1725
                    $baseClass = ($c%2) ? 'db_list_normal ' : 'db_list_alt ';
1726
                    $rowClass = $baseClass . (($sM) ? 'c-selectedItem' : 'c-unselectedItem');
1725 1727
					$rowId = uniqid('select_checkbox_row_');
1726 1728
					$onClickCell = $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked=!' . $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked;';
1727
					$onClick = 'this.attributes.getNamedItem("class").nodeValue = ' . $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked ? "c-selectedItem" : "c-unselectedItem";';
1729
                    $onClick = 'this.attributes.getNamedItem("class").nodeValue = ' . $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked ? "' .$baseClass . 'c-selectedItem" : "' .$baseClass .'c-unselectedItem";';
1728 1730
					$setAll[] = $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked=1;';
1729
					$setAll[] .= '$(\'' . $rowId . '\').removeClassName(\'c-unselectedItem\');$(\'' . $rowId . '\').addClassName(\'c-selectedItem\');';
1731
					$setAll[] .= '$(\'' . $rowId . '\').removeClassName(\'' .$baseClass .'c-unselectedItem\');$(\'' . $rowId . '\').addClassName(\'' .$baseClass .'c-selectedItem\');';
1730 1732
					$unSetAll[] = $this->elName($PA['itemFormElName'].'['.$c.']').'.checked=0;';
1731
					$unSetAll[] .= '$(\'' . $rowId . '\').removeClassName(\'c-selectedItem\');$(\'' . $rowId . '\').addClassName(\'c-unselectedItem\');';
1733
					$unSetAll[] .= '$(\'' . $rowId . '\').removeClassName(\'' .$baseClass .'c-selectedItem\');$(\'' . $rowId . '\').addClassName(\'' .$baseClass .'c-unselectedItem\');';
1732 1734
					$restoreCmd[] = $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked=' . ($sM ? 1 : 0) . ';' .
1733
								'$(\'' . $rowId . '\').removeClassName(\'c-selectedItem\');$(\'' . $rowId . '\').removeClassName(\'c-unselectedItem\');' .
1734
								'$(\'' . $rowId . '\').addClassName(\'c-' . ($sM ? '' : 'un') . 'selectedItem\');';
1735
								'$(\'' . $rowId . '\').removeClassName(\'' .$baseClass .'c-selectedItem\');$(\'' . $rowId . '\').removeClassName(\'' .$baseClass .'c-unselectedItem\');' .
1736
								'$(\'' . $rowId . '\').addClassName(\'' .$baseClass .'c-' . ($sM ? '' : 'un') . 'selectedItem\');';
1735 1737

  
1736 1738
					$hasHelp = ($p[3] !='');
1737 1739

  
......
1748 1750
					}
1749 1751

  
1750 1752
					$tRows[] = '
1751
						<tr id="' . $rowId . '" class="'.($sM ? 'c-selectedItem' : 'c-unselectedItem').'" onclick="'.htmlspecialchars($onClick).'" style="cursor: pointer;">
1753
						<tr id="' . $rowId . '" class="' . $rowClass . '" onclick="'.htmlspecialchars($onClick).'" style="cursor: pointer;">
1752 1754
							<td width="12"><input type="checkbox"'.$this->insertDefStyle('check').' name="'.htmlspecialchars($PA['itemFormElName'].'['.$c.']').'" value="'.htmlspecialchars($p[1]).'"'.$sM.' onclick="'.htmlspecialchars($sOnChange).'"'.$PA['onFocus'].' /></td>
1753 1755
							<td class="c-labelCell" onclick="'.htmlspecialchars($onClickCell).'">'.
1754 1756
								($selIconFile ? '<img src="'.$selIconFile.'" '.$selIconInfo[3].' vspace="2" border="0" class="absmiddle" style="margin-right: 4px;" alt="" />' : '').
    (1-1/1)