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

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