[TASK] Follow-up to TCA refactoring
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / ext_tables.php
1 <?php
2 if (!defined('TYPO3_MODE')) {
3 die('Access denied.');
4 }
5 if (TYPO3_MODE == 'BE') {
6 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule('web', 'layout', 'top', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'layout/');
7 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('_MOD_web_layout', 'EXT:cms/locallang_csh_weblayout.xml');
8 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('_MOD_web_info', 'EXT:cms/locallang_csh_webinfo.xml');
9 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction('web_info', 'tx_cms_webinfo_page', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'web_info/class.tx_cms_webinfo.php', 'LLL:EXT:cms/locallang_tca.xml:mod_tx_cms_webinfo_page');
10 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction('web_info', 'tx_cms_webinfo_lang', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'web_info/class.tx_cms_webinfo_lang.php', 'LLL:EXT:cms/locallang_tca.xml:mod_tx_cms_webinfo_lang');
11 }
12 // Add allowed records to pages:
13 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('pages_language_overlay,tt_content,sys_template,sys_domain,backend_layout');
14
15 if (!function_exists('user_sortPluginList')) {
16 function user_sortPluginList(array &$parameters) {
17 usort($parameters['items'], create_function('$item1,$item2', 'return strcasecmp($GLOBALS[\'LANG\']->sL($item1[0]),$GLOBALS[\'LANG\']->sL($item2[0]));'));
18 }
19 }
20
21 // keep old code (pre-FAL) for installations that haven't upgraded yet. please remove this code in TYPO3 7.0
22 // @deprecated since TYPO3 6.0, please remove in TYPO3 7.0
23 // existing installation - and files are merged, nothing to do
24 if ((!isset($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['Tx_Install_Updates_File_TceformsUpdateWizard']) || !\TYPO3\CMS\Core\Utility\GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['Tx_Install_Updates_File_TceformsUpdateWizard'], 'tt_content:image')) && !\TYPO3\CMS\Core\Utility\GeneralUtility::compat_version('6.0')) {
25 \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('This installation hasn\'t been migrated to FAL for the field $TCA[tt_content][columns][image] yet. Please do so before TYPO3 v7.');
26 // Existing installation and no upgrade wizard was executed - and files haven't been merged: use the old code
27 $GLOBALS['TCA']['tt_content']['columns']['image']['config'] = array(
28 'type' => 'group',
29 'internal_type' => 'file',
30 'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
31 'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
32 'uploadfolder' => 'uploads/pics',
33 'show_thumbs' => '1',
34 'size' => '3',
35 'maxitems' => '200',
36 'minitems' => '0',
37 'autoSizeMax' => 40
38 );
39 }
40
41 if ((!isset($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['Tx_Install_Updates_File_TceformsUpdateWizard']) || !\TYPO3\CMS\Core\Utility\GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['Tx_Install_Updates_File_TceformsUpdateWizard'], 'tt_content:media')) && !\TYPO3\CMS\Core\Utility\GeneralUtility::compat_version('6.0')) {
42 \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('This installation hasn\'t been migrated to FAL for the field $TCA[tt_content][columns][media] yet. Please do so before TYPO3 v7.');
43 // Existing installation and no upgrade wizard was executed - and files haven't been merged: use the old code
44 $GLOBALS['TCA']['tt_content']['columns']['media']['config'] = array(
45 'type' => 'group',
46 'internal_type' => 'file',
47 'allowed' => '',
48 // Must be empty for disallowed to work.
49 'disallowed' => PHP_EXTENSIONS_DEFAULT,
50 'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
51 'uploadfolder' => 'uploads/media',
52 'show_thumbs' => '1',
53 'size' => '3',
54 'maxitems' => '10',
55 'minitems' => '0'
56 );
57 }
58
59 // Keep old code (pre-FAL) for installations that haven't upgraded yet.
60 // @deprecated since TYPO3 6.0, please remove at earliest in TYPO3 6.2
61 // existing installation - and files are merged, nothing to do
62 if ((!isset($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['Tx_Install_Updates_File_TceformsUpdateWizard']) || !\TYPO3\CMS\Core\Utility\GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['Tx_Install_Updates_File_TceformsUpdateWizard'], 'pages_language_overlay:media')) && !\TYPO3\CMS\Core\Utility\GeneralUtility::compat_version('6.0')) {
63 \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('This installation hasn\'t been migrated to FAL for the field $TCA[pages_language_overlay][columns][media] yet. Please do so before TYPO3 v7.');
64 // Existing installation and no upgrade wizard was executed - and files haven't been merged: use the old code
65 $GLOBALS['TCA']['pages_language_overlay']['columns']['media']['config'] = array(
66 'type' => 'group',
67 'internal_type' => 'file',
68 'allowed' => $TCA['pages']['columns']['media']['config']['allowed'],
69 'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
70 'uploadfolder' => 'uploads/media',
71 'show_thumbs' => '1',
72 'size' => '3',
73 'maxitems' => '100',
74 'minitems' => '0'
75 );
76 }
77 ?>