[TASK] FSC: Do not show pageTS template if it's included by default 00/44400/3
authorMarkus Klein <markus.klein@typo3.org>
Fri, 30 Oct 2015 13:53:33 +0000 (14:53 +0100)
committerJan Helke <typo3@helke.de>
Sat, 31 Oct 2015 11:12:17 +0000 (12:12 +0100)
If the extension fluid_styled_content is configured to include the
pageTS by default, there is no need to show the template in the
page resources.

Resolves: #71170
Releases: master
Change-Id: I61d44fa0c5b347d2622f8117afb8735c7a597b80
Reviewed-on: https://review.typo3.org/44400
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
typo3/sysext/fluid_styled_content/Configuration/TCA/Overrides/pages.php
typo3/sysext/fluid_styled_content/ext_localconf.php

index f9e64fd..859ea0f 100644 (file)
@@ -1,9 +1,18 @@
 <?php
 defined('TYPO3_MODE') or die();
 
-// Add pageTSconfig
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
-    'fluid_styled_content',
-    'Configuration/PageTSconfig/NewContentElementWizard.ts',
-    'Fluid-based Content Elements'
+call_user_func(
+    function ($extKey) {
+        $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$extKey]);
+
+        if (isset($extConf['loadContentElementWizardTsConfig']) && (int)$extConf['loadContentElementWizardTsConfig'] === 0) {
+            // Add pageTSconfig
+            \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
+                $extKey,
+                'Configuration/PageTSconfig/NewContentElementWizard.ts',
+                'Fluid-based Content Elements'
+            );
+        }
+    },
+    'fluid_styled_content'
 );
index 623e9b6..0870d3d 100644 (file)
@@ -1,16 +1,23 @@
 <?php
 defined('TYPO3_MODE') or die();
 
-// Get the extension configuration
-$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY]);
-
 // Define TypoScript as content rendering template
 $GLOBALS['TYPO3_CONF_VARS']['FE']['contentRenderingTemplates'][] = 'fluidstyledcontent/Configuration/TypoScript/Static/';
 
 // Register for hook to show preview of tt_content element of CType="textmedia" in page module
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['textmedia'] = \TYPO3\CMS\FluidStyledContent\Hooks\TextmediaPreviewRenderer::class;
 
-if (!isset($extConf['loadContentElementWizardTsConfig']) || (int)$extConf['loadContentElementWizardTsConfig'] === 1) {
-    // Include new content elements to modWizards
-    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/PageTSconfig/NewContentElementWizard.ts">');
+if (TYPO3_MODE === 'BE') {
+    call_user_func(
+        function ($extKey) {
+            // Get the extension configuration
+            $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$extKey]);
+
+            if (!isset($extConf['loadContentElementWizardTsConfig']) || (int)$extConf['loadContentElementWizardTsConfig'] === 1) {
+                // Include new content elements to modWizards
+                \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/PageTSconfig/NewContentElementWizard.ts">');
+            }
+        },
+        $_EXTKEY
+    );
 }