Project

General

Profile

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)
}
// Compile row:
$baseClass = ($c%2) ? 'db_list_normal ' : 'db_list_alt ';
$rowClass = $baseClass . (($sM) ? 'c-selectedItem' : 'c-unselectedItem');
$rowId = uniqid('select_checkbox_row_');
$onClickCell = $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked=!' . $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked;';
$onClick = 'this.attributes.getNamedItem("class").nodeValue = ' . $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked ? "c-selectedItem" : "c-unselectedItem";';
$onClick = 'this.attributes.getNamedItem("class").nodeValue = ' . $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked ? "' .$baseClass . 'c-selectedItem" : "' .$baseClass .'c-unselectedItem";';
$setAll[] = $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked=1;';
$setAll[] .= '$(\'' . $rowId . '\').removeClassName(\'c-unselectedItem\');$(\'' . $rowId . '\').addClassName(\'c-selectedItem\');';
$setAll[] .= '$(\'' . $rowId . '\').removeClassName(\'' .$baseClass .'c-unselectedItem\');$(\'' . $rowId . '\').addClassName(\'' .$baseClass .'c-selectedItem\');';
$unSetAll[] = $this->elName($PA['itemFormElName'].'['.$c.']').'.checked=0;';
$unSetAll[] .= '$(\'' . $rowId . '\').removeClassName(\'c-selectedItem\');$(\'' . $rowId . '\').addClassName(\'c-unselectedItem\');';
$unSetAll[] .= '$(\'' . $rowId . '\').removeClassName(\'' .$baseClass .'c-selectedItem\');$(\'' . $rowId . '\').addClassName(\'' .$baseClass .'c-unselectedItem\');';
$restoreCmd[] = $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked=' . ($sM ? 1 : 0) . ';' .
'$(\'' . $rowId . '\').removeClassName(\'c-selectedItem\');$(\'' . $rowId . '\').removeClassName(\'c-unselectedItem\');' .
'$(\'' . $rowId . '\').addClassName(\'c-' . ($sM ? '' : 'un') . 'selectedItem\');';
'$(\'' . $rowId . '\').removeClassName(\'' .$baseClass .'c-selectedItem\');$(\'' . $rowId . '\').removeClassName(\'' .$baseClass .'c-unselectedItem\');' .
'$(\'' . $rowId . '\').addClassName(\'' .$baseClass .'c-' . ($sM ? '' : 'un') . 'selectedItem\');';
$hasHelp = ($p[3] !='');
......
}
$tRows[] = '
<tr id="' . $rowId . '" class="'.($sM ? 'c-selectedItem' : 'c-unselectedItem').'" onclick="'.htmlspecialchars($onClick).'" style="cursor: pointer;">
<tr id="' . $rowId . '" class="' . $rowClass . '" onclick="'.htmlspecialchars($onClick).'" style="cursor: pointer;">
<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>
<td class="c-labelCell" onclick="'.htmlspecialchars($onClickCell).'">'.
($selIconFile ? '<img src="'.$selIconFile.'" '.$selIconInfo[3].' vspace="2" border="0" class="absmiddle" style="margin-right: 4px;" alt="" />' : '').
    (1-1/1)