PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.2.1
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.2.1
V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 2.10.2 All 137 releases
bit-form / includes / Core / Migration / FieldsConversionFormate.php

FieldsConversionFormate.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 3.2.1, at includes/Core/Migration/FieldsConversionFormate.php

446 lines 15.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace BitCode\BitForm\Core\Migration;
4
5 class FieldsConversionFormate
6 {
7 public static function getFormate($fieldType)
8 {
9 $formate = [
10 'button' => [
11 'unchangeProperty'=> ['typ', 'valid', 'btnSiz', 'btnTyp', 'txt', 'fulW'],
12 'changedProperty' => [],
13 'newProperty' => [
14 'icn' => ['pos' => '', 'url' => ''],
15 'align' => 'end',
16 'customClasses' => (object)[],
17 'customAttributes' => (object)[],
18 'fieldName' => 'button',
19 ],
20 'removeProperty' => []
21 ],
22 'text' => [
23 'unchangeProperty'=> ['typ', 'lbl', 'valid', 'err', 'adminLbl', 'ac', 'ph'],
24 'changedProperty' => [],
25 'newProperty' => [
26 'valid->reqShow' => true,
27 'valid->reqPos' => 'after',
28 'customClasses' => (object)[],
29 'customAttributes' => (object)[],
30 'fieldName' => 'text',
31 'phHide' => true,
32 'adminLblHide' => true,
33 ],
34 'removeProperty' => []
35 ],
36 'username' => [
37 'unchangeProperty'=> ['typ', 'lbl', 'valid', 'err', 'adminLbl', 'ph'],
38 'changedProperty' => [],
39 'newProperty' => [
40 'valid->reqShow' => true,
41 'valid->reqPos' => 'after',
42 'customClasses' => (object)[],
43 'customAttributes' => (object)[],
44 'fieldName' => 'username',
45 'phHide' => true,
46 'adminLblHide' => true,
47 ],
48 'removeProperty' => []
49 ],
50 'textarea' => [
51 'unchangeProperty'=> ['typ', 'lbl', 'valid', 'err', 'adminLbl', 'ph'],
52 'changedProperty' => [],
53 'newProperty' => [
54 'valid->reqShow' => true,
55 'valid->reqPos' => 'after',
56 'customClasses' => (object)[],
57 'customAttributes' => (object)[],
58 'fieldName' => 'textarea',
59 'phHide' => true,
60 'adminLblHide' => true,
61 ],
62 'removeProperty' => []
63 ],
64 'check' => [
65 'unchangeProperty'=> ['typ', 'lbl', 'opt', 'valid', 'err', 'adminLbl', 'mn', 'mx', 'customType'],
66 'changedProperty' => [],
67 'newProperty' => [
68 'valid->reqShow' => true,
69 'valid->reqPos' => 'after',
70 'optionCol' => 1,
71 'customClasses' => (object)[],
72 'customAttributes' => (object)[],
73 'fieldName' => 'check',
74 'phHide' => true,
75 'adminLblHide' => true,
76 ],
77 'removeProperty' => ['round']
78 ],
79 'radio' => [
80 'unchangeProperty'=> ['typ', 'lbl', 'opt', 'valid', 'err', 'adminLbl', 'customType'],
81 'changedProperty' => [],
82 'newProperty' => [
83 'valid->reqShow' => true,
84 'valid->reqPos' => 'after',
85 'optionCol' => 1,
86 'customClasses' => (object)[],
87 'customAttributes' => (object)[],
88 'fieldName' => 'radio',
89 'phHide' => true,
90 'adminLblHide' => true,
91 'round' => true,
92 ],
93 'removeProperty' => []
94 ],
95 'email' => [
96 'unchangeProperty'=> ['typ', 'lbl', 'valid', 'err', 'adminLbl', 'pattern', 'ph', 'ac'],
97 'changedProperty' => [],
98 'newProperty' => [
99 'valid->reqShow' => true,
100 'valid->reqPos' => 'after',
101 'customClasses' => (object)[],
102 'customAttributes' => (object)[],
103 'fieldName' => 'email',
104 'phHide' => true,
105 'adminLblHide' => true,
106 'acHide' => true,
107 ],
108 'removeProperty' => []
109 ],
110 'password' => [
111 'unchangeProperty'=> ['typ', 'lbl', 'valid', 'err', 'adminLbl', 'ph'],
112 'changedProperty' => [],
113 'newProperty' => [
114 'valid->reqShow' => true,
115 'valid->reqPos' => 'after',
116 'customClasses' => (object)[],
117 'customAttributes' => (object)[],
118 'fieldName' => 'password',
119 'phHide' => true,
120 'adminLblHide' => true,
121 ],
122 'removeProperty' => ['ac']
123 ],
124 'number' => [
125 'unchangeProperty'=> ['typ', 'lbl', 'valid', 'err', 'adminLbl', 'ph', 'ac', 'mn', 'mx'],
126 'changedProperty' => [],
127 'newProperty' => [
128 'valid->reqShow' => true,
129 'valid->reqPos' => 'after',
130 'customClasses' => (object)[],
131 'customAttributes' => (object)[],
132 'fieldName' => 'number',
133 'phHide' => true,
134 'adminLblHide' => true,
135 ],
136 'removeProperty' => []
137 ],
138 'url' => [
139 'unchangeProperty'=> ['typ', 'attr', 'lbl', 'valid', 'err', 'adminLbl', 'ph', 'ac'],
140 'changedProperty' => [],
141 'newProperty' => [
142 'valid->reqShow' => true,
143 'valid->reqPos' => 'after',
144 'customClasses' => (object)[],
145 'customAttributes' => (object)[],
146 'fieldName' => 'url',
147 'phHide' => true,
148 'adminLblHide' => true,
149 ],
150 'removeProperty' => []
151 ],
152 'file-up' => [
153 'unchangeProperty'=> ['typ', 'lbl', 'valid', 'err', 'adminLbl'],
154 'changedProperty' => [
155 'upBtnTxt' => [['path' => 'btnTxt']],
156 'mul' => [['path' => 'config->multiple']],
157 'mxUp' => [['path' => 'config->maxSize'],
158 ['path' => 'config->allowMaxSize', 'isEqualTo' => null, 'val' => false],
159 ['path' => 'config->showMaxSize', 'isEqualTo' => null, 'val' => false]],
160 'unit' => [['path' => 'config->sizeUnit']],
161 'exts' => [['path' => 'config->allowedFileType']],
162 ],
163 'newProperty' => [
164 'valid->reqShow' => true,
165 'valid->reqPos' => 'after',
166 'customClasses' => (object)[],
167 'customAttributes' => (object)[],
168 'fieldName' => 'file-up',
169 'phHide' => true,
170 'adminLblHide' => true,
171 'prefixIcn' => BITFORMS_ROOT_URI . '/static/file-upload/paperclip.svg',
172 'btnTxt' => 'Attach File',
173 'config' => [
174 'multiple' => false,
175 'allowMaxSize' => true,
176 'showMaxSize' => true,
177 'maxSize' => 2,
178 'sizeUnit' => 'MB',
179 'isItTotalMax' => false,
180 'showSelectStatus'=> true,
181 'fileSelectStatus'=> 'No File Selected',
182 'allowedFileType' => '',
183 'showFileList' => true,
184 'fileExistMsg' => 'A file allready exist',
185 'showFilePreview' => true,
186 'showFileSize' => true,
187 'duplicateAllow' => false,
188 'accept' => '',
189 'minFile' => 0,
190 'maxFile' => 0
191 ]
192 ],
193 'removeProperty' => ['mul', 'mxUp', 'unit', 'exts', 'upBtnTxt']
194 ],
195 'date' => [
196 'unchangeProperty'=> ['typ', 'lbl', 'valid', 'err', 'adminLbl'],
197 'changedProperty' => [],
198 'newProperty' => [
199 'valid->reqShow' => true,
200 'valid->reqPos' => 'after',
201 'customClasses' => (object)[],
202 'customAttributes' => (object)[],
203 'fieldName' => 'date',
204 'adminLblHide' => true,
205 ],
206 'removeProperty' => []
207 ],
208 'time' => [
209 'unchangeProperty'=> ['typ', 'lbl', 'valid', 'err', 'adminLbl'],
210 'changedProperty' => [],
211 'newProperty' => [
212 'valid->reqShow' => true,
213 'valid->reqPos' => 'after',
214 'customClasses' => (object)[],
215 'customAttributes' => (object)[],
216 'fieldName' => 'time',
217 'adminLblHide' => true,
218 ],
219 'removeProperty' => []
220 ],
221 'month' => [
222 'unchangeProperty'=> ['typ', 'lbl', 'valid', 'err', 'adminLbl'],
223 'changedProperty' => [],
224 'newProperty' => [
225 'valid->reqShow' => true,
226 'valid->reqPos' => 'after',
227 'customClasses' => (object)[],
228 'customAttributes' => (object)[],
229 'fieldName' => 'month',
230 'adminLblHide' => true,
231 ],
232 'removeProperty' => []
233 ],
234 'week' => [
235 'unchangeProperty'=> ['typ', 'lbl', 'valid', 'err', 'adminLbl'],
236 'changedProperty' => [],
237 'newProperty' => [
238 'valid->reqShow' => true,
239 'valid->reqPos' => 'after',
240 'customClasses' => (object)[],
241 'customAttributes' => (object)[],
242 'fieldName' => 'week',
243 'adminLblHide' => true,
244 ],
245 'removeProperty' => []
246 ],
247 'datetime-local' => [
248 'unchangeProperty'=> ['typ', 'lbl', 'valid', 'err', 'adminLbl'],
249 'changedProperty' => [],
250 'newProperty' => [
251 'valid->reqShow' => true,
252 'valid->reqPos' => 'after',
253 'customClasses' => (object)[],
254 'customAttributes' => (object)[],
255 'fieldName' => 'datetime-local',
256 'adminLblHide' => true,
257 ],
258 'removeProperty' => []
259 ],
260 'color' => [
261 'unchangeProperty'=> ['typ', 'lbl', 'valid', 'err', 'adminLbl'],
262 'changedProperty' => [],
263 'newProperty' => [
264 'valid->reqShow' => true,
265 'valid->reqPos' => 'after',
266 'customClasses' => (object)[],
267 'customAttributes' => (object)[],
268 'fieldName' => 'color',
269 'adminLblHide' => true,
270 ],
271 'removeProperty' => []
272 ],
273 'decision-box' => [
274 'unchangeProperty'=> ['typ', 'lbl', 'msg', 'valid', 'err', 'adminLbl'],
275 'changedProperty' => [],
276 'newProperty' => [
277 'valid->reqShow' => true,
278 'valid->reqPos' => 'after',
279 'customClasses' => (object)[],
280 'customAttributes' => (object)[],
281 'fieldName' => 'decision-box',
282 'adminLblHide' => true,
283 ],
284 'removeProperty' => []
285 ],
286 'select' => [
287 'unchangeProperty'=> ['typ', 'lbl', 'ph', 'mul', 'valid', 'err', 'adminLbl', 'val', 'mn', 'mx'],
288 'changedProperty' => [
289 'mul' => [
290 ['path' => 'config->multipleSelect'],
291 ['path' => 'config->showChip', 'isEqualTo' => false, 'val' => false],
292 ['path' => 'config->closeOnSelect', 'isEqualTo' => false, 'val' => true]
293 ],
294 'opt' => [['path' => 'optionsList->0->List-1']],
295 'customOpt' => [['path' => 'config->allowCustomOption']],
296 'ph' => [['path' => 'ph', 'val' => 'Select...']],
297 'customType'=> [['path' => 'customTypeList->0']],
298 ],
299 'newProperty' => [
300 'valid->reqShow' => true,
301 'valid->reqPos' => 'after',
302 'customClasses' => (object)[],
303 'customAttributes' => (object)[],
304 'fieldName' => 'select',
305 'phHide' => true,
306 'adminLblHide' => true,
307 'optionsList' => [
308 ['List-1' => []]
309 ],
310 'config' => [
311 'selectedOptImage' => false,
312 'selectedOptClearable'=> true,
313 'searchClearable' => true,
314 'showSearch' => true,
315 'optionIcon' => false,
316 'placeholder' => 'Select an option',
317 'showSearchPh' => true,
318 'searchPlaceholder' => 'Search options..',
319 'maxHeight' => 400,
320 'multipleSelect' => true,
321 'showChip' => true,
322 'selectedOptImgSrc' => 'test.png',
323 'closeOnSelect' => false,
324 'activeList' => 0,
325 'allowCustomOption' => false
326 ]
327 ],
328 'removeProperty' => ['mul']
329 ],
330 'country' => [
331 'unchangeProperty'=> ['lbl', 'ph', 'mul', 'valid', 'err', 'adminLbl', 'val', 'customOpt', 'mn', 'mx'],
332 'changedProperty' => [
333 'opt' => [['path' => 'options']]
334 ],
335 'newProperty' => [
336 'typ' => 'country',
337 'valid->reqShow' => true,
338 'valid->reqPos' => 'after',
339 'customClasses' => (object)[],
340 'customAttributes' => (object)[],
341 'fieldName' => 'country',
342 'phHide' => true,
343 'adminLblHide' => true,
344 'config' => [
345 'selectedFlagImage' => true,
346 'selectedCountryClearable'=> true,
347 'searchClearable' => true,
348 'optionFlagImage' => true,
349 'detectCountryByIp' => false,
350 'detectCountryByGeo' => false,
351 'defaultValue' => '',
352 'showSearchPh' => true,
353 'searchPlaceholder' => 'Search for countries',
354 'noCountryFoundText' => 'No Country Found'
355 ]
356 ],
357 'removeProperty' => ['mul']
358 ],
359 'recaptcha' => [
360 'unchangeProperty'=> ['typ', 'lbl', 'valid'],
361 'changedProperty' => [
362 'theme' => [['path' => 'config->theme']]
363 ],
364 'newProperty' => [
365 'fieldName' => 'recaptcha',
366 'config' => [
367 'theme' => 'light',
368 'size' => 'normal',
369 ],
370 ],
371 'removeProperty' => ['theme']
372 ],
373 'html' => [
374 'unchangeProperty'=> ['typ', 'valid', 'content'],
375 'changedProperty' => [],
376 'newProperty' => [
377 'customClasses' => (object)[],
378 'customAttributes' => (object)[],
379 'fieldName' => 'html',
380 'adminLbl' => 'HTML',
381 'adminLblHide' => true,
382 ],
383 'removeProperty' => ['lbl']
384 ],
385 'paypal' => [
386 'unchangeProperty'=> [
387 'typ',
388 'valid',
389 'payIntegID',
390 'currency',
391 'locale',
392 'disableFunding',
393 'amount',
394 'amountType',
395 'amountFld',
396 'shipping',
397 'shippingType',
398 'shippingFld',
399 'tax',
400 'taxType',
401 'taxFld',
402 'payType',
403 'planId'],
404 'changedProperty' => [],
405 'newProperty' => [
406 'fieldName' => 'paypal',
407 'adminLbl' => 'Paypal',
408 'adminLblHide'=> true,
409 'style' => [
410 'layout'=> 'vertical',
411 'color' => 'gold',
412 'shape' => 'rect',
413 'label' => 'paypal',
414 'height'=> '55'
415 ]
416 ],
417 'removeProperty' => []
418 ],
419 'razorpay' => [
420 'unchangeProperty'=> [
421 'typ',
422 'lbl',
423 'valid',
424 'btnTxt',
425 'btnSiz',
426 'align',
427 'fulW',
428 'options'],
429 'changedProperty' => [
430 'options->payIntegID' => [['path' => 'payIntegID']]
431 ],
432 'newProperty' => [
433 'customClasses' => (object)[],
434 'customAttributes' => (object)[],
435 'fieldName' => 'razorpay',
436 ],
437 'removeProperty' => ['options->payIntegID']
438 ],
439 ];
440
441 // Unknown field type must not fatal mid-migration (undefined index +
442 // null dereference in the caller would leave form_content half-migrated)
443 return isset($formate[$fieldType]) ? $formate[$fieldType] : null;
444 }
445 }
446