PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.12
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.12
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Services / FormBuilder / ValidationRuleSettings.php

ValidationRuleSettings.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.12, at app/Services/FormBuilder/ValidationRuleSettings.php

277 lines 8.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * validation_rule_settings
5 *
6 * Returns an array of countries and codes.
7 *
8 * @author WooThemes
9 *
10 * @category i18n
11 * @package fluentform/i18n
12 *
13 * @version 2.5.0
14 */
15 if (! defined('ABSPATH')) {
16 exit;
17 }
18
19 $fluentformFileTypeOptions = [
20 [
21 'label' => __('Images (jpg, jpeg, gif, png, bmp)', 'fluentform'),
22 'value' => 'jpg|jpeg|gif|png|bmp',
23 ],
24 [
25 'label' => __('Audio (mp3, wav, ogg, oga, wma, mka, m4a, ra, mid, midi)', 'fluentform'),
26 'value' => 'mp3|wav|ogg|oga|wma|mka|m4a|ra|mid|midi|mpga',
27 ],
28 [
29 'label' => __('Video (avi, divx, flv, mov, ogv, mkv, mp4, m4v, divx, mpg, mpeg, mpe)', 'fluentform'),
30 'value' => 'avi|divx|flv|mov|ogv|mkv|mp4|m4v|divx|mpg|mpeg|mpe|video/quicktime|qt',
31 ],
32 [
33 'label' => __('PDF (pdf)', 'fluentform'),
34 'value' => 'pdf',
35 ],
36 [
37 'label' => __('Docs (doc, ppt, pps, xls, mdb, docx, xlsx, pptx, odt, odp, ods, odg, odc, odb, odf, rtf, txt)', 'fluentform'),
38 'value' => 'doc|ppt|pps|xls|mdb|docx|xlsx|pptx|odt|odp|ods|odg|odc|odb|odf|rtf|txt',
39 ],
40 [
41 'label' => __('Zip Archives (zip, gz, gzip, rar, 7z)', 'fluentform'),
42 'value' => 'zip|gz|gzip|rar|7z',
43 ],
44 [
45 'label' => __('Executable Files (exe)', 'fluentform'),
46 'value' => 'exe',
47 ],
48 [
49 'label' => __('CSV (csv)', 'fluentform'),
50 'value' => 'csv',
51 ],
52 ];
53
54 $fluentformFileTypeOptions = apply_filters_deprecated(
55 'fluentform_file_type_options',
56 [
57 $fluentformFileTypeOptions
58 ],
59 FLUENTFORM_FRAMEWORK_UPGRADE,
60 'fluentform/file_type_options',
61 'Use fluentform/file_type_options instead of fluentform_file_type_options.'
62 );
63
64 $fluentformFileTypeOptions = apply_filters('fluentform/file_type_options', $fluentformFileTypeOptions);
65
66 $fluentformImageTypeOptions = [
67 [
68 'label' => __('JPG', 'fluentform'),
69 'value' => 'jpg|jpeg',
70 ],
71 [
72 'label' => __('PNG', 'fluentform'),
73 'value' => 'png',
74 ],
75 [
76 'label' => __('GIF', 'fluentform'),
77 'value' => 'gif',
78 ],
79 ];
80
81 $fluentformImageTypeOptions = apply_filters('fluentform/image_type_options', $fluentformImageTypeOptions);
82
83 $fluentformValidationRuleSettings = [
84 'required' => [
85 'template' => 'inputRadio',
86 'label' => __('Required', 'fluentform'),
87 'help_text' => __('Select whether this field is a required field for the form or not.', 'fluentform'),
88 'options' => [
89 [
90 'value' => true,
91 'label' => __('Yes', 'fluentform'),
92 ],
93 [
94 'value' => false,
95 'label' => __('No', 'fluentform'),
96 ],
97 ],
98 ],
99 'valid_phone_number' => [
100 'template' => 'inputRadio',
101 'label' => __('Validate Phone Number', 'fluentform'),
102 'help_text' => __('Select whether the phone number should be validated or not.', 'fluentform'),
103 'options' => [
104 [
105 'value' => true,
106 'label' => __('Yes', 'fluentform'),
107 ],
108 [
109 'value' => false,
110 'label' => __('No', 'fluentform'),
111 ],
112 ],
113 ],
114 'email' => [
115 'template' => 'inputRadio',
116 'label' => __('Validate Email', 'fluentform'),
117 'help_text' => __('Select whether to validate this field as email or not', 'fluentform'),
118 'options' => [
119 [
120 'value' => true,
121 'label' => __('Yes', 'fluentform'),
122 ],
123 [
124 'value' => false,
125 'label' => __('No', 'fluentform'),
126 ],
127 ],
128 ],
129 'url' => [
130 'template' => 'inputRadio',
131 'label' => __('Validate URL', 'fluentform'),
132 'help_text' => __('Select whether to validate this field as URL or not', 'fluentform'),
133 'options' => [
134 [
135 'value' => true,
136 'label' => __('Yes', 'fluentform'),
137 ],
138 [
139 'value' => false,
140 'label' => __('No', 'fluentform'),
141 ],
142 ],
143 ],
144 'min' => [
145 'template' => 'inputText',
146 'type' => 'number',
147 'label' => __('Min Value', 'fluentform'),
148 'help_text' => __('Minimum value for the input field.', 'fluentform'),
149 ],
150 'digits' => [
151 'template' => 'inputText',
152 'type' => 'number',
153 'label' => __('Digits', 'fluentform'),
154 'help_text' => __('Number of digits for the input field.', 'fluentform'),
155 ],
156 'max' => [
157 'template' => 'inputText',
158 'type' => 'number',
159 'label' => __('Max Value', 'fluentform'),
160 'help_text' => __('Maximum value for the input field.', 'fluentform'),
161 ],
162 'max_file_size' => [
163 'template' => 'maxFileSize',
164 'label' => __('Max File Size', 'fluentform'),
165 'help_text' => __('The file size limit uploaded by the user.', 'fluentform'),
166 ],
167 'max_file_count' => [
168 'template' => 'inputText',
169 'type' => 'number',
170 'label' => __('Max Files Count', 'fluentform'),
171 'help_text' => __('Maximum user file upload number.', 'fluentform'),
172 ],
173 'allowed_file_types' => [
174 'template' => 'inputCheckbox',
175 'label' => __('Allowed Files', 'fluentform'),
176 'help_text' => __('Allowed Files', 'fluentform'),
177 'fileTypes' => [
178 [
179 'title' => __('Images', 'fluentform'),
180 'types' => ['jpg', 'jpeg', 'gif', 'png', 'bmp'],
181 ],
182 [
183 'title' => __('Audio', 'fluentform'),
184 'types' => ['mp3', 'wav', 'ogg', 'oga', 'wma', 'mka', 'm4a', 'ra', 'mid', 'midi'],
185 ],
186 [
187 'title' => __('Video', 'fluentform'),
188 'types' => [
189 'avi',
190 'divx',
191 'flv',
192 'mov',
193 'ogv',
194 'mkv',
195 'mp4',
196 'm4v',
197 'divx',
198 'mpg',
199 'mpeg',
200 'mpe',
201 ],
202 ],
203 [
204 'title' => __('PDF', 'fluentform'),
205 'types' => ['pdf'],
206 ],
207 [
208 'title' => __('Docs', 'fluentform'),
209 'types' => [
210 'doc',
211 'ppt',
212 'pps',
213 'xls',
214 'mdb',
215 'docx',
216 'xlsx',
217 'pptx',
218 'odt',
219 'odp',
220 'ods',
221 'odg',
222 'odc',
223 'odb',
224 'odf',
225 'rtf',
226 'txt',
227 ],
228 ],
229 [
230 'title' => __('Zip Archives', 'fluentform'),
231 'types' => ['zip', 'gz', 'gzip', 'rar', '7z', ],
232 ],
233 [
234 'title' => __('Executable Files', 'fluentform'),
235 'types' => ['exe'],
236 ],
237 [
238 'title' => __('CSV', 'fluentform'),
239 'types' => ['csv'],
240 ],
241 ],
242 'options' => $fluentformFileTypeOptions,
243 ],
244 'allowed_image_types' => [
245 'template' => 'inputCheckbox',
246 'label' => __('Allowed Images', 'fluentform'),
247 'help_text' => __('Allowed Images', 'fluentform'),
248 'fileTypes' => [
249 [
250 'title' => __('JPG', 'fluentform'),
251 'types' => ['jpg|jpeg', ],
252 ],
253 [
254 'title' => __('PNG', 'fluentform'),
255 'types' => ['png'],
256 ],
257 [
258 'title' => __('GIF', 'fluentform'),
259 'types' => ['gif'],
260 ],
261 ],
262 'options' => $fluentformImageTypeOptions,
263 ],
264 ];
265
266 $fluentformValidationRuleSettings = apply_filters_deprecated(
267 'fluent_editor_validation_rule_settings',
268 [
269 $fluentformValidationRuleSettings
270 ],
271 FLUENTFORM_FRAMEWORK_UPGRADE,
272 'fluentform/editor_validation_rule_settings',
273 'Use fluentform/editor_validation_rule_settings instead of fluent_editor_validation_rule_settings.'
274 );
275
276 return apply_filters('fluentform/editor_validation_rule_settings', $fluentformValidationRuleSettings);
277