Working Copy
[TYPO3CMS/Extensions/powermailCond.git] / Configuration / TCA / Condition.php
1 <?php
2 if (!defined ('TYPO3_MODE')) {
3 die ('Access denied.');
4 }
5
6 $TCA['tx_powermailcond_domain_model_condition'] = array (
7 'ctrl' => $TCA['tx_powermailcond_domain_model_condition']['ctrl'],
8 'interface' => array (
9 'showRecordFieldList' => 'sys_language_uid,l18n_parent,l18n_diffsource,hidden,starttime,endtime,title,targetField,actions,filterSelectField,rules,conjunction,form'
10 ),
11 'types' => array (
12 '1' => array('showitem' => '--palette--;x;1, form, targetField, --palette--;x;2, rules, conjunction')
13 ),
14 'palettes' => array (
15 '1' => array('showitem' => 'title, hidden'),
16 '2' => array('showitem' => 'actions, filterSelectField'),
17 'canNotCollapse' => '1'
18 ),
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 'form' => array(
96 'exclude' => 1,
97 'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.form',
98 'config' => Array (
99 'type' => 'select',
100 'items' => Array (
101 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.form.pleaseChoose', '')
102 ),
103 'maxitems' => '1',
104 'size' => '1',
105 'minitems' => 1,
106 'requestUpdate' => 1,
107 'foreign_table' => 'tx_powermail_domain_model_forms',
108 'foreign_table_where' => 'AND tx_powermail_domain_model_forms.deleted = 0 AND tx_powermail_domain_model_forms.hidden = 0 AND tx_powermail_domain_model_forms.sys_language_uid = 0 order by tx_powermail_domain_model_forms.title'
109 )
110 ),
111 'targetField' => Array (
112 'exclude' => 1,
113 'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.targetField',
114 'config' => Array (
115 'type' => 'select',
116 'items' => Array (
117 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.targetField.I.0', '0'),
118 ),
119 'itemsProcFunc' => 'Tx_PowermailCond_Utility_FieldlistingBackend->getFieldname',
120 'itemsProcFunc_addFieldsets' => 1, // add fieldsets
121 'size' => 1,
122 'maxitems' => 1,
123 'eval' => 'required'
124 ),
125 'displayCond' => 'FIELD:form:>:0'
126 ),
127 'actions' => Array (
128 'exclude' => 1,
129 'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action',
130 'config' => Array (
131 'type' => 'select',
132 'items' => Array (
133 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.main', '--div--'), // title main
134 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.0', '0'), // hide
135 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.1', '1'), // unhide
136 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.additional', '--div--'), // title additional
137 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.2', '2'), // filter selectbox
138 ),
139 'size' => 1,
140 'maxitems' => 1,
141 ),
142 'displayCond' => 'FIELD:form:>:0'
143 ),
144 'filterSelectField' => Array (
145 'exclude' => 1,
146 'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.filterSelectField',
147 'config' => Array (
148 'type' => 'select',
149 'items' => Array (
150 ),
151 'itemsProcFunc' => 'Tx_PowermailCond_Utility_FieldlistingBackend->valuesFromPowermailSelectbox',
152 'size' => 4,
153 'maxitems' => 1000,
154 'allowNonIdValues' => 1
155 ),
156 'displayCond' => 'FIELD:actions:IN:2,FIELD:form:>:0' // show only if ops value is greater than 1
157 ),
158 'rules' => Array (
159 'exclude' => 1,
160 'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.rules',
161 'config' => Array (
162 'type' => 'inline',
163 'foreign_table' => 'tx_powermailcond_domain_model_rule',
164 'foreign_table_where' => 'AND tx_powermailcond_domain_model_rule.pid=###CURRENT_PID### ORDER BY tx_powermailcond_domain_model_rule.sorting',
165 'foreign_field' => 'conditions',
166 'maxitems' => 99,
167 'appearance' => array(
168 'collapseAll' => 1,
169 'expandSingle' => 1,
170 'useSortable' => 1,
171 'newRecordLinkAddTitle' => 1,
172 'newRecordLinkPosition' => 'both',
173 ),
174 ),
175 'displayCond' => 'FIELD:form:>:0'
176 ),
177 'conjunction' => Array (
178 'exclude' => 1,
179 'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction',
180 'config' => Array (
181 'type' => 'select',
182 'items' => Array (
183 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction.I.1', 'OR'), // OR
184 Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction.I.0', 'AND'), // AND
185 ),
186 'size' => 1,
187 'maxitems' => 1,
188 ),
189 'displayCond' => 'FIELD:form:>:0'
190 ),
191 ),
192 );
193
194 ?>