[!!!][TASK] Move legacy "search" CType to compatibility6
[Packages/TYPO3.CMS.git] / typo3 / sysext / compatibility6 / ext_localconf.php
1 <?php
2 defined('TYPO3_MODE') or die();
3
4 if (TYPO3_MODE === 'FE') {
5
6 // Register legacy content objects
7 $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['IMGTEXT'] = \TYPO3\CMS\Compatibility6\ContentObject\ImageTextContentObject::class;
8 $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['CLEARGIF'] = \TYPO3\CMS\Compatibility6\ContentObject\ClearGifContentObject::class;
9 $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['CTABLE'] = \TYPO3\CMS\Compatibility6\ContentObject\ContentTableContentObject::class;
10 $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['OTABLE'] = \TYPO3\CMS\Compatibility6\ContentObject\OffsetTableContentObject::class;
11 $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['COLUMNS'] = \TYPO3\CMS\Compatibility6\ContentObject\ColumnsContentObject::class;
12 $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['HRULER'] = \TYPO3\CMS\Compatibility6\ContentObject\HorizontalRulerContentObject::class;
13 $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['FORM'] = \TYPO3\CMS\Compatibility6\ContentObject\FormContentObject::class;
14 $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['SEARCHRESULT'] = \TYPO3\CMS\Compatibility6\ContentObject\SearchResultContentObject::class;
15
16 // Register a hook for data submission
17 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission']['mailform'] = \TYPO3\CMS\Compatibility6\Controller\FormDataSubmissionController::class;
18
19 // Register hooks for xhtml_cleaning
20 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'][] = \TYPO3\CMS\Compatibility6\Hooks\TypoScriptFrontendController\ContentPostProcHook::class . '->contentPostProcAll';
21 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-cached'][] = \TYPO3\CMS\Compatibility6\Hooks\TypoScriptFrontendController\ContentPostProcHook::class . '->contentPostProcCached';
22 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'][] = \TYPO3\CMS\Compatibility6\Hooks\TypoScriptFrontendController\ContentPostProcHook::class . '->contentPostProcOutput';
23 }
24
25 /**
26 * CType "mailform"
27 */
28 // Add Default TypoScript for CType "mailform" after default content rendering
29 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('compatibility6', 'constants', '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:compatibility6/Configuration/TypoScript/Form/constants.txt">', 'defaultContentRendering');
30 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('compatibility6', 'setup', '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:compatibility6/Configuration/TypoScript/Form/setup.txt">', 'defaultContentRendering');
31
32 // Add the search CType to the "New Content Element" wizard
33 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
34 mod.wizards.newContentElement.wizardItems.forms {
35 elements.mailform {
36 icon = gfx/c_wiz/mailform.gif
37 title = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_mail_title
38 description = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_mail_description
39 tt_content_defValues {
40 CType = mailform
41 bodytext (
42 # Example content:
43 Name: | *name = input,40 | Enter your name here
44 Email: | *email=input,40 |
45 Address: | address=textarea,40,5 |
46 Contact me: | tv=check | 1
47
48 |formtype_mail = submit | Send form!
49 |html_enabled=hidden | 1
50 |subject=hidden| This is the subject
51 )
52 }
53 }
54 show :=addToList(mailform)
55 }
56 ');
57
58 // Add a for previewing tt_content elements of CType="mailform"
59 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['mailform'] = \TYPO3\CMS\Compatibility6\Hooks\PageLayoutView\MailformPreviewRenderer::class;
60
61
62 /**
63 * CType "search"
64 */
65
66 // Add Default TypoScript for CType "search" after default content rendering
67 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('compatibility6', 'constants', '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:compatibility6/Configuration/TypoScript/Search/constants.txt">', 'defaultContentRendering');
68 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('compatibility6', 'setup', '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:compatibility6/Configuration/TypoScript/Search/setup.txt">', 'defaultContentRendering');
69
70 // Add the search CType to the "New Content Element" wizard
71 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
72 mod.wizards.newContentElement.wizardItems.forms {
73 elements.search {
74 icon = gfx/c_wiz/searchform.gif
75 title = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_search_title
76 description = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_search_description
77 tt_content_defValues.CType = search
78 }
79 show :=addToList(search)
80 }
81 ');