forked from simplethings/typo3-doctrine2-blog-example
/
ext_tables.php
195 lines (176 loc) · 7.66 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
$extensionName = t3lib_div::underscoredToUpperCamelCase($_EXTKEY);
/**
* Registers a Plugin to be listed in the Backend. You also have to configure the Dispatcher in ext_localconf.php.
*/
if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['registerSinglePlugin']) {
Tx_Extbase_Utility_Extension::registerPlugin(
$_EXTKEY,// The extension name (in UpperCamelCase) or the extension key (in lower_underscore)
'Pi1', // A unique name of the plugin in UpperCamelCase
'A Blog Example' // A title shown in the backend dropdown field
);
$pluginSignature = strtolower($extensionName) . '_pi1';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature] = 'select_key';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform,recursive';
t3lib_extMgm::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_list.xml');
} else {
t3lib_div::loadTCA('tt_content');
// These dividers are a little trick to group these items in the plugin selector
$TCA['tt_content']['columns']['list_type']['config']['items'][] = array('Blog Example', '--div--', t3lib_extMgm::extRelPath($_EXTKEY) . 'ext_icon.gif');
Tx_Extbase_Utility_Extension::registerPlugin(
$_EXTKEY,
'BlogList',
'List of Blogs (BlogExample)'
);
Tx_Extbase_Utility_Extension::registerPlugin(
$_EXTKEY,
'PostList',
'List of Posts (BlogExample)'
);
Tx_Extbase_Utility_Extension::registerPlugin(
$_EXTKEY,
'PostSingle',
'Single Post (BlogExample)'
);
Tx_Extbase_Utility_Extension::registerPlugin(
$_EXTKEY,
'BlogAdmin',
'Admin Plugin (BlogExample)'
);
$TCA['tt_content']['columns']['list_type']['config']['items'][] = array('', '--div--');
$pluginSignature = strtolower($extensionName) . '_postlist';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature] = 'select_key';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform,recursive';
t3lib_extMgm::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_list.xml');
}
if (TYPO3_MODE === 'BE') {
/**
* Registers a Backend Module
*/
Tx_Extbase_Utility_Extension::registerModule(
$_EXTKEY,
'web', // Make module a submodule of 'web'
'tx_blogexample_m1', // Submodule key
'', // Position
array( // An array holding the controller-action-combinations that are accessible
'Blog' => 'index,new,create,delete,deleteAll,edit,update,populate', // The first controller and its first action will be the default
'Post' => 'index,show,new,create,delete,edit,update',
'Comment' => 'create,delete,deleteAll',
),
array(
'access' => 'user,group',
'icon' => 'EXT:blog_example/ext_icon.gif',
'labels' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_mod.xml',
)
);
}
/**
* Add labels for context sensitive help (CSH)
*/
t3lib_extMgm::addLLrefForTCAdescr('_MOD_web_BlogExampleTxBlogexampleM1', 'EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_csh.xml');
t3lib_extMgm::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'BlogExample setup');
t3lib_extMgm::addStaticFile($_EXTKEY, 'Configuration/TypoScript/DefaultStyles', 'BlogExample CSS Styles (optional)');
t3lib_extMgm::allowTableOnStandardPages('tx_blogexample_domain_model_blog');
$TCA['tx_blogexample_domain_model_blog'] = array (
'ctrl' => array (
'title' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_blog',
'label' => 'title',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'versioningWS' => 2,
'versioning_followPages' => true,
'origUid' => 't3_origuid',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l18n_parent',
'transOrigDiffSourceField' => 'l18n_diffsource',
'delete' => 'deleted',
'enablecolumns' => array(
'disabled' => 'hidden'
),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'Configuration/TCA/Blog.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'Resources/Public/Icons/icon_tx_blogexample_domain_model_blog.gif'
)
);
t3lib_extMgm::allowTableOnStandardPages('tx_blogexample_domain_model_post');
$TCA['tx_blogexample_domain_model_post'] = array (
'ctrl' => array (
'title' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_post',
'label' => 'title',
'label_alt' => 'author',
'label_alt_force' => TRUE,
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'versioningWS' => 2,
'versioning_followPages' => true,
'origUid' => 't3_origuid',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l18n_parent',
'transOrigDiffSourceField' => 'l18n_diffsource',
'delete' => 'deleted',
'enablecolumns' => array(
'disabled' => 'hidden'
),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'Configuration/TCA/Post.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'Resources/Public/Icons/icon_tx_blogexample_domain_model_post.gif'
)
);
t3lib_extMgm::allowTableOnStandardPages('tx_blogexample_domain_model_comment');
$TCA['tx_blogexample_domain_model_comment'] = array (
'ctrl' => array (
'title' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_comment',
'label' => 'date',
'label_alt' => 'author',
'label_alt_force' => TRUE,
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'delete' => 'deleted',
'enablecolumns' => array (
'disabled' => 'hidden'
),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'Configuration/TCA/Comment.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'Resources/Public/Icons/icon_tx_blogexample_domain_model_comment.gif'
)
);
t3lib_extMgm::allowTableOnStandardPages('tx_blogexample_domain_model_person');
$TCA['tx_blogexample_domain_model_person'] = array (
'ctrl' => array (
'title' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_person',
'label' => 'lastname',
'label_alt' => 'firstname',
'label_alt_force' => TRUE,
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'versioningWS' => 2,
'versioning_followPages' => true,
'origUid' => 't3_origuid',
'prependAtCopy' => 'LLL:EXT:lang/locallang_general.xml:LGL.prependAtCopy',
'delete' => 'deleted',
'enablecolumns' => array(
'disabled' => 'hidden'
),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'Configuration/TCA/Person.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'Resources/Public/Icons/icon_tx_blogexample_domain_model_person.gif'
)
);
t3lib_extMgm::allowTableOnStandardPages('tx_blogexample_domain_model_tag');
$TCA['tx_blogexample_domain_model_tag'] = array (
'ctrl' => array (
'title' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_tag',
'label' => 'name',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'delete' => 'deleted',
'enablecolumns' => array (
'disabled' => 'hidden'
),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'Configuration/TCA/Tag.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'Resources/Public/Icons/icon_tx_blogexample_domain_model_tag.gif'
)
);
t3lib_div::loadTCA('fe_users');
if (is_array($TCA['fe_users']['columns']['tx_extbase_type'])) {
$TCA['fe_users']['types']['Tx_BlogExample_Domain_Model_Administrator'] = $TCA['fe_users']['types']['0'];
array_push($TCA['fe_users']['columns']['tx_extbase_type']['config']['items'], array('LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:fe_users.tx_extbase_type.Tx_BlogExample_Domain_Model_Administrator', 'Tx_BlogExample_Domain_Model_Administrator'));
}
?>