[TASK] Avoid hardcoded path for file list icons
[Packages/TYPO3.CMS.git] / typo3 / sysext / css_styled_content / ext_localconf.php
old mode 100755 (executable)
new mode 100644 (file)
index d553aa2..0018f56
@@ -1,53 +1,46 @@
 <?php
-# TYPO3 CVS ID: $Id$
+defined('TYPO3_MODE') or die();
 
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+// 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
+');
 
-$_EXTCONF = unserialize($_EXTCONF);    // unserializing the configuration so we can use it here:
-if ($_EXTCONF['setPageTSconfig'] || !$_EXTCONF)        {
-       t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:css_styled_content/pageTSconfig.txt">');
-}
+// Mark the delivered TypoScript templates as "content rendering template"
+$GLOBALS['TYPO3_CONF_VARS']['FE']['contentRenderingTemplates'][] = 'cssstyledcontent/static/';
+$GLOBALS['TYPO3_CONF_VARS']['FE']['contentRenderingTemplates'][] = 'cssstyledcontent/Configuration/TypoScript/v7/';
 
-if ($_EXTCONF['removePositionTypes'] || !$_EXTCONF)    {
-       t3lib_extMgm::addPageTSConfig('
-               TCEFORM.tt_content.imageorient.types.image.removeItems = 8,9,10,17,18,25,26
-       ');
-}
+// Register for hook to show preview of tt_content element of CType="image" in page module
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['image'] =
+    \TYPO3\CMS\CssStyledContent\Hooks\PageLayoutView\ImagePreviewRenderer::class;
+
+// Register for hook to show preview of tt_content element of CType="textpic" in page module
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['textpic'] =
+    \TYPO3\CMS\CssStyledContent\Hooks\PageLayoutView\TextpicPreviewRenderer::class;
+
+// Register for hook to show preview of tt_content element of CType="text" in page module
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['text'] =
+    \TYPO3\CMS\CssStyledContent\Hooks\PageLayoutView\TextPreviewRenderer::class;
 
-$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['compat_version']['tx_cssstyledcontent_accessibility'] = array(
-       'title' => 'CSS Styled Content: Accessibility improvements',
-       'version' => 3009000,
-       'description' => '<p>The rendering of the following elements will change:
-                               <ul><li><strong>tt_content.menu</strong> (used f.e. for sitemaps): Instead of div-tags, lists are used now.</li>
-                               <li><strong>tt_content.mailform</strong>: Mailforms do not use tables anymore, instead, they use the div-tag. Besides that, mailforms are accessible now.</li>
-                               <li><strong>The p-tag</strong> has been removed from all table cells.</li>
-                               <li><strong>CSS based "image" and "text with image"</strong><br />As the extension cron_cssstyledimgtext has been merged into the core, rendering of the content elements "image" and "text with image" has been changed to be CSS instead of table based. Read the <a href="http://wiki.typo3.org/index.php/TYPO3_4.0" target="_blank">4.0 release notes</a> for further information.</li></ul>',
-       'description_acknowledge' => 'You will have to update your stylesheets to comply with these changes.'
-);
-$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['compat_version']['tx_cssstyledcontent_pagetargets'] = array(
-       'title' => 'CSS Styled Content: Default targets for non-frame pages',
-       'version' => 4002000,
-       'description' => '<p>The default page target is empty (so no target is generated). If you use frames, you have to set target to "page" in Constants.</p>'
-);
-$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['compat_version']['tx_cssstyledcontent_menuhtmlspecialchars'] = array(
-       'title' => 'CSS Styled Content: htmlspecialchars in menu content elements',
-       'version' => 4003000,
-       'description' => '<p>Page titles will get htmlspecialchar\'ed when rendered in "Sitemap/menu" content elements, to avoid generating invalid XHTML.</p>',
-);
-$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['compat_version']['tx_cssstyledcontent_clearerdivsafterintexttextpicelements'] = array(
-       'title' => 'CSS Styled Content: clear divs, changed row space, corrected margins',
-       'version' => 4004000,
-       'description' => '<ul><li>Clear divs will be generated by default for in-text right or left positioned textpic elements.</li><li>The default row space changes to 10px, to be in line with col space and text margin.</li><li>Rendering bugs with wrong margins were fixed (Default CSS changed).</li></ul>',
-);
-
-       // Register ourselves as "content rendering template" (providing the hooks of "static template 43" = content (default) )
-$TYPO3_CONF_VARS['FE']['contentRenderingTemplates'] = array(
-       'cssstyledcontent/static/',
-       'cssstyledcontent/static/v4.4/',
-       'cssstyledcontent/static/v4.3/',
-       'cssstyledcontent/static/v4.2/',
-       'cssstyledcontent/static/v3.9/',
-       'cssstyledcontent/static/v3.8/',
-);
-
-?>
\ No newline at end of file
+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:css_styled_content/Configuration/PageTSconfig/NewContentElementWizard.ts">');
+            }
+
+            $dispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
+            $dispatcher->connect(
+                \TYPO3\CMS\Extensionmanager\Controller\ConfigurationController::class,
+                'afterExtensionConfigurationWrite',
+                \TYPO3\CMS\CssStyledContent\Hooks\TcaCacheClearing::class,
+                'clearTcaCache'
+            );
+        },
+        $_EXTKEY
+    );
+}