[BUGFIX] EXT:form - catch exceptions within page module and form engine
[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 if (TYPO3_MODE === 'BE') {
6 // Hook to enrich tt_content form flex element with finisher settings and form list drop down
7 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::class]['flexParsing'][
8 \TYPO3\CMS\Form\Hooks\DataStructureIdentifierHook::class
9 ] = \TYPO3\CMS\Form\Hooks\DataStructureIdentifierHook::class;
10
11 // Hook to count used forms elements in tt_content
12 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser']['formPersistenceIdentifier'] =
13 \TYPO3\CMS\Form\Hooks\SoftReferenceParserHook::class;
14
15 // Register for hook to show preview of tt_content element of CType="form_formframework" in page module
16 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['form_formframework'] =
17 \TYPO3\CMS\Form\Hooks\FormPagePreviewRenderer::class;
18
19 // Add a bunch of icons to icon registry
20 $iconIdentifiers = [
21 'advanced-password',
22 'checkbox',
23 'content-element',
24 'date-picker',
25 'duplicate',
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 'page',
39 'password',
40 'radio-button',
41 'single-select',
42 'static-text',
43 'summary-page',
44 'text',
45 'textarea',
46 'validator'
47 ];
48 $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
49 foreach ($iconIdentifiers as $iconIdentifier) {
50 $iconRegistry->registerIcon(
51 't3-form-icon-' . $iconIdentifier,
52 \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
53 ['source' => 'EXT:form/Resources/Public/Images/' . $iconIdentifier . '.svg']
54 );
55 }
56
57 // Add new content element wizard entry
58 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
59 '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:form/Configuration/PageTS/modWizards.ts">'
60 );
61 }
62
63 if (TYPO3_MODE === 'FE') {
64 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterSubmit'][1489772699]
65 = \TYPO3\CMS\Form\Hooks\FormElementsOnSubmitHooks::class;
66
67 // FE file upload processing
68 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterBuildingFinished'][1489772699]
69 = \TYPO3\CMS\Form\Mvc\Property\PropertyMappingConfiguration::class;
70
71 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter(
72 \TYPO3\CMS\Form\Mvc\Property\TypeConverter\UploadedFileReferenceConverter::class
73 );
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 });