888e262caef8519e17f649275312e53d996ee7b0
[Packages/TYPO3.CMS.git] / typo3 / sysext / form / ext_localconf.php
1 <?php
2 defined('TYPO3_MODE') or die();
3
4 call_user_func(function () {
5 // Register upgrade wizard in install tool
6 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['formFileExtension']
7 = \TYPO3\CMS\Form\Hooks\FormFileExtensionUpdate::class;
8
9 // Context menu item handling for form files
10 $GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders'][1530637161]
11 = \TYPO3\CMS\Form\Hooks\FormFileProvider::class;
12
13 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/impexp/class.tx_impexp.php']['before_addSysFileRecord'][1530637161]
14 = \TYPO3\CMS\Form\Hooks\ImportExportHook::class . '->beforeAddSysFileRecordOnImport';
15
16 // File list edit icons
17 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'][1530637161]
18 = \TYPO3\CMS\Form\Hooks\FileListEditIconsHook::class;
19
20 // Hook to enrich tt_content form flex element with finisher settings and form list drop down
21 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::class]['flexParsing'][
22 \TYPO3\CMS\Form\Hooks\DataStructureIdentifierHook::class
23 ] = \TYPO3\CMS\Form\Hooks\DataStructureIdentifierHook::class;
24
25 // Hook to count used forms elements in tt_content
26 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser']['formPersistenceIdentifier'] =
27 \TYPO3\CMS\Form\Hooks\SoftReferenceParserHook::class;
28
29 // Register for hook to show preview of tt_content element of CType="form_formframework" in page module
30 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['form_formframework'] =
31 \TYPO3\CMS\Form\Hooks\FormPagePreviewRenderer::class;
32
33 // Add new content element wizard entry
34 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
35 '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:form/Configuration/PageTS/modWizards.tsconfig">'
36 );
37
38 // Add module configuration
39 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup(
40 'module.tx_form {
41 settings {
42 yamlConfigurations {
43 10 = EXT:form/Configuration/Yaml/BaseSetup.yaml
44 20 = EXT:form/Configuration/Yaml/FormEditorSetup.yaml
45 30 = EXT:form/Configuration/Yaml/FormEngineSetup.yaml
46 }
47 }
48 view {
49 templateRootPaths.10 = EXT:form/Resources/Private/Backend/Templates/
50 partialRootPaths.10 = EXT:form/Resources/Private/Backend/Partials/
51 layoutRootPaths.10 = EXT:form/Resources/Private/Backend/Layouts/
52 }
53 }'
54 );
55
56 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterSubmit'][1489772699]
57 = \TYPO3\CMS\Form\Hooks\FormElementHooks::class;
58
59 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['initializeFormElement'][1489772699]
60 = \TYPO3\CMS\Form\Hooks\FormElementHooks::class;
61
62 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeRendering'][1489772699]
63 = \TYPO3\CMS\Form\Hooks\FormElementHooks::class;
64
65 // FE file upload processing
66 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterBuildingFinished'][1489772699]
67 = \TYPO3\CMS\Form\Mvc\Property\PropertyMappingConfiguration::class;
68
69 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter(
70 \TYPO3\CMS\Form\Mvc\Property\TypeConverter\FormDefinitionArrayConverter::class
71 );
72 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter(
73 \TYPO3\CMS\Form\Mvc\Property\TypeConverter\UploadedFileReferenceConverter::class
74 );
75
76 // Register "formvh:" namespace
77 $GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['formvh'][] = 'TYPO3\\CMS\\Form\\ViewHelpers';
78
79 // Register FE plugin
80 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
81 'TYPO3.CMS.Form',
82 'Formframework',
83 ['FormFrontend' => 'render, perform'],
84 ['FormFrontend' => 'perform'],
85 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
86 );
87
88 // Register slots for file handling
89 $signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
90 \TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class
91 );
92 $signalSlotDispatcher->connect(
93 \TYPO3\CMS\Core\Resource\ResourceStorage::class,
94 \TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreFileCreate,
95 \TYPO3\CMS\Form\Slot\FilePersistenceSlot::class,
96 'onPreFileCreate'
97 );
98 $signalSlotDispatcher->connect(
99 \TYPO3\CMS\Core\Resource\ResourceStorage::class,
100 \TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreFileAdd,
101 \TYPO3\CMS\Form\Slot\FilePersistenceSlot::class,
102 'onPreFileAdd'
103 );
104 $signalSlotDispatcher->connect(
105 \TYPO3\CMS\Core\Resource\ResourceStorage::class,
106 \TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreFileRename,
107 \TYPO3\CMS\Form\Slot\FilePersistenceSlot::class,
108 'onPreFileRename'
109 );
110 $signalSlotDispatcher->connect(
111 \TYPO3\CMS\Core\Resource\ResourceStorage::class,
112 \TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreFileReplace,
113 \TYPO3\CMS\Form\Slot\FilePersistenceSlot::class,
114 'onPreFileReplace'
115 );
116 $signalSlotDispatcher->connect(
117 \TYPO3\CMS\Core\Resource\ResourceStorage::class,
118 \TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreFileMove,
119 \TYPO3\CMS\Form\Slot\FilePersistenceSlot::class,
120 'onPreFileMove'
121 );
122 $signalSlotDispatcher->connect(
123 \TYPO3\CMS\Core\Resource\ResourceStorage::class,
124 \TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreFileSetContents,
125 \TYPO3\CMS\Form\Slot\FilePersistenceSlot::class,
126 'onPreFileSetContents'
127 );
128 });