TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
css_styled_content/ext_localconf.php
Go to the documentation of this file.
1 <?php
2 defined('TYPO3_MODE') or die();
3 
4 // Disable image positions that make no sense on CType=image (it leaves just "above left", "center" and "right")
5 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
6  TCEFORM.tt_content.imageorient.types.image.removeItems = 8,9,10,17,18,25,26
7 ');
8 
9 // Mark the delivered TypoScript templates as "content rendering template"
10 $GLOBALS['TYPO3_CONF_VARS']['FE']['contentRenderingTemplates'][] = 'cssstyledcontent/static/';
11 $GLOBALS['TYPO3_CONF_VARS']['FE']['contentRenderingTemplates'][] = 'cssstyledcontent/Configuration/TypoScript/v7/';
12 
13 // Register for hook to show preview of tt_content element of CType="image" in page module
14 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['image'] =
15  \TYPO3\CMS\CssStyledContent\Hooks\PageLayoutView\ImagePreviewRenderer::class;
16 
17 // Register for hook to show preview of tt_content element of CType="textpic" in page module
18 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['textpic'] =
19  \TYPO3\CMS\CssStyledContent\Hooks\PageLayoutView\TextpicPreviewRenderer::class;
20 
21 // Register for hook to show preview of tt_content element of CType="text" in page module
22 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['text'] =
23  \TYPO3\CMS\CssStyledContent\Hooks\PageLayoutView\TextPreviewRenderer::class;
24 
25 if (TYPO3_MODE === 'BE') {
26  call_user_func(function () {
27  // Get the extension configuration
28  $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['css_styled_content'], ['allowed_classes' => false]);
29 
30  if (!isset($extConf['loadContentElementWizardTsConfig']) || (int)$extConf['loadContentElementWizardTsConfig'] === 1) {
31  // Include new content elements to modWizards
32  \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:css_styled_content/Configuration/PageTSconfig/NewContentElementWizard.ts">');
33  }
34 
35  \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class)
36  ->connect(
37  \TYPO3\CMS\Extensionmanager\Controller\ConfigurationController::class,
38  'afterExtensionConfigurationWrite',
39  \TYPO3\CMS\CssStyledContent\Hooks\TcaCacheClearing::class,
40  'clearTcaCache'
41  );
42  });
43 }
static makeInstance($className,...$constructorArguments)
$GLOBALS['TYPO3_CONF_VARS']['FE']['contentRenderingTemplates'][]