forked from TYPO3-Headless/headless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
65 lines (54 loc) · 3.18 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
<?php
/*
* This file is part of the "headless" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.md file that was distributed with this source code.
*
* (c) 2021
*/
defined('TYPO3_MODE') || die();
call_user_func(
static function () {
$GLOBALS['TYPO3_CONF_VARS']['FE']['contentRenderingTemplates'][] = 'headless/Configuration/TypoScript/';
$GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects'] = array_merge($GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects'], [
'JSON' => \FriendsOfTYPO3\Headless\ContentObject\JsonContentObject::class,
'INT' => \FriendsOfTYPO3\Headless\ContentObject\IntegerContentObject::class,
'BOOL' => \FriendsOfTYPO3\Headless\ContentObject\BooleanContentObject::class,
]);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['headless'] = [
'FriendsOfTYPO3\Headless\ViewHelpers'
];
$features = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Configuration\Features::class);
if ($features->isFeatureEnabled('headless.frontendUrls')) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Core\Routing\PageRouter::class] = [
'className' => FriendsOfTYPO3\Headless\XClass\Routing\PageRouter::class
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Frontend\Typolink\PageLinkBuilder::class] = [
'className' => FriendsOfTYPO3\Headless\XClass\Typolink\PageLinkBuilder::class,
];
}
if ($features->isFeatureEnabled('headless.storageProxy')) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Core\Resource\Driver\LocalDriver::class] = [
'className' => FriendsOfTYPO3\Headless\XClass\ResourceLocalDriver::class
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Extbase\Service\ImageService::class] = [
'className' => FriendsOfTYPO3\Headless\XClass\ImageService::class
];
}
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('form')) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Form\Controller\FormFrontendController::class] = [
'className' => FriendsOfTYPO3\Headless\XClass\Controller\FormFrontendController::class
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Form\Domain\Runtime\FormRuntime::class] = [
'className' => FriendsOfTYPO3\Headless\XClass\FormRuntime::class
];
}
$rendererRegistry = \TYPO3\CMS\Core\Resource\Rendering\RendererRegistry::getInstance();
$rendererRegistry->registerRendererClass(\FriendsOfTYPO3\Headless\Resource\Rendering\YouTubeRenderer::class);
$rendererRegistry->registerRendererClass(\FriendsOfTYPO3\Headless\Resource\Rendering\VimeoRenderer::class);
$rendererRegistry->registerRendererClass(\FriendsOfTYPO3\Headless\Resource\Rendering\AudioTagRenderer::class);
$rendererRegistry->registerRendererClass(\FriendsOfTYPO3\Headless\Resource\Rendering\VideoTagRenderer::class);
unset($rendererRegistry);
}
);