forked from in2code-de/powermail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_tables.php
143 lines (131 loc) · 5.16 KB
/
ext_tables.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
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
call_user_func(function () {
/**
* Include Plugins
*/
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin('powermail', 'Pi1', 'Powermail');
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin('powermail', 'Pi2', 'Powermail_Frontend');
/**
* Disable not needed fields in tt_content
*/
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['powermail_pi1'] =
'select_key,pages,recursive';
/**
* Include Backend Module
*/
if (TYPO3_MODE === 'BE' &&
!\In2code\Powermail\Utility\ConfigurationUtility::isDisableBackendModuleActive() &&
!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL)
) {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'In2code.powermail',
'web',
'm1',
'',
array(
'Module' => 'dispatch, list, exportXls, exportCsv, reportingBe, toolsBe, overviewBe, ' .
'checkBe, converterBe, converterUpdateBe, reportingFormBe, reportingMarketingBe, ' .
'fixUploadFolder, fixWrongLocalizedForms, fixFilledMarkersInLocalizedFields, ' .
'fixWrongLocalizedPages, fixFilledMarkersInLocalizedPages'
),
array(
'access' => 'user,group',
'icon' => 'EXT:powermail/Resources/Public/Icons/powermail.svg',
'labels' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_mod.xlf',
)
);
}
/**
* Include Flexform
*/
// Pi1
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['powermail_pi1'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
'powermail_pi1',
'FILE:EXT:powermail/Configuration/FlexForms/FlexformPi1.xml'
);
// Pi2
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['powermail_pi2'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
'powermail_pi2',
'FILE:EXT:powermail/Configuration/FlexForms/FlexformPi2.xml'
);
/**
* ContentElementWizard for Pi1
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:powermail/Configuration/TSConfig/ContentElementWizard.typoscript">'
);
/**
* Include TypoScript
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'powermail',
'Configuration/TypoScript/Main',
'Main Template'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'powermail',
'Configuration/TypoScript/Powermail_Frontend',
'Powermail_Frontend'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'powermail',
'Configuration/TypoScript/BootstrapClassesAndLayout',
'Add classes and CSS based on bootstrap'
);
if (!\In2code\Powermail\Utility\ConfigurationUtility::isDisableMarketingInformationActive()) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'powermail',
'Configuration/TypoScript/Marketing',
'Marketing Information'
);
}
/**
* Table Configuration
*/
$tables = [
\In2code\Powermail\Domain\Model\Form::TABLE_NAME,
\In2code\Powermail\Domain\Model\Page::TABLE_NAME,
\In2code\Powermail\Domain\Model\Field::TABLE_NAME,
\In2code\Powermail\Domain\Model\Mail::TABLE_NAME,
\In2code\Powermail\Domain\Model\Answer::TABLE_NAME
];
foreach ($tables as $table) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
$table,
'EXT:powermail/Resources/Private/Language/locallang_csh_' . $table . '.xlf'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages($table);
}
/**
* Garbage Collector
*/
$tgct = 'TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask';
$tables = [\In2code\Powermail\Domain\Model\Mail::TABLE_NAME, \In2code\Powermail\Domain\Model\Answer::TABLE_NAME];
foreach ($tables as $table) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][$tgct]['options']['tables'][$table] = [
'dateField' => 'tstamp',
'expirePeriod' => 30
];
}
/**
* Register icons
*/
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$iconRegistry->registerIcon(
'extension-powermail-main',
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => 'EXT:powermail/Resources/Public/Icons/powermail.svg']
);
/**
* Search with TYPO3 backend search
* search for an email: "#mail:senderemail"
* search for a form: "#form:contactform"
*/
$GLOBALS['TYPO3_CONF_VARS']['SYS']['livesearch']['mail'] = 'tx_powermail_domain_model_mail';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['livesearch']['form'] = 'tx_powermail_domain_model_form';
});