Fixed bug #14461: TCEforms: Use fieldsets for palettes instead of tables (Thanks...
authorSusanne Moog <typo3@susannemoog.de>
Fri, 28 May 2010 17:05:56 +0000 (17:05 +0000)
committerSusanne Moog <typo3@susannemoog.de>
Fri, 28 May 2010 17:05:56 +0000 (17:05 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7723 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms.php
typo3/sysext/t3skin/stylesheets/structure/element_tceforms.css
typo3/sysext/t3skin/stylesheets/visual/element_tceforms.css

index de2d61b..9d8d590 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,7 @@
        * Fixed bug #1402: Text area / RTE fields can't be set to required at the moment.
        * Fixed bug #12604: fileNameASCIIPrefix got deprecated but is used in core (Thanks to Steffen Gebert)
        * Fixed bug #11437: New labels in the log module are hardcoded (Thanks to Andy Grunwald)
+       * Fixed bug #14461: TCEforms: Use fieldsets for palettes instead of tables (Thanks to Jo Hasenau)
 
 2010-05-28  Christian Kuhn  <lolli@schwarzbu.ch>
 
index dd04a03..a328d0c 100644 (file)
@@ -4955,20 +4955,34 @@ class t3lib_TCEforms    {
         * @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="t3-form-palette-field' . $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++;
@@ -4976,43 +4990,31 @@ class t3lib_TCEforms    {
                                }
                        } 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>';
-               }
+                               $fieldIdentifierForJs = $content['TABLE'] . '_' . $content['ID'] . '_' . $content['FIELD'];
+                               $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'] .
+                                                       $content['HELP_ICON'] .
+                                               '</span>' .
+                                       '</span>';
+                       }
                }
 
-                       // 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.
         *
index d7d0660..10cb06d 100644 (file)
@@ -25,14 +25,24 @@ img.t3-TCEforms-contentchangedImg {
        width: 7px;
 }
 
+.t3-form-palette-icon-required {
+       display: inline-block;
+       height: 16px;
+       margin-right: 2px;
+       width: 16px;
+}
+/* renamed to .t3-form-palette-icon-required, lines below kept for backwards-compatibility */
 img.t3-TCEforms-reqPaletteImg {
        display: inline-block;
        height: 16px;
        margin-right: 2px;
        width: 16px;
-
 }
 
+.t3-form-palette-icon-contentchanged {
+       width: 7px;
+}
+/* renamed to .t3-form-palette-icon-contentchanged, lines below kept for backwards-compatibility */
 img.t3-TCEforms-contentchangedPaletteImg {
        width: 7px;
 }
@@ -174,6 +184,16 @@ table.typo3-TCEforms td.thumbnails {
        margin-top: 2px;
 }
 
+.t3-form-palette-field-container {
+       display:inline-block;
+       margin-left:20px;
+       vertical-align:top;
+}
+
+.t3-form-palette-field-container .t3-form-palette-field-label, .t3-form-palette-field-container .t3-form-palette-field {
+       display:block;
+}
+
 /* - - - - - - - - - - - - - - - - - - - - -
 TCEforms suggest
 - - - - - - - - - - - - - - - - - - - - - */
index 34cfc5c..63eac4e 100644 (file)
@@ -212,6 +212,9 @@ table.typo3-TCEforms table.wrapperAttention .wrapperTable5 {
        border: 1px solid #a30904;
 }
 
+.t3-form-palette-fieldset {
+       border:none;
+}
 
 input.typo3-TCEforms-suggest-search {
        background-image: url('../../icons/gfx/zoom.gif');