forked from T3Voila/templavoilaplus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_tables.php
120 lines (109 loc) · 5.31 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
<?php
defined('TYPO3_MODE') or die();
if (TYPO3_MODE === 'BE') {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'][\Tvp\TemplaVoilaPlus\Hooks\WizardItems::class]
= \Tvp\TemplaVoilaPlus\Hooks\WizardItems::class;
$GLOBALS['TBE_STYLES']['skins']['templavoilaplus']['stylesheetDirectories'][]
= 'EXT:templavoilaplus/Resources/Public/StyleSheet/Skin';
$navigationComponentId = 'TYPO3/CMS/Backend/PageTree/PageTreeElement';
if (version_compare(TYPO3_version, '9.0.0', '<')) {
$navigationComponentId = 'typo3-pagetree';
}
$classPrefixForRegisterModule = '';
$classPostfixForRegisterModule = '';
$moduleName = 'Tvp.TemplaVoilaPlus';
if (version_compare(TYPO3_version, '10.0.0', '>=')) {
$classPrefixForRegisterModule = Tvp\TemplaVoilaPlus\Controller::class . '\\';
$classPostfixForRegisterModule = 'Controller';
$moduleName = 'TemplaVoilaPlus';
}
// Adding backend modules:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
$moduleName,
'web',
'Layout',
'top',
[
$classPrefixForRegisterModule . 'Backend\PageLayout' . $classPostfixForRegisterModule => 'show',
],
[
'access' => 'user,group',
'icon' => 'EXT:templavoilaplus/Resources/Public/Icons/PageModuleIcon.svg',
'labels' => 'LLL:EXT:templavoilaplus/Resources/Private/Language/Backend/PageLayout.xlf',
'navigationComponentId' => $navigationComponentId,
// 'configureModuleFunction' => [\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::class, 'configureModule'],
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
$moduleName,
'tools',
'ControlCenter',
'bottom',
[
$classPrefixForRegisterModule . 'Backend\ControlCenter' . $classPostfixForRegisterModule => 'show,debug',
$classPrefixForRegisterModule . 'Backend\ControlCenter\DataStructures' . $classPostfixForRegisterModule => 'list,info,delete',
$classPrefixForRegisterModule . 'Backend\ControlCenter\Mappings' . $classPostfixForRegisterModule => 'list',
$classPrefixForRegisterModule . 'Backend\ControlCenter\Templates' . $classPostfixForRegisterModule => 'list,info',
$classPrefixForRegisterModule . 'Backend\ControlCenter\Update' . $classPostfixForRegisterModule => 'info',
$classPrefixForRegisterModule . 'Backend\ControlCenter\TemplaVoilaPlus8Update' . $classPostfixForRegisterModule => 'stepStart,step1,step2,step3,step3NewExtension,step3ExistingExtension,step4,step5,stepFinal',
],
[
'access' => 'user,group',
'icon' => 'EXT:templavoilaplus/Resources/Public/Icons/AdministrationModuleIcon.svg',
'labels' => 'LLL:EXT:templavoilaplus/Resources/Private/Language/Backend/ControlCenter.xlf',
'navigationComponentId' => '',
'inheritNavigationComponentFromMainModule' => false
]
);
}
// complex condition to make sure the icons are available during frontend editing...
if (
TYPO3_MODE === 'BE' ||
(
TYPO3_MODE === 'FE'
&& isset($GLOBALS['BE_USER'])
&& method_exists($GLOBALS['BE_USER'], 'isFrontendEditingActive')
&& $GLOBALS['BE_USER']->isFrontendEditingActive()
)
) {
$iconsBitmap = [
'paste' => 'EXT:templavoilaplus/Resources/Public/Icon/clip_pasteafter.gif',
'pasteSubRef' => 'EXT:templavoilaplus/Resources/Public/Icon/clip_pastesubref.gif',
'makelocalcopy' => 'EXT:templavoilaplus/Resources/Public/Icon/makelocalcopy.gif',
'clip_ref' => 'EXT:templavoilaplus/Resources/Public/Icon/clip_ref.gif',
'clip_ref-release' => 'EXT:templavoilaplus/Resources/Public/Icon/clip_ref_h.gif',
'htmlvalidate' => 'EXT:templavoilaplus/Resources/Public/Icon/html_go.png',
'type-fce' => 'EXT:templavoilaplus/Resources/Public/Icon/icon_fce_ce.png',
];
$iconsSvg = [
'template-default' => 'EXT:templavoilaplus/Resources/Public/Icons/TemplateDefault.svg',
'datastructure-default' => 'EXT:templavoilaplus/Resources/Public/Icons/DataStructureDefault.svg',
'folder' => 'EXT:templavoilaplus/Resources/Public/Icons/Folder.svg',
'menu-item' => 'EXT:templavoilaplus/Resources/Public/Icons/MenuItem.svg',
];
$iconsFontAwesome = [
'unlink' => 'unlink',
];
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
foreach ($iconsBitmap as $identifier => $file) {
$iconRegistry->registerIcon(
'extensions-templavoila-' . $identifier,
\TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
['source' => $file]
);
}
foreach ($iconsSvg as $identifier => $file) {
$iconRegistry->registerIcon(
'extensions-templavoila-' . $identifier,
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => $file]
);
}
foreach ($iconsFontAwesome as $identifier => $name) {
$iconRegistry->registerIcon(
'extensions-templavoila-' . $identifier,
\TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider::class,
['name' => $name]
);
}
}