Fixed bug #16435: Headers in GridView are rendered wrong
authorSteffen Kamper <info@sk-typo3.de>
Wed, 17 Nov 2010 13:48:49 +0000 (13:48 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Wed, 17 Nov 2010 13:48:49 +0000 (13:48 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9453 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/class.tx_cms_be_layout.php
typo3/sysext/cms/layout/class.tx_cms_layout.php

index 8e3fd61..be05efe 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
 
 2010-11-17  Steffen Kamper  <steffen@typo3.org>
 
+       * Fixed bug #16435: Headers in GridView are rendered wrong
        * Follow-up to #16315: fixed an issue in ext_conf_template with mod menu
        * Fixed bug #16434: GridView does not show cells if they are not mapped to any column
        * Added feature #16334: Make FlexForms editable via TSConfig and group access lists (Thanks to Kai Vogel)
index 598deea..03fbc38 100644 (file)
@@ -91,20 +91,16 @@ class tx_cms_be_layout {
                                // create items and colPosList
                                if ($backendLayout['__config']['be_layout.'] && $backendLayout['__config']['be_layout.']['rows.']) {
                                        foreach ($backendLayout['__config']['be_layout.']['rows.'] as $row) {
-                                               if (true && count($row['columns.'])) {
                                                        foreach ($row['columns.'] as $column) {
-                                                               if (true) {
                                                                        $backendLayout['__items'][] = array(
                                                                                $column['name'],
                                                                                $column['colPos'],
-                                                                               null
+                                                               NULL
                                                                        );
                                                                        $backendLayout['__colPosList'][] = $column['colPos'];
                                                                }
                                                        }
                                                }
-                                       }
-                               }
 
                        }
                }
index 93fd718..80acf5e 100755 (executable)
@@ -445,7 +445,6 @@ class tx_cms_layout extends recordList {
                        $this->itemLabels[$name] = $GLOBALS['LANG']->sL($val['label']);
                }
 
-
                // Select display mode:
                if (!$this->tt_contentConfig['single']) { // MULTIPLE column display mode, side by side:
 
@@ -622,11 +621,19 @@ class tx_cms_layout extends recordList {
                                                                        (isset($columnConfig['colspan']) ? ' colspan="' . $columnConfig['colspan'] . '"' : '') .
                                                                        (isset($columnConfig['rowspan']) ? ' rowspan="' . $columnConfig['rowspan'] . '"' : '') .
                                                                        ' class="t3-gridCell t3-page-column t3-page-column-' . $columnKey .
-                                                                       (isset($columnKey) ? ' t3-gridCell-disabled' : '') .
+                                                                       (!isset($columnConfig['colPos']) ? ' t3-gridCell-disabled' : '') .
                                                                        (isset($columnConfig['colspan']) ? ' t3-gridCell-width' . $columnConfig['colspan'] : '') .
                                                                        (isset($columnConfig['rowspan']) ? ' t3-gridCell-height' . $columnConfig['rowspan'] : '') . '">';
-                                                       $grid .= $head[$columnKey] . $content[$columnKey] . '</td>';
 
+                                                       // Draw the pre-generated header with edit and new buttons if a colPos is assigned.
+                                                       // If not, a new header without any buttons will be generated.
+                                                       if (isset($columnConfig['colPos'])) {
+                                                               $grid .= $head[$columnKey] . $content[$columnKey];
+                                                       } else {
+                                                               $grid .= $this->tt_content_drawColHeader($columnConfig['name'], '', '');
+                                               }
+
+                                                       $grid .= '</td>';
                                                }
                                                $grid .= '</tr>';
                                        }
@@ -2733,4 +2740,4 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/lay
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/layout/class.tx_cms_layout.php']);
 }
 
-?>
\ No newline at end of file
+?>