[FEATURE] EXT:form - integrate new form framework
[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 FE plugin
6 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
7 'TYPO3.CMS.Form',
8 'Formframework',
9 ['FormFrontend' => 'render, perform'],
10 ['FormFrontend' => 'perform'],
11 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
12 );
13
14 // Add new content element wizard entry
15 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
16 '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:form/Configuration/PageTS/modWizards.ts">'
17 );
18
19 // FE file upload processing
20 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter(
21 \TYPO3\CMS\Form\Mvc\Property\TypeConverter\UploadedFileReferenceConverter::class
22 );
23
24 // Hook to enrich tt_content form flex element with finisher settings and form list drop down
25 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::class]['flexParsing'][
26 \TYPO3\CMS\Form\Hooks\DataStructureIdentifierHook::class
27 ] = \TYPO3\CMS\Form\Hooks\DataStructureIdentifierHook::class;
28
29 // Hook to count used forms elements in tt_content
30 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser']['formPersistenceIdentifier'] =
31 \TYPO3\CMS\Form\Hooks\SoftReferenceParserHook::class;
32
33 // Add a bunch of icons to icon registry
34 $iconIdentifiers = [
35 'advanced-password',
36 'checkbox',
37 'content-element',
38 'date-picker',
39 'duplicate',
40 'fieldset',
41 'file-upload',
42 'finisher',
43 'image-upload',
44 'insert-after',
45 'insert-in',
46 'multi-checkbox',
47 'multi-select',
48 'page',
49 'password',
50 'radio-button',
51 'single-select',
52 'static-text',
53 'summary-page',
54 'text',
55 'textarea',
56 'validator'
57 ];
58 $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
59 foreach ($iconIdentifiers as $iconIdentifier) {
60 $iconRegistry->registerIcon(
61 't3-form-icon-' . $iconIdentifier,
62 \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
63 ['source' => 'EXT:form/Resources/Public/Images/' . $iconIdentifier . '.svg']
64 );
65 }
66 });