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

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