[TASK] CSC: Do not show pageTS template if it's included by default
[Packages/TYPO3.CMS.git] / typo3 / sysext / css_styled_content / Configuration / TCA / Overrides / pages.php
index d7aeda7..739e7fd 100644 (file)
@@ -1,9 +1,18 @@
 <?php
 defined('TYPO3_MODE') or die();
 
-// Add pageTSconfig
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
-    'css_styled_content',
-    'Configuration/PageTSconfig/NewContentElementWizard.ts',
-    'CSS-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',
+                'CSS-based Content Elements'
+            );
+        }
+    },
+    'css_styled_content'
 );