Bug #24580 ยป 17044_v3.diff
t3lib/class.t3lib_tceforms.php (Arbeitskopie) | ||
---|---|---|
* @return string The HTML code for the item
|
||
* @see getSingleField_typeSelect()
|
||
*/
|
||
function getSingleField_typeSelect_checkbox($table, $field, $row, &$PA, $config, $selItems, $nMV_label) {
|
||
function getSingleField_typeSelect_checkbox(
|
||
$table, $field, $row, &$PA, $config, $selItems, $nMV_label) {
|
||
// Get values in an array (and make unique, which is fine because there can be no duplicates anyway):
|
||
$itemArray = array_flip($this->extractValuesOnlyFromValueLabelList($PA['itemFormElValue']));
|
||
... | ... | |
foreach ($selItems as $p) {
|
||
// Non-selectable element:
|
||
if (!strcmp($p[1], '--div--')) {
|
||
if (count($setAll)) {
|
||
$tRows[] = '
|
||
<tr class="c-header-checkbox-controls">
|
||
<td colspan="3">' .
|
||
'<a href="#" onclick="' . htmlspecialchars(implode('', $setAll) . ' return false;') . '">' .
|
||
htmlspecialchars($this->getLL('l_checkAll')) .
|
||
'</a>
|
||
<a href="#" onclick="' . htmlspecialchars(implode('', $unSetAll) . ' return false;') . '">' .
|
||
htmlspecialchars($this->getLL('l_uncheckAll')) .
|
||
'</a>
|
||
</td>
|
||
</tr>';
|
||
$setAll = array();
|
||
$unSetAll = array();
|
||
}
|
||
$tRows[] = '
|
||
<tr class="c-header">
|
||
<td colspan="3">' . htmlspecialchars($p[0]) . '</td>
|
||
... | ... | |
$tRows[] = '
|
||
<tr id="' . $rowId . '" class="' . ($sM ? 'c-selectedItem' : 'c-unselectedItem') . '" 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-checkbox"><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) . '">' .
|
||
$this->getIconHtml($selIcon) .
|
||
$label .
|
||
... | ... | |
$c++;
|
||
}
|
||
}
|
||
// Remaining checkboxes will get their set-all link:
|
||
if (count($setAll)) {
|
||
$tRows[] = '
|
||
<tr class="c-header-checkbox-controls">
|
||
<td colspan="3">' .
|
||
'<a href="#" onclick="' . htmlspecialchars(implode('', $setAll) . ' return false;') . '">' .
|
||
htmlspecialchars($this->getLL('l_checkAll')) .
|
||
'</a>
|
||
<a href="#" onclick="' . htmlspecialchars(implode('', $unSetAll) . ' return false;') . '">' .
|
||
htmlspecialchars($this->getLL('l_uncheckAll')) .
|
||
'</a>
|
||
</td>
|
||
</tr>';
|
||
}
|
||
}
|
||
// Remaining values (invalid):
|
||
... | ... | |
// Compile <checkboxes> tag:
|
||
array_unshift($tRows, '
|
||
<tr class="c-invalidItem">
|
||
<td><input type="checkbox"' . $this->insertDefStyle('check') . ' name="' . htmlspecialchars($PA['itemFormElName'] . '[' . $c . ']') . '" value="' . htmlspecialchars($theNoMatchValue) . '" checked="checked" onclick="' . htmlspecialchars($sOnChange) . '"' . $PA['onFocus'] . $disabled . ' /></td>
|
||
<td class="c-checkbox"><input type="checkbox"' . $this->insertDefStyle('check') . ' name="' . htmlspecialchars($PA['itemFormElName'] . '[' . $c . ']') . '" value="' . htmlspecialchars($theNoMatchValue) . '" checked="checked" onclick="' . htmlspecialchars($sOnChange) . '"' . $PA['onFocus'] . $disabled . ' /></td>
|
||
<td class="c-labelCell">' .
|
||
t3lib_div::deHSCentities(htmlspecialchars(@sprintf($nMV_label, $theNoMatchValue))) .
|
||
'</td><td> </td>
|
||
... | ... | |
// Add an empty hidden field which will send a blank value if all items are unselected.
|
||
$item .= '<input type="hidden" name="' . htmlspecialchars($PA['itemFormElName']) . '" value="" />';
|
||
// Add revert icon
|
||
if (is_array($restoreCmd)) {
|
||
$item .= '<a href="#" onclick="' . implode('', $restoreCmd) . ' return false;' . '">' .
|
||
t3lib_iconWorks::getSpriteIcon('actions-edit-undo', array('title' => htmlspecialchars($this->getLL('l_revertSelection')))) . '</a>';
|
||
// Remaining checkboxes will get their set-all link:
|
||
if (count($setAll)) {
|
||
$tableHead = '<thead>
|
||
<tr class="c-header-checkbox-controls t3-row-header">
|
||
<td class="c-checkbox">
|
||
<input type="checkbox" class="checkbox" onclick="if (checked) {' . htmlspecialchars(implode('', $setAll) . '} else {' . implode('', $unSetAll) . '}') . '">
|
||
</td>
|
||
<td colspan="2">
|
||
</td>
|
||
</tr></thead>';
|
||
}
|
||
// Implode rows in table:
|
||
$item .= '
|
||
<table border="0" cellpadding="0" cellspacing="0" class="typo3-TCEforms-select-checkbox">' .
|
||
implode('', $tRows) . '
|
||
$tableHead .
|
||
'<tbody>' . implode('', $tRows) . '</tbody>
|
||
</table>
|
||
';
|
||
// Add revert icon
|
||
if (is_array($restoreCmd)) {
|
||
$item .= '<a href="#" onclick="' . implode('', $restoreCmd) . ' return false;' . '">' .
|
||
t3lib_iconWorks::getSpriteIcon('actions-edit-undo', array('title' => htmlspecialchars($this->getLL('l_revertSelection')))) . '</a>';
|
||
}
|
||
return $item;
|
||
}
|
||
... | ... | |
}
|
||
if ($this->classScheme[4]) {
|
||
$fieldAttributes .= ' class="t3-form-palette-field' . $this->classScheme[4] . '"';
|
||
$fieldAttributes .= ' class="t3-form-palette-field ' . $this->classScheme[4] . '"';
|
||
}
|
||
$row = 0;
|
||
... | ... | |
$iRow[$row][] = '<span class="t3-form-palette-field-container">' .
|
||
'<label' . $labelAttributes . '>' .
|
||
$content['NAME'] .
|
||
'<img name="req_' . $fieldIdentifierForJs . '" src="clear.gif" class="t3-form-palette-icon-required" alt="" />' .
|
||
'<img name="cm_' . $fieldIdentifierForJs . '" src="clear.gif" class="t3-form-palette-icon-contentchanged" alt="" />' .
|
||
'</label>' .
|
||
'<span' . $fieldAttributes . '>' .
|
||
$content['ITEM'] .
|
||
'<img name="cm_' . $fieldIdentifierForJs . '" src="clear.gif" class="t3-form-palette-icon-contentchanged" alt="" />' .
|
||
'<img name="req_' . $fieldIdentifierForJs . '" src="clear.gif" class="t3-form-palette-icon-required" alt="" />' .
|
||
$content['ITEM'] .
|
||
'</span>' .
|
||
'</span>';
|
||
}
|
typo3/sysext/t3skin/stylesheets/structure/element_tceforms.css (Arbeitskopie) | ||
---|---|---|
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox {
|
||
margin-bottom: 10px;
|
||
width: 98%;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tbody {
|
||
display: block;
|
||
max-height: 300px;
|
||
overflow-y: scroll;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr td {
|
||
padding: 1px 3px 1px 3px;
|
||
vertical-align: middle;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-header td,
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr td.c-checkbox,
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr td.c-labelCell {
|
||
padding-right: 30px;
|
||
padding: 1px 3px;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr td.c-labelCell P.c-descr {
|
||
margin-left: 30px;
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr td.c-labelCell {
|
||
min-width: 300px;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-header td {
|
||
padding-left: 4px;
|
||
padding-top: 10px;
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr td.c-labelCell img {
|
||
margin-right: 5px;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-header-checkbox-controls td {
|
||
padding-right: 16px;
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox td.c-descr {
|
||
width: 40px;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-header-checkbox-controls td a {
|
||
padding-left: 16px;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox td.c-descr img {
|
||
float: right;
|
||
}
|
typo3/sysext/t3skin/stylesheets/visual/element_tceforms.css (Arbeitskopie) | ||
---|---|---|
color: #fff;
|
||
}
|
||
table.typo3-TCEforms-select-checkbox {
|
||
background-color: #efeff4;
|
||
table.typo3-TCEforms-select-checkbox {
|
||
background-color: #ffffff;
|
||
border: 1px solid #aaa;
|
||
}
|
||
table.typo3-TCEforms-select-checkbox tr {
|
||
background-color: #efeff4;
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-header td {
|
||
background-color: #fff;
|
||
font-weight: bold;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-selectedItem {
|
||
background-color: #d7dbe2;
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr:nth-child(2n) {
|
||
background-color: #f7f7f7;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-unselectedItem {
|
||
background-color: #efeff4;
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-selectedItem {
|
||
background-color: #d8ecd0;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-invalidItem {
|
||
background-color: #ff6600;
|
||
color: #dddddd;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-header-checkbox-controls td {
|
||
background-color: #b8bec9;
|
||
text-align: right;
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr:hover {
|
||
background-color: #dedede;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-header-checkbox-controls td a {
|
||
color: white;
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-selectedItem:hover {
|
||
background-color: #abd99a;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-header td {
|
||
background-color: #fff;
|
||
border-bottom: 1px solid #999999;
|
||
font-weight: bold;
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-invalidItem:hover {
|
||
background-color: transparent;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr td {
|
||
border-bottom: 1px #999 dashed;
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr td.c-labelCell {
|
||
white-space: nowrap;
|
||
}
|
||
table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr td.c-labelCell p.c-descr {
|
||
font-style: italic;
|
||
}
|
||
table.typo3-TCEforms optgroup.c-divider,
|
||
select option.c-divider {
|
||
background-color: #eee;
|