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 / Fallback / Message.php

Message.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 2.0, at includes/Core/Fallback/Message.php

156 lines 5.1 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\Fallback;
4
5 use BitCode\BitForm\Core\Database\SuccessMessageModel;
6
7 class Message {
8 public function confirmation() {
9 $sucMsgMdl = new SuccessMessageModel();
10 $messages = $sucMsgMdl->get(
11 ['id', 'message_config']
12 );
13
14 if (!is_wp_error($messages)) {
15 foreach ($messages as $msg) {
16 $messageId = $msg->id;
17 $messageConfig = new \stdClass();
18 $messageConfig->msgType = 'snackbar';
19 $messageConfig->position = 'bottom-right';
20 $messageConfig->animation = 'slide-up';
21 $messageConfig->autoHide = true;
22 $messageConfig->duration = 5;
23
24 $styles = [
25 'width' => '300px',
26 'padding' => '5px 35px 5px 20px',
27 'background' => '#fafafa',
28 'color' => '#000000',
29 'borderWidth' => '1px',
30 'borderType' => 'solid',
31 'borderColor' => 'gray',
32 'borderRadius' => '10px',
33 'boxShadow' => [
34 [
35 'x' => '0px',
36 'y' => '27px',
37 'blur' => '30px',
38 'spread' => '',
39 'color' => "rgb(0 0 0 \/ 18%)",
40 'inset' => '',
41 ],
42 [
43 'x' => '0px',
44 'y' => '5.2px',
45 'blur' => '9.4px',
46 'spread' => '5px',
47 'color' => "rgb(0 0 0 \/ 6%)",
48 'inset' => '',
49 ],
50 [
51 'x' => '0px',
52 'y' => '11.1px',
53 'blur' => '14px',
54 'spread' => '',
55 'color' => "rgb(0 0 0 \/ 14%)",
56 'inset' => '',
57 ],
58 ],
59 'closeBackground' => '#48484829',
60 'closeHover' => '#dfdfdf',
61 'closeIconColor' => '#5a5a5a',
62 'closeIconHover' => '#000',
63 ];
64
65 $stylesObj = [
66 ".msg-container-$messageId" => [
67 'display' => 'flex',
68 'justify-content' => 'center',
69 'align-items' => 'center',
70 'position' => 'fixed',
71 'z-ndex' => 999,
72 'width' => '300px',
73 'height' => 'auto',
74 'visibility' => 'hidden',
75 'opacity' => 0,
76 'transition' => 'opacity 0.4s',
77 'left' => '50%',
78 'margin-eft' => '-200px',
79 'top' => '30px',
80 ],
81 ".msg-container-$messageId.active" => [
82 'opacity' => 1,
83 'visibility' => 'visible',
84 ],
85 ".msg-container-$messageId.deactive" => [
86 'opacity' => 0,
87 'visibility' => 'hidden',
88 'transition' => 'opacity 0.4s, visibility 0s ease-out 0.4s',
89 ],
90 ".msg-background-$messageId" => [
91 'width' => '100%',
92 'height' => '100%',
93 'display' => 'flex',
94 'justify-content' => 'center',
95 'align-items' => 'center',
96 'background' => 'rgba(0, 0, 0, 0.0)',
97 ],
98 ".msg-content-$messageId" => [
99 'background' => '#fafafa',
100 'padding' => '5px 35px 5px 20px',
101 'border-width' => '1px',
102 'border-style' => 'solid',
103 'border-color' => 'gray',
104 'border-radius' => '10px',
105 'width' => '100%',
106 'margin' => 'auto',
107 'position' => 'relative',
108 'word-break' => 'break-all',
109 'box-shadow' => '0px 27px 30px rgb(0 0 0 / 18%) ,0px 5.2px 9.4px 5px rgb(0 0 0 / 6%) ,0px 11.1px 14px rgb(0 0 0 / 14%) ',
110 ],
111 ".close-$messageId" => [
112 'color' => '#5a5a5a',
113 'background' => '#48484829',
114 'position' => 'absolute',
115 'right' => '7px',
116 'top' => '50%',
117 'transform' => 'translateY(-50%)',
118 'height' => '25px',
119 'width' => '25px',
120 'border' => 'none',
121 'border-radius' => '50%',
122 'padding' => 0,
123 'display' => 'grid',
124 'place-content' => 'center',
125 'cursor' => 'pointer',
126 ],
127 ".close-$messageId:hover" => [
128 'color' => '#000',
129 'background' => '#dfdfdf',
130 ],
131 ".close-$messageId:focus" => [
132 'color' => '#000',
133 ],
134 ".close-icn-$messageId" => [
135 'width' => '15px',
136 'height' => '15px',
137 'stroke-width' => 2,
138 ],
139 ];
140
141 $messageConfig->styles = $styles;
142 $messageConfig->stylesObj = $stylesObj;
143
144 $sucMsgMdl->update(
145 [
146 'message_config' => wp_json_encode($messageConfig),
147 ],
148 [
149 'id' => $messageId,
150 ]
151 );
152 }
153 }
154 }
155 }
156