4672c3ac84675ef59464a94db94b2630325498c1
[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 // Hook to enrich tt_content form flex element with finisher settings and form list drop down
6 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::class]['flexParsing'][
7 \TYPO3\CMS\Form\Hooks\DataStructureIdentifierHook::class
8 ] = \TYPO3\CMS\Form\Hooks\DataStructureIdentifierHook::class;
9
10 // Hook to count used forms elements in tt_content
11 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser']['formPersistenceIdentifier'] =
12 \TYPO3\CMS\Form\Hooks\SoftReferenceParserHook::class;
13
14 // Register for hook to show preview of tt_content element of CType="form_formframework" in page module
15 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['form_formframework'] =
16 \TYPO3\CMS\Form\Hooks\FormPagePreviewRenderer::class;
17
18 // Add a bunch of icons to icon registry
19 $iconIdentifiers = [
20 'advanced-password',
21 'checkbox',
22 'content-element',
23 'date-picker',
24 'duplicate',
25 'email',
26 'fieldset',
27 'file-upload',
28 'finisher',
29 'form-element-selector',
30 'gridcontainer',
31 'gridrow',
32 'hidden',
33 'image-upload',
34 'insert-after',
35 'insert-in',
36 'multi-checkbox',
37 'multi-select',
38 'number',
39 'page',
40 'password',
41 'radio-button',
42 'single-select',
43 'static-text',
44 'summary-page',
45 'telephone',
46 'text',
47 'textarea',
48 'url',
49 'validator'
50 ];
51 $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
52 foreach ($iconIdentifiers as $iconIdentifier) {
53 $iconRegistry->registerIcon(
54 't3-form-icon-' . $iconIdentifier,
55 \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
56 ['source' => 'EXT:form/Resources/Public/Images/' . $iconIdentifier . '.svg']
57 );
58 }
59
60 // Add new content element wizard entry
61 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
62 '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:form/Configuration/PageTS/modWizards.ts">'
63 );
64
65 // Add module configuration
66 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup(
67 trim('
68 module.tx_form {
69 view {
70 templateRootPaths.10 = EXT:form/Resources/Private/Backend/Templates/
71 partialRootPaths.10 = EXT:form/Resources/Private/Backend/Partials/
72 layoutRootPaths.10 = EXT:form/Resources/Private/Backend/Layouts/
73 }
74 settings {
75 configurationFile = EXT:form/Configuration/Yaml/FormSetup.yaml
76 }
77 }
78 ')
79 );
80
81 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterSubmit'][1489772699]
82 = \TYPO3\CMS\Form\Hooks\FormElementsOnSubmitHooks::class;
83
84 // FE file upload processing
85 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterBuildingFinished'][1489772699]
86 = \TYPO3\CMS\Form\Mvc\Property\PropertyMappingConfiguration::class;
87
88 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter(
89 \TYPO3\CMS\Form\Property\TypeConverter\FormDefinitionArrayConverter::class
90 );
91 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter(
92 \TYPO3\CMS\Form\Mvc\Property\TypeConverter\UploadedFileReferenceConverter::class
93 );
94
95 // Register "formvh:" namespace
96 $GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['formvh'][] = 'TYPO3\\CMS\\Form\\ViewHelpers';
97
98 // Register FE plugin
99 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
100 'TYPO3.CMS.Form',
101 'Formframework',
102 ['FormFrontend' => 'render, perform'],
103 ['FormFrontend' => 'perform'],
104 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
105 );
106 });