-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathext_localconf.php
231 lines (213 loc) · 9.54 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<?php
/*
* This file is part of the web-tp3/tp3mods.
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
defined('TYPO3_MODE') || die('Access denied.');
$_EXTKEY = 'tp3mods';
/***************
* Make the extension configuration accessible
*/
if (class_exists('TYPO3\CMS\Core\Configuration\ExtensionConfiguration')) {
$extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
);
$tp3modsConfig = $extensionConfiguration->get('tp3mods');
} else {
// Fallback for CMS8
// @extensionScannerIgnoreLine
$tp3modsConfig = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['tp3mods'];
if (!is_array($tp3modsConfig)) {
$tp3modsConfig = unserialize($tp3modsConfig);
}
}
if (!is_array($tp3modsConfig)) {
$tp3modsConfig = unserialize($tp3modsConfig);
}
// Override local page not found handling configuration
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling'] = \Tp3\Tp3mods\Utility\PageNotFoundHandling::class . '->pageNotFound';
// Define global hooks array
if (!isset($tp3modsConfig['errorHandlers'])) {
$tp3modsConfig['errorHandlers'] = [];
}
if (TYPO3_MODE == 'BE') {
/***************
* Add default RTE configuration for tp3mods
*/
if (!$tp3modsConfig['disableConfigRTE'] == 0 || $tp3modsConfig['disableConfigRTE'] == false) {
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['bootstrap'] = 'EXT:tp3mods/Configuration/RTE/Default.yaml';
}
if (!$tp3modsConfig['disablePageTs'] == 0 || $tp3modsConfig['disablePageTs'] == false) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/Configuration/PageTS/Page/TCEFORM.tsconfig">');
// \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:tp3mods/Configuration/TypoScript/PageTS/setup.txt">');
}
/***************
* Register Icons
*/
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$iconRegistry->registerIcon(
'tp3mods-tp3mods-downloads',
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => 'EXT:' . $_EXTKEY . '/Resources/Public/Icons/user_mod_tp3backend.svg']
);
$iconRegistry->registerIcon(
'tp3mods-plugin-tp3micro',
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => 'EXT:' . $_EXTKEY . '/Resources/Public/Icons/user_plugin_tp3micro.svg']
);
$icons = [
'accordion',
'accordion-item',
'card-group',
'card-group-item',
'carousel',
'carousel-item',
'carousel-item-backgroundimage',
'carousel-item-calltoaction',
'carousel-item-header',
'carousel-item-html',
'carousel-item-image',
'carousel-item-textandimage',
'beside-text-img-centered-left',
'beside-text-img-centered-right',
'csv',
'externalmedia',
'icon-group',
'icon-group-item',
'listgroup',
'menu-card',
'social-links',
'tab',
'tab-item',
'texticon',
'timeline',
'timeline-item'
];
foreach ($icons as $icon) {
$iconRegistry->registerIcon(
'content-bootstrappackage-' . $icon,
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => 'EXT:tp3mods/Resources/Public/Icons/ContentElements/' . $icon . '.svg']
);
}
/***************
* Backend Styling for CMS8
* Please see \BK2K\BootstrapPackage\Service\BrandingService for CMS9
*/
if (TYPO3_MODE == 'BE' && !class_exists('TYPO3\CMS\Core\Configuration\ExtensionConfiguration')) {
if (!$tp3modsConfig['disablePageTsBackendLogo'] == 0 || $tp3modsConfig['disablePageTsBackendLogo'] == false) {
/**
* Configure Backend Extension
*/
// Login Logo
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend'])) {
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend'] = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend']);
}
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend']['loginLogo'])
|| empty(trim($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend']['loginLogo']))
) {
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend']['loginLogo'] = 'EXT:tp3mods/Resources/Public/Images/Backend/login-logo.svg';
}
// Login Background
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend']['loginBackgroundImage'])
|| empty(trim($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend']['loginBackgroundImage']))
) {
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend']['loginBackgroundImage'] = 'EXT:tp3mods/Resources/Public/Images/Backend/login-background-image.jpg';
}
// Backend Logo
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend']['backendLogo'])
|| empty(trim($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend']['backendLogo']))
) {
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend']['backendLogo'] = 'EXT:tp3mods/Resources/Public/Images/Backend/backend-logo.svg';
}
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend'])) {
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend'] = serialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend']);
}
}
}
} else {
/*
* webapp
*
*/
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['webapp'] = \Tp3\Tp3mods\Hooks\GoogleWebApp::class . '::getManifest';
/*
* Rich snippets hook in postrenderer
*/
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postProcess'][] = \Tp3\Tp3mods\Frontend\PageRenderer\Tp3RichSnippetsRenderer::class . '->render';
//call only on FE
/*
* dsvgo hook
*/
if (!$tp3modsConfig['cookieconsent'] == 0) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postProcess'][] = \Tp3\Tp3mods\Hooks\GoogleAnalyticsFehook::class . '->intPages';
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['consent'] = \Tp3\Tp3mods\Hooks\GoogleAnalyticsFehook::class . '::setTracking';//Tp3\Tp3ratings\Controller\RatingsdataController::class . '->RatingAction';//
}
}
//// Cache configuration
////if (!is_array($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'][\R3H6\Error404page\Domain\Cache\ErrorHandlerCache::IDENTIFIER])) {
//// $TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'][\R3H6\Error404page\Domain\Cache\ErrorHandlerCache::IDENTIFIER] = array();
////}
//
//// Debug log
//if (\Tp3\Tp3mods\Configuration\ExtensionConfiguration::is('debugMode')) {
// $GLOBALS['TYPO3_CONF_VARS']['LOG']['R3H6']['Error404page']['writerConfiguration'] = array(
// \TYPO3\CMS\Core\Log\LogLevel::DEBUG => array(
// 'TYPO3\\CMS\\Core\\Log\\Writer\\FileWriter' => array(
// 'logFile' => 'typo3temp/logs/debug.log',
// ),
// ),
// );
//}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Tp3.Tp3mods',
'Tp3micro',
[
'Tp3Mods' => 'list, show',
'Tp3Adress' => 'list, show'
],
// non-cacheable actions
[
'Tp3Mods' => '',
'Tp3Adress' => ''
]
);
// wizards
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'mod {
wizards.newContentElement.wizardItems.plugins {
elements {
tp3micro {
iconIdentifier = tp3mods-plugin-tp3micro
title = LLL:EXT:tp3mods/Resources/Private/Language/locallang_db.xlf:tx_tp3mods_tp3micro.name
description = LLL:EXT:tp3mods/Resources/Private/Language/locallang_db.xlf:tx_tp3mods_tp3micro.description
tt_content_defValues {
CType = list
list_type = tp3mods_tp3micro
}
}
}
show = *
}
}'
);
$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] .= ($GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] ? ',' : '') . 'subtitle,author,keywords,description,title,abstract,media,tsconfig,tp3microdata';
//$GLOBALS['TYPO3_CONF_VARS']['FE']['pageOverlayFields'] .= ($GLOBALS['TYPO3_CONF_VARS']['FE']['pageOverlayFields'] ? ',' : '' ) . 'media';
/* \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'mod {
wizards.newContentElement.wizardItems.common{
elements {
tp3mods_downloads {
icon = ' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/user_plugin_tp3micro.svg
title = LLL:EXT:tp3mods/Resources/Private/Language/locallang_db.xlf:tp3mods_downloads
description = LLL:EXT:tp3mods/Resources/Private/Language/locallang_db.xlf:tp3mods_downloads.description
tt_content_defValues {
CType = tp3mods_downloads
}
}
}
show = *
}
}'
);*/