This repository has been archived by the owner on Jul 19, 2022. It is now read-only.
forked from fabarea/vidi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathext_tables.php
115 lines (93 loc) · 4.24 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
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
// Check from Vidi configuration what default module should be loaded.
// Make sure the class exists to avoid a Runtime Error
if (TYPO3_MODE == 'BE') {
// Register Selection table
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_vidi_domain_model_selection');
// Add sprite icons.
\TYPO3\CMS\Backend\Sprite\SpriteManager::addSingleIcons(
array(
'selection' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('vidi') . 'Resources/Public/Images/tx_vidi_domain_model_selection.png',
),
'vidi'
);
/** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
/** @var \TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility $configurationUtility */
$configurationUtility = $objectManager->get('TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility');
$configuration = $configurationUtility->getCurrentConfiguration($_EXTKEY);
// Loop around the data types and register them to be displayed within a BE module.
if ($configuration['data_types']['value']) {
$dataTypes = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $configuration['data_types']['value']);
foreach ($dataTypes as $dataType) {
/** @var \TYPO3\CMS\Vidi\Module\ModuleLoader $moduleLoader */
$moduleLoader = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Vidi\Module\ModuleLoader', $dataType);
/** @var \TYPO3\CMS\Vidi\Module\ModuleLoader $moduleLoader */
$moduleLoader->setIcon(sprintf('EXT:vidi/Resources/Public/Images/%s.png', $dataType))
->setModuleLanguageFile(sprintf('LLL:EXT:vidi/Resources/Private/Language/%s.xlf', $dataType))
->addJavaScriptFiles(array(sprintf('EXT:vidi/Resources/Public/JavaScript/%s.js', $dataType)))
->setDefaultPid($configuration['default_pid']['value'])
->register();
}
}
// Register List2 only if beta feature is enabled.
if ($configuration['activate_beta_features']['value']) {
$labelFile = 'LLL:EXT:vidi/Resources/Private/Language/locallang_module.xlf';
if (!$configuration['hide_module_list']['value']) {
$labelFile = 'LLL:EXT:vidi/Resources/Private/Language/locallang_module_transitional.xlf';
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
$_EXTKEY, 'web', // Make newsletter module a submodule of 'user'
'm1', // Submodule key
'after:list', // Position
array(
'Content' => 'index, list, delete, update, edit, copy, move, localize',
'Tool' => 'welcome, work',
'FacetValue' => 'list',
), array(
'access' => 'user,group',
'icon' => 'EXT:vidi/Resources/Public/Images/list.png',
'labels' => $labelFile,
)
);
}
if ($configuration['hide_module_list']['value']) {
// Default User TSConfig to be added in any case.
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('
# Hide the module in the BE.
options.hideModules.web := addToList(list)
');
}
/** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
/** @var $signalSlotDispatcher \TYPO3\CMS\Extbase\SignalSlot\Dispatcher */
$signalSlotDispatcher = $objectManager->get('TYPO3\CMS\Extbase\SignalSlot\Dispatcher');
// Connect "processContentData" signal slot with the "ContentObjectProcessor".
$signalSlotDispatcher->connect(
'TYPO3\CMS\Vidi\Controller\Backend\ContentController',
'processContentData',
'TYPO3\CMS\Vidi\Processor\ContentObjectProcessor',
'processRelations',
TRUE
);
// Connect "processContentData" signal with the "MarkerProcessor".
$signalSlotDispatcher->connect(
'TYPO3\CMS\Vidi\Controller\Backend\ContentController',
'processContentData',
'TYPO3\CMS\Vidi\Processor\MarkerProcessor',
'processMarkers',
TRUE
);
// Register default Tools for Vidi.
\TYPO3\CMS\Vidi\Tool\ToolRegistry::getInstance()->register('*', 'TYPO3\CMS\Vidi\Tool\RelationAnalyserTool');
}
// Add new sprite icon.
\TYPO3\CMS\Backend\Sprite\SpriteManager::addSingleIcons(
array(
'go' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Images/bullet_go.png',
),
$_EXTKEY
);