This repository has been archived by the owner on Mar 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
55 lines (47 loc) · 2.55 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
<?php
defined('TYPO3_MODE') || die('Access denied.');
call_user_func(
function ($extKey) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="DIR:EXT:'. $extKey .'/Configuration/PageTS/" extensions="tsc">');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup('<INCLUDE_TYPOSCRIPT: source="DIR:EXT:'. $extKey .'/Configuration/TypoScript/" extensions="tsc">');
/**
* show cache wizard only in dev mode
*/
if (\TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext()->isDevelopment() === true) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions'][$extKey] = \VK\CustomFluidStyledContent\Hooks\ContentElementHook::class;
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler(
'CustomFluidStyledContent::addContentElements',
'VK\\CustomFluidStyledContent\\Hooks\\ContentElementHook->addContentElements'
);
}
// load / register assets
if (TYPO3_MODE === 'BE') {
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
// register preset icon
$iconRegistry->registerIcon(
'custom-fluid-styled-content-preset',
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => 'EXT:' . $extKey . '/Resources/Public/Icons/custom-fluid-styled-content-preset.svg']
);
// add all other icons
foreach(\VK\CustomFluidStyledContent\Hooks\ContentElementHook::getAssets() as $asset => $files) {
switch (strtolower($asset)) {
case 'icons':
foreach($files as $icon) {
switch (\GuzzleHttp\Psr7\mimetype_from_filename($icon)) {
case 'image/png':
$iconRegistry->registerIcon(
pathinfo($icon)['filename'],
\TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
['source' => 'EXT:' . $extKey . '/Resources/Public/Icons/' . pathinfo($icon)['basename']]
);
break;
}
}
break;
}
}
}
},
$_EXTKEY
);