[BUGFIX] EXT:info_pagetsconfig Optimized view on page 0 43/51043/4
authorMichael Oehlhof <typo3@oehlhof.de>
Sun, 25 Dec 2016 21:57:29 +0000 (22:57 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 26 Feb 2017 17:47:05 +0000 (18:47 +0100)
If there are no pages containing Page TSconfig settings in the page
configuration an info FlashMessage is shown instead of an empty table.

Resolves: #78509
Releases: master
Change-Id: I4a5cda38746187a1147e5500e77b516cb9a85fd6
Reviewed-on: https://review.typo3.org/51043
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/info_pagetsconfig/Classes/Controller/InfoPageTyposcriptConfigController.php
typo3/sysext/info_pagetsconfig/Resources/Private/Language/locallang.xlf
typo3/sysext/info_pagetsconfig/Resources/Private/Partials/PageZero.html

index 689edde..7418c96 100644 (file)
@@ -95,7 +95,10 @@ class InfoPageTyposcriptConfigController extends \TYPO3\CMS\Backend\Module\Abstr
 
         if ($pageId === 0) {
             $this->view->assign('pageZero', 1);
-            $this->view->assign('overviewOfPagesUsingTSConfig', $this->getOverviewOfPagesUsingTSConfig());
+            $pagesUsingTSConfig = $this->getOverviewOfPagesUsingTSConfig();
+            if (count($pagesUsingTSConfig) > 0) {
+                $this->view->assign('overviewOfPagesUsingTSConfig', $pagesUsingTSConfig);
+            }
         } else {
             if ($this->pObj->MOD_SETTINGS['tsconf_parts'] == 99) {
                 $TSparts = BackendUtility::getPagesTSconfig($this->pObj->id, null, true);
@@ -328,7 +331,7 @@ class InfoPageTyposcriptConfigController extends \TYPO3\CMS\Backend\Module\Abstr
                 continue;
             }
             $line = [];
-            $line['padding'] = ($pageDepth * 20);
+            $line['padding'] = ($pageDepth * 20) + 10;
             if (isset($pageArray[$identifier . '_'])) {
                 $line['link'] = GeneralUtility::linkThisScript(['id' => $identifier]);
                 $line['icon'] = $this->iconFactory->getIconForRecord('pages', BackendUtility::getRecordWSOL('pages', $identifier), Icon::SIZE_SMALL)->render();
index e67c8c5..78ed91b 100644 (file)
@@ -63,6 +63,9 @@
                        <trans-unit id="written_tsconfig_lines">
                                <source>Lines:</source>
                        </trans-unit>
+                       <trans-unit id="tsconf_noPageTSconfig">
+                               <source>There are no pages containing custom Page TSconfig settings in the page configuration.</source>
+                       </trans-unit>
                </body>
        </file>
 </xliff>
index 5ce6e45..fbeafd8 100644 (file)
@@ -1,18 +1,25 @@
 <div class="nowrap">
-    <div class="table-fit">
-        <table class="table table-striped table-hover" id="tsconfig-overview">
-            <thead>
-                <tr>
-                    <th>{f:translate(key: 'LLL:EXT:info_pagetsconfig/Resources/Private/Language/locallang.xlf:pagetitle')}</th>
-                    <th>{f:translate(key: 'LLL:EXT:info_pagetsconfig/Resources/Private/Language/locallang.xlf:included_tsconfig_files')}</th>
-                    <th>{f:translate(key: 'LLL:EXT:info_pagetsconfig/Resources/Private/Language/locallang.xlf:written_tsconfig_lines')}</th>
-                </tr>
-            </thead>
-            <tbody>
-                <f:for each="{overviewOfPagesUsingTSConfig}" as="line">
-                    <f:render partial="PageZeroTableRow" arguments="{line: line}" />
-                </f:for>
-            </tbody>
-        </table>
-    </div>
+    <f:if condition="{overviewOfPagesUsingTSConfig}">
+        <f:then>
+            <div class="table-fit">
+                <table class="table table-striped table-hover" id="tsconfig-overview">
+                    <thead>
+                        <tr>
+                            <th>{f:translate(key: 'LLL:EXT:info_pagetsconfig/Resources/Private/Language/locallang.xlf:pagetitle')}</th>
+                            <th>{f:translate(key: 'LLL:EXT:info_pagetsconfig/Resources/Private/Language/locallang.xlf:included_tsconfig_files')}</th>
+                            <th>{f:translate(key: 'LLL:EXT:info_pagetsconfig/Resources/Private/Language/locallang.xlf:written_tsconfig_lines')}</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        <f:for each="{overviewOfPagesUsingTSConfig}" as="line">
+                            <f:render partial="PageZeroTableRow" arguments="{line: line}" />
+                        </f:for>
+                    </tbody>
+                </table>
+            </div>
+        </f:then>
+        <f:else>
+            <f:be.infobox message="{f:translate(key: 'LLL:EXT:info_pagetsconfig/Resources/Private/Language/locallang.xlf:tsconf_noPageTSconfig')}" state="-1" />
+        </f:else>
+    </f:if>
 </div>
\ No newline at end of file