forked from typo3-themes/themes
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathext_localconf.php
84 lines (73 loc) · 3.12 KB
/
ext_localconf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
/*
* Add page typoscript for new content element wizard
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:'.$_EXTKEY.'/Configuration/PageTS/tsconfig.txt">');
/*
* Register hook to inject themes
*/
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Tx_Themes_Domain_Repository_ThemeRepository']['init'][]
= 'KayStrobach\\Themes\\Hooks\\ThemesDomainRepositoryThemeRepositoryInitHook->init';
/*
* register used hooks to inject the TS
*/
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSourcesAtEnd'][]
= 'KayStrobach\\Themes\\Hooks\\T3libTstemplateIncludeStaticTypoScriptSourcesAtEndHook->main';
/*
* register hook to manipulate the template module
*/
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['moduleBodyPostProcess'][]
= 'KayStrobach\\Themes\\Hooks\\TemplateModuleBodyPostProcessHook->main';
/**
* register signal to inject pagets without xclassing
* Requires signal slot call from http://forge.typo3.org/issues/59703.
*
* @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
*/
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
$signalSlotDispatcher->connect(
'TYPO3\\CMS\\Backend\\Utility\\BackendUtility',
'getPagesTSconfigPreInclude',
'KayStrobach\\Themes\\Slots\\BackendUtilitySlot',
'getPagesTsConfigPreInclude'
);
unset($signalSlotDispatcher);
/*
* register hook to inject BeLayoutTsprovider
*/
if (TYPO3_MODE === 'BE') {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['BackendLayoutDataProvider']['pagets']
= 'KayStrobach\\Themes\\Provider\\PageTsBackendLayoutDataProvider';
}
/*
* register command controller
*/
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = 'KayStrobach\Themes\Command\ThemesCommandController';
/*
* register frontend plugin to allow usage of extbase controller
*/
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'KayStrobach.'.$_EXTKEY,
'Theme', [
'Theme' => 'index',
],
[]
);
/*
* register cache for extension
*/
if (!is_array($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['themes_cache'])) {
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['themes_cache'] = [];
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['themes_cache']['frontend'] = 'TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend';
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['themes_cache']['backend'] = 'TYPO3\\CMS\\Core\\Cache\\Backend\\Typo3DatabaseBackend';
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['themes_cache']['options']['compression'] = 1;
}
/*
* Get YAML parser
*/
if (!class_exists('\Symfony\Component\Yaml\Parser')) {
include_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('themes').'/Resources/Private/PHP/vendor/autoload.php';
}