-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathext_localconf.php
63 lines (53 loc) · 3.11 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
<?php
/*
* This file is part of the package t3g/hubspot.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
defined('TYPO3_MODE') || die();
call_user_func(function (string $extensionName) {
if (!\TYPO3\CMS\Core\Core\Environment::isComposerMode()) {
@include 'phar://' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('hubspot')
. 'Libraries/hubspot-php.phar/vendor/autoload.php';
}
if (\T3G\Hubspot\Utility\CompatibilityUtility::typo3VersionIsGreaterThanOrEqualTo('9')) {
$pageTs = '@import \'FILE:EXT:' . $extensionName . '/Configuration/TsConfig/Page/All.tsconfig\'';
} else {
$pageTs = '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $extensionName . '/Configuration/TsConfig/Page/All.tsconfig">';
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig($pageTs);
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['hubspot_form'] =
\T3G\Hubspot\Hooks\PageLayoutView\HubspotPreviewRenderer::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['Hubspot'] = \T3G\Hubspot\Hooks\DataHandler\DataHandlerHook::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typolinkProcessing']['typolinkModifyParameterForPageLinks'][] = \T3G\Hubspot\Hooks\Typolink\ModifyParameterForPageLinksHook::class;
if (TYPO3_MODE === 'BE') {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1483626131161] = [
'nodeName' => 'HubspotCampaign',
'priority' => 40,
'class' => \T3G\Hubspot\Form\Element\HubspotCampaignElement::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1484299681] = [
'nodeName' => 'HubspotCallToAction',
'priority' => 40,
'class' => \T3G\Hubspot\Form\Element\HubspotCallToActionElement::class,
];
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$icons = [
'ctype-hubspot-form' => 'EXT:' . $extensionName . '/Resources/Public/Icons/ContentElements/hubspot_form.svg',
'ctype-hubspot-cta' => 'EXT:' . $extensionName . '/Resources/Public/Icons/ContentElements/hubspot_cta.svg',
'hubspot-custom-object' => 'EXT:' . $extensionName . '/Resources/Public/Icons/hubspot_custom_object.svg',
'hubspot-add-or-update' => 'EXT:' . $extensionName . '/Resources/Public/Icons/add-or-update.svg',
];
foreach ($icons as $iconIdentifier => $source) {
$iconRegistry->registerIcon(
$iconIdentifier,
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => $source]
);
}
if (\T3G\Hubspot\Utility\CompatibilityUtility::typo3VersionIsLessThan('9.3')) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['be'][] = 'T3G\\Hubspot\\ViewHelpers\\Compatibility\\Backend';
}
}
}, 'hubspot');