Completed
Pull Request — master (#154)
by
unknown
04:41
created
ext_tables.php 2 patches
Indentation   +160 added lines, -160 removed lines patch added patch discarded remove patch
@@ -1,179 +1,179 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if (!defined('TYPO3_MODE')) {
4
-    die ('Access denied.');
4
+	die ('Access denied.');
5 5
 }
6 6
 
7 7
 // Check from Vidi configuration what default module should be loaded.
8 8
 // Make sure the class exists to avoid a Runtime Error
9 9
 if (TYPO3_MODE === 'BE') {
10 10
 
11
-    // Add content main module before 'user'
12
-    if (!isset($GLOBALS['TBE_MODULES']['content'])) {
13
-
14
-        // Position module "content" after module "user" manually. No API is available for that, it seems...
15
-        $modules = [];
16
-        foreach ($GLOBALS['TBE_MODULES'] as $key => $val) {
17
-            if ($key === 'user') {
18
-                $modules['content'] = '';
19
-            }
20
-            $modules[$key] = $val;
21
-        }
22
-        $GLOBALS['TBE_MODULES'] = $modules;
23
-
24
-        // Register "data management" module.
25
-        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
26
-            'content',
27
-            '',
28
-            '',
29
-            '',
30
-            [
31
-                'name' => 'content',
32
-                'access' => 'user,group',
33
-                'labels' => [
34
-                    'll_ref' => 'LLL:EXT:vidi/Resources/Private/Language/content_module.xlf',
35
-                ],
36
-            ]
37
-        );
38
-    }
39
-
40
-    /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
41
-    $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
42
-
43
-    /** @var \TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility $configurationUtility */
44
-    $configurationUtility = $objectManager->get('TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility');
45
-    $configuration = $configurationUtility->getCurrentConfiguration('vidi');
46
-
47
-    $pids = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $configuration['default_pid']['value'], true);
48
-    $defaultPid = array_shift($pids);
49
-    $defaultPids = [];
50
-    foreach ($pids as $dataTypeAndPid) {
51
-        $parts = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(':', $dataTypeAndPid);
52
-        if (count($parts) === 2) {
53
-            $defaultPids[$parts[0]] = $parts[1];
54
-        }
55
-    }
56
-
57
-    // Loop around the data types and register them to be displayed within a BE module.
58
-    if ($configuration['data_types']['value']) {
59
-
60
-        $dataTypes = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $configuration['data_types']['value'], true);
61
-        foreach ($dataTypes as $dataType) {
62
-
63
-            /** @var \Fab\Vidi\Module\ModuleLoader $moduleLoader */
64
-            $moduleLoader = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Fab\Vidi\Module\ModuleLoader', $dataType);
65
-
66
-            // Special case already defined in Vidi.
67
-            if ($dataType === 'fe_users') {
68
-                $languageFile = 'LLL:EXT:vidi/Resources/Private/Language/fe_users.xlf';
69
-                $icon = 'EXT:core/Resources/Public/Icons/T3Icons/status/status-user-frontend.svg';
70
-                $icon = 'EXT:vidi/Resources/Public/Images/fe_users.png';
71
-            } elseif ($dataType === 'fe_groups') {
72
-                $languageFile = 'LLL:EXT:vidi/Resources/Private/Language/fe_groups.xlf';
73
-                $icon = 'EXT:core/Resources/Public/Icons/T3Icons/status/status-user-group-frontend.svg';
74
-                $icon = 'EXT:vidi/Resources/Public/Images/fe_groups.png';
75
-            } else {
76
-                /** @var \Fab\Vidi\Backend\LanguageFileGenerator $languageService */
77
-                $languageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(Fab\Vidi\Backend\LanguageFileGenerator::class);
78
-                $languageFile = $languageService->generate($dataType);
79
-                $icon = '';
80
-            }
81
-
82
-            $pid = isset($defaultPids[$dataType]) ? $defaultPids[$dataType] : $defaultPid;
83
-
84
-            /** @var \Fab\Vidi\Module\ModuleLoader $moduleLoader */
85
-            $moduleLoader->setIcon($icon)
86
-                ->setModuleLanguageFile($languageFile)
87
-                ->setDefaultPid($pid)
88
-                ->register();
89
-        }
90
-    }
91
-
92
-    // Possible Static TS loading
93
-    if (true === isset($configuration['autoload_typoscript']['value']) && false === (bool)$configuration['autoload_typoscript']['value']) {
94
-        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('vidi', 'Configuration/TypoScript', 'Vidi: versatile and interactive display');
95
-    }
96
-
97
-    // Register List2 only if beta feature is enabled.
98
-    // @todo let see what we do with that
99
-    #if ($configuration['activate_beta_features']['value']) {
100
-    #	$labelFile = 'LLL:EXT:vidi/Resources/Private/Language/locallang_module.xlf';
101
-    #
102
-    #	if (!$configuration['hide_module_list']['value']) {
103
-    #		$labelFile = 'LLL:EXT:vidi/Resources/Private/Language/locallang_module_transitional.xlf';
104
-    #	}
105
-    #
106
-    #	\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
107
-    #		'vidi',
108
-    #		'web', // Make module a submodule of 'web'
109
-    #		'm1', // Submodule key
110
-    #		'after:list', // Position
111
-    #		array(
112
-    #			'Content' => 'index, list, delete, update, edit, copy, move, localize, sort, copyClipboard, moveClipboard',
113
-    #			'Tool' => 'welcome, work',
114
-    #			'Facet' => 'autoSuggest, autoSuggests',
115
-    #			'Selection' => 'edit, update, create, delete, list, show',
116
-    #			'UserPreferences' => 'save',
117
-    #			'Clipboard' => 'save, flush, show',
118
-    #		), array(
119
-    #			'access' => 'user,group',
120
-    #			'icon' => 'EXT:vidi/Resources/Public/Images/list.png',
121
-    #			'labels' => $labelFile,
122
-    #		)
123
-    #	);
124
-    #}
125
-    #if ($configuration['hide_module_list']['value']) {
126
-    #
127
-    #	// Default User TSConfig to be added in any case.
128
-    #	TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('
129
-    #
130
-    #		# Hide the module in the BE.
131
-    #		options.hideModules.web := addToList(list)
132
-    #	');
133
-    #}
134
-
135
-    /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
136
-    $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
137
-
138
-    /** @var $signalSlotDispatcher \TYPO3\CMS\Extbase\SignalSlot\Dispatcher */
139
-    $signalSlotDispatcher = $objectManager->get('TYPO3\CMS\Extbase\SignalSlot\Dispatcher');
140
-
141
-    // Connect "processContentData" signal slot with the "ContentObjectProcessor".
142
-    $signalSlotDispatcher->connect(
143
-        'Fab\Vidi\Controller\Backend\ContentController',
144
-        'processContentData',
145
-        'Fab\Vidi\Processor\ContentObjectProcessor',
146
-        'processRelations',
147
-        true
148
-    );
149
-
150
-    // Connect "processContentData" signal with the "MarkerProcessor".
151
-    $signalSlotDispatcher->connect(
152
-        'Fab\Vidi\Controller\Backend\ContentController',
153
-        'processContentData',
154
-        'Fab\Vidi\Processor\MarkerProcessor',
155
-        'processMarkers',
156
-        true
157
-    );
158
-
159
-    // Register default Tools for Vidi.
160
-    \Fab\Vidi\Tool\ToolRegistry::getInstance()->register('*', 'Fab\Vidi\Tool\ModulePreferencesTool');
161
-    \Fab\Vidi\Tool\ToolRegistry::getInstance()->register('*', 'Fab\Vidi\Tool\RelationAnalyserTool');
11
+	// Add content main module before 'user'
12
+	if (!isset($GLOBALS['TBE_MODULES']['content'])) {
13
+
14
+		// Position module "content" after module "user" manually. No API is available for that, it seems...
15
+		$modules = [];
16
+		foreach ($GLOBALS['TBE_MODULES'] as $key => $val) {
17
+			if ($key === 'user') {
18
+				$modules['content'] = '';
19
+			}
20
+			$modules[$key] = $val;
21
+		}
22
+		$GLOBALS['TBE_MODULES'] = $modules;
23
+
24
+		// Register "data management" module.
25
+		\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
26
+			'content',
27
+			'',
28
+			'',
29
+			'',
30
+			[
31
+				'name' => 'content',
32
+				'access' => 'user,group',
33
+				'labels' => [
34
+					'll_ref' => 'LLL:EXT:vidi/Resources/Private/Language/content_module.xlf',
35
+				],
36
+			]
37
+		);
38
+	}
39
+
40
+	/** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
41
+	$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
42
+
43
+	/** @var \TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility $configurationUtility */
44
+	$configurationUtility = $objectManager->get('TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility');
45
+	$configuration = $configurationUtility->getCurrentConfiguration('vidi');
46
+
47
+	$pids = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $configuration['default_pid']['value'], true);
48
+	$defaultPid = array_shift($pids);
49
+	$defaultPids = [];
50
+	foreach ($pids as $dataTypeAndPid) {
51
+		$parts = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(':', $dataTypeAndPid);
52
+		if (count($parts) === 2) {
53
+			$defaultPids[$parts[0]] = $parts[1];
54
+		}
55
+	}
56
+
57
+	// Loop around the data types and register them to be displayed within a BE module.
58
+	if ($configuration['data_types']['value']) {
59
+
60
+		$dataTypes = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $configuration['data_types']['value'], true);
61
+		foreach ($dataTypes as $dataType) {
62
+
63
+			/** @var \Fab\Vidi\Module\ModuleLoader $moduleLoader */
64
+			$moduleLoader = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Fab\Vidi\Module\ModuleLoader', $dataType);
65
+
66
+			// Special case already defined in Vidi.
67
+			if ($dataType === 'fe_users') {
68
+				$languageFile = 'LLL:EXT:vidi/Resources/Private/Language/fe_users.xlf';
69
+				$icon = 'EXT:core/Resources/Public/Icons/T3Icons/status/status-user-frontend.svg';
70
+				$icon = 'EXT:vidi/Resources/Public/Images/fe_users.png';
71
+			} elseif ($dataType === 'fe_groups') {
72
+				$languageFile = 'LLL:EXT:vidi/Resources/Private/Language/fe_groups.xlf';
73
+				$icon = 'EXT:core/Resources/Public/Icons/T3Icons/status/status-user-group-frontend.svg';
74
+				$icon = 'EXT:vidi/Resources/Public/Images/fe_groups.png';
75
+			} else {
76
+				/** @var \Fab\Vidi\Backend\LanguageFileGenerator $languageService */
77
+				$languageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(Fab\Vidi\Backend\LanguageFileGenerator::class);
78
+				$languageFile = $languageService->generate($dataType);
79
+				$icon = '';
80
+			}
81
+
82
+			$pid = isset($defaultPids[$dataType]) ? $defaultPids[$dataType] : $defaultPid;
83
+
84
+			/** @var \Fab\Vidi\Module\ModuleLoader $moduleLoader */
85
+			$moduleLoader->setIcon($icon)
86
+				->setModuleLanguageFile($languageFile)
87
+				->setDefaultPid($pid)
88
+				->register();
89
+		}
90
+	}
91
+
92
+	// Possible Static TS loading
93
+	if (true === isset($configuration['autoload_typoscript']['value']) && false === (bool)$configuration['autoload_typoscript']['value']) {
94
+		\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('vidi', 'Configuration/TypoScript', 'Vidi: versatile and interactive display');
95
+	}
96
+
97
+	// Register List2 only if beta feature is enabled.
98
+	// @todo let see what we do with that
99
+	#if ($configuration['activate_beta_features']['value']) {
100
+	#	$labelFile = 'LLL:EXT:vidi/Resources/Private/Language/locallang_module.xlf';
101
+	#
102
+	#	if (!$configuration['hide_module_list']['value']) {
103
+	#		$labelFile = 'LLL:EXT:vidi/Resources/Private/Language/locallang_module_transitional.xlf';
104
+	#	}
105
+	#
106
+	#	\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
107
+	#		'vidi',
108
+	#		'web', // Make module a submodule of 'web'
109
+	#		'm1', // Submodule key
110
+	#		'after:list', // Position
111
+	#		array(
112
+	#			'Content' => 'index, list, delete, update, edit, copy, move, localize, sort, copyClipboard, moveClipboard',
113
+	#			'Tool' => 'welcome, work',
114
+	#			'Facet' => 'autoSuggest, autoSuggests',
115
+	#			'Selection' => 'edit, update, create, delete, list, show',
116
+	#			'UserPreferences' => 'save',
117
+	#			'Clipboard' => 'save, flush, show',
118
+	#		), array(
119
+	#			'access' => 'user,group',
120
+	#			'icon' => 'EXT:vidi/Resources/Public/Images/list.png',
121
+	#			'labels' => $labelFile,
122
+	#		)
123
+	#	);
124
+	#}
125
+	#if ($configuration['hide_module_list']['value']) {
126
+	#
127
+	#	// Default User TSConfig to be added in any case.
128
+	#	TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('
129
+	#
130
+	#		# Hide the module in the BE.
131
+	#		options.hideModules.web := addToList(list)
132
+	#	');
133
+	#}
134
+
135
+	/** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
136
+	$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
137
+
138
+	/** @var $signalSlotDispatcher \TYPO3\CMS\Extbase\SignalSlot\Dispatcher */
139
+	$signalSlotDispatcher = $objectManager->get('TYPO3\CMS\Extbase\SignalSlot\Dispatcher');
140
+
141
+	// Connect "processContentData" signal slot with the "ContentObjectProcessor".
142
+	$signalSlotDispatcher->connect(
143
+		'Fab\Vidi\Controller\Backend\ContentController',
144
+		'processContentData',
145
+		'Fab\Vidi\Processor\ContentObjectProcessor',
146
+		'processRelations',
147
+		true
148
+	);
149
+
150
+	// Connect "processContentData" signal with the "MarkerProcessor".
151
+	$signalSlotDispatcher->connect(
152
+		'Fab\Vidi\Controller\Backend\ContentController',
153
+		'processContentData',
154
+		'Fab\Vidi\Processor\MarkerProcessor',
155
+		'processMarkers',
156
+		true
157
+	);
158
+
159
+	// Register default Tools for Vidi.
160
+	\Fab\Vidi\Tool\ToolRegistry::getInstance()->register('*', 'Fab\Vidi\Tool\ModulePreferencesTool');
161
+	\Fab\Vidi\Tool\ToolRegistry::getInstance()->register('*', 'Fab\Vidi\Tool\RelationAnalyserTool');
162 162
 }
163 163
 
164 164
 // Add new sprite icon.
165 165
 $icons = [
166
-    'go' => 'EXT:' . $_EXTKEY . '/Resources/Public/Images/bullet_go.png',
167
-    'query' => 'EXT:' . $_EXTKEY . '/Resources/Public/Images/drive_disk.png',
166
+	'go' => 'EXT:' . $_EXTKEY . '/Resources/Public/Images/bullet_go.png',
167
+	'query' => 'EXT:' . $_EXTKEY . '/Resources/Public/Images/drive_disk.png',
168 168
 ];
169 169
 /** @var \TYPO3\CMS\Core\Imaging\IconRegistry $iconRegistry */
170 170
 $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
171 171
 foreach ($icons as $key => $icon) {
172
-    $iconRegistry->registerIcon('extensions-' . $_EXTKEY . '-' . $key,
173
-        \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
174
-        [
175
-            'source' => $icon
176
-        ]
177
-    );
172
+	$iconRegistry->registerIcon('extensions-' . $_EXTKEY . '-' . $key,
173
+		\TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
174
+		[
175
+			'source' => $icon
176
+		]
177
+	);
178 178
 }
179 179
 unset($iconRegistry);
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -163,13 +163,13 @@
 block discarded – undo
163 163
 
164 164
 // Add new sprite icon.
165 165
 $icons = [
166
-    'go' => 'EXT:' . $_EXTKEY . '/Resources/Public/Images/bullet_go.png',
167
-    'query' => 'EXT:' . $_EXTKEY . '/Resources/Public/Images/drive_disk.png',
166
+    'go' => 'EXT:'.$_EXTKEY.'/Resources/Public/Images/bullet_go.png',
167
+    'query' => 'EXT:'.$_EXTKEY.'/Resources/Public/Images/drive_disk.png',
168 168
 ];
169 169
 /** @var \TYPO3\CMS\Core\Imaging\IconRegistry $iconRegistry */
170 170
 $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
171 171
 foreach ($icons as $key => $icon) {
172
-    $iconRegistry->registerIcon('extensions-' . $_EXTKEY . '-' . $key,
172
+    $iconRegistry->registerIcon('extensions-'.$_EXTKEY.'-'.$key,
173 173
         \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
174 174
         [
175 175
             'source' => $icon
Please login to merge, or discard this patch.