This repository was archived by the owner on Mar 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathext_localconf.php
More file actions
58 lines (51 loc) · 2.9 KB
/
ext_localconf.php
File metadata and controls
58 lines (51 loc) · 2.9 KB
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
<?php
if (!defined('TYPO3_MODE')) {
throw new \Exception('Access denied.');
}
/** @noinspection PhpUndefinedVariableInspection */
call_user_func(
function ($extensionKey) {
// Registering the default FormZ conditions.
\Romm\Formz\Condition\ConditionFactory::get()->registerDefaultConditions();
// Registering the cache.
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][\Romm\Formz\Service\CacheService::CACHE_IDENTIFIER])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][\Romm\Formz\Service\CacheService::CACHE_IDENTIFIER] = [
'backend' => \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend::class,
'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
'groups' => ['all', 'system', 'pages']
];
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Romm.' . $extensionKey,
'AjaxValidation',
[
'AjaxValidation' => 'run'
],
[
'AjaxValidation' => 'run'
]
);
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'][] = \Romm\Formz\Service\CacheService::class . '->clearCacheCommand';
/** @var \TYPO3\CMS\Extbase\Object\Container\Container $container */
$container = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\Container\Container::class);
$typo3Version = \TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version();
if (version_compare($typo3Version, '8.3.0', '<')) {
$container->registerImplementation(\Romm\Formz\ViewHelpers\FormViewHelper::class, \Romm\Formz\Service\ViewHelper\Legacy\OldFormViewHelper::class);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\Romm\Formz\ViewHelpers\FormViewHelper::class] = [
'className' => \Romm\Formz\Service\ViewHelper\Legacy\OldFormViewHelper::class
];
} else {
$container->registerImplementation(\Romm\Formz\ViewHelpers\FormViewHelper::class, \Romm\Formz\Service\ViewHelper\Legacy\FormViewHelper::class);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\Romm\Formz\ViewHelpers\FormViewHelper::class] = [
'className' => \Romm\Formz\Service\ViewHelper\Legacy\FormViewHelper::class
];
}
if (version_compare($typo3Version, '7.3.0', '<')) {
$container->registerImplementation(\Romm\Formz\ViewHelpers\Slot\HasViewHelper::class, \Romm\Formz\Service\ViewHelper\Legacy\OldHasViewHelper::class);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\Romm\Formz\ViewHelpers\Slot\HasViewHelper::class] = [
'className' => \Romm\Formz\Service\ViewHelper\Legacy\OldHasViewHelper::class
];
}
},
$_EXTKEY
);