This repository has been archived by the owner on Nov 19, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ext_tables.php
168 lines (150 loc) · 5.49 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
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
include_once(t3lib_extMgm::extPath($_EXTKEY).'Classes/class.tx_pubdb_flexform.php');
//include_once(t3lib_extMgm::extPath($_EXTKEY).'class.tx_pubdb_tca.php');
include_once(t3lib_extMgm::extPath($_EXTKEY).'Classes/class.tx_pubdb_compatibility.php');
$TCA['tx_pubdb_data'] = Array (
'ctrl' => Array (
'title' => 'LLL:EXT:pubdb/locallang_db.xml:tx_pubdb_data',
'label' => 'title',
'label_alt' => 'number,issue,year',
'label_alt_force' => 'true',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'default_sortby' => 'ORDER BY year DESC',
'delete' => 'deleted',
'filter' => 'filter_for_all_fields',
'enablecolumns' => Array (
'disabled' => 'hidden',
),
'requestUpdate' => 'pubtype',
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'icon_tx_pubdb_data.gif',
),
'interface' => Array(
'always_description' => 'true',
'showRecordFieldList' => 'title,subtitle,author,coauthors,contributors,publisher,location,year,number,doi,category,hascrossrefentry',
),
);
$TCA['tx_pubdb_categories'] = Array (
'ctrl' => Array (
'title' => 'LLL:EXT:pubdb/locallang_db.xml:tx_pubdb_categories',
'label' => 'name',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'default_sortby' => 'ORDER BY name',
'delete' => 'deleted',
'enablecolumns' => Array (
'disabled' => 'hidden',
),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'icon_tx_pubdb_categories.gif',
),
'feInterface' => Array (
'fe_admin_fieldList' => 'hidden, name, fegroup',
)
);
$TCA['tx_pubdb_contributors'] = Array (
'ctrl' => Array (
'title' => 'LLL:EXT:pubdb/locallang_db.xml:tx_pubdb_contributors',
'label' => 'surname',
'label_alt' => 'given_name,affiliation,organization',
'label_alt_force' => TRUE,
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'default_sortby' => 'ORDER BY surname',
'requestUpdate' => 'contributor_type',
'delete' => 'deleted',
'enablecolumns' => Array (
'disabled' => 'hidden',
),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'icon_tx_pubdb_contributors.gif',
),
'feInterface' => Array (
'fe_admin_fieldList' => 'name',
)
);
$TCA['tx_pubdb_pub_contributors'] = Array (
'ctrl' => Array (
'title' => 'LLL:EXT:pubdb/locallang_db.xml:tx_pubdb_pub_contributors',
'label' => 'uid',
'label_alt' => 'pubid,contributorid',
'label_alt_force' => TRUE,
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'delete' => 'deleted',
'enablecolumns' => Array (
'disabled' => 'hidden',
),
//'hideTable' => TRUE,
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'icon_tx_pubdb_contributors.gif',
),
'feInterface' => Array (
'fe_admin_fieldList' => 'hidden, pubid, contributorid',
)
);
$tempColumns = Array (
'tx_pubdb_newslink' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:pubdb/locallang_db.xml:tx_pubdb_newslink.publication',
'config' => Array (
'type' => 'select',
'items' => Array (
Array('',0),
),
'foreign_table' => 'tx_pubdb_data',
'foreign_table_where' => 'ORDER BY tx_pubdb_data.uid',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
)
),
'tx_pubdb_link_title' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:pubdb/locallang_db.xml:tx_pubdb_newslink.linktitle',
'config' => Array (
'type' => 'input',
'size' => '30',
)
),
);
//tt_news erweitern
t3lib_div::loadTCA('tt_news');
t3lib_extMgm::addTCAcolumns('tt_news', $tempColumns, 1);
t3lib_extMgm::addToAllTCAtypes('tt_news', ',--div--;Publication,tx_pubdb_link_title,tx_pubdb_newslink;;;;1-1-1');
//tt_content muss vor jeder Änderung eines $TCA Beriches im frontend geladen werden
t3lib_div::loadTCA('tt_content');
//nicht benötigte felder ausblenden
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY.'_pi1']='layout,select_key,pages,recursive';
// Get the typo3 version
$typo3Version = tx_pubdb_compatibility::getInstance()->int_from_ver(TYPO3_version);
//for typo3 > 6.0
if ($typo3Version >= 6000000) {
//debug("typo3 6",'debug ver');
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'pi1',
'Publication database FE plugin');
$pluginSignature = str_replace('_', '', $_EXTKEY) . '_pi1';
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/flexform_ds.xml');
} else {
//flexform feld einblenden
$TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY . '_pi1']='pi_flexform';
//xml datei laden
t3lib_extMgm::addPiFlexFormValue($_EXTKEY.'_pi1', 'FILE:EXT:' . $_EXTKEY . '/flexform_ds.xml');
}
t3lib_extMgm::addPlugin(Array('LLL:EXT:pubdb/locallang_db.xml:tt_content.list_type_pi1', $_EXTKEY . '_pi1'), 'list_type');
//t3lib_extMgm::addStaticFile($_EXTKEY,'pi1/static/','Pubdb list');
t3lib_extMgm::addStaticFile($_EXTKEY, 'static/css/', 'default CSS-styles');
//if (TYPO3_MODE=='BE') {
t3lib_extMgm::addLLrefForTCAdescr('tx_pubdb_data', 'EXT:pubdb/csh/locallang_csh_data.xml');
t3lib_extMgm::addLLrefForTCAdescr('tx_pubdb_data', 'EXT:pubdb/csh/locallang_csh_contributors.xml');
//}
?>