forked from in2code-de/powermail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_tables.php
88 lines (82 loc) · 3.44 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
<?php
if (!defined('TYPO3')) {
die('Access denied.');
}
call_user_func(
function () {
/**
* Include Backend Module
*/
if (TYPO3_MODE === 'BE' &&
!\In2code\Powermail\Utility\ConfigurationUtility::isDisableBackendModuleActive() &&
!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL)
) {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'Powermail',
'web',
'm1',
'',
[
\In2code\Powermail\Controller\ModuleController::class =>
'dispatch, list, exportXls, exportCsv, reportingBe, toolsBe, overviewBe, ' .
'checkBe, converterBe, converterUpdateBe, reportingFormBe, reportingMarketingBe, ' .
'fixUploadFolder, fixWrongLocalizedForms, fixFilledMarkersInLocalizedFields, ' .
'fixWrongLocalizedPages, fixFilledMarkersInLocalizedPages'
],
[
'access' => 'user,group',
'icon' => 'EXT:powermail/Resources/Public/Icons/powermail.svg',
'labels' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_mod.xlf',
]
);
}
/**
* Table description files for localization and allowing powermail tables on pages of type default
*/
$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';
}
);