-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathext_localconf.php
74 lines (63 loc) · 2.53 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
<?php
use FelixNagel\GenericGallery\Utility\EmConfiguration;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
use FelixNagel\GenericGallery\Controller\GalleryCollectionController;
use FelixNagel\GenericGallery\Controller\GalleryItemController;
use FelixNagel\GenericGallery\Routing\Aspect\ImageItemMapper;
use TYPO3\CMS\Core\Resource\Collection\StaticFileCollection;
defined('TYPO3') || die();
call_user_func(static function () {
$configuration = EmConfiguration::getSettings();
// Add page TS config
if (!$configuration->isEnableTypeItems()) {
ExtensionManagementUtility::addPageTSConfig(
'TCEFORM.tt_content.tx_generic_gallery_items.disabled = 1'
);
}
if (!$configuration->isEnableTypeImages()) {
ExtensionManagementUtility::addPageTSConfig(
'TCEFORM.tt_content.tx_generic_gallery_images.disabled = 1'
);
}
if (!$configuration->isEnableTypeCollection()) {
ExtensionManagementUtility::addPageTSConfig(
'TCEFORM.tt_content.tx_generic_gallery_collection.disabled = 1'
);
}
if ($configuration->isHideRelations()) {
ExtensionManagementUtility::addPageTSConfig(trim('
mod.web_list.table.tx_generic_gallery_pictures.hideTable = 1
mod.web_list.table.tx_generic_gallery_content.hideTable = 1
'));
}
// FE plugin
ExtensionUtility::configurePlugin(
'GenericGallery',
'Pi1',
[
GalleryCollectionController::class => 'show',
GalleryItemController::class => 'show',
],
// non-cacheable actions
[
GalleryCollectionController::class => '',
GalleryItemController::class => '',
]
);
// Add cHash configuration
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['requireCacheHashPresenceParameters'] =
array_merge($GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['requireCacheHashPresenceParameters'], [
'tx_genericgallery_pi1[controller]',
'tx_genericgallery_pi1[action]',
'tx_genericgallery_pi1[item]',
'tx_genericgallery_pi1[contentElement]',
]);
// Routing
$GLOBALS['TYPO3_CONF_VARS']['SYS']['routing']['aspects']['GenericGalleryImageItemMapper'] = ImageItemMapper::class;
// File collection
if ($configuration->getAddImageCollection()) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['registeredCollections']['images'] =
StaticFileCollection::class;
}
});