forked from hoogi91/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
43 lines (38 loc) · 1.73 KB
/
ext_localconf.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
<?php
defined('TYPO3') or die();
(static function (string $extKey = 'charts') {
// add content element to insert tables in content element wizard
// and register template for backend preview rendering
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $extKey . '/Configuration/PageTSconfig/NewContentElementWizard.typoscript">
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $extKey . '/Configuration/PageTSconfig/BackendPreview.typoscript">'
);
// override TextTableElement to create fix for old XML values
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Backend\Form\Element\TextTableElement::class] = [
'className' => \Hoogi91\Charts\Controller\Wizard\TextTableElement::class,
];
// add field type to form engine
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1644609317993] = [
'nodeName' => 'colorPalette',
'priority' => 30,
'class' => \Hoogi91\Charts\Form\Element\ColorPaletteInputElement::class,
];
// register extension relevant icons
$icons = [
'chart' => 'Extension',
'bar_chart' => 'BarChart',
'line_chart' => 'LineChart',
'pie_chart' => 'PieChart',
'doughnut_chart' => 'DoughnutChart',
];
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Imaging\IconRegistry::class
);
foreach ($icons as $key => $icon) {
$iconRegistry->registerIcon(
'tx_charts_' . strtolower($key),
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => sprintf('EXT:%s/Resources/Public/Icons/%s.svg', $extKey, $icon)]
);
}
})();