[TASK] Don't render table header if no files given 62/18362/2
authorGeorg Ringer <georg.ringer@gmail.com>
Mon, 18 Feb 2013 16:19:35 +0000 (17:19 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 8 Mar 2013 10:01:59 +0000 (11:01 +0100)
It doesn't make sense to render the table header in
the filelist module if no files are given.

Change-Id: I81870bca94e63643e3f27c90efa370b0a9964337
Resolves: #45579
Releases: 6.1
Reviewed-on: https://review.typo3.org/18362
Reviewed-by: Felix Kopp
Tested-by: Felix Kopp
Reviewed-by: Soren Malling
Tested-by: Soren Malling
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/filelist/Classes/FileList.php

index 98694f0..7163d80 100644 (file)
@@ -356,19 +356,20 @@ class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
                                        $theData[$v] = $theT;
                                }
                        }
-                       $out .= '<thead>' . $this->addelement(1, $levelUp, $theData, ' class="t3-row-header"', '') . '</thead>';
-                       $out .= '<tbody>' . $iOut . '</tbody>';
-                       // half line is drawn
-                       // finish
-                       $out = '
-
 
+                       if (!empty($iOut)) {
+                               $out .= '<thead>' . $this->addelement(1, $levelUp, $theData, ' class="t3-row-header"', '') . '</thead>';
+                               $out .= '<tbody>' . $iOut . '</tbody>';
+                               // half line is drawn
+                               // finish
+                               $out = '
                <!--
                        File list table:
                -->
                        <table cellpadding="0" cellspacing="0" id="typo3-filelist">
                                ' . $out . '
                        </table>';
+                       }
                } else {
                        /** @var $flashMessage \TYPO3\CMS\Core\Messaging\FlashMessage */
                        $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('storageNotBrowsableMessage'), $GLOBALS['LANG']->getLL('storageNotBrowsableTitle'), \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);