[TASK] Load Page TSconfig of fluid_styled_content per default 16/43616/6
authorSascha Egerer <sascha@sascha-egerer.de>
Mon, 28 Sep 2015 16:04:25 +0000 (18:04 +0200)
committerStefan Froemken <froemken@gmail.com>
Tue, 29 Sep 2015 11:34:42 +0000 (13:34 +0200)
Load the "New Content Element Wizard" Page TSconfig of the
fluid_styled_content extension by default.
To prevent the autoloading of the TSConfig an extension
configuration is added.
The same option is added for css_styled_content to prevent
the autoloading of the Page TSconfig.

Resolves: #70162
Releases: master
Change-Id: Ie898eba92836681631274251cd0010ad4c8470a2
Reviewed-on: http://review.typo3.org/43616
Reviewed-by: Stefan Froemken <froemken@gmail.com>
Tested-by: Stefan Froemken <froemken@gmail.com>
typo3/sysext/core/Documentation/Changelog/7.5/Feature-38732-Fluid-basedContentElementsIntroduced.rst
typo3/sysext/css_styled_content/Configuration/TCA/Overrides/pages.php [new file with mode: 0644]
typo3/sysext/css_styled_content/Resources/Private/Language/locallang_em.xlf [new file with mode: 0644]
typo3/sysext/css_styled_content/ext_conf_template.txt [new file with mode: 0644]
typo3/sysext/css_styled_content/ext_localconf.php
typo3/sysext/fluid_styled_content/Resources/Private/Language/locallang_em.xlf [new file with mode: 0644]
typo3/sysext/fluid_styled_content/ext_conf_template.txt [new file with mode: 0644]
typo3/sysext/fluid_styled_content/ext_localconf.php

index 0be985e..5d868a3 100644 (file)
@@ -11,7 +11,11 @@ rendered by Fluid Templates. This extension is installed by default on new
 installations.
 
 In order to have Fluid Styled Content running, add the TypoScript file inside the
-Template module, and the PageTSconfig file on the page properties.
+Template module.
+The Page TSconfig is loaded automatically when the extension is installed. The autoloading
+of this file can be disabled by deactivating the ``loadContentElementWizardTsConfig`` option
+in the extension configuration of the extension manager. You have then to load the Page
+TSConfig by yourself on the page properties.
 
 It is possible to overwrite the templates by adding your own paths in the TypoScript setup:
 
@@ -21,7 +25,6 @@ It is possible to overwrite the templates by adding your own paths in the TypoSc
        lib.fluidContent.partialRootPaths.50 = EXT:site_example/Resources/Private/Partials/
        lib.fluidContent.layoutRootPaths.50 = EXT:site_example/Resources/Private/Layouts/
 
-
 The new CType ``textmedia`` adds support for rendering media elements and image elements side by side.
 
 Impact
@@ -31,4 +34,4 @@ Please note that this extension is still in an early stage and breaking changes
 still possible until TYPO3 CMS 7 LTS, so be aware of changes to TCA, Templates,
 Behaviour and Feature set.
 
-Some conflicts regarding CSS Styled Content and Fluid Styled Content might still exist.
\ No newline at end of file
+Some conflicts regarding CSS Styled Content and Fluid Styled Content might still exist.
diff --git a/typo3/sysext/css_styled_content/Configuration/TCA/Overrides/pages.php b/typo3/sysext/css_styled_content/Configuration/TCA/Overrides/pages.php
new file mode 100644 (file)
index 0000000..5d2e0a0
--- /dev/null
@@ -0,0 +1,9 @@
+<?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'
+);
diff --git a/typo3/sysext/css_styled_content/Resources/Private/Language/locallang_em.xlf b/typo3/sysext/css_styled_content/Resources/Private/Language/locallang_em.xlf
new file mode 100644 (file)
index 0000000..d2bf9f6
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
+       <file t3:id="1443455371" source-language="en" datatype="plaintext" original="messages" date="2014-02-07T20:22:32Z" product-name="css_styled_content">
+               <header/>
+               <body>
+                       <trans-unit id="css_styled_content.config.loadContentElementWizardTsConfig">
+                               <source>Load Page TSconfig with "New Content Element Wizard" definitions. The definitions can also be loaded manually by including it in a page.</source>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>
diff --git a/typo3/sysext/css_styled_content/ext_conf_template.txt b/typo3/sysext/css_styled_content/ext_conf_template.txt
new file mode 100644 (file)
index 0000000..f4f6331
--- /dev/null
@@ -0,0 +1,2 @@
+# cat=basic//; type=boolean; label=LLL:EXT:css_styled_content/Resources/Private/Language/locallang_em.xlf:css_styled_content.config.loadContentElementWizardTsConfig
+loadContentElementWizardTsConfig = 1
index ac4fb93..e167b58 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 defined('TYPO3_MODE') or die();
 
+// Get the extension configuration
+$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY]);
+
 // Disable image positions that make no sense on CType=image (it leaves just "above left", "center" and "right")
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
        TCEFORM.tt_content.imageorient.types.image.removeItems = 8,9,10,17,18,25,26
@@ -22,5 +25,7 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php'][
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['text'] =
        \TYPO3\CMS\CssStyledContent\Hooks\PageLayoutView\TextPreviewRenderer::class;
 
-// Include new content elements to modWizards
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:css_styled_content/Configuration/PageTSconfig/NewContentElementWizard.ts">');
\ No newline at end of file
+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:css_styled_content/Configuration/PageTSconfig/NewContentElementWizard.ts">');
+}
diff --git a/typo3/sysext/fluid_styled_content/Resources/Private/Language/locallang_em.xlf b/typo3/sysext/fluid_styled_content/Resources/Private/Language/locallang_em.xlf
new file mode 100644 (file)
index 0000000..b70cc12
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
+       <file t3:id="1443455370" source-language="en" datatype="plaintext" original="messages" date="2014-02-07T20:22:32Z" product-name="fluid_styled_content">
+               <header/>
+               <body>
+                       <trans-unit id="fluid_styled_content.config.loadContentElementWizardTsConfig">
+                               <source>Load Page TSconfig with "New Content Element Wizard" definitions. The definitions can also be loaded manually by including it in a page.</source>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>
diff --git a/typo3/sysext/fluid_styled_content/ext_conf_template.txt b/typo3/sysext/fluid_styled_content/ext_conf_template.txt
new file mode 100644 (file)
index 0000000..f22a692
--- /dev/null
@@ -0,0 +1,2 @@
+# cat=basic//; type=boolean; label=LLL:EXT:fluid_styled_content/Resources/Private/Language/locallang_em.xlf:fluid_styled_content.config.loadContentElementWizardTsConfig
+loadContentElementWizardTsConfig = 1
index 2b66ba2..254099b 100644 (file)
@@ -1,8 +1,16 @@
 <?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">');
+}