[TASK] Remove table for icons in TCA type "select" 47/33447/2
authorGeorg Ringer <georg.ringer@gmail.com>
Wed, 22 Oct 2014 07:42:26 +0000 (09:42 +0200)
committerBenjamin Mack <benni@typo3.org>
Fri, 24 Oct 2014 07:41:35 +0000 (09:41 +0200)
The TCA type "select" uses a table to render the belonging icons.
Use divs instead for the markup.

Change-Id: I9bd8fb58d314913ec7b0859361c0c25fcc90d73e
Resolves: #62386
Releases: master
Reviewed-on: http://review.typo3.org/33447
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/backend/Classes/Form/Element/SelectElement.php

index e7ff2c4..5e2b312 100644 (file)
@@ -478,7 +478,7 @@ class SelectElement extends AbstractFormElement {
                $item .= '</select>';
                // Create icon table:
                if (count($selicons) && !$config['noIconsBelowSelect']) {
-                       $item .= '<table border="0" cellpadding="0" cellspacing="0" class="typo3-TCEforms-selectIcons">';
+                       $item .= '<div class="typo3-TCEforms-selectIcons">';
                        $selicon_cols = (int)$config['selicon_cols'];
                        if (!$selicon_cols) {
                                $selicon_cols = count($selicons);
@@ -486,17 +486,17 @@ class SelectElement extends AbstractFormElement {
                        $sR = ceil(count($selicons) / $selicon_cols);
                        $selicons = array_pad($selicons, $sR * $selicon_cols, '');
                        for ($sa = 0; $sa < $sR; $sa++) {
-                               $item .= '<tr>';
+                               $item .= '<div>';
                                for ($sb = 0; $sb < $selicon_cols; $sb++) {
                                        $sk = $sa * $selicon_cols + $sb;
                                        $imgN = 'selIcon_' . $table . '_' . $row['uid'] . '_' . $field . '_' . $selicons[$sk][1];
                                        $imgS = $selicons[$sk][2] ? $this->formEngine->backPath . 'gfx/content_selected.gif' : 'clear.gif';
-                                       $item .= '<td><img name="' . htmlspecialchars($imgN) . '" src="' . $imgS . '" width="7" height="10" alt="" /></td>';
-                                       $item .= '<td>' . $selicons[$sk][0] . '</td>';
+                                       $item .= '<span><img name="' . htmlspecialchars($imgN) . '" src="' . htmlspecialchars($imgS) . '" width="7" height="10" alt="" /></span>';
+                                       $item .= '<span>' . $selicons[$sk][0] . '</span>';
                                }
-                               $item .= '</tr>';
+                               $item .= '</div>';
                        }
-                       $item .= '</table>';
+                       $item .= '</div>';
                }
                return $item;
        }