-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathext_localconf.php
88 lines (76 loc) · 2.69 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
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
<?php
defined('TYPO3_MODE') or die();
// Register hook to update the answers after selecting a predefined answer group
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['pbsurvey'] =
\PatrickBroens\Pbsurvey\Hook\ProcessDataMap::class;
// Get the icon registry
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
/**
* Add the icons for the new content elements to the icon registry
*/
$newContentElementCTypes = [
'pbsurvey'
];
foreach ($newContentElementCTypes as $newContentElementCType) {
// Add the content element icon to the icon registry
$iconRegistry->registerIcon(
'mimetypes-x-content-' . $newContentElementCType,
\TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
[
'source' => 'EXT:pbsurvey/Resources/Public/Icons/ContentElements/' . $newContentElementCType . '.gif'
]
);
// Add the content element icon to the icon registry for the content element wizard
$iconRegistry->registerIcon(
'content-special-' . $newContentElementCType,
\TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
[
'source' => 'EXT:pbsurvey/Resources/Public/Icons/ContentElementWizard/' . $newContentElementCType . '.gif'
]
);
}
/**
* Add the icons for record types to the icon registry
*/
$recordTypes = [
'answer',
'item',
'option',
'option-predefined',
'option-predefined-group',
'page',
'page-condition-group',
'page-condition-rule',
'result',
'row',
'score'
];
foreach ($recordTypes as $recordType) {
$iconRegistry->registerIcon(
'mimetypes-x-pbsurvey-' . $recordType,
\TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
[
'source' => 'EXT:pbsurvey/Resources/Public/Icons/TCA/' . $recordType . '.gif'
]
);
}
/**
* Add the icons for item types to the icon registry
*/
$itemsAmount = 24;
for ($itemNumber = 1; $itemNumber <= $itemsAmount; $itemNumber++) {
$iconRegistry->registerIcon(
'mimetypes-x-pbsurvey-item-' . $itemNumber,
\TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
[
'source' => 'EXT:pbsurvey/Resources/Public/Icons/TCA/Item/' . $itemNumber . '.gif'
]
);
}
// Include TS configuration
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:pbsurvey/Configuration/TSconfig/Root.ts">'
);
// Update wizard 4.7 => 7.6
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['pbsurvey'] =
\PatrickBroens\Pbsurvey\Updates\Upgrade::class;