forked from patrickbroens/TYPO3.ContentElements
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathext_tables.php
176 lines (164 loc) · 6.37 KB
/
ext_tables.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
// Add an entry in the static template list found in sys_templates for static TS
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
$_EXTKEY,
'Configuration/TypoScript/Static',
'Content Elements'
);
// Add an entry in the static template list found in sys_templates for CSS TS
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
$_EXTKEY,
'Configuration/TypoScript/Styling',
'Content Elements CSS (optional)'
);
//Extra fields for the tt_content table
$extraContentColumns = array(
'bullets_type' => array(
'exclude' => TRUE,
'label' => 'LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.bullets_type',
'config' => array(
'type' => 'select',
'items' => array(
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.bullets_type.0', 0),
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.bullets_type.1', 1),
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.bullets_type.2', 2)
),
'default' => 0
)
),
'table_caption' => array(
'exclude' => TRUE,
'label' => 'LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_caption',
'config' => array(
'type' => 'input'
)
),
'table_delimiter' => array(
'exclude' => TRUE,
'label' => 'LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_delimiter',
'config' => array(
'type' => 'select',
'items' => array(
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_delimiter.124', 124),
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_delimiter.59', 59),
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_delimiter.44', 44),
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_delimiter.58', 58),
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_delimiter.9', 9)
),
'default' => 124
)
),
'table_enclosure' => array(
'exclude' => TRUE,
'label' => 'LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_enclosure',
'config' => array(
'type' => 'select',
'items' => array(
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_enclosure.0', 0),
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_enclosure.39', 39),
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_enclosure.34', 34)
),
'default' => 0
)
),
'table_header_position' => array(
'exclude' => TRUE,
'label' => 'LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_header_position',
'config' => array(
'type' => 'select',
'items' => array(
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_header_position.0', 0),
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_header_position.1', 1),
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_header_position.2', 2)
),
'default' => 0
)
),
'table_tfoot' => array(
'exclude' => TRUE,
'label' => 'LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.table_tfoot',
'config' => array(
'type' => 'check',
'default' => 0,
'items' => array(
array('LLL:EXT:lang/locallang_core.xml:labels.enabled', 1)
)
)
),
'uploads_description' => array(
'exclude' => TRUE,
'label' => 'LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.uploads_description',
'config' => array(
'type' => 'check',
'default' => 0,
'items' => array(
array('LLL:EXT:lang/locallang_core.xml:labels.enabled', 1)
)
)
),
'uploads_type' => array(
'exclude' => TRUE,
'label' => 'LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.uploads_type',
'config' => array(
'type' => 'select',
'items' => array(
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.uploads_type.0', 0),
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.uploads_type.1', 1),
array('LLL:EXT:contentelements/Resources/Private/Language/Database.xlf:tt_content.uploads_type.2', 2)
),
'default' => 0
)
)
);
// Adding fields to the tt_content table definition in TCA
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $extraContentColumns);
/**
* CE "Bullets"
*/
// Add the field "bullets_type" to TCA for type "bullets"
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'tt_content',
'bullets_type;;;;1-1-1',
'bullets',
'after:layout'
);
/**
* CE "File links"
*/
// Add the fields "uploads_description" and "uploads_type" to TCA for palette "uploadslayout"
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette(
'tt_content',
'uploadslayout',
'uploads_description, uploads_type'
);
/**
* CE "Table"
*/
// Add a new palette
$TCA['tt_content']['palettes']['tableconfiguration'] = array(
'canNotCollapse' => 1,
'showitem' => 'table_delimiter, table_enclosure'
) ;
// Add the fields "cols", "table_header_position", "table_tfoot" to TCA for palette "tablelayout"
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette(
'tt_content',
'tablelayout',
'cols, table_header_position, table_tfoot'
);
// Restructure the TCA to have the fields in the proper tabs and palettes
$TCA['tt_content']['types']['table']['showitem'] = '
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
bodytext;;tableconfiguration;nowrap:wizards[table], table_caption,
--div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.table_layout;tablelayout,
--div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
--div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended,
--div--;LLL:EXT:lang/locallang_tca.xlf:sys_category.tabs.category, categories
';