forked from derhansen/sf_event_mgt
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ext_tables.php
81 lines (75 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
<?php
defined('TYPO3_MODE') or die();
call_user_func(function () {
/**
* Table description files for localization and allowing sf_event_mgt tables on pages of type default
*/
$tables = [
'tx_sfeventmgt_domain_model_event',
'tx_sfeventmgt_domain_model_location',
'tx_sfeventmgt_domain_model_organisator',
'tx_sfeventmgt_domain_model_registration',
'tx_sfeventmgt_domain_model_priceoption',
'tx_sfeventmgt_domain_model_speaker',
'tx_sfeventmgt_domain_model_registration_field',
'tx_sfeventmgt_domain_model_registration_fieldvalue'
];
foreach ($tables as $table) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
$table,
'EXT:sf_event_mgt/Resources/Private/Language/locallang_csh_' . $table . '.xlf'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages($table);
}
/**
* Register event as "Insert Record"
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToInsertRecords('tx_sfeventmgt_domain_model_event');
if (TYPO3_MODE === 'BE') {
/**
* Register Administration Module
*/
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'SfEventMgt',
'web',
'tx_sfeventmgt_m1',
'',
[
\DERHANSEN\SfEventMgt\Controller\AdministrationController::class => 'list, export, handleExpiredRegistrations, indexNotify, notify, settingsError',
],
[
'access' => 'user,group',
'icon' => 'EXT:sf_event_mgt/Resources/Public/Icons/events.svg',
'labels' => 'LLL:EXT:sf_event_mgt/Resources/Private/Language/locallang_modadministration.xlf',
]
);
/**
* Register icons
*/
$icons = [
'apps-pagetree-folder-contains-events' => 'apps-pagetree-folder-contains-events.svg',
'ext-sfeventmgt-wizard' => 'events.svg',
'ext-sfeventmgt-registration-unconfirmed' => 'tx_sfeventmgt_domain_model_registration_unconfirmed.svg',
'ext-sfeventmgt-registration-confirmed' => 'tx_sfeventmgt_domain_model_registration_confirmed.svg',
'ext-sfeventmgt-event' => 'tx_sfeventmgt_domain_model_event.svg',
'ext-sfeventmgt-priceoption' => 'tx_sfeventmgt_domain_model_priceoption.svg',
'ext-sfeventmgt-organisator' => 'tx_sfeventmgt_domain_model_organisator.svg',
'ext-sfeventmgt-location' => 'tx_sfeventmgt_domain_model_location.svg',
'ext-sfeventmgt-speaker' => 'tx_sfeventmgt_domain_model_speaker.svg',
'ext-sfeventmgt-registration-field' => 'tx_sfeventmgt_domain_model_registration_field.svg',
'ext-sfeventmgt-logfile' => 'logfile.svg',
'ext-sfeventmgt-action-handle-expired' => 'hande-expired-registrations.svg'
];
/** @var \TYPO3\CMS\Core\Imaging\IconRegistry $iconRegistry */
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Imaging\IconRegistry::class
);
foreach ($icons as $identifier => $path) {
$iconRegistry->registerIcon(
$identifier,
\TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
['source' => 'EXT:sf_event_mgt/Resources/Public/Icons/' . $path]
);
}
}
});