PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.17.6
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.17.6
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 2.17.6, at includes/Core/Migration/FieldsConversionFormate.php

443 lines 15.3 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' => str_replace('/v1', '', BITFORMS_ASSET_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 'optionIcon' => false,
315 'placeholder' => 'Select an option',
316 'showSearchPh' => true,
317 'searchPlaceholder' => 'Search options..',
318 'maxHeight' => 400,
319 'multipleSelect' => true,
320 'showChip' => true,
321 'selectedOptImgSrc' => 'test.png',
322 'closeOnSelect' => false,
323 'activeList' => 0,
324 'allowCustomOption' => false
325 ]
326 ],
327 'removeProperty' => ['mul']
328 ],
329 'country' => [
330 'unchangeProperty'=> ['lbl', 'ph', 'mul', 'valid', 'err', 'adminLbl', 'val', 'customOpt', 'mn', 'mx'],
331 'changedProperty' => [
332 'opt' => [['path' => 'options']]
333 ],
334 'newProperty' => [
335 'typ' => 'country',
336 'valid->reqShow' => true,
337 'valid->reqPos' => 'after',
338 'customClasses' => (object)[],
339 'customAttributes' => (object)[],
340 'fieldName' => 'country',
341 'phHide' => true,
342 'adminLblHide' => true,
343 'config' => [
344 'selectedFlagImage' => true,
345 'selectedCountryClearable'=> true,
346 'searchClearable' => true,
347 'optionFlagImage' => true,
348 'detectCountryByIp' => false,
349 'detectCountryByGeo' => false,
350 'defaultValue' => '',
351 'showSearchPh' => true,
352 'searchPlaceholder' => 'Search for countries',
353 'noCountryFoundText' => 'No Country Found'
354 ]
355 ],
356 'removeProperty' => ['mul']
357 ],
358 'recaptcha' => [
359 'unchangeProperty'=> ['typ', 'lbl', 'valid'],
360 'changedProperty' => [
361 'theme' => [['path' => 'config->theme']]
362 ],
363 'newProperty' => [
364 'fieldName' => 'recaptcha',
365 'config' => [
366 'theme' => 'light',
367 'size' => 'normal',
368 ],
369 ],
370 'removeProperty' => ['theme']
371 ],
372 'html' => [
373 'unchangeProperty'=> ['typ', 'valid', 'content'],
374 'changedProperty' => [],
375 'newProperty' => [
376 'customClasses' => (object)[],
377 'customAttributes' => (object)[],
378 'fieldName' => 'html',
379 'adminLbl' => 'HTML',
380 'adminLblHide' => true,
381 ],
382 'removeProperty' => ['lbl']
383 ],
384 'paypal' => [
385 'unchangeProperty'=> [
386 'typ',
387 'valid',
388 'payIntegID',
389 'currency',
390 'locale',
391 'disableFunding',
392 'amount',
393 'amountType',
394 'amountFld',
395 'shipping',
396 'shippingType',
397 'shippingFld',
398 'tax',
399 'taxType',
400 'taxFld',
401 'payType',
402 'planId'],
403 'changedProperty' => [],
404 'newProperty' => [
405 'fieldName' => 'paypal',
406 'adminLbl' => 'Paypal',
407 'adminLblHide'=> true,
408 'style' => [
409 'layout'=> 'vertical',
410 'color' => 'gold',
411 'shape' => 'rect',
412 'label' => 'paypal',
413 'height'=> '55'
414 ]
415 ],
416 'removeProperty' => []
417 ],
418 'razorpay' => [
419 'unchangeProperty'=> [
420 'typ',
421 'lbl',
422 'valid',
423 'btnTxt',
424 'btnSiz',
425 'align',
426 'fulW',
427 'options'],
428 'changedProperty' => [
429 'options->payIntegID' => [['path' => 'payIntegID']]
430 ],
431 'newProperty' => [
432 'customClasses' => (object)[],
433 'customAttributes' => (object)[],
434 'fieldName' => 'razorpay',
435 ],
436 'removeProperty' => ['options->payIntegID']
437 ],
438 ];
439
440 return $formate[$fieldType];
441 }
442 }
443