This repository has been archived by the owner on Dec 4, 2018. It is now read-only.
forked from fgerards/fluidcontent
-
Notifications
You must be signed in to change notification settings - Fork 64
/
tt_content.php
74 lines (68 loc) · 3.89 KB
/
tt_content.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
call_user_func(
function () {
$languageFilePrefix = 'LLL:EXT:fluidcontent/Resources/Private/Language/locallang.xlf:';
$frontendLanguageFilePrefix = 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:';
if (version_compare(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('core'), '8.0', '<')) {
$tabsLanguageFilePrefix = 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.';
$categoryTabLabel = 'LLL:EXT:lang/locallang_tca.xlf:sys_category.tabs.category:category';
} else {
$tabsLanguageFilePrefix = 'LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:';
$categoryTabLabel = $tabsLanguageFilePrefix . 'categories';
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
'tt_content',
[
'tx_fed_fcefile' => [
'exclude' => 1,
'label' => $languageFilePrefix.'tt_content.tx_fed_fcefile',
'displayCond' => 'FIELD:CType:=:fluidcontent_content',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
[$languageFilePrefix.'tt_content.tx_fed_fcefile', ''],
],
'showIconTable' => false,
'selicon_cols' => 0,
],
],
]
);
$GLOBALS['TCA']['tt_content']['ctrl']['useColumnsForDefaultValues'] .= ',tx_fed_fcefile';
$GLOBALS['TCA']['tt_content']['ctrl']['requestUpdate'] .= ',tx_fed_fcefile';
$GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['userFunc'] = \FluidTYPO3\Fluidcontent\Hooks\ContentIconUserFunction::class . '->getIcon';
$GLOBALS['TCA']['tt_content']['types']['fluidcontent_content']['showitem'] = '
--palette--;' . $frontendLanguageFilePrefix . 'palette.general;general,
--palette--;' . $frontendLanguageFilePrefix . 'palette.header;header,
--div--;' . $frontendLanguageFilePrefix . 'tabs.appearance, layout;' . $frontendLanguageFilePrefix . 'layout_formlabel,
--palette--; '. $frontendLanguageFilePrefix . 'palette.frames;frames,
--palette--;' . $frontendLanguageFilePrefix . 'palette.appearanceLinks;appearanceLinks,
--div--;' . $tabsLanguageFilePrefix . 'access,
--palette--;' . $frontendLanguageFilePrefix . ';visibility,
--palette--;' . $frontendLanguageFilePrefix . ':palette.access;access,
--div--;' . $categoryTabLabel . ', categories,
--div--;' . $tabsLanguageFilePrefix . 'extended,
--div--;LLL:EXT:flux/Resources/Private/Language/locallang.xlf:tt_content.tabs.relation, tx_flux_parent, tx_flux_column
';
if (version_compare(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('core'), '8.0', '>=')) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tt_content', ',--div--;' . $tabsLanguageFilePrefix . 'language, --palette--;;language,', 'fluidcontent_content', 'before:access');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tt_content', ',--div--;' . $tabsLanguageFilePrefix . 'notes, rowDescription,', 'fluidcontent_content', 'after:language');
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette(
'tt_content',
'general',
'tx_fed_fcefile',
'after:CType'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'tt_content',
'pi_flexform',
'fluidcontent_content',
'after:header'
);
}
);