Project

General

Profile

Bug #22700 ยป tceform_palette_fieldset.patch

Administrator Admin, 2010-05-22 17:55

View differences:

t3lib/class.t3lib_tceforms.php (Arbeitskopie)
* @param array The palette array to print
* @return string HTML output
*/
function printPalette($palArr) {
function printPalette($palArr) {
$fieldAttributes = $labelAttributes = '';
// Init color/class attributes:
$ccAttr2 = $this->colorScheme[2] ? ' bgcolor="'.$this->colorScheme[2].'"' : '';
$ccAttr2.= $this->classScheme[2] ? ' class="'.$this->classScheme[2].'"' : '';
$ccAttr4 = $this->colorScheme[4] ? ' style="color:'.$this->colorScheme[4].'"' : '';
$ccAttr4.= $this->classScheme[4] ? ' class="'.$this->classScheme[4].'"' : '';
if ($this->colorScheme[2]) {
$labelAttributes .= ' bgcolor="' . $this->colorScheme[2] . '"';
}
if ($this->classScheme[2]) {
$labelAttributes .= ' class="t3-form-palette-field-label ' . $this->classScheme[2] . '"';
} else {
$labelAttributes .= ' class="t3-form-palette-field-label"';
}
if ($this->colorScheme[4]) {
$fieldAttributes .= ' style="color: ' . $this->colorScheme[4] . '"';
}
if ($this->classScheme[4]) {
$fieldAttributes .= ' class="' . $this->classScheme[4] . '"';
}
$row = 0;
$hRow = $iRow = array();
$lastLineWasLinebreak = FALSE;
// Traverse palette fields and render them into table rows:
foreach($palArr as $content) {
// Traverse palette fields and render them into containers:
foreach ($palArr as $content) {
if ($content['NAME'] === '--linebreak--') {
if (!$lastLineWasLinebreak) {
$row++;
......
}
} else {
$lastLineWasLinebreak = FALSE;
$hRow[$row][] = '<td' . $ccAttr2 . '>&nbsp;</td>
<td nowrap="nowrap"'.$ccAttr2.'>'.
'<span'.$ccAttr4.'>'.
$content['NAME'].
'</span>'.
'</td>';
$iRow[$row][] = '<td valign="top">' .
'<img name="req_'.$content['TABLE'].'_'.$content['ID'].'_'.$content['FIELD'].'" src="clear.gif" class="t3-TCEforms-reqPaletteImg"alt="" />'.
'<img name="cm_'.$content['TABLE'].'_'.$content['ID'].'_'.$content['FIELD'].'" src="clear.gif" class="t3-TCEforms-contentchangedPaletteImg" alt="" />'.
'</td>
<td nowrap="nowrap" valign="top">'.
$content['ITEM'].
$content['HELP_ICON'].
'</td>';
$iRow[$row][] = '<div class="t3-form-palette-field-container">' .
'<label' . $labelAttributes . '>' .
'<span' . $fieldAttributes . '>' .
$content['NAME'] . ' ' .
$content['HELP_ICON'] .
'</span>' .
'</label>' .
$content['ITEM'] .
'</div>';
}
}
}
// Final wrapping into the table:
$out='<table border="0" cellpadding="0" cellspacing="0" class="typo3-TCEforms-palette">';
for ($i=0; $i<=$row; $i++) {
$out .= '
<tr>
<td><img src="clear.gif" width="'.intval($this->paletteMargin).'" height="1" alt="" /></td>'.
implode('
', $hRow[$i]) . '
</tr>
<tr>
<td></td>'.
implode('
', $iRow[$i]) . '
</tr>';
// Final wrapping into the fieldset:
$out = '<fieldset class="t3-form-palette-fieldset">';
for ($i = 0; $i <= $row; $i++) {
$out .= implode($iRow[$i]);
}
$out .= '</table>';
$out .= '</fieldset>';
return $out;
}
/**
* Returns help-text ICON if configured for.
*
typo3/sysext/t3skin/stylesheets/structure/element_palette.css (Arbeitskopie)
$Id$
- - - - - - - - - - - - - - - - - - - - - */
div.t3-form-palette-field-container {
display: block;
float: left;
margin-right: 2px;
margin-bottom: 2px;
padding: 2px 10px;
}
label.t3-form-palette-field-label {
white-space: nowrap;
line-height: 20px;
}
/* kept for backwards-compatibility reasons, remove sometime in 2011 */
body#typo3-alt-palette-php {
margin-left: 6px;
margin-top: 8px;
typo3/sysext/t3skin/stylesheets/visual/element_palette.css (Arbeitskopie)
$Id$
- - - - - - - - - - - - - - - - - - - - - */
fieldset.t3-form-palette-fieldset {
border: none;
background: #E8E8F2;
}
/* kept for backwards-compatibility reasons, remove sometime in 2011 */
body#typo3-alt-palette-php {
background-image: url('../../icons/gfx/topmenu_background_palette.jpg');
}
    (1-1/1)