Working Copy
[TYPO3CMS/Extensions/powermailCond.git] / Configuration / TCA / Conditions.php
1 <?php
2 if (!defined ('TYPO3_MODE')) {
3 die ('Access denied.');
4 }
5
6 $TCA['tx_powermailcond_conditions'] = array (
7 'ctrl' => $TCA['tx_powermailcond_conditions']['ctrl'],
8 'interface' => array (
9 'showRecordFieldList' => 'sys_language_uid,l18n_parent,l18n_diffsource,hidden,starttime,endtime,title,targetField,actions,filterSelectField,rules,conjunction'
10 ),
11 'types' => array (
12 '0' => array('showitem' => '--palette--;;1, targetField, --palette--;;2, rules, conjunction, sys_language_uid, l18n_parent, l18n_diffsource')
13 ),
14 'palettes' => array (
15 '1' => array('showitem' => 'title, starttime, endtime, hidden'),
16 '2' => array('showitem' => 'actions, filterSelectField')
17 ),
18 'feInterface' => $TCA['tx_powermailcond_conditions']['feInterface'],
19 'columns' => array (
20 'sys_language_uid' => array (
21 'exclude' => 1,
22 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.language',
23 'config' => array (
24 'type' => 'select',
25 'foreign_table' => 'sys_language',
26 'foreign_table_where' => 'ORDER BY sys_language.title',
27 'items' => array(
28 array('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1),
29 array('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0)
30 )
31 )
32 ),
33 'l18n_parent' => array (
34 'displayCond' => 'FIELD:sys_language_uid:>:0',
35 'exclude' => 1,
36 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent',
37 'config' => array (
38 'type' => 'select',
39 'items' => array (
40 array('', 0),
41 ),
42 'foreign_table' => 'tx_powermailcond_conditions',
43 'foreign_table_where' => 'AND tx_powermailcond_conditions.pid=###CURRENT_PID### AND tx_powermailcond_conditions.sys_language_uid IN (-1,0)',
44 )
45 ),
46 'l18n_diffsource' => array (
47 'config' => array (
48 'type' => 'passthrough'
49 )
50 ),
51 'hidden' => array (
52 'exclude' => 1,
53 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
54 'config' => array (
55 'type' => 'check',
56 'default' => '0'
57 )
58 ),
59 'starttime' => array (
60 'exclude' => 1,
61 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.starttime',
62 'config' => array (
63 'type' => 'input',
64 'size' => '8',
65 'max' => '20',
66 //'eval' => 'date',
67 'default' => '0',
68 'checkbox' => '0'
69 )
70 ),
71 'endtime' => array (
72 'exclude' => 1,
73 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.endtime',
74 'config' => array (
75 'type' => 'input',
76 'size' => '8',
77 'max' => '20',
78 //'eval' => 'date',
79 'checkbox' => '0',
80 'default' => '0',
81 'range' => array (
82 'upper' => mktime(0, 0, 0, 12, 31, 2020),
83 'lower' => mktime(0, 0, 0, date('m')-1, date('d'), date('Y'))
84 )
85 )
86 ),
87 'title' => Array (
88 'exclude' => 1,
89 'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.title',
90 'config' => Array (
91 'type' => 'input',
92 'size' => '30',
93 )
94 ),
95 'targetField' => Array (
96 'exclude' => 1,
97 'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.targetField',
98 'config' => Array (
99 'type' => 'select',
100 'items' => Array (
101 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.targetField.I.0', '0'),
102 ),
103 'itemsProcFunc' => 'tx_powermailcond_fields_be->fieldname',
104 'itemsProcFunc_addFieldsets' => 1, // add fieldsets
105 'size' => 1,
106 'maxitems' => 1,
107 'eval' => 'required'
108 )
109 ),
110 'actions' => Array (
111 'exclude' => 1,
112 'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action',
113 'config' => Array (
114 'type' => 'select',
115 'items' => Array (
116 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.main', '--div--'), // title main
117 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.0', '0'), // hide
118 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.1', '1'), // unhide
119 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.additional', '--div--'), // title additional
120 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.2', '2'), // filter selectbox
121 ),
122 'size' => 1,
123 'maxitems' => 1,
124 )
125 ),
126 'filterSelectField' => Array (
127 'exclude' => 1,
128 'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.filterSelectField',
129 'config' => Array (
130 'type' => 'select',
131 'items' => Array (
132 ),
133 'itemsProcFunc' => 'tx_powermailcond_fields_be->valuesFromPowermailSelectbox',
134 'size' => 4,
135 'maxitems' => 1000
136 ),
137 'displayCond' => 'FIELD:actions:IN:2' // show only if ops value is greater than 1
138 ),
139 'rules' => Array (
140 'exclude' => 1,
141 'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.rules',
142 'config' => Array (
143 'type' => 'inline',
144 'foreign_table' => 'tx_powermailcond_rules',
145 'foreign_table_where' => 'AND tx_powermailcond_rules.pid=###CURRENT_PID### ORDER BY tx_powermailcond_rules.uid',
146 'foreign_field' => 'conditions',
147 'maxitems' => 99,
148 'appearance' => array(
149 'collapseAll' => 1,
150 'expandSingle' => 1,
151 'useSortable' => 1,
152 'newRecordLinkAddTitle' => 1,
153 'newRecordLinkPosition' => 'both',
154 ),
155 )
156 ),
157 'conjunction' => Array (
158 'exclude' => 1,
159 'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction',
160 'config' => Array (
161 'type' => 'select',
162 'items' => Array (
163 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction.I.1', 'OR'), // OR
164 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction.I.0', 'AND'), // AND
165 ),
166 'size' => 1,
167 'maxitems' => 1,
168 )
169 ),
170 ),
171 );
172
173 ?>