Version Description
Download this release
Release Info
Developer | ataurr |
Plugin | Metform Elementor Contact Form Builder – Flexible and Design-Friendly Contact Form builder plugin for WordPress |
Version | 1.1.8 |
Comparing to | |
See all releases |
Code changes from version 1.1.7 to 1.1.8
- controls/assets/js/form-picker-inspactor.js +4 -3
- core/entries/action.php +37 -59
- core/entries/api.php +17 -0
- core/entries/form-data.php +96 -0
- core/entries/meta-data.php +28 -33
- core/forms/action.php +11 -3
- core/forms/cpt.php +18 -0
- core/forms/views/modal-editor.php +56 -0
- languages/metform.pot +2 -2
- metform.php +1 -1
- plugin.php +12 -3
- public/assets/css/admin-style.css +1 -1
- public/assets/css/category-top.css +8 -0
- public/assets/css/style.css +76 -31
- public/assets/js/admin-script.js +1 -1
- public/assets/js/inputs.js +1 -1
- public/assets/js/jquery.validate.min.js +4 -0
- public/assets/js/submission.js +1 -1
- readme.txt +30 -16
- traits/button-controls.php +13 -6
- traits/common-controls.php +71 -45
- widgets/button/button.php +11 -4
- widgets/checkbox/checkbox.php +6 -5
- widgets/email/email.php +3 -2
- widgets/form.php +9 -14
- widgets/listing-fname/listing-fname.php +3 -2
- widgets/listing-lname/listing-lname.php +4 -2
- widgets/listing-optin/listing-optin.php +7 -6
- widgets/manifest.php +6 -5
- widgets/number/number.php +4 -2
- widgets/password/password.php +2 -2
- widgets/radio/radio.php +6 -5
- widgets/range/range.php +27 -10
- widgets/rating/rating.php +2 -2
- widgets/switch/switch.php +130 -10
- widgets/telephone/telephone.php +10 -1
- widgets/text/text.php +3 -2
- widgets/textarea/textarea.php +3 -2
controls/assets/js/form-picker-inspactor.js
CHANGED
@@ -21,9 +21,7 @@ jQuery(window).on('elementor:init', function () {
|
|
21 |
clearTimeout(this.correctionTimeout);
|
22 |
|
23 |
var input = event.currentTarget,
|
24 |
-
value = this.getInputValue(input)
|
25 |
-
validators = this.validators.slice(0),
|
26 |
-
settingsValidators = this.elementSettingsModel.validators[this.model.get('name')];
|
27 |
|
28 |
//console.log(event.currentTarget);
|
29 |
//console.log(value);
|
@@ -37,6 +35,7 @@ jQuery(window).on('elementor:init', function () {
|
|
37 |
// console.log('boo');
|
38 |
clearInterval(window.metFormPickerInterval2555);
|
39 |
},
|
|
|
40 |
onRender: function onRender() {
|
41 |
ControlBaseDataView.prototype.onRender.apply(this, arguments);
|
42 |
var self = this;
|
@@ -45,6 +44,8 @@ jQuery(window).on('elementor:init', function () {
|
|
45 |
|
46 |
var formpicker_load = jQuery('body').attr('data-metform-template-load'),
|
47 |
formpicker_key = jQuery('body').attr('data-metform-template-key');
|
|
|
|
|
48 |
|
49 |
if(formpicker_load == 'true' && self.isRendered == true && formpicker_key !== undefined){
|
50 |
// console.log([formpicker_key, formpicker_load, self.isRendered, self.isDestroyed]);
|
21 |
clearTimeout(this.correctionTimeout);
|
22 |
|
23 |
var input = event.currentTarget,
|
24 |
+
value = this.getInputValue(input);
|
|
|
|
|
25 |
|
26 |
//console.log(event.currentTarget);
|
27 |
//console.log(value);
|
35 |
// console.log('boo');
|
36 |
clearInterval(window.metFormPickerInterval2555);
|
37 |
},
|
38 |
+
|
39 |
onRender: function onRender() {
|
40 |
ControlBaseDataView.prototype.onRender.apply(this, arguments);
|
41 |
var self = this;
|
44 |
|
45 |
var formpicker_load = jQuery('body').attr('data-metform-template-load'),
|
46 |
formpicker_key = jQuery('body').attr('data-metform-template-key');
|
47 |
+
|
48 |
+
// console.log(self.isRendered);
|
49 |
|
50 |
if(formpicker_load == 'true' && self.isRendered == true && formpicker_key !== undefined){
|
51 |
// console.log([formpicker_key, formpicker_load, self.isRendered, self.isDestroyed]);
|
core/entries/action.php
CHANGED
@@ -11,6 +11,7 @@ Class Action{
|
|
11 |
private $key_browser_data;
|
12 |
private $key_form_total_entries;
|
13 |
private $key_form_file;
|
|
|
14 |
private $post_type;
|
15 |
|
16 |
private $fields;
|
@@ -44,6 +45,7 @@ Class Action{
|
|
44 |
$this->key_form_id = 'metform_entries__form_id';
|
45 |
$this->key_form_data = 'metform_entries__form_data';
|
46 |
$this->key_form_file = 'metform_entries__file_upload';
|
|
|
47 |
$this->post_type = Init::instance()->cpt->get_name();
|
48 |
|
49 |
}
|
@@ -59,7 +61,8 @@ Class Action{
|
|
59 |
$this->response->data['form_data'] = $form_data;
|
60 |
$this->response->data['map_data'] = $this->fields;
|
61 |
|
62 |
-
$
|
|
|
63 |
|
64 |
if( !isset( $form_data['form_nonce'] ) || !wp_verify_nonce( $form_data['form_nonce'], 'form_nonce' ) ){
|
65 |
$this->response->status = 0;
|
@@ -197,7 +200,8 @@ Class Action{
|
|
197 |
$this->response->status = isset($response['status']) ? $response['status'] : 0;
|
198 |
}
|
199 |
|
200 |
-
$file_input_names = $this->
|
|
|
201 |
if( (!empty($file_data)) && ($file_input_names != null)){
|
202 |
$this->upload_file($file_data, $file_input_names);
|
203 |
}
|
@@ -211,7 +215,17 @@ Class Action{
|
|
211 |
if(isset($this->form_settings['enable_admin_notification']) && $this->form_settings['enable_admin_notification'] == 1){
|
212 |
|
213 |
$this->send_admin_email($this->form_data);
|
214 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
|
216 |
$this->response->data['message'] = $this->form_settings['success_message'];
|
217 |
return $this->response;
|
@@ -228,22 +242,22 @@ Class Action{
|
|
228 |
$field_count++;
|
229 |
$min = ( ( isset( $this->fields[$key]->mf_input_min_length ) && $this->fields[$key]->mf_input_min_length != '' ) ? $this->fields[$key]->mf_input_min_length : '' );
|
230 |
$max = ( ( isset( $this->fields[$key]->mf_input_max_length ) && $this->fields[$key]->mf_input_max_length != '' ) ? $this->fields[$key]->mf_input_max_length : '' );
|
231 |
-
$
|
232 |
$expression = ( (isset( $this->fields[$key]->mf_input_validation_expression ) && $this->fields[$key]->mf_input_validation_expression != '' ) ? $this->fields[$key]->mf_input_validation_expression : '' );
|
|
|
|
|
233 |
|
234 |
-
|
235 |
-
|
236 |
-
if( ( $length_type != 'none' ) && ( $min != '' ) && ( $min > $str_length ) ){
|
237 |
$errors++;
|
238 |
$this->response->status = 0;
|
239 |
-
$this->response->error[] = esc_html( ( ( $this->fields[$key]->mf_input_label != '' ) ? $this->fields[$key]->mf_input_label : $key ). " minimum input ". $min ." ".$
|
240 |
}
|
241 |
-
if( ( $
|
242 |
$errors++;
|
243 |
$this->response->status = 0;
|
244 |
-
$this->response->error[] = esc_html( ( ( $this->fields[$key]->mf_input_label != '' ) ? $this->fields[$key]->mf_input_label : $key ). " maximum input ". $max ." ".$
|
245 |
}
|
246 |
-
if( ( $expression != '' ) && ( !preg_match( "/".$expression."/", $value ) ) ){
|
247 |
$errors++;
|
248 |
$this->response->status = 0;
|
249 |
$this->response->error[] = esc_html( ( ( $this->fields[$key]->mf_input_label != '' ) ? $this->fields[$key]->mf_input_label : $key ). " input criteria is not matched.");
|
@@ -332,7 +346,7 @@ Class Action{
|
|
332 |
$user_email_attached_submision_copy = isset($this->form_settings['user_email_attach_submission_copy']) ? $this->form_settings['user_email_attach_submission_copy'] : null;
|
333 |
|
334 |
$body = "<html><body><h4 style='text-align: center;'>".$body."</h4>";
|
335 |
-
$form_html = \MetForm\Core\Entries\Form_Data::
|
336 |
$body .= $form_html."</body></html>";
|
337 |
|
338 |
$headers = 'MIME-Version: 1.0' . "\r\n";
|
@@ -344,13 +358,14 @@ Class Action{
|
|
344 |
|
345 |
if(!$user_mail){
|
346 |
$this->response->status = 0;
|
347 |
-
$this->response->error[] = esc_html__('
|
348 |
}else{
|
349 |
$status = wp_mail($user_mail, $subject, $body, $headers);
|
350 |
$this->response->status = ($status) ? 1 : 0;
|
351 |
}
|
352 |
|
353 |
}
|
|
|
354 |
public function send_admin_email($form_data){
|
355 |
|
356 |
$subject = isset($this->form_settings['admin_email_subject']) ? $this->form_settings['admin_email_subject'] : null;
|
@@ -360,7 +375,7 @@ Class Action{
|
|
360 |
$admin_email_attached_submision_copy = isset($this->form_settings['admin_email_attach_submission_copy']) ? $this->form_settings['admin_email_attach_submission_copy'] : null;
|
361 |
|
362 |
$body = "<html><body><h4 style='text-align: center;'>".$body."</h4>";
|
363 |
-
$form_html = \MetForm\Core\Entries\Form_Data::
|
364 |
$body .= $form_html."</body></html>";
|
365 |
|
366 |
$headers = 'MIME-Version: 1.0' . "\r\n";
|
@@ -415,7 +430,7 @@ Class Action{
|
|
415 |
|
416 |
}
|
417 |
|
418 |
-
$repeaters = $this->
|
419 |
|
420 |
$repeaters = (is_array($repeaters) ? $repeaters : []);
|
421 |
|
@@ -480,8 +495,8 @@ Class Action{
|
|
480 |
$user_agent = sanitize_text_field($_SERVER['HTTP_USER_AGENT']);
|
481 |
|
482 |
return [
|
483 |
-
'
|
484 |
-
'
|
485 |
];
|
486 |
}
|
487 |
|
@@ -489,14 +504,17 @@ Class Action{
|
|
489 |
return get_post_meta($form_id, $this->key_form_settings, true);
|
490 |
}
|
491 |
|
492 |
-
public function
|
|
|
493 |
if($fields != null){
|
494 |
$this->fields = $fields;
|
495 |
}
|
496 |
$response = [];
|
497 |
|
|
|
498 |
$files = array_values(array_filter($this->fields, function($v){
|
499 |
-
|
|
|
500 |
return $v;
|
501 |
}
|
502 |
}));
|
@@ -511,46 +529,6 @@ Class Action{
|
|
511 |
}
|
512 |
}
|
513 |
|
514 |
-
public function get_repeater_input_name($fields = null){
|
515 |
-
if($fields != null){
|
516 |
-
$this->fields = $fields;
|
517 |
-
}
|
518 |
-
$response = [];
|
519 |
-
|
520 |
-
$repeaters = array_values(array_filter($this->fields, function($v){
|
521 |
-
if($v->widgetType == 'mf-simple-repeater'){
|
522 |
-
return $v;
|
523 |
-
}
|
524 |
-
}));
|
525 |
-
foreach($repeaters as $repeater){
|
526 |
-
$response [] = $repeater->mf_input_name;
|
527 |
-
}
|
528 |
-
|
529 |
-
if(!empty($response)){
|
530 |
-
return $response;
|
531 |
-
}else{
|
532 |
-
return null;
|
533 |
-
}
|
534 |
-
}
|
535 |
-
|
536 |
-
public function get_email_name($fields = null){
|
537 |
-
if($fields != null){
|
538 |
-
$this->fields = $fields;
|
539 |
-
}
|
540 |
-
$response = null;
|
541 |
-
|
542 |
-
$email = array_values(array_filter($this->fields, function($v){
|
543 |
-
if($v->widgetType == 'mf-email'){
|
544 |
-
return $v;
|
545 |
-
}
|
546 |
-
}));
|
547 |
-
|
548 |
-
if(isset($email[0])){
|
549 |
-
$response = $email[0]->mf_input_name;
|
550 |
-
}
|
551 |
-
return $response;
|
552 |
-
}
|
553 |
-
|
554 |
public function process_repeater_data($repeater_data){
|
555 |
$data = [];
|
556 |
foreach($repeater_data as $index => $value){
|
11 |
private $key_browser_data;
|
12 |
private $key_form_total_entries;
|
13 |
private $key_form_file;
|
14 |
+
private $key_payment_status;
|
15 |
private $post_type;
|
16 |
|
17 |
private $fields;
|
45 |
$this->key_form_id = 'metform_entries__form_id';
|
46 |
$this->key_form_data = 'metform_entries__form_data';
|
47 |
$this->key_form_file = 'metform_entries__file_upload';
|
48 |
+
$this->key_payment_status = 'metform_entries__payment_status';
|
49 |
$this->post_type = Init::instance()->cpt->get_name();
|
50 |
|
51 |
}
|
61 |
$this->response->data['form_data'] = $form_data;
|
62 |
$this->response->data['map_data'] = $this->fields;
|
63 |
|
64 |
+
$email_name = $this->get_input_name_by_widget_type('mf-email');
|
65 |
+
$this->email_name = (isset($email_name[0]) ? $email_name[0] : null);
|
66 |
|
67 |
if( !isset( $form_data['form_nonce'] ) || !wp_verify_nonce( $form_data['form_nonce'], 'form_nonce' ) ){
|
68 |
$this->response->status = 0;
|
200 |
$this->response->status = isset($response['status']) ? $response['status'] : 0;
|
201 |
}
|
202 |
|
203 |
+
$file_input_names = $this->get_input_name_by_widget_type('mf-file-upload');
|
204 |
+
|
205 |
if( (!empty($file_data)) && ($file_input_names != null)){
|
206 |
$this->upload_file($file_data, $file_input_names);
|
207 |
}
|
215 |
if(isset($this->form_settings['enable_admin_notification']) && $this->form_settings['enable_admin_notification'] == 1){
|
216 |
|
217 |
$this->send_admin_email($this->form_data);
|
218 |
+
}
|
219 |
+
|
220 |
+
$paymet_method = $this->get_input_name_by_widget_type('mf-payment-method');
|
221 |
+
|
222 |
+
if(class_exists('\MetForm_Pro\Core\Integrations\Payment\Paypal') && isset($this->form_settings['mf_paypal']) && ($this->form_settings['mf_paypal_email'] != '') && ($paymet_method[0] != null) ){
|
223 |
+
if(isset($this->form_data[$paymet_method[0]])){
|
224 |
+
update_post_meta( $this->entry_id, $this->key_payment_status, 'unpaid');
|
225 |
+
$rest_url = get_rest_url( null, 'metform/v1/entries/');
|
226 |
+
$this->response->data['redirect_to'] = $rest_url."paypal/pay?entry_id=".$this->entry_id;
|
227 |
+
}
|
228 |
+
}
|
229 |
|
230 |
$this->response->data['message'] = $this->form_settings['success_message'];
|
231 |
return $this->response;
|
242 |
$field_count++;
|
243 |
$min = ( ( isset( $this->fields[$key]->mf_input_min_length ) && $this->fields[$key]->mf_input_min_length != '' ) ? $this->fields[$key]->mf_input_min_length : '' );
|
244 |
$max = ( ( isset( $this->fields[$key]->mf_input_max_length ) && $this->fields[$key]->mf_input_max_length != '' ) ? $this->fields[$key]->mf_input_max_length : '' );
|
245 |
+
$validation_type = ( (isset( $this->fields[$key]->mf_input_validation_type ) && $this->fields[$key]->mf_input_validation_type != '' ) ? $this->fields[$key]->mf_input_validation_type : 'none' );
|
246 |
$expression = ( (isset( $this->fields[$key]->mf_input_validation_expression ) && $this->fields[$key]->mf_input_validation_expression != '' ) ? $this->fields[$key]->mf_input_validation_expression : '' );
|
247 |
+
$type = str_replace(['by_', '_length'], '', $validation_type);
|
248 |
+
$str_length = ( ( $validation_type == 'by_word_length' ) ? str_word_count( $value ) : ( ( $validation_type == 'by_character_length' ) ? strlen( $value ) : '' ) );
|
249 |
|
250 |
+
if( ( !in_array($validation_type, ['none', 'by_expresssion_based']) ) && ( $min != '' ) && ( $min > $str_length ) ){
|
|
|
|
|
251 |
$errors++;
|
252 |
$this->response->status = 0;
|
253 |
+
$this->response->error[] = esc_html( ( ( $this->fields[$key]->mf_input_label != '' ) ? $this->fields[$key]->mf_input_label : $key ). " minimum input ". $min ." ".$type );
|
254 |
}
|
255 |
+
if( ( !in_array($validation_type, ['none', 'by_expresssion_based']) ) && ( $max != '' ) && ( $max < $str_length ) ){
|
256 |
$errors++;
|
257 |
$this->response->status = 0;
|
258 |
+
$this->response->error[] = esc_html( ( ( $this->fields[$key]->mf_input_label != '' ) ? $this->fields[$key]->mf_input_label : $key ). " maximum input ". $max ." ".$type );
|
259 |
}
|
260 |
+
if( ($validation_type == 'by_expresssion_based') && ( $expression != '' ) && ( !preg_match( "/".$expression."/", $value ) ) ){
|
261 |
$errors++;
|
262 |
$this->response->status = 0;
|
263 |
$this->response->error[] = esc_html( ( ( $this->fields[$key]->mf_input_label != '' ) ? $this->fields[$key]->mf_input_label : $key ). " input criteria is not matched.");
|
346 |
$user_email_attached_submision_copy = isset($this->form_settings['user_email_attach_submission_copy']) ? $this->form_settings['user_email_attach_submission_copy'] : null;
|
347 |
|
348 |
$body = "<html><body><h4 style='text-align: center;'>".$body."</h4>";
|
349 |
+
$form_html = \MetForm\Core\Entries\Form_Data::format_data_for_mail_style_2($this->form_id, $form_data);
|
350 |
$body .= $form_html."</body></html>";
|
351 |
|
352 |
$headers = 'MIME-Version: 1.0' . "\r\n";
|
358 |
|
359 |
if(!$user_mail){
|
360 |
$this->response->status = 0;
|
361 |
+
$this->response->error[] = esc_html__('Mail not found.', 'metform');
|
362 |
}else{
|
363 |
$status = wp_mail($user_mail, $subject, $body, $headers);
|
364 |
$this->response->status = ($status) ? 1 : 0;
|
365 |
}
|
366 |
|
367 |
}
|
368 |
+
|
369 |
public function send_admin_email($form_data){
|
370 |
|
371 |
$subject = isset($this->form_settings['admin_email_subject']) ? $this->form_settings['admin_email_subject'] : null;
|
375 |
$admin_email_attached_submision_copy = isset($this->form_settings['admin_email_attach_submission_copy']) ? $this->form_settings['admin_email_attach_submission_copy'] : null;
|
376 |
|
377 |
$body = "<html><body><h4 style='text-align: center;'>".$body."</h4>";
|
378 |
+
$form_html = \MetForm\Core\Entries\Form_Data::format_data_for_mail_style_2($this->form_id, $form_data);
|
379 |
$body .= $form_html."</body></html>";
|
380 |
|
381 |
$headers = 'MIME-Version: 1.0' . "\r\n";
|
430 |
|
431 |
}
|
432 |
|
433 |
+
$repeaters = $this->get_input_name_by_widget_type('mf-simple-repeater');
|
434 |
|
435 |
$repeaters = (is_array($repeaters) ? $repeaters : []);
|
436 |
|
495 |
$user_agent = sanitize_text_field($_SERVER['HTTP_USER_AGENT']);
|
496 |
|
497 |
return [
|
498 |
+
'IP' => $ip,
|
499 |
+
'User_Agent' => $user_agent,
|
500 |
];
|
501 |
}
|
502 |
|
504 |
return get_post_meta($form_id, $this->key_form_settings, true);
|
505 |
}
|
506 |
|
507 |
+
public function get_input_name_by_widget_type( $widget_type, $fields = null ){
|
508 |
+
global $w;
|
509 |
if($fields != null){
|
510 |
$this->fields = $fields;
|
511 |
}
|
512 |
$response = [];
|
513 |
|
514 |
+
$w = $widget_type;
|
515 |
$files = array_values(array_filter($this->fields, function($v){
|
516 |
+
global $w;
|
517 |
+
if($v->widgetType == $w){
|
518 |
return $v;
|
519 |
}
|
520 |
}));
|
529 |
}
|
530 |
}
|
531 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
532 |
public function process_repeater_data($repeater_data){
|
533 |
$data = [];
|
534 |
foreach($repeater_data as $index => $value){
|
core/entries/api.php
CHANGED
@@ -28,6 +28,23 @@ Class Api extends \MetForm\Base\Api{
|
|
28 |
return Export::instance()->export_data($id);
|
29 |
|
30 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
}
|
33 |
|
28 |
return Export::instance()->export_data($id);
|
29 |
|
30 |
}
|
31 |
+
|
32 |
+
public function get_paypal(){
|
33 |
+
$args = [
|
34 |
+
'method' => (isset($this->request['action']) ? $this->request['action']: ''),
|
35 |
+
'action' => (isset($this->request['id']) ? $this->request['id']: ''),
|
36 |
+
'entry_id' => (isset($this->request['entry_id']) ? $this->request['entry_id']: ''),
|
37 |
+
];
|
38 |
+
if(class_exists('\MetForm_Pro\Core\Integrations\Payment\Paypal')){
|
39 |
+
return \MetForm_Pro\Core\Integrations\Payment\Paypal::instance()->init($args);
|
40 |
+
}
|
41 |
+
return 'Pro needed';
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
public function get_stripe(){
|
46 |
+
return $this->request->get_params();
|
47 |
+
}
|
48 |
|
49 |
}
|
50 |
|
core/entries/form-data.php
CHANGED
@@ -98,4 +98,100 @@ Class Form_Data{
|
|
98 |
ob_end_clean();
|
99 |
return $data_html;
|
100 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
}
|
98 |
ob_end_clean();
|
99 |
return $data_html;
|
100 |
}
|
101 |
+
|
102 |
+
public static function format_form_data_style_2( $form_id, $form_data ){
|
103 |
+
$map_data = \MetForm\Core\Entries\Action::instance()->get_fields($form_id);
|
104 |
+
$map_data = json_decode(json_encode($map_data), true);
|
105 |
+
ob_start();
|
106 |
+
?>
|
107 |
+
<div class="metform-entry-data container">
|
108 |
+
<table class='mf-entry-data' cellpadding="5" cellspacing="0">
|
109 |
+
<tbody>
|
110 |
+
<?php
|
111 |
+
foreach($map_data as $key => $value){
|
112 |
+
if( ( $value['widgetType'] != 'mf-file-upload' ) && ( $value['widgetType'] != 'mf-simple-repeater' ) ){
|
113 |
+
echo "<tr class='mf-data-label'>";
|
114 |
+
echo "<td colspan='2'><strong>".esc_html(($map_data[$key]['mf_input_label'] != '') ? $map_data[$key]['mf_input_label'] : $key)."</strong></td>";
|
115 |
+
echo "</tr>";
|
116 |
+
echo "<tr class='mf-data-value'>";
|
117 |
+
echo "<td class='mf-value-space'> </td>";
|
118 |
+
echo "<td>".esc_html((array_key_exists($key, $form_data) ? ((is_array($form_data[$key])) ? implode(', ', $form_data[$key]) : $form_data[$key]) : ' '))."</td>";
|
119 |
+
echo "</tr>";
|
120 |
+
}
|
121 |
+
|
122 |
+
if( $value['widgetType'] == 'mf-simple-repeater' ){
|
123 |
+
echo "<tr class='mf-data-label'>";
|
124 |
+
echo "<td colspan='2'><strong>".esc_html(($map_data[$key]['mf_input_label'] != '') ? $map_data[$key]['mf_input_label'] : $key)."</strong></td>";
|
125 |
+
echo "</tr>";
|
126 |
+
echo "<tr class='mf-data-value'>";
|
127 |
+
echo "<td class='mf-value-space'> </td>";
|
128 |
+
echo "<td>";
|
129 |
+
$repeater_data = ((array_key_exists($key, $form_data)) ? $form_data[$key] : []);
|
130 |
+
foreach($repeater_data as $key => $value){
|
131 |
+
echo "<strong>".esc_html($key).": </strong>";
|
132 |
+
echo "<span>".esc_html($value)."</span>";
|
133 |
+
echo "<br>";
|
134 |
+
}
|
135 |
+
echo "</td>";
|
136 |
+
echo "</tr>";
|
137 |
+
}
|
138 |
+
|
139 |
+
}
|
140 |
+
?>
|
141 |
+
</tbody>
|
142 |
+
</table>
|
143 |
+
</div>
|
144 |
+
<?php
|
145 |
+
$data_html = ob_get_contents();
|
146 |
+
ob_end_clean();
|
147 |
+
return $data_html;
|
148 |
+
}
|
149 |
+
|
150 |
+
public static function format_data_for_mail_style_2( $form_id, $form_data ){
|
151 |
+
$map_data = \MetForm\Core\Entries\Action::instance()->get_fields($form_id);
|
152 |
+
$map_data = json_decode(json_encode($map_data), true);
|
153 |
+
ob_start();
|
154 |
+
?>
|
155 |
+
<div>
|
156 |
+
<table width="100%" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF" style="border: 1px solid #EAF2FA">
|
157 |
+
<tbody>
|
158 |
+
<?php
|
159 |
+
foreach($map_data as $key => $value){
|
160 |
+
if( ( $value['widgetType'] != 'mf-file-upload' ) && ( $value['widgetType'] != 'mf-simple-repeater' ) && ( $value['widgetType'] != 'mf-recaptcha' ) ){
|
161 |
+
echo "<tr bgcolor='#EAF2FA'>";
|
162 |
+
echo "<td colspan='2'><strong>".esc_html(($map_data[$key]['mf_input_label'] != '') ? $map_data[$key]['mf_input_label'] : $key)."</strong></td>";
|
163 |
+
echo "</tr>";
|
164 |
+
echo "<tr bgcolor='#FFFFFF'>";
|
165 |
+
echo "<td width='20'> </td>";
|
166 |
+
echo "<td>".esc_html((array_key_exists($key, $form_data) ? ((is_array($form_data[$key])) ? implode(', ', $form_data[$key]) : $form_data[$key]) : ' '))."</td>";
|
167 |
+
echo "</tr>";
|
168 |
+
}
|
169 |
+
|
170 |
+
if( $value['widgetType'] == 'mf-simple-repeater' ){
|
171 |
+
echo "<tr bgcolor='#EAF2FA'>";
|
172 |
+
echo "<td colspan='2'><strong>".esc_html(($map_data[$key]['mf_input_label'] != '') ? $map_data[$key]['mf_input_label'] : $key)."</strong></td>";
|
173 |
+
echo "</tr>";
|
174 |
+
echo "<tr bgcolor='#FFFFFF'>";
|
175 |
+
echo "<td width='20'> </td>";
|
176 |
+
echo "<td>";
|
177 |
+
$repeater_data = ((array_key_exists($key, $form_data)) ? $form_data[$key] : []);
|
178 |
+
foreach($repeater_data as $key => $value){
|
179 |
+
echo "<strong>".esc_html($key).": </strong>";
|
180 |
+
echo "<span>".esc_html($value)."</span>";
|
181 |
+
echo "<br>";
|
182 |
+
}
|
183 |
+
echo "</td>";
|
184 |
+
echo "</tr>";
|
185 |
+
}
|
186 |
+
|
187 |
+
}
|
188 |
+
?>
|
189 |
+
</tbody>
|
190 |
+
</table>
|
191 |
+
</div>
|
192 |
+
<?php
|
193 |
+
$data_html = ob_get_contents();
|
194 |
+
ob_end_clean();
|
195 |
+
return $data_html;
|
196 |
+
}
|
197 |
}
|
core/entries/meta-data.php
CHANGED
@@ -31,8 +31,8 @@ Class Meta_Data{
|
|
31 |
esc_html__('Info', 'metform'),
|
32 |
[$this,'show_form_id_cmb'],
|
33 |
$this->cpt->get_name(),
|
34 |
-
'
|
35 |
-
'
|
36 |
);
|
37 |
}
|
38 |
|
@@ -46,26 +46,25 @@ Class Meta_Data{
|
|
46 |
|
47 |
?>
|
48 |
|
49 |
-
<div class="
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
<
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
65 |
</div>
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
<?php
|
70 |
}
|
71 |
|
@@ -104,21 +103,17 @@ Class Meta_Data{
|
|
104 |
function show_browser_data_cmb($post){
|
105 |
if($this->browser_data != ''){
|
106 |
?>
|
107 |
-
<div class="metform-entry-
|
108 |
-
<table class="
|
109 |
-
<thead>
|
110 |
-
<tr>
|
111 |
-
<th scope="col"><?php esc_html_e('Name', 'metform')?></th>
|
112 |
-
<th scope="col"><?php esc_html_e('Value', 'metform')?></th>
|
113 |
-
</tr>
|
114 |
-
</thead>
|
115 |
<?php
|
116 |
foreach($this->browser_data as $key => $value){
|
117 |
?>
|
118 |
<tbody>
|
119 |
-
<tr>
|
120 |
-
|
121 |
-
|
|
|
|
|
122 |
</tr>
|
123 |
</tbody>
|
124 |
<?php
|
@@ -158,7 +153,7 @@ Class Meta_Data{
|
|
158 |
$this->form_data = (isset($this->form_data)) ? $this->form_data : "";
|
159 |
// format all form data into html table
|
160 |
if($this->form_data != ''){
|
161 |
-
$form_html = \MetForm\Core\Entries\Form_Data::
|
162 |
echo $form_html;
|
163 |
}
|
164 |
}
|
31 |
esc_html__('Info', 'metform'),
|
32 |
[$this,'show_form_id_cmb'],
|
33 |
$this->cpt->get_name(),
|
34 |
+
'side',
|
35 |
+
'low'
|
36 |
);
|
37 |
}
|
38 |
|
46 |
|
47 |
?>
|
48 |
|
49 |
+
<div class="metform-entry-data container">
|
50 |
+
<table class='mf-entry-data' cellpadding="5" cellspacing="0">
|
51 |
+
<tbody>
|
52 |
+
<tr class="mf-data-label">
|
53 |
+
<td colspan='2'><strong><?php esc_html_e('Form Name ', 'metform'); ?></strong></td>
|
54 |
+
</tr>
|
55 |
+
<tr class='mf-data-value'>
|
56 |
+
<td><?php echo esc_attr($form_title); ?></td>
|
57 |
+
</tr>
|
58 |
+
<tr class="mf-data-label">
|
59 |
+
<td colspan='2'><strong><?php esc_html_e('Entry ID', 'metform'); ?></strong></td>
|
60 |
+
</tr>
|
61 |
+
<tr class='mf-data-value'>
|
62 |
+
<td><?php echo esc_attr($post->ID); ?></td>
|
63 |
+
</tr>
|
64 |
+
</tbody>
|
65 |
+
</table>
|
66 |
</div>
|
67 |
+
|
|
|
|
|
68 |
<?php
|
69 |
}
|
70 |
|
103 |
function show_browser_data_cmb($post){
|
104 |
if($this->browser_data != ''){
|
105 |
?>
|
106 |
+
<div class="metform-entry-data container">
|
107 |
+
<table class='mf-entry-data' cellpadding="5" cellspacing="0">
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
<?php
|
109 |
foreach($this->browser_data as $key => $value){
|
110 |
?>
|
111 |
<tbody>
|
112 |
+
<tr class="mf-data-label">
|
113 |
+
<td colspan='2'><strong><?php echo esc_attr($key); ?></strong></td>
|
114 |
+
</tr>
|
115 |
+
<tr class='mf-data-value'>
|
116 |
+
<td><?php echo esc_attr($value); ?></td>
|
117 |
</tr>
|
118 |
</tbody>
|
119 |
<?php
|
153 |
$this->form_data = (isset($this->form_data)) ? $this->form_data : "";
|
154 |
// format all form data into html table
|
155 |
if($this->form_data != ''){
|
156 |
+
$form_html = \MetForm\Core\Entries\Form_Data::format_form_data_style_2($this->form_id, $this->form_data);
|
157 |
echo $form_html;
|
158 |
}
|
159 |
}
|
core/forms/action.php
CHANGED
@@ -40,7 +40,7 @@ Class Action{
|
|
40 |
if(isset($form_setting['mf_zapier']) && $form_setting['mf_zapier'] == '1' && $form_setting['mf_zapier'] != ''){
|
41 |
|
42 |
$map_data = \MetForm\Core\Entries\Action::instance()->get_fields($form_id);
|
43 |
-
$email_name = \MetForm\Core\Entries\Action::instance()->
|
44 |
|
45 |
$existing_settings = \MetForm\Core\Entries\Action::instance()->get_form_settings($this->form_id);
|
46 |
$zapier = new \MetForm_Pro\Core\Integrations\Zapier();
|
@@ -80,11 +80,15 @@ Class Action{
|
|
80 |
update_post_meta( $this->form_id, '_wp_page_template', 'elementor_canvas' );
|
81 |
|
82 |
$this->response['saved'] = true;
|
83 |
-
$this->response['status'] =
|
84 |
|
85 |
if((!array_key_exists('store_entries',$this->form_setting)) && (!array_key_exists('enable_user_notification',$this->form_setting)) && (!array_key_exists('enable_admin_notification',$this->form_setting)) && (!array_key_exists('mf_mail_chimp',$this->form_setting)) && (!array_key_exists('mf_zapier',$this->form_setting))){
|
86 |
$this->response['saved'] = false;
|
87 |
-
$this->response['status'] =
|
|
|
|
|
|
|
|
|
88 |
}
|
89 |
|
90 |
$this->response['data']['id'] = $this->form_id;
|
@@ -115,6 +119,10 @@ Class Action{
|
|
115 |
$this->response['saved'] = false;
|
116 |
$this->response['status'] = esc_html('You must active at least one field of these fields "store entries/ Confirmation/ Notification/ REST API/ MailChimp/ Slack/ Zapier". ','metform');
|
117 |
}
|
|
|
|
|
|
|
|
|
118 |
|
119 |
$this->response['data']['id'] = $this->form_id;
|
120 |
$this->response['data']['title'] = $this->title;
|
40 |
if(isset($form_setting['mf_zapier']) && $form_setting['mf_zapier'] == '1' && $form_setting['mf_zapier'] != ''){
|
41 |
|
42 |
$map_data = \MetForm\Core\Entries\Action::instance()->get_fields($form_id);
|
43 |
+
$email_name = \MetForm\Core\Entries\Action::instance()->get_input_name_by_widget_type('mf-email', $map_data);
|
44 |
|
45 |
$existing_settings = \MetForm\Core\Entries\Action::instance()->get_form_settings($this->form_id);
|
46 |
$zapier = new \MetForm_Pro\Core\Integrations\Zapier();
|
80 |
update_post_meta( $this->form_id, '_wp_page_template', 'elementor_canvas' );
|
81 |
|
82 |
$this->response['saved'] = true;
|
83 |
+
$this->response['status'] = esc_html__('Form settings inserted','metform');
|
84 |
|
85 |
if((!array_key_exists('store_entries',$this->form_setting)) && (!array_key_exists('enable_user_notification',$this->form_setting)) && (!array_key_exists('enable_admin_notification',$this->form_setting)) && (!array_key_exists('mf_mail_chimp',$this->form_setting)) && (!array_key_exists('mf_zapier',$this->form_setting))){
|
86 |
$this->response['saved'] = false;
|
87 |
+
$this->response['status'] = esc_html__('You must active at least one field of these fields "store entry/ Confirmation/ Notification/ MailChimp/ Zapier". ','metform');
|
88 |
+
}
|
89 |
+
if( (array_key_exists('mf_paypal', $this->form_setting)) && (!array_key_exists('store_entries', $this->form_setting)) ){
|
90 |
+
$this->response['saved'] = false;
|
91 |
+
$this->response['status'] = esc_html__('You must enable "store entries" for integrating payment method.','metform');
|
92 |
}
|
93 |
|
94 |
$this->response['data']['id'] = $this->form_id;
|
119 |
$this->response['saved'] = false;
|
120 |
$this->response['status'] = esc_html('You must active at least one field of these fields "store entries/ Confirmation/ Notification/ REST API/ MailChimp/ Slack/ Zapier". ','metform');
|
121 |
}
|
122 |
+
if( (array_key_exists('mf_paypal', $this->form_setting)) && (!array_key_exists('store_entries', $this->form_setting)) ){
|
123 |
+
$this->response['saved'] = false;
|
124 |
+
$this->response['status'] = esc_html__('You must enable "store entries" for integrating payment method.','metform');
|
125 |
+
}
|
126 |
|
127 |
$this->response['data']['id'] = $this->form_id;
|
128 |
$this->response['data']['title'] = $this->title;
|
core/forms/cpt.php
CHANGED
@@ -32,6 +32,12 @@ Class Cpt extends \MetForm\Base\Cpt{
|
|
32 |
'redirect_to' => [
|
33 |
'name' => 'redirect_to',
|
34 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
'require_login' => [
|
36 |
'name' => 'require_login',
|
37 |
],
|
@@ -119,6 +125,18 @@ Class Cpt extends \MetForm\Base\Cpt{
|
|
119 |
'mf_slack_webhook' => [
|
120 |
'name' => 'mf_slack_webhook',
|
121 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
'mf_recaptcha' => [
|
123 |
'name' => 'mf_recaptcha',
|
124 |
],
|
32 |
'redirect_to' => [
|
33 |
'name' => 'redirect_to',
|
34 |
],
|
35 |
+
'success_url' => [
|
36 |
+
'name' => 'success_url',
|
37 |
+
],
|
38 |
+
'failed_cancel_url' => [
|
39 |
+
'name' => 'failed_cancel_url',
|
40 |
+
],
|
41 |
'require_login' => [
|
42 |
'name' => 'require_login',
|
43 |
],
|
125 |
'mf_slack_webhook' => [
|
126 |
'name' => 'mf_slack_webhook',
|
127 |
],
|
128 |
+
'mf_paypal' => [
|
129 |
+
'name' => 'mf_paypal',
|
130 |
+
],
|
131 |
+
'mf_paypal_email' => [
|
132 |
+
'name' => 'mf_paypal_email',
|
133 |
+
],
|
134 |
+
'mf_paypal_token' => [
|
135 |
+
'name' => 'mf_paypal_token',
|
136 |
+
],
|
137 |
+
'mf_paypal_sandbox' => [
|
138 |
+
'name' => 'mf_paypal_sandbox',
|
139 |
+
],
|
140 |
'mf_recaptcha' => [
|
141 |
'name' => 'mf_recaptcha',
|
142 |
],
|
core/forms/views/modal-editor.php
CHANGED
@@ -18,6 +18,9 @@
|
|
18 |
<li role="presentation"><a href="#mf-confirmation" aria-controls="confirmation" role="tab" data-toggle="tab"><?php esc_html_e('Confirmation', 'metform');?></a></li>
|
19 |
<li role="presentation"><a href="#mf-notification" aria-controls="notification" role="tab" data-toggle="tab"><?php esc_html_e('Notification', 'metform'); ?></a></li>
|
20 |
<li role="presentation"><a href="#mf-integration" aria-controls="integration" role="tab" data-toggle="tab"><?php esc_html_e('Integration', 'metform');?></a></li>
|
|
|
|
|
|
|
21 |
</ul>
|
22 |
</div>
|
23 |
|
@@ -87,6 +90,7 @@
|
|
87 |
<input type="text" name="redirect_to" class="mf-form-modalinput-redirect_to attr-form-control" placeholder="<?php esc_html_e('Redirection link', 'metform'); ?>">
|
88 |
<span class='mf-input-help'><?php esc_html_e('Users will be redirected to the this link after submission.','metform'); ?></span>
|
89 |
</div>
|
|
|
90 |
|
91 |
</div>
|
92 |
|
@@ -292,6 +296,58 @@
|
|
292 |
</div>
|
293 |
|
294 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
</div>
|
296 |
|
297 |
<div class="attr-modal-footer">
|
18 |
<li role="presentation"><a href="#mf-confirmation" aria-controls="confirmation" role="tab" data-toggle="tab"><?php esc_html_e('Confirmation', 'metform');?></a></li>
|
19 |
<li role="presentation"><a href="#mf-notification" aria-controls="notification" role="tab" data-toggle="tab"><?php esc_html_e('Notification', 'metform'); ?></a></li>
|
20 |
<li role="presentation"><a href="#mf-integration" aria-controls="integration" role="tab" data-toggle="tab"><?php esc_html_e('Integration', 'metform');?></a></li>
|
21 |
+
<?php if(class_exists('MetForm_Pro\Base\Package')) : ?>
|
22 |
+
<li role="presentation"><a href="#mf-payment" aria-controls="payment" role="tab" data-toggle="tab"><?php esc_html_e('Payment', 'metform');?></a></li>
|
23 |
+
<?php endif; ?>
|
24 |
</ul>
|
25 |
</div>
|
26 |
|
90 |
<input type="text" name="redirect_to" class="mf-form-modalinput-redirect_to attr-form-control" placeholder="<?php esc_html_e('Redirection link', 'metform'); ?>">
|
91 |
<span class='mf-input-help'><?php esc_html_e('Users will be redirected to the this link after submission.','metform'); ?></span>
|
92 |
</div>
|
93 |
+
<br>
|
94 |
|
95 |
</div>
|
96 |
|
296 |
</div>
|
297 |
|
298 |
</div>
|
299 |
+
|
300 |
+
<?php if(class_exists('MetForm_Pro\Base\Package')) : ?>
|
301 |
+
<div role="tabpanel" class="attr-tab-pane" id="mf-payment">
|
302 |
+
<div class="attr-modal-body" id="metform_form_modal_body">
|
303 |
+
<div class="mf-input-group">
|
304 |
+
<label for="attr-input-label" class="attr-input-label"><?php esc_html_e('Success url:', 'metform'); ?></label>
|
305 |
+
<input type="text" name="success_url" class="mf-form-modalinput-success_url attr-form-control" placeholder="<?php esc_html_e('Success url', 'metform'); ?>">
|
306 |
+
<span class='mf-input-help'><?php esc_html_e('Users will be redirected to the this link after successfully form submission.','metform'); ?></span>
|
307 |
+
</div>
|
308 |
+
<br>
|
309 |
+
<div class="mf-input-group">
|
310 |
+
<label for="attr-input-label" class="attr-input-label"><?php esc_html_e('Failed/ Cancel url:', 'metform'); ?></label>
|
311 |
+
<input type="text" name="failed_cancel_url" class="mf-form-modalinput-failed_cancel_url attr-form-control" placeholder="<?php esc_html_e('Failed/Cancel url', 'metform'); ?>">
|
312 |
+
<span class='mf-input-help'><?php esc_html_e('Users will be redirected to the this link after any failure/ cancelation of form submission.','metform'); ?></span>
|
313 |
+
</div>
|
314 |
+
<?php if(class_exists('\MetForm_Pro\Core\Integrations\Payment\Paypal')): ?>
|
315 |
+
<div class="mf-input-group">
|
316 |
+
<label class="attr-input-label">
|
317 |
+
<input type="checkbox" value="1" name="mf_paypal" class="mf-admin-control-input mf-form-modalinput-paypal">
|
318 |
+
<span><?php esc_html_e('Paypal:', 'metform'); ?></span>
|
319 |
+
</label>
|
320 |
+
<span class='mf-input-help'><?php esc_html_e('Integrate paypal payment with this form.','metform'); ?><strong><?php esc_html_e('Paypal payment.', 'metform'); ?></strong></span>
|
321 |
+
</div>
|
322 |
+
<br>
|
323 |
+
<div class="mf-input-group mf-paypal">
|
324 |
+
<label for="attr-input-label" class="attr-input-label"><?php esc_html_e('Paypal email:', 'metform'); ?></label>
|
325 |
+
<input type="email" name="mf_paypal_email" class="mf-paypal-email attr-form-control" placeholder="<?php esc_html_e('Paypal email', 'metform');?>">
|
326 |
+
<span class='mf-input-help'><?php esc_html_e('Enter here paypal email.','metform'); ?><a href="https://www.paypal.com/"><?php esc_html_e('create from here', 'metform');?></a></span>
|
327 |
+
</div>
|
328 |
+
<br>
|
329 |
+
<div class="mf-input-group mf-paypal">
|
330 |
+
<label for="attr-input-label" class="attr-input-label"><?php esc_html_e('Paypal token:', 'metform'); ?></label>
|
331 |
+
<input type="text" name="mf_paypal_token" class="mf-paypal-token attr-form-control" placeholder="<?php esc_html_e('Paypal token', 'metform');?>">
|
332 |
+
<span class='mf-input-help'><?php esc_html_e('Enter here paypal token. This is optional.','metform'); ?></span>
|
333 |
+
</div>
|
334 |
+
<br>
|
335 |
+
<div class="mf-input-group mf-paypal">
|
336 |
+
<label class="attr-input-label">
|
337 |
+
<input type="checkbox" value="1" name="mf_paypal_sandbox" class="mf-admin-control-input mf-form-modalinput-paypal_sandbox">
|
338 |
+
<span><?php esc_html_e('Enable sandbox mode:', 'metform'); ?></span>
|
339 |
+
</label>
|
340 |
+
<span class='mf-input-help'><?php esc_html_e('Enable sandbox mode for testing paypal payment','metform'); ?></span>
|
341 |
+
</div>
|
342 |
+
<br>
|
343 |
+
<?php endif ?>
|
344 |
+
<br>
|
345 |
+
|
346 |
+
</div>
|
347 |
+
|
348 |
+
</div>
|
349 |
+
<?php endif; ?>
|
350 |
+
|
351 |
</div>
|
352 |
|
353 |
<div class="attr-modal-footer">
|
languages/metform.pot
CHANGED
@@ -216,7 +216,7 @@ msgid "Form Name "
|
|
216 |
msgstr ""
|
217 |
|
218 |
#: core/entries/meta-data.php:59
|
219 |
-
msgid "
|
220 |
msgstr ""
|
221 |
|
222 |
#: core/entries/meta-data.php:75
|
@@ -422,7 +422,7 @@ msgid "Redirect To:"
|
|
422 |
msgstr ""
|
423 |
|
424 |
#: core/forms/views/modal-editor.php:87
|
425 |
-
msgid "
|
426 |
msgstr ""
|
427 |
|
428 |
#: core/forms/views/modal-editor.php:88
|
216 |
msgstr ""
|
217 |
|
218 |
#: core/entries/meta-data.php:59
|
219 |
+
msgid "Entry ID"
|
220 |
msgstr ""
|
221 |
|
222 |
#: core/entries/meta-data.php:75
|
422 |
msgstr ""
|
423 |
|
424 |
#: core/forms/views/modal-editor.php:87
|
425 |
+
msgid "Success url"
|
426 |
msgstr ""
|
427 |
|
428 |
#: core/forms/views/modal-editor.php:88
|
metform.php
CHANGED
@@ -5,7 +5,7 @@ defined( 'ABSPATH' ) || exit;
|
|
5 |
* Plugin Name: MetForm
|
6 |
* Plugin URI: http://products.wpmet.com/metform/
|
7 |
* Description: Most flexible and design friendly form builder for Elementor
|
8 |
-
* Version: 1.1.
|
9 |
* Author: Wpmet
|
10 |
* Author URI: https://wpmet.com
|
11 |
* Text Domain: metform
|
5 |
* Plugin Name: MetForm
|
6 |
* Plugin URI: http://products.wpmet.com/metform/
|
7 |
* Description: Most flexible and design friendly form builder for Elementor
|
8 |
+
* Version: 1.1.8
|
9 |
* Author: Wpmet
|
10 |
* Author URI: https://wpmet.com
|
11 |
* Text Domain: metform
|
plugin.php
CHANGED
@@ -14,7 +14,7 @@ final class Plugin{
|
|
14 |
}
|
15 |
|
16 |
public function version(){
|
17 |
-
return '1.1.
|
18 |
}
|
19 |
|
20 |
public function package_type(){
|
@@ -105,6 +105,8 @@ final class Plugin{
|
|
105 |
add_action('wp_enqueue_scripts', [$this,'js_css_public']);
|
106 |
add_action( 'elementor/frontend/before_enqueue_scripts', [$this, 'elementor_js'] );
|
107 |
|
|
|
|
|
108 |
add_action('admin_footer', [$this, 'footer_data']);
|
109 |
|
110 |
Core\Forms\Base::instance()->init();
|
@@ -130,14 +132,15 @@ final class Plugin{
|
|
130 |
wp_enqueue_style('font-awesome', $this->public_url().'assets/css/font-awesome.min.css', false, $this->version());
|
131 |
wp_enqueue_style('metform-style', $this->public_url().'assets/css/style.css', false, $this->version());
|
132 |
|
|
|
133 |
wp_enqueue_script('asRange', $this->public_url().'assets/js/jquery-asRange.min.js', array(), $this->version(), true);
|
134 |
wp_enqueue_script('select2', $this->public_url().'assets/js/select2.min.js', array(), $this->version(), true);
|
135 |
wp_enqueue_script('flatpickr', $this->public_url().'assets/js/flatpickr.js', array(), $this->version(), true);
|
136 |
|
137 |
wp_register_script('recaptcha', 'https://www.google.com/recaptcha/api.js?onload=onloadMetFormCallback&render=explicit', array(), $this->version(), true);
|
138 |
wp_enqueue_script('metform-submission', $this->public_url().'assets/js/submission.js', array(), $this->version(), true);
|
139 |
-
wp_localize_script('metform-submission', '
|
140 |
-
'
|
141 |
));
|
142 |
|
143 |
do_action('metform/onload/enqueue_scripts');
|
@@ -165,6 +168,12 @@ final class Plugin{
|
|
165 |
|
166 |
}
|
167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
function js_css_admin(){
|
169 |
|
170 |
$screen = get_current_screen();
|
14 |
}
|
15 |
|
16 |
public function version(){
|
17 |
+
return '1.1.8';
|
18 |
}
|
19 |
|
20 |
public function package_type(){
|
105 |
add_action('wp_enqueue_scripts', [$this,'js_css_public']);
|
106 |
add_action( 'elementor/frontend/before_enqueue_scripts', [$this, 'elementor_js'] );
|
107 |
|
108 |
+
add_action( 'elementor/editor/before_enqueue_styles', [ $this, 'elementor_css' ] );
|
109 |
+
|
110 |
add_action('admin_footer', [$this, 'footer_data']);
|
111 |
|
112 |
Core\Forms\Base::instance()->init();
|
132 |
wp_enqueue_style('font-awesome', $this->public_url().'assets/css/font-awesome.min.css', false, $this->version());
|
133 |
wp_enqueue_style('metform-style', $this->public_url().'assets/css/style.css', false, $this->version());
|
134 |
|
135 |
+
wp_enqueue_script('validate', $this->public_url().'assets/js/jquery.validate.min.js', array(), $this->version(), true);
|
136 |
wp_enqueue_script('asRange', $this->public_url().'assets/js/jquery-asRange.min.js', array(), $this->version(), true);
|
137 |
wp_enqueue_script('select2', $this->public_url().'assets/js/select2.min.js', array(), $this->version(), true);
|
138 |
wp_enqueue_script('flatpickr', $this->public_url().'assets/js/flatpickr.js', array(), $this->version(), true);
|
139 |
|
140 |
wp_register_script('recaptcha', 'https://www.google.com/recaptcha/api.js?onload=onloadMetFormCallback&render=explicit', array(), $this->version(), true);
|
141 |
wp_enqueue_script('metform-submission', $this->public_url().'assets/js/submission.js', array(), $this->version(), true);
|
142 |
+
wp_localize_script('metform-submission', 'mf_submission', array(
|
143 |
+
'default_required_message' => esc_html__('This field is required.', 'metform')
|
144 |
));
|
145 |
|
146 |
do_action('metform/onload/enqueue_scripts');
|
168 |
|
169 |
}
|
170 |
|
171 |
+
public function elementor_css(){
|
172 |
+
if('metform-form' == get_post_type()){
|
173 |
+
wp_enqueue_style('metform-category-top', $this->public_url().'assets/css/category-top.css', false, $this->version());
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
function js_css_admin(){
|
178 |
|
179 |
$screen = get_current_screen();
|
public/assets/css/admin-style.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.loading .attr-modal-content:before{opacity:.8;position:absolute;content:"";top:0;left:0;height:100%;width:100%;background-color:#fff;-webkit-transition:opaicty .5s ease;-o-transition:opaicty .5s ease;transition:opaicty .5s ease;z-index:5;border-radius:inherit}.loading .
|
1 |
+
.loading .attr-modal-content:before{opacity:.8;position:absolute;content:"";top:0;left:0;height:100%;width:100%;background-color:#fff;-webkit-transition:opaicty .5s ease;-o-transition:opaicty .5s ease;transition:opaicty .5s ease;z-index:5;border-radius:inherit}.loading .mf-spinner{display:block}.elementor-editor-active .metform-form-save-btn-editor{display:none!important}.attr-modal-dialog-centered{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-top:30px;width:565px}.attr-modal-dialog-centered .attr-modal-header{padding:36px 50px;border-bottom:none}.attr-modal-dialog-centered .attr-modal-header .attr-modal-title{font-size:20px;font-weight:bold;color:#111111;text-transform:capitalize;margin-bottom:38px;line-height:1}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs{border:none;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:wrap;flex-wrap:wrap}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs li{margin:0;float:none}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs a{text-decoration:none;text-align:center;color:#111111;font-size:14px;text-transform:capitalize;font-weight:600;padding:8px 14px;border:none;margin-right:0;border:none}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs a:hover{border:none;background-color:transparent}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs a:focus{outline:none;-webkit-box-shadow:none;box-shadow:none;border:none}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs li.attr-active a{border:none;color:#ffffff;background-color:#1F55F8;border-radius:4px}.attr-modal-dialog-centered .attr-modal-header button.attr-close{opacity:.8;font-size:inherit;outline:none;margin-top:-15px;margin-right:-25px}.attr-modal-dialog-centered .attr-modal-header button.attr-close span{color:#e81123;font-size:35px;font-weight:100;background-color:#FCE7E9;height:36px;width:36px;display:inline-block;line-height:36px;border-radius:100px;outline:none;margin-top:5px;font-family:initial}.attr-modal-dialog-centered .attr-tab-content .attr-modal-body{padding:40px 50px;padding-top:0}.attr-modal-dialog-centered .attr-tab-content div#limit_status.hide_input{display:none}.attr-modal-dialog-centered .attr-tab-content .mf-input-group label.attr-input-label{color:#111111;font-size:16px;margin-bottom:7px;display:block;font-weight:500}.attr-modal-dialog-centered .attr-tab-content .mf-input-group{margin-bottom:14px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .attr-form-control,.attr-modal-dialog-centered .attr-tab-content .mf-input-group input{color:#555;font-size:14px;height:48px;padding:0 22px;border-color:#ededed;-webkit-box-shadow:0px 2px 5px rgba(153, 153, 153, 0.2);box-shadow:0px 2px 5px rgba(153, 153, 153, 0.2);margin-top:12px;max-width:100%}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]{display:none}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]+span{position:relative;display:block}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]+span:before{content:"No";width:55px;height:25px;background-color:#EDEDED;left:0;border-radius:15px;text-align:right;color:#fff;text-transform:uppercase;font-weight:bold;font-size:10px;padding:3px;-webkit-box-sizing:border-box;box-sizing:border-box;padding-right:10px;-webkit-transition:all .4s;-o-transition:all .4s;transition:all .4s;float:right;line-height:18px;cursor:pointer}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]+span:after{content:"";width:20px;height:20px;background-color:#fff;border-radius:100px;display:inline-block;position:absolute;right:31px;top:2px;-webkit-transition:all .4s;-o-transition:all .4s;transition:all .4s}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]:checked+span:before{content:"Yes";width:55px;height:25px;background-color:#1F55F8;left:0;border-radius:15px;display:inline-block;text-align:left;color:#fff;text-transform:uppercase;font-weight:bold;font-size:10px;padding:3px;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:10px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]:checked+span:after{content:"";width:20px;height:20px;background-color:#fff;border-radius:100px;display:inline-block;position:absolute;right:2px;top:2px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-rest-api-method{padding:0 18px;margin:0}.attr-modal-dialog-centered .attr-tab-content .mf-input-group span.mf-input-help{color:#b7b7b7;font-style:italic;font-size:12px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group span.mf-input-help strong{color:red}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner label.attr-input-label{display:inline-block}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner #limit_status{width:100px;margin:0;position:relative;margin-left:15px;float:right;margin-top:-2px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner input{margin:0}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner input[type=checkbox]+span:before{position:relative;top:-2px;left:5px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner input[type=checkbox]+span:after{right:28px;top:0px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner input[type=checkbox]:checked+span:after{right:-2px;top:0}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=number]+span,.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=text]+span{display:block;margin-top:5px}.attr-modal-dialog-centered .attr-tab-content #limit_status.show_input{margin-top:32px}.attr-modal-dialog-centered .attr-modal-footer{padding:30px 50px}.attr-modal-dialog-centered .attr-modal-footer button{color:#fff;background-color:#1F55F8;font-size:16px;font-weight:bold;-webkit-box-sizing:border-box;box-sizing:border-box;padding:12px 20px;-webkit-box-shadow:none;box-shadow:none;border:1px solid transparent;-webkit-transition:all .4s;-o-transition:all .4s;transition:all .4s;outline:none}.attr-modal-dialog-centered .attr-modal-footer button:focus{border:none;outline:none}.attr-modal-dialog-centered .attr-modal-footer button.metform-form-save-btn-editor{background-color:#d8d8d8;color:#111111}.attr-modal-dialog-centered>form{width:100%}.modal-backdrop{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:rgba(0, 0, 0, 0.5)}.modal-backdrop{z-index:9999}.attr-modal{z-index:10000}.mf_multipile_ajax_search_filed .select2-container--default .select2-selection--multiple .select2-selection__choice{line-height:1.5;font-size:.9em;border:none;border-radius:0;color:#6d7882}.mf-headerfooter-status{display:inline-block;margin-left:5px;padding:2px 5px 3px;color:#FFFFFF;background-color:#9a9a9a;border-radius:3px;font-size:10px;line-height:1;font-weight:700}.mf-headerfooter-status-active{background-color:#00cd00}.irs--round .irs-max,.irs--round .irs-min{display:none}.irs--round .irs-handle{cursor:pointer}.mf-success-msg{position:fixed;z-index:9;text-align:center;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);transform:translate(-50%, -50%);-webkit-box-shadow:0px 2px 5px rgba(153, 153, 153, 0.2);box-shadow:0px 2px 5px rgba(153, 153, 153, 0.2);min-width:300px}textarea.attr-form-control{height:auto!important}.post-type-metform-form .row-actions .inline{display:none!important}div.metform-entry-browser-data table tbody,div.metform-entry-browser-data table thead,div.metform-entry-data table tbody,div.metform-entry-data table thead{text-align:left}img.form-editor-icon{height:20px;width:20px;margin-right:5px;vertical-align:middle}div.mf-file-show button.attr-btn.attr-btn-primary{margin-left:10px}.mf-file-show a{text-decoration:none}.mf-modal-container{margin-top:50px}.mf-modal-container .attr-modal-body img{margin:0 auto}.mf-entry-input,.mf-entry-label{-webkit-box-sizing:border-box;box-sizing:border-box}.mf-entry-filter{margin-right:10px}.mf-entry-filter{min-width:15%}.mf-entry-export-csv{min-width:20%}.metform_open_content_editor_modal .attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]+span:before{line-height:20px}.mf-image-select-input,.mf-toggle-select-input{position:absolute;opacity:0;width:0;height:0}.mf-image-select-input+img,.mf-toggle-select-input+p{cursor:pointer}.mf-input-rest-api-group .mf-rest-api-key{width:100px;display:inline-block;position:relative;top:-1px}.mf-input-rest-api-group .mf-rest-api{width:calc(100% - 110px);vertical-align:middle;display:inline-block!important}.metform_open_content_editor_modal .mf-rest-api-key{top:0}.metform-entry-data table.mf-entry-data{width:100%;background-color:#FFFFFF;border:1px solid #EAF2FA}.metform-entry-data table.mf-entry-data tbody tr.mf-data-label{background-color:#EAF2FA}.metform-entry-data table.mf-entry-data tbody tr.mf-data-value{background-color:#FFFFFF}.metform-entry-data table.mf-entry-data tbody tr.mf-data-value td.mf-value-space{width:20px}
|
public/assets/css/category-top.css
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#elementor-panel-categories {
|
2 |
+
display: flex;
|
3 |
+
flex-wrap: wrap;
|
4 |
+
flex-direction: column;
|
5 |
+
}
|
6 |
+
#elementor-panel-category-metform {
|
7 |
+
order: -10;
|
8 |
+
}
|
public/assets/css/style.css
CHANGED
@@ -11,23 +11,37 @@
|
|
11 |
position: relative;
|
12 |
display: inline-block;
|
13 |
}
|
|
|
14 |
.mf-input-control {
|
15 |
position: absolute;
|
16 |
z-index: -1;
|
17 |
opacity: 0;
|
18 |
}
|
19 |
.mf-input-switch .mf-input-control-label::before {
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
pointer-events: none;
|
25 |
-
content: "";
|
26 |
-
background-color: #fff;
|
27 |
-
border: #adb5bd solid 1px;
|
28 |
-
border-radius: 50px;
|
29 |
left: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
transition: all .4s;
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
|
33 |
.metform-msg {
|
@@ -52,6 +66,7 @@
|
|
52 |
background-color: #adb5bd;
|
53 |
border-radius: 100px;
|
54 |
transition: all .4s;
|
|
|
55 |
}
|
56 |
|
57 |
.mf-input-switch label.mf-input-control-label {
|
@@ -63,11 +78,15 @@
|
|
63 |
color: #fff;
|
64 |
border-color: #007bff;
|
65 |
background-color: #007bff;
|
|
|
|
|
|
|
|
|
66 |
}
|
67 |
.mf-input-switch .mf-input-control:checked~.mf-input-control-label::after {
|
68 |
background-color: #fff;
|
69 |
-
right: 2px;
|
70 |
-
left: inherit;
|
71 |
}
|
72 |
.metform-msg{
|
73 |
display: none;
|
@@ -89,13 +108,22 @@
|
|
89 |
border-style: solid;
|
90 |
border-color: #eaeaea;
|
91 |
border-radius: 2px;
|
92 |
-
background:
|
|
|
93 |
box-shadow: none;
|
94 |
box-sizing: border-box;
|
95 |
transition: all .2s linear;
|
96 |
-
background-color: transparent;
|
97 |
font-size: 14px;
|
98 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
.mf-input-wrapper .mf-input::placeholder {
|
100 |
color: #c9c1c1;
|
101 |
font-weight: 400;
|
@@ -114,6 +142,12 @@
|
|
114 |
.mf-input-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered{
|
115 |
font-size: 14px;
|
116 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
.mf-input-wrapper .mf-input-label{
|
118 |
font-family: "Roboto", Sans-serif;
|
119 |
font-weight: 600;
|
@@ -238,9 +272,9 @@ div.mf-input-wrapper > textarea.mf-input {
|
|
238 |
width: 100%;
|
239 |
height: auto;
|
240 |
border-color: #eaeaea;
|
241 |
-
padding:
|
242 |
border-radius: 0;
|
243 |
-
background-color:
|
244 |
}
|
245 |
.mf-input-wrapper .select2-container--default .select2-selection--single .select2-selection__arrow {
|
246 |
height: 26px;
|
@@ -282,6 +316,7 @@ div.mf-input-wrapper > textarea.mf-input {
|
|
282 |
white-space: nowrap;
|
283 |
border: 1px solid #eaeaea;
|
284 |
padding: 5px !important;
|
|
|
285 |
}
|
286 |
.mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice {
|
287 |
background-color: #eaeaea;
|
@@ -358,7 +393,7 @@ div.mf-input-wrapper > textarea.mf-input {
|
|
358 |
transform: translateX(-50%);
|
359 |
}
|
360 |
.metform-btn {
|
361 |
-
background-color: #
|
362 |
border: none;
|
363 |
box-shadow: none;
|
364 |
display: inline-block;
|
@@ -366,6 +401,16 @@ div.mf-input-wrapper > textarea.mf-input {
|
|
366 |
font-size: 16px;
|
367 |
border-radius: 2px;
|
368 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
}
|
370 |
|
371 |
.mf-input-wrapper ul.mf-input-rating {
|
@@ -403,20 +448,6 @@ display: none;
|
|
403 |
.mf-input-wrapper .iti > .iti__flag-container{
|
404 |
display: block;
|
405 |
}
|
406 |
-
/* HIDE RADIO */
|
407 |
-
.mf-image-select-input,
|
408 |
-
.mf-toggle-select-input {
|
409 |
-
position: absolute;
|
410 |
-
opacity: 0;
|
411 |
-
width: 0;
|
412 |
-
height: 0;
|
413 |
-
}
|
414 |
-
|
415 |
-
/* IMAGE STYLES */
|
416 |
-
.mf-image-select-input + img,
|
417 |
-
.mf-toggle-select-input + p {
|
418 |
-
cursor: pointer;
|
419 |
-
}
|
420 |
|
421 |
.flatpickr-calendar {
|
422 |
margin-bottom: -8px;
|
@@ -442,6 +473,10 @@ ul.mf-input.mf-input-rating{
|
|
442 |
padding: 5px 15px;
|
443 |
display: inline-flex;
|
444 |
align-items: center;
|
|
|
|
|
|
|
|
|
445 |
}
|
446 |
.mf-input-file-upload-label i{
|
447 |
font-size: 18px;
|
@@ -452,5 +487,15 @@ ul.mf-input.mf-input-rating{
|
|
452 |
vertical-align: middle;
|
453 |
}
|
454 |
.mf-file-name span{
|
455 |
-
display: inline-block
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
}
|
11 |
position: relative;
|
12 |
display: inline-block;
|
13 |
}
|
14 |
+
|
15 |
.mf-input-control {
|
16 |
position: absolute;
|
17 |
z-index: -1;
|
18 |
opacity: 0;
|
19 |
}
|
20 |
.mf-input-switch .mf-input-control-label::before {
|
21 |
+
content: attr(data-disable);
|
22 |
+
width: 55px;
|
23 |
+
height: 25px;
|
24 |
+
background-color: #EDEDED;
|
|
|
|
|
|
|
|
|
|
|
25 |
left: 0;
|
26 |
+
border-radius: 15px;
|
27 |
+
text-align: right;
|
28 |
+
color: #fff;
|
29 |
+
text-transform: uppercase;
|
30 |
+
font-weight: bold;
|
31 |
+
font-size: 10px;
|
32 |
+
padding: 3px;
|
33 |
+
-webkit-box-sizing: border-box;
|
34 |
+
box-sizing: border-box;
|
35 |
+
padding-right: 10px;
|
36 |
+
-webkit-transition: all .4s;
|
37 |
+
-o-transition: all .4s;
|
38 |
transition: all .4s;
|
39 |
+
float: right;
|
40 |
+
line-height: 18px;
|
41 |
+
cursor: pointer;
|
42 |
+
display: flex;
|
43 |
+
align-items: center;
|
44 |
+
justify-content: flex-end;
|
45 |
}
|
46 |
|
47 |
.metform-msg {
|
66 |
background-color: #adb5bd;
|
67 |
border-radius: 100px;
|
68 |
transition: all .4s;
|
69 |
+
cursor: pointer;
|
70 |
}
|
71 |
|
72 |
.mf-input-switch label.mf-input-control-label {
|
78 |
color: #fff;
|
79 |
border-color: #007bff;
|
80 |
background-color: #007bff;
|
81 |
+
content: attr(data-enable);
|
82 |
+
text-align: left;
|
83 |
+
padding-left: 10px;
|
84 |
+
justify-content: flex-start;
|
85 |
}
|
86 |
.mf-input-switch .mf-input-control:checked~.mf-input-control-label::after {
|
87 |
background-color: #fff;
|
88 |
+
/* right: 2px;
|
89 |
+
left: inherit; */
|
90 |
}
|
91 |
.metform-msg{
|
92 |
display: none;
|
108 |
border-style: solid;
|
109 |
border-color: #eaeaea;
|
110 |
border-radius: 2px;
|
111 |
+
background: none;
|
112 |
+
background-color: #fafafa;
|
113 |
box-shadow: none;
|
114 |
box-sizing: border-box;
|
115 |
transition: all .2s linear;
|
|
|
116 |
font-size: 14px;
|
117 |
}
|
118 |
+
|
119 |
+
.mf-input-wrapper.mf-field-error .mf-input,
|
120 |
+
.mf-input-wrapper.mf-field-error .mf-input:focus,
|
121 |
+
.mf-input-wrapper .mf-input:focus{
|
122 |
+
outline: none;
|
123 |
+
}
|
124 |
+
.mf-input-wrapper .mf-input:focus{
|
125 |
+
border-color: #4285f478
|
126 |
+
}
|
127 |
.mf-input-wrapper .mf-input::placeholder {
|
128 |
color: #c9c1c1;
|
129 |
font-weight: 400;
|
142 |
.mf-input-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered{
|
143 |
font-size: 14px;
|
144 |
}
|
145 |
+
.mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__rendered li{
|
146 |
+
line-height: 29px;
|
147 |
+
}
|
148 |
+
.mf-input-wrapper .select2-container--default .select2-search--inline .select2-search__field{
|
149 |
+
line-height: inherit;
|
150 |
+
}
|
151 |
.mf-input-wrapper .mf-input-label{
|
152 |
font-family: "Roboto", Sans-serif;
|
153 |
font-weight: 600;
|
272 |
width: 100%;
|
273 |
height: auto;
|
274 |
border-color: #eaeaea;
|
275 |
+
padding: 8px;
|
276 |
border-radius: 0;
|
277 |
+
background-color: #FAFAFA;
|
278 |
}
|
279 |
.mf-input-wrapper .select2-container--default .select2-selection--single .select2-selection__arrow {
|
280 |
height: 26px;
|
316 |
white-space: nowrap;
|
317 |
border: 1px solid #eaeaea;
|
318 |
padding: 5px !important;
|
319 |
+
background-color:#FAFAFA
|
320 |
}
|
321 |
.mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice {
|
322 |
background-color: #eaeaea;
|
393 |
transform: translateX(-50%);
|
394 |
}
|
395 |
.metform-btn {
|
396 |
+
background-color: #4285f4;
|
397 |
border: none;
|
398 |
box-shadow: none;
|
399 |
display: inline-block;
|
401 |
font-size: 16px;
|
402 |
border-radius: 2px;
|
403 |
cursor: pointer;
|
404 |
+
box-shadow: 0px 5px 5px 0px rgba(66,133,244,0.3);
|
405 |
+
line-height: 18px;
|
406 |
+
transition: all .4s;
|
407 |
+
font-weight: 500;
|
408 |
+
text-decoration: none;
|
409 |
+
}
|
410 |
+
.metform-btn:hover,
|
411 |
+
.metform-btn:focus {
|
412 |
+
background-color: #4285f4;
|
413 |
+
outline: none;
|
414 |
}
|
415 |
|
416 |
.mf-input-wrapper ul.mf-input-rating {
|
448 |
.mf-input-wrapper .iti > .iti__flag-container{
|
449 |
display: block;
|
450 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
451 |
|
452 |
.flatpickr-calendar {
|
453 |
margin-bottom: -8px;
|
473 |
padding: 5px 15px;
|
474 |
display: inline-flex;
|
475 |
align-items: center;
|
476 |
+
box-shadow: none;
|
477 |
+
font-size: 16px;
|
478 |
+
font-weight: normal;
|
479 |
+
line-height: 28px;
|
480 |
}
|
481 |
.mf-input-file-upload-label i{
|
482 |
font-size: 18px;
|
487 |
vertical-align: middle;
|
488 |
}
|
489 |
.mf-file-name span{
|
490 |
+
display: inline-block;
|
491 |
+
font-size: 15px;
|
492 |
+
}
|
493 |
+
|
494 |
+
.mf-input-wrapper .error {
|
495 |
+
display: block;
|
496 |
+
font-size: 14px;
|
497 |
+
}
|
498 |
+
.mf-input-multiselect,
|
499 |
+
.mf-input-select{
|
500 |
+
display: none;
|
501 |
}
|
public/assets/js/admin-script.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(e){"use strict";function t(t){if(e(".mf-form-user-confirmation").hide(),e(".mf-form-admin-notification").hide(),e(".mf-input-rest-api-group").hide(),e(".mf-mailchimp").hide(),e(".mf-zapier").hide(),e(".mf-slack").hide(),e(".mf-recaptcha").hide(),""!=t.form_title){e(".mf-form-modalinput-title").val(t.form_title),e(".mf-form-modalinput-success_message").val(t.success_message),e(".mf-form-modalinput-redirect_to").val(t.redirect_to),e(".mf-form-modalinput-limit_total_entries").val(t.limit_total_entries);var
|
1 |
+
jQuery(document).ready(function(e){"use strict";function t(t){if(e(".mf-form-user-confirmation").hide(),e(".mf-form-admin-notification").hide(),e(".mf-input-rest-api-group").hide(),e(".mf-mailchimp").hide(),e(".mf-zapier").hide(),e(".mf-slack").hide(),e(".mf-paypal").hide(),e(".mf-recaptcha").hide(),""!=t.form_title){e(".mf-form-modalinput-title").val(t.form_title),e(".mf-form-modalinput-success_message").val(t.success_message),e(".mf-form-modalinput-redirect_to").val(t.redirect_to),e(".mf-form-modalinput-success_url").val(t.success_url),e(".mf-form-modalinput-failed_cancel_url").val(t.failed_cancel_url),e(".mf-form-modalinput-limit_total_entries").val(t.limit_total_entries);var a=e(".mf-form-modalinput-store_entries");"1"==t.store_entries?a.attr("checked",!0):a.removeAttr("checked");var i=e(".mf-form-modalinput-hide_form_after_submission");"1"==t.hide_form_after_submission?i.attr("checked",!0):i.removeAttr("checked");var m=e(".mf-form-modalinput-require_login");"1"==t.require_login?m.attr("checked",!0):m.removeAttr("checked");var r=e(".mf-form-modalinput-limit_status");"1"==t.limit_total_entries_status?r.attr("checked",!0):r.removeAttr("checked");var o=e(".mf-form-modalinput-multiple_submission");"1"==t.multiple_submission?o.attr("checked",!0):o.removeAttr("checked");var s=e(".mf-form-modalinput-enable_recaptcha");"1"==t.enable_recaptcha?s.attr("checked",!0):s.removeAttr("checked");var n=e(".mf-form-modalinput-capture_user_browser_data");"1"==t.capture_user_browser_data?(n.attr("checked",!0),e("#multiple_submission").removeClass("hide_input"),e("#multiple_submission").addClass("show_input")):n.removeAttr("checked"),e(".mf-form-user-email-subject").val(t.user_email_subject),e(".mf-form-user-email-from").val(t.user_email_from),e(".mf-form-user-reply-to").val(t.user_email_reply_to),e(".mf-form-user-email-body").val(t.user_email_body);var c=e(".mf-form-user-enable");"1"==t.enable_user_notification?(c.attr("checked",!0),e(".mf-form-user-confirmation").show()):(c.removeAttr("checked"),e(".mf-form-user-confirmation").hide());var f=e(".mf-form-user-submission-copy");"1"==t.user_email_attach_submission_copy?f.attr("checked",!0):f.removeAttr("checked"),e(".mf-form-admin-email-subject").val(t.admin_email_subject),e(".mf-form-admin-email-from").val(t.admin_email_from),e(".mf-form-admin-email-to").val(t.admin_email_to),e(".mf-form-admin-reply-to").val(t.admin_email_reply_to),e(".mf-form-admin-email-body").val(t.admin_email_body);var d=e(".mf-form-admin-enable");"1"==t.enable_admin_notification?(d.attr("checked",!0),e(".mf-form-admin-notification").show()):(d.removeAttr("checked"),e(".mf-form-admin-notification").hide());var l=e(".mf-form-admin-submission-copy");"1"==t.admin_email_attach_submission_copy?l.attr("checked",!0):l.removeAttr("checked");var u=e(".mf-form-modalinput-rest_api");"1"==t.mf_rest_api?(u.attr("checked",!0),e(".mf-rest-api").show()):(u.removeAttr("checked"),e(".mf-rest-api").hide());var p=e(".mf-form-modalinput-mail_chimp");"1"==t.mf_mail_chimp?(p.attr("checked",!0),e(".mf-mailchimp").show()):(p.removeAttr("checked"),e(".mf-mailchimp").hide());var h=e(".mf-form-modalinput-zapier");"1"==t.mf_zapier?(h.attr("checked",!0),e(".mf-zapier").show()):(h.removeAttr("checked",!0),e(".mf-zapier").hide());var _=e(".mf-form-modalinput-slack");"1"==t.mf_slack?(_.attr("checked",!0),e(".mf-slack").show()):(_.removeAttr("checked",!0),e(".mf-slack").hide());var v=e(".mf-form-modalinput-paypal");"1"==t.mf_paypal?(v.attr("checked",!0),e(".mf-paypal").show()):(v.removeAttr("checked",!0),e(".mf-paypal").hide());var k=e(".mf-form-modalinput-paypal_sandbox");"1"==t.mf_paypal_sandbox?k.attr("checked",!0):k.removeAttr("checked",!0);var b=e(".mf-form-modalinput-recaptcha");"1"==t.mf_recaptcha?(b.attr("checked",!0),e(".mf-recaptcha").show()):b.removeAttr("checked");var y=t.mf_rest_api_method&&t.mf_rest_api_method.length?t.mf_rest_api_method:"POST";e('.mf-rest-api-method option[value="'+y+'"]').prop("selected",!0),e(".mf-rest-api-url").val(t.mf_rest_api_url),e(".mf-mailchimp-api-key").val(t.mf_mailchimp_api_key),e(".mf-mailchimp-list-id").val(t.mf_mailchimp_list_id),e(".mf-zapier-web-hook").val(t.mf_zapier_webhook),e(".mf-slack-web-hook").val(t.mf_slack_webhook),e(".mf-paypal-email").val(t.mf_paypal_email),e(".mf-paypal-token").val(t.mf_paypal_token),e(".mf-recaptcha-site-key").val(t.mf_recaptcha_site_key),e(".mf-recaptcha-secret-key").val(t.mf_recaptcha_secret_key),e("input.mf-form-modalinput-limit_status, .mf-form-modalinput-rest_api").trigger("change")}}e(".row-actions .edit a, .page-title-action, .metform-form-edit-btn, body.post-type-metform-form a.row-title").on("click",function(a){a.preventDefault();var i=0,m=e("#metform_form_modal"),r=e(this).parents(".column-title"),o=e("body").attr("data-metform-template-key");if(m.addClass("loading"),m.modal("show"),r.length>0){i=e(this).attr("data-metform-form-id"),"undefined"!==o&&(i=o),i=void 0!==i?i:r.find(".hidden").attr("id").split("_")[1];var s=e("#metform-form-modalinput-settings").attr("data-nonce");e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get/"+i,type:"get",headers:{"X-WP-Nonce":s},dataType:"json",success:function(e){t(e),m.removeClass("loading")}})}else{t({form_title:e(".mf-form-modalinput-title").attr("data-default-value"),admin_email_body:"",admin_email_from:"",admin_email_reply_to:"",admin_email_subject:"",capture_user_browser_data:"",enable_admin_notification:"",limit_total_entries_status:"",limit_total_entries:"0",redirect_to:"",success_url:"",failed_cancel_url:"",require_login:"",store_entries:"1",success_message:e(".mf-form-modalinput-success_message").attr("data-default-value"),user_email_body:"",user_email_from:"",user_email_reply_to:"",user_email_subject:""}),m.removeClass("loading")}m.find("form").attr("data-mf-id",i)}),e(".metform-form-save-btn-editor").on("click",function(){e(".metform-form-save-btn-editor").attr("disabled",!0);var t=e("#metform-form-modalinput-settings");t.attr("data-open-editor","1"),t.trigger("submit")}),e("#metform-form-modalinput-settings").on("submit",function(t){t.preventDefault();var a=e("#metform-form-modal");a.addClass("loading"),e(".metform-form-save-btn-editor").attr("disabled",!0),e(".metform-form-save-btn").attr("disabled",!0);var i=e(this).serialize(),m=e(this).attr("data-mf-id"),r=e(this).attr("data-open-editor"),o=e(this).attr("data-editor-url"),s=e(this).attr("data-nonce");e.ajax({url:window.metform_api.resturl+"metform/v1/forms/update/"+m,type:"post",data:i,headers:{"X-WP-Nonce":s},dataType:"json",success:function(t){e("#message").css("display","block"),1==t.saved?(e("#post-"+t.data.id).find(".row-title").html(t.data.title),e("#message").removeClass("attr-alert-warning").addClass("attr-alert-success").html(t.status)):e("#message").removeClass("attr-alert-success").addClass("attr-alert-warning").html(t.status),setTimeout(function(){e("#message").css("display","none")},5e3),a.removeClass("loading"),"1"==r&&1==t.saved?setTimeout(function(){window.location.href=o+"?post="+t.data.id+"&action=elementor"},1500):"0"!=m?(e(".metform-form-save-btn-editor").removeAttr("disabled"),e(".metform-form-save-btn").removeAttr("disabled")):"0"==m&&setTimeout(function(){location.reload()},1500)}})}),e("input.mf-form-modalinput-limit_status").on("change",function(){e(this).is(":checked")?e("#limit_status").find("input").removeAttr("disabled"):e(this).is(":not(:checked)")&&e("#limit_status").find("input").attr("disabled","disabled")}),e("input.mf-form-user-enable").on("change",function(){e(this).is(":checked")?e(".mf-form-user-confirmation").show():e(this).is(":not(:checked)")&&e(".mf-form-user-confirmation").hide()}),e("input.mf-form-admin-enable").on("change",function(){e(this).is(":checked")?e(".mf-form-admin-notification").show():e(this).is(":not(:checked)")&&e(".mf-form-admin-notification").hide()}),e("input.mf-form-modalinput-rest_api").on("change",function(){e(this).is(":checked")?e(".mf-input-rest-api-group").show():e(this).is(":not(:checked)")&&e(".mf-input-rest-api-group").hide()}),e("input.mf-form-modalinput-mail_chimp").on("change",function(){e(this).is(":checked")?e(".mf-mailchimp").show():e(this).is(":not(:checked)")&&e(".mf-mailchimp").hide()}),e("input.mf-form-modalinput-zapier").on("change",function(){e(this).is(":checked")?e(".mf-zapier").show():e(this).is(":not(:checked)")&&e(".mf-zapier").hide()}),e("input.mf-form-modalinput-slack").on("change",function(){e(this).is(":checked")?e(".mf-slack").show():e(this).is(":not(:checked)")&&e(".mf-slack").hide()}),e("input.mf-form-modalinput-paypal").on("change",function(){e(this).is(":checked")?e(".mf-paypal").show():e(this).is(":not(:checked)")&&e(".mf-paypal").hide()}),e("input.mf-form-modalinput-recaptcha").on("change",function(){e(this).is(":checked")?e(".mf-recaptcha").show():e(this).is(":not(:checked)")&&e(".mf-recaptcha").hide()}),e("input.mf-form-modalinput-capture_user_browser_data").click(function(){e(this).is(":checked")?(e("#multiple_submission").removeClass("hide_input"),e("#multiple_submission").addClass("show_input")):e(this).is(":not(:checked)")&&(e("#multiple_submission").removeClass("show_input"),e("#multiple_submission").addClass("hide_input"))})});
|
public/assets/js/inputs.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(t,e){"use strict";var a={init:function(){var n={"mf-range.default":a.RangeInput,"mf-date.default":a.DateInput,"mf-time.default":a.TimeInput,"mf-select.default":a.SelectInput,"mf-multi-select.default":a.MultiSelectInput,"mf-rating.default":a.Rating,"mf-file-upload.default":a.fileUpload};t.each(n,function(t,a){e.hooks.addAction("frontend/element_ready/"+t,a)})},RangeInput:function(e){var a=e.find(".mf-rs-range"),n=a.attr("min"),i=a.attr("max"),r=a.attr("step"),f=a.attr("range"),l={step:r,min:n,max:i};"true"==f&&(l.range=Boolean(f)),a.asRange(l),a.on("asRange::change",function(e){var a=t(this).asRange("get");Array.isArray(a)&&(a=Number(a[1])-Number(a[0])),t(this).val(a).trigger("change")})},DateInput:function(t){var e=t.find(".mf-date-input"),a=e.attr("data-mfMinDate"),n=e.attr("data-mfMaxDate"),i=e.attr("data-mfRangeDate"),r=e.attr("data-mfDateFormat"),f=e.attr("data-mfEnableTime"),l=e.attr("data-mfDisableDates"),d={appendTo:t.find(".mf-input-wrapper").get(0)};"yes"==f&&(d.enableTime=!0,r+=" H:i"),""!=l&&(d.disable=JSON.parse(l)),""!=a&&(d.minDate=a),""!=n&&(d.maxDate=n),"yes"==i&&(d.mode="range"),d.dateFormat=r,e.flatpickr(d)},TimeInput:function(t){var e=t.find(".mf-input-time"),a=e.attr("mftime24h"),n={appendTo:t.find(".mf-input-wrapper").get(0),dateFormat:"h:i K",enableTime:!0,noCalendar:!0};"yes"==a&&(n.dateFormat="H:i",n.time_24hr=!0),e.flatpickr(n)},SelectInput:function(t){t.find("select.mf-input-select").select2({dropdownParent:t.find(".mf-input-wrapper")})},MultiSelectInput:function(
|
1 |
+
!function(t,e){"use strict";var a={init:function(){var n={"mf-range.default":a.RangeInput,"mf-date.default":a.DateInput,"mf-time.default":a.TimeInput,"mf-select.default":a.SelectInput,"mf-multi-select.default":a.MultiSelectInput,"mf-rating.default":a.Rating,"mf-file-upload.default":a.fileUpload};t.each(n,function(t,a){e.hooks.addAction("frontend/element_ready/"+t,a)})},RangeInput:function(e){var a=e.find(".mf-rs-range"),n=a.attr("min"),i=a.attr("max"),r=a.attr("step"),f=a.attr("range"),l={step:r,min:n,max:i};"true"==f&&(l.range=Boolean(f)),a.asRange(l),a.on("asRange::change",function(e){var a=t(this).asRange("get");Array.isArray(a)&&(a=Number(a[1])-Number(a[0])),t(this).val(a).trigger("change").valid()})},DateInput:function(t){var e=t.find(".mf-date-input"),a=e.attr("data-mfMinDate"),n=e.attr("data-mfMaxDate"),i=e.attr("data-mfRangeDate"),r=e.attr("data-mfDateFormat"),f=e.attr("data-mfEnableTime"),l=e.attr("data-mfDisableDates"),d={appendTo:t.find(".mf-input-wrapper").get(0)};"yes"==f&&(d.enableTime=!0,r+=" H:i"),""!=l&&(d.disable=JSON.parse(l)),""!=a&&(d.minDate=a),""!=n&&(d.maxDate=n),"yes"==i&&(d.mode="range"),d.dateFormat=r,e.flatpickr(d)},TimeInput:function(t){var e=t.find(".mf-input-time"),a=e.attr("data-mftime24h"),n={appendTo:t.find(".mf-input-wrapper").get(0),dateFormat:"h:i K",enableTime:!0,noCalendar:!0};"yes"==a&&(n.dateFormat="H:i",n.time_24hr=!0),e.flatpickr(n)},SelectInput:function(t){t.find("select.mf-input-select").select2({dropdownParent:t.find(".mf-input-wrapper")})},MultiSelectInput:function(e){var a=e.find("select.mf-input-multiselect");a.select2({dropdownParent:e.find(".mf-input-wrapper")}),a.on("change",function(){t(this).valid()})},Rating:function(e){var a=e.find(".mf-input-rating li");a.on("mouseover",function(){var e=parseInt(t(this).data("value"),10);t(this).parent().children("li.star-li").each(function(a){a<e?t(this).addClass("hover"):t(this).removeClass("hover")})}).on("mouseout",function(){t(this).parent().children("li.star-li").each(function(e){t(this).removeClass("hover")})}),a.on("click",function(){var e=parseInt(t(this).data("value"),10),a=t(this).parent().children("li.star-li");for(let e=0;e<a.length;e++)t(a[e]).removeClass("selected");for(let n=0;n<e;n++)t(a[n]).addClass("selected");var n=t(this).parents().find("input.mf-input-hidden");n.val(e),n.valid()})},fileUpload:function(e){e.find(".mf-input-file-upload").on("change",function(){var a=t(this).val().match(/\\([^\\]+)$/)[1];e.find(".mf-file-name span").html(a)})}};t(window).on("elementor/frontend/init",a.init)}(jQuery,window.elementorFrontend);
|
public/assets/js/jquery.validate.min.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/*! jQuery Validation Plugin - v1.16.0 - 12/2/2016
|
2 |
+
* http://jqueryvalidation.org/
|
3 |
+
* Copyright (c) 2016 Jörn Zaefferer; Licensed MIT */
|
4 |
+
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return!c.settings.submitHandler||(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),e=c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),void 0!==e&&e)}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(null!=j&&null!=j.form){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}}),a.extend(a.expr.pseudos||a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){var c=a(b).val();return null!==c&&!!a.trim(""+c)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){!this.form&&this.hasAttribute("contenteditable")&&(this.form=a(this).closest("form")[0]);var c=a.data(this.form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!a(this).is(e.ignore)&&e[d].call(c,this,b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=g.check(e)&&h))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)a[b]&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.hasAttribute("contenteditable")&&(this.form=a(this).closest("form")[0]),!(d in c||!b.objectLength(a(this).rules()))&&(c[d]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type;return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=b.hasAttribute("contenteditable")?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);if("function"==typeof f.normalizer){if(i=f.normalizer.call(b,i),"string"!=typeof i)throw new TypeError("The normalizer should return a string value.");delete f.normalizer}for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j instanceof TypeError&&(j.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){"string"==typeof c&&(c={method:c});var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement.call(this,d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return a.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return!this.dependTypes[typeof a]||this.dependTypes[typeof a](a,b)},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return c="string"==typeof c&&c||"remote",a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0===e.param||e.param:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(d,e){b[d]=a.isFunction(e)&&"normalizer"!==d?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e<=d},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e,f=a(c).attr("type"),g="Step attribute on input type "+f+" is not supported.",h=["text","number","range"],i=new RegExp("\\b"+f+"\\b"),j=f&&!i.test(h.join()),k=function(a){var b=(""+a).match(/(?:\.(\d+))?$/);return b&&b[1]?b[1].length:0},l=function(a){return Math.round(a*Math.pow(10,e))},m=!0;if(j)throw new Error(g);return e=k(d),(k(b)>e||l(b)%l(d)!==0)&&(m=!1),this.optional(c)||m},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var b,c={};return a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a});
|
public/assets/js/submission.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var onloadMetFormCallback=function(){jQuery(".recaptcha_site_key").each(function(e){var t=jQuery(this),a=t.parents(".metform-form-content");t.attr("id",t.attr("id")+"_"+e),grecaptcha.render("recaptcha_site_key_"+e,{sitekey:a.data("site-key")})})};jQuery(document).ready(function(e){e(".metform-form-content").
|
1 |
+
var onloadMetFormCallback=function(){jQuery(".recaptcha_site_key").each(function(e){var t=jQuery(this),a=t.parents(".metform-form-content");t.attr("id",t.attr("id")+"_"+e),grecaptcha.render("recaptcha_site_key_"+e,{sitekey:a.data("site-key")})})};jQuery(document).ready(function(e){var t=!1;e.validator.addMethod("regx",function(e,t,a){return new RegExp(a).test(e)},e.validator.format("Please match the expression {0}")),e.validator.addMethod("wordLength",function(e,t,a){var s=e.trim().split(/\s+/),n=a.min,r=a.max;return!n&&r&&(n=1),s.filter(()=>s.length>=n&&s.length<=r).length},e.validator.format("Please match word length.")),jQuery.validator.addMethod("ratingValidate",function(t,a,s){return!e(a).prop("required")||e(a).parents(".mf-input-wrapper").find(".mf-input-rating li.selected").length},e.validator.format(mf_submission.default_required_message)),e(".metform-form-content").validate({ignore:[],rules:{"mf-rating":{ratingValidate:!0}},submitHandler:function(e){t=!0},errorPlacement:function(e,t){t.parents(".mf-input-wrapper").append(e)},highlight:function(t){e(t).parents(".mf-input-wrapper").addClass("mf-field-error")},unhighlight:function(t){e(t).parents(".mf-input-wrapper").removeClass("mf-field-error")}}),e(".mf-input").each(function(){var t=e(this).attr("data-validation"),a=e(this).attr("min"),s=e(this).attr("max"),n={messages:{required:mf_submission.default_required_message,email:mf_submission.default_required_message,url:mf_submission.default_required_message,range:mf_submission.default_required_message,max:mf_submission.default_required_message,min:mf_submission.default_required_message}};t&&("none"!==(t=JSON.parse(t)).validation_type&&(n.required=!0,n.messages.required=t.warning_message),"by_character_length"===t.validation_type?(t.min_length&&(n.minlength=t.min_length,n.messages.minlength=t.warning_message),t.max_length&&(n.maxlength=t.max_length,n.messages.maxlength=t.warning_message),n.messages.email=t.warning_message):"by_word_length"===t.validation_type?(n.wordLength={},n.messages.wordLength=t.warning_message,t.min_length&&(n.wordLength.min=t.min_length),t.max_length&&(n.wordLength.max=t.max_length),n.messages.email=t.warning_message):"by_expresssion_based"===t.validation_type&&(n.messages.regx=t.warning_message,t.expression&&e(this).rules("add",{regx:t.expression}),n.messages.email=t.warning_message)),(a||s)&&(n.range=[a,s]),e(this).rules("add",n)}),e(".metform-form-content").submit(function(a){if(t){a.preventDefault();var s=e(this);s.find('.mf-input[type="tel"]').each(function(){var t,a=e(this),s=a.val();t=a.siblings(".iti__flag-container").find(".iti__selected-dial-code").text(),a.val(t+s)});var n=s.parent().find(".metform-msg"),r=s.attr("action"),i=new FormData(this),m=s.attr("data-nonce");n.length>1&&s.parent().find(".metform-inx").remove(),e.ajax({url:r,type:"POST",dataType:"JSON",data:i,processData:!1,contentType:!1,headers:{"X-WP-Nonce":m},success:function(a){t=!1;var r=Number(a.status),i="";e.each(a.error,function(e,t){i+=t+"<br>"}),i.replace(/<br>+$/,""),1==r?(n.css("display","block"),n.removeClass("attr-alert-warning"),n.addClass("attr-alert-success"),n.html(a.data.message),setTimeout(function(){n.css("display","none")},8e3),s.trigger("reset"),s.find(".metform-step-item").removeClass("active prev next").first().addClass("active").next().addClass("next"),s.find(".elementor-top-section").first().addClass("active").find(".metform-btn").attr("type","submit").end().siblings().removeClass("active"),s.find(".elementor-section-wrap").css({transform:"translateX(0)"}),s.find(".mf-input-select, .mf-input-multiselect").trigger("change"),s.find(".mf-input > li").removeClass("selected"),s.find(".asRange > .asRange-pointer").css("left","0%"),s.find(".asRange > .asRange-selected").css({left:"0%",width:"0%"})):(n.css("display","block"),n.removeClass("attr-alert-success"),n.addClass("attr-alert-warning"),n.html(i),setTimeout(function(){n.css("display","none")},8e3)),""!=a.data.hide_form&&setTimeout(function(){s.css("display","none")},2e3),""!=a.data.redirect_to&&setTimeout(function(){window.location.href=a.data.redirect_to},1500)}})}})});
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
=== Metform Elementor Addon - Most flexible and design-friendly Contact Form builder ===
|
2 |
Contributors: ataurr, wpmet, emrnco, sayedulsayem
|
3 |
Tags: Form builder, Elementor form builder, contact form, custom form, forms, drag & drop form builder
|
4 |
Requires at least: 4.8
|
5 |
Tested up to: 5.3
|
6 |
-
Stable tag: 1.1.
|
7 |
Requires PHP: 5.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
@@ -16,6 +16,10 @@ Metform an addon for elementor builder, build any kind of form metform builder.
|
|
16 |
Metform builder an addon for elementor, build any form on the fly with metform builder. It can manage multiple contact forms, and you can customize the form with an elementor builder.
|
17 |
MetForm is not only a contact form plugin, but it is also a complete drag & drop form builder with elementor. You can build any contact forms, in Just Minutes. You don't even Have to be a programmer or developer.
|
18 |
|
|
|
|
|
|
|
|
|
19 |
<iframe width="560" height="315" src="https://www.youtube.com/embed/8R4-Q14cu-w" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
20 |
|
21 |
== Flexibility ==
|
@@ -65,6 +69,14 @@ You can use MailChimp in your contact form also create MailChimp signup forms wi
|
|
65 |
* Editable successful form submission message.
|
66 |
* Translation ready
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
|
70 |
|
@@ -89,19 +101,24 @@ You can use MailChimp in your contact form also create MailChimp signup forms wi
|
|
89 |
* Rating
|
90 |
* File Upload
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
== Changelog ==
|
93 |
-
Version: 1.1.7
|
94 |
-
Fixed notice removal button
|
95 |
-
Update form-picker-editor.js
|
96 |
-
Update style.css
|
97 |
-
Update banner
|
98 |
-
Update config
|
99 |
-
Libs change to public
|
100 |
-
Multiselect change
|
101 |
-
Fixed array ignore validation
|
102 |
-
Update submission.js
|
103 |
-
Fixed select reset after submission
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
Version: 1.1.5
|
107 |
3rd party plugin compatibility
|
@@ -130,9 +147,6 @@ Added telephone widget
|
|
130 |
Added widget area to edit save use from same page.
|
131 |
|
132 |
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
== Upgrade Notice ==
|
137 |
|
138 |
|
1 |
+
=== Metform Elementor Addon - Most flexible and design-friendly Contact Form builder ===
|
2 |
Contributors: ataurr, wpmet, emrnco, sayedulsayem
|
3 |
Tags: Form builder, Elementor form builder, contact form, custom form, forms, drag & drop form builder
|
4 |
Requires at least: 4.8
|
5 |
Tested up to: 5.3
|
6 |
+
Stable tag: 1.1.8
|
7 |
Requires PHP: 5.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
16 |
Metform builder an addon for elementor, build any form on the fly with metform builder. It can manage multiple contact forms, and you can customize the form with an elementor builder.
|
17 |
MetForm is not only a contact form plugin, but it is also a complete drag & drop form builder with elementor. You can build any contact forms, in Just Minutes. You don't even Have to be a programmer or developer.
|
18 |
|
19 |
+
== Metform intro ==
|
20 |
+
<iframe width="560" height="315" src="https://www.youtube.com/embed/zg1QIouKO_Q" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
21 |
+
|
22 |
+
== Metform from scratch ==
|
23 |
<iframe width="560" height="315" src="https://www.youtube.com/embed/8R4-Q14cu-w" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
24 |
|
25 |
== Flexibility ==
|
69 |
* Editable successful form submission message.
|
70 |
* Translation ready
|
71 |
|
72 |
+
== PRO FEATURES ==
|
73 |
+
* Muti Step form
|
74 |
+
* Calculation
|
75 |
+
* Conditional Logic
|
76 |
+
* Paypal Intregation
|
77 |
+
* Webhook
|
78 |
+
* Zapier Intregation
|
79 |
+
|
80 |
|
81 |
|
82 |
|
101 |
* Rating
|
102 |
* File Upload
|
103 |
|
104 |
+
== Supported PRO fields==
|
105 |
+
* Simple Repeater Field
|
106 |
+
* Toggle select Field
|
107 |
+
* Phone number with country code
|
108 |
+
* Image Select Field
|
109 |
+
* More coming soon
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
|
115 |
+
Version 1.1.8
|
116 |
+
Fix: Updated input default color
|
117 |
+
Fix: CSS bug fixed
|
118 |
+
Fix: JS bug fixed
|
119 |
+
Fix: Added default value of some widget controls
|
120 |
+
Fix: Organized the widget controls
|
121 |
+
Fix: Improved table UI
|
122 |
|
123 |
Version: 1.1.5
|
124 |
3rd party plugin compatibility
|
147 |
Added widget area to edit save use from same page.
|
148 |
|
149 |
|
|
|
|
|
|
|
150 |
== Upgrade Notice ==
|
151 |
|
152 |
|
traits/button-controls.php
CHANGED
@@ -23,8 +23,8 @@ trait Button_Controls{
|
|
23 |
[
|
24 |
'label' =>esc_html__( 'Label', 'metform' ),
|
25 |
'type' => Controls_Manager::TEXT,
|
26 |
-
'default' =>
|
27 |
-
'placeholder' =>
|
28 |
'dynamic' => [
|
29 |
'active' => true,
|
30 |
],
|
@@ -157,6 +157,13 @@ trait Button_Controls{
|
|
157 |
'label' =>esc_html__( 'Padding', 'metform' ),
|
158 |
'type' => Controls_Manager::DIMENSIONS,
|
159 |
'size_units' => [ 'px', 'em', '%' ],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
'selectors' => [
|
161 |
'{{WRAPPER}} .metform-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
162 |
],
|
@@ -337,10 +344,10 @@ trait Button_Controls{
|
|
337 |
'type' => Controls_Manager::DIMENSIONS,
|
338 |
'size_units' => [ 'px', '%'],
|
339 |
'default' => [
|
340 |
-
'top' => '',
|
341 |
-
'right' => '',
|
342 |
-
'bottom' => '' ,
|
343 |
-
'left' => '',
|
344 |
],
|
345 |
'selectors' => [
|
346 |
'{{WRAPPER}} .metform-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
23 |
[
|
24 |
'label' =>esc_html__( 'Label', 'metform' ),
|
25 |
'type' => Controls_Manager::TEXT,
|
26 |
+
'default' => $this->get_title(),
|
27 |
+
'placeholder' => $this->get_title(),
|
28 |
'dynamic' => [
|
29 |
'active' => true,
|
30 |
],
|
157 |
'label' =>esc_html__( 'Padding', 'metform' ),
|
158 |
'type' => Controls_Manager::DIMENSIONS,
|
159 |
'size_units' => [ 'px', 'em', '%' ],
|
160 |
+
'default' => [
|
161 |
+
'top' => '15',
|
162 |
+
'right' => '20',
|
163 |
+
'bottom' => '15',
|
164 |
+
'left' => '20',
|
165 |
+
'unit' => 'px',
|
166 |
+
],
|
167 |
'selectors' => [
|
168 |
'{{WRAPPER}} .metform-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
169 |
],
|
344 |
'type' => Controls_Manager::DIMENSIONS,
|
345 |
'size_units' => [ 'px', '%'],
|
346 |
'default' => [
|
347 |
+
'top' => '5',
|
348 |
+
'right' => '5',
|
349 |
+
'bottom' => '5' ,
|
350 |
+
'left' => '5',
|
351 |
],
|
352 |
'selectors' => [
|
353 |
'{{WRAPPER}} .metform-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
traits/common-controls.php
CHANGED
@@ -89,7 +89,7 @@ trait Common_Controls{
|
|
89 |
'type' => Controls_Manager::TEXT,
|
90 |
'default' => $this->get_name(),
|
91 |
'title' => esc_html__( 'Enter here name of the input', 'metform' ),
|
92 |
-
'description' => esc_html__('Name is must required. Enter name without space or any special character. use only underscore/ hyphen (_/-) for multiple word.', 'metform'),
|
93 |
]
|
94 |
);
|
95 |
}
|
@@ -135,43 +135,47 @@ trait Common_Controls{
|
|
135 |
);
|
136 |
}
|
137 |
|
138 |
-
if( in_array('
|
139 |
$this->add_control(
|
140 |
-
'
|
141 |
[
|
142 |
-
'label' => esc_html__( '
|
143 |
-
'type' => Controls_Manager::NUMBER,
|
144 |
-
'step' => 1,
|
145 |
-
]
|
146 |
-
);
|
147 |
-
$this->add_control(
|
148 |
-
'mf_input_max_length',
|
149 |
-
[
|
150 |
-
'label' => esc_html__( 'Max Length', 'metform' ),
|
151 |
-
'type' => Controls_Manager::NUMBER,
|
152 |
-
'step' => 1,
|
153 |
-
]
|
154 |
-
);
|
155 |
-
}
|
156 |
-
|
157 |
-
if( in_array('CHAR_WORD', $param ) ){
|
158 |
-
$this->add_control(
|
159 |
-
'mf_input_length_type',
|
160 |
-
[
|
161 |
-
'label' => esc_html__( 'Length type', 'metform' ),
|
162 |
'type' => Controls_Manager::SELECT,
|
163 |
'default' => 'none',
|
164 |
'options' => [
|
165 |
'none' => esc_html__( 'None', 'metform' ),
|
166 |
-
'
|
167 |
-
'
|
|
|
168 |
],
|
169 |
]
|
170 |
-
);
|
171 |
}
|
172 |
|
173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
|
|
|
175 |
$this->add_control(
|
176 |
'mf_input_validation_expression',
|
177 |
[
|
@@ -179,10 +183,25 @@ trait Common_Controls{
|
|
179 |
'type' => Controls_Manager::TEXTAREA,
|
180 |
'rows' => 2,
|
181 |
'placeholder' => esc_html__( 'Ex: [a-zA-Z]+ ', 'metform' ),
|
|
|
|
|
|
|
182 |
]
|
183 |
-
);
|
184 |
}
|
185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
|
187 |
// $this->add_control(
|
188 |
// 'mf_input_readonly_status',
|
@@ -351,11 +370,16 @@ trait Common_Controls{
|
|
351 |
],
|
352 |
'default' => '#FF0000',
|
353 |
'selectors' => [
|
354 |
-
'{{WRAPPER}} .mf-input-label .mf-input-required-indicator' => 'color: {{VALUE}}',
|
|
|
|
|
|
|
|
|
|
|
355 |
],
|
356 |
-
'condition' => [
|
357 |
-
|
358 |
-
],
|
359 |
]
|
360 |
);
|
361 |
|
@@ -373,6 +397,7 @@ trait Common_Controls{
|
|
373 |
'{{WRAPPER}} .mf-input' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
374 |
'{{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
375 |
'{{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .mf-input-wrapper .range-slider' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important',
|
|
|
376 |
],
|
377 |
]
|
378 |
);
|
@@ -385,7 +410,8 @@ trait Common_Controls{
|
|
385 |
'selectors' => [
|
386 |
'{{WRAPPER}} .mf-input' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
387 |
'{{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .select2-container--open .select2-dropdown--below' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
388 |
-
'{{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .mf-input-wrapper .range-slider' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
|
|
389 |
],
|
390 |
]
|
391 |
);
|
@@ -421,7 +447,7 @@ trait Common_Controls{
|
|
421 |
|
422 |
'{{WRAPPER}} .mf-input-wrapper .asRange .asRange-pointer:before, {{WRAPPER}} .mf-input-wrapper .asRange .asRange-pointer .asRange-tip:before, {{WRAPPER}} .mf-input-wrapper .asRange .asRange-selected' => 'background-color: {{VALUE}}',
|
423 |
'{{WRAPPER}} .mf-input-wrapper .asRange .asRange-pointer .asRange-tip' => 'background-color: {{VALUE}}; border-color: {{VALUE}}',
|
424 |
-
'{{WRAPPER}} .mf-input-file-upload-label' => 'color: {{VALUE}};',
|
425 |
'{{WRAPPER}} .mf-input-file-upload-label svg path' => 'stroke: {{VALUE}}; fill: {{VALUE}};',
|
426 |
],
|
427 |
'default' => '#000000',
|
@@ -435,7 +461,7 @@ trait Common_Controls{
|
|
435 |
'name' => 'mf_input_background',
|
436 |
'label' => esc_html__( 'Background', 'metform' ),
|
437 |
'types' => [ 'classic', 'gradient' ],
|
438 |
-
'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} span.select2-dropdown, {{WRAPPER}} span.select2-dropdown input, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice, {{WRAPPER}} .select2-container--default .select2-selection--multiple .select2-selection__choice__remove, {{WRAPPER}} .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag',
|
439 |
]
|
440 |
);
|
441 |
}
|
@@ -447,7 +473,7 @@ trait Common_Controls{
|
|
447 |
[
|
448 |
'name' => 'mf_input_border',
|
449 |
'label' => esc_html__( 'Border', 'metform' ),
|
450 |
-
'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .select2-container--default .select2-results>.select2-results__options, {{WRAPPER}} .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag',
|
451 |
]
|
452 |
);
|
453 |
}
|
@@ -475,7 +501,7 @@ trait Common_Controls{
|
|
475 |
'{{WRAPPER}} .mf-input:hover, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-dial-code' => 'color: {{VALUE}}',
|
476 |
'{{WRAPPER}} .irs--round .irs-handle:hover' => 'border-color: {{VALUE}}',
|
477 |
|
478 |
-
'{{WRAPPER}} .select2-container--default .select2-selection--single .select2-selection__rendered:hover,{{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:hover, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default ul.select2-results__options .select2-results__option[aria-selected=true]:hover, {{WRAPPER}} span.select2-dropdown input:hover, {{WRAPPER}} span.select2-dropdown:hover, {{WRAPPER}} span.select2-dropdown input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover .select2-selection__choice__remove,{{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label, {{WRAPPER}} .mf-file-upload-container:hover .mf-image-label' => 'color: {{VALUE}}',
|
479 |
|
480 |
'{{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label svg path' => 'stroke:{{VALUE}}; fill: {{VALUE}}',
|
481 |
|
@@ -492,7 +518,7 @@ trait Common_Controls{
|
|
492 |
'name' => 'mf_input_background_hover',
|
493 |
'label' => esc_html__( 'Background', 'metform' ),
|
494 |
'types' => [ 'classic', 'gradient' ],
|
495 |
-
'selector' => '{{WRAPPER}} .mf-input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:hover, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:hover, {{WRAPPER}} span.select2-dropdown:hover, {{WRAPPER}} span.select2-dropdown input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover .select2-selection__choice__remove, {{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-flag',
|
496 |
]
|
497 |
);
|
498 |
}
|
@@ -504,7 +530,7 @@ trait Common_Controls{
|
|
504 |
[
|
505 |
'name' => 'mf_input_border_hover',
|
506 |
'label' => esc_html__( 'Border', 'metform' ),
|
507 |
-
'selector' => '{{WRAPPER}} .mf-input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:hover, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field:hover, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:hover, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered:hover, {{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-flag',
|
508 |
]
|
509 |
);
|
510 |
}
|
@@ -533,7 +559,7 @@ trait Common_Controls{
|
|
533 |
'{{WRAPPER}} .mf-input:focus, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-dial-code' => 'color: {{VALUE}}',
|
534 |
'{{WRAPPER}} .irs--round .irs-handle:focus' => 'border-color: {{VALUE}}',
|
535 |
|
536 |
-
'{{WRAPPER}} .select2-container--default .select2-selection--single .select2-selection__rendered:focus,{{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:focus, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default ul.select2-results__options .select2-results__option[aria-selected=true]:focus, {{WRAPPER}} span.select2-dropdown input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus .select2-selection__choice__remove, {{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label, {{WRAPPER}} .mf-file-upload-container:focus .mf-image-label' => 'color: {{VALUE}};',
|
537 |
|
538 |
'{{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label svg path' => 'stroke: {{VALUE}}; fill: {{VALUE}};',
|
539 |
|
@@ -551,7 +577,7 @@ trait Common_Controls{
|
|
551 |
'name' => 'mf_input_background_focus',
|
552 |
'label' => esc_html__( 'Background', 'metform' ),
|
553 |
'types' => [ 'classic', 'gradient' ],
|
554 |
-
'selector' => '{{WRAPPER}} .mf-input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:focus, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:focus, {{WRAPPER}} span.select2-dropdown:focus, {{WRAPPER}} span.select2-dropdown input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus .select2-selection__choice__remove, {{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-flag',
|
555 |
]
|
556 |
);
|
557 |
|
@@ -564,7 +590,7 @@ trait Common_Controls{
|
|
564 |
[
|
565 |
'name' => 'mf_input_border_focus',
|
566 |
'label' => esc_html__( 'Border', 'metform' ),
|
567 |
-
'selector' => '{{WRAPPER}} .mf-input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:focus, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field:focus, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:focus, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered:focus, {{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-flag',
|
568 |
]
|
569 |
);
|
570 |
}
|
@@ -580,7 +606,7 @@ trait Common_Controls{
|
|
580 |
'name' => 'mf_input_typgraphy',
|
581 |
'label' => esc_html__( 'Typography', 'metform' ),
|
582 |
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
583 |
-
'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .irs--round .irs-single, {{WRAPPER}} .select2-container--default .select2-selection--single .select2-selection__rendered,{{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown, {{WRAPPER}} .mf-input-wrapper .select2-container--default ul.select2-results__options .select2-results__option[aria-selected=true], {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .asRange .asRange-pointer .asRange-tip, {{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag',
|
584 |
]
|
585 |
);
|
586 |
|
@@ -609,7 +635,7 @@ trait Common_Controls{
|
|
609 |
],
|
610 |
'selectors' => [
|
611 |
'{{WRAPPER}} .mf-input' => 'border-radius: {{SIZE}}{{UNIT}};',
|
612 |
-
'{{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag' => 'border-radius: {{SIZE}}{{UNIT}};',
|
613 |
],
|
614 |
'condition' => [
|
615 |
'mf_input_border_border!' => '',
|
@@ -622,7 +648,7 @@ trait Common_Controls{
|
|
622 |
[
|
623 |
'name' => 'mf_input_box_shadow',
|
624 |
'label' => esc_html__( 'Box Shadow', 'metform' ),
|
625 |
-
'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .irs--round .irs-line, {{WRAPPER}} .select2-container, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .mf-input-switch label.mf-input-control-label:before, {{WRAPPER}} .mf-input-wrapper .asRange, {{WRAPPER}} .asRange .asRange-pointer:before, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag',
|
626 |
]
|
627 |
);
|
628 |
|
89 |
'type' => Controls_Manager::TEXT,
|
90 |
'default' => $this->get_name(),
|
91 |
'title' => esc_html__( 'Enter here name of the input', 'metform' ),
|
92 |
+
'description' => esc_html__('Name is must required. Enter name without space or any special character. use only underscore/ hyphen (_/-) for multiple word. Name must be different.', 'metform'),
|
93 |
]
|
94 |
);
|
95 |
}
|
135 |
);
|
136 |
}
|
137 |
|
138 |
+
if( in_array('VALIDATION', $param ) ){
|
139 |
$this->add_control(
|
140 |
+
'mf_input_validation_type',
|
141 |
[
|
142 |
+
'label' => esc_html__( 'Validation type', 'metform' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
'type' => Controls_Manager::SELECT,
|
144 |
'default' => 'none',
|
145 |
'options' => [
|
146 |
'none' => esc_html__( 'None', 'metform' ),
|
147 |
+
'by_character_length' => esc_html__( 'By character length', 'metform' ),
|
148 |
+
'by_word_length' => esc_html__( 'By Word length', 'metform' ),
|
149 |
+
'by_expresssion_based' => esc_html__( 'By expression based', 'metform' ),
|
150 |
],
|
151 |
]
|
152 |
+
);
|
153 |
}
|
154 |
|
155 |
+
$this->add_control(
|
156 |
+
'mf_input_min_length',
|
157 |
+
[
|
158 |
+
'label' => esc_html__( 'Min Length', 'metform' ),
|
159 |
+
'type' => Controls_Manager::NUMBER,
|
160 |
+
'step' => 1,
|
161 |
+
'condition' => [
|
162 |
+
'mf_input_validation_type' => ['by_character_length', 'by_word_length']
|
163 |
+
],
|
164 |
+
]
|
165 |
+
);
|
166 |
+
$this->add_control(
|
167 |
+
'mf_input_max_length',
|
168 |
+
[
|
169 |
+
'label' => esc_html__( 'Max Length', 'metform' ),
|
170 |
+
'type' => Controls_Manager::NUMBER,
|
171 |
+
'step' => 1,
|
172 |
+
'condition' => [
|
173 |
+
'mf_input_validation_type' => ['by_character_length', 'by_word_length']
|
174 |
+
],
|
175 |
+
]
|
176 |
+
);
|
177 |
|
178 |
+
if( class_exists('\MetForm_Pro\Base\Package') ){
|
179 |
$this->add_control(
|
180 |
'mf_input_validation_expression',
|
181 |
[
|
183 |
'type' => Controls_Manager::TEXTAREA,
|
184 |
'rows' => 2,
|
185 |
'placeholder' => esc_html__( 'Ex: [a-zA-Z]+ ', 'metform' ),
|
186 |
+
'condition' => [
|
187 |
+
'mf_input_validation_type' => 'by_expresssion_based'
|
188 |
+
],
|
189 |
]
|
190 |
+
);
|
191 |
}
|
192 |
|
193 |
+
$this->add_control(
|
194 |
+
'mf_input_validation_warning_message',
|
195 |
+
[
|
196 |
+
'label' => esc_html__( 'Warning message', 'metform' ),
|
197 |
+
'type' => Controls_Manager::TEXT,
|
198 |
+
'placeholder' => esc_html__( 'Warning message', 'metform' ),
|
199 |
+
'default' => esc_html__( 'Something went wrong.', 'metform' ),
|
200 |
+
'condition' => [
|
201 |
+
'mf_input_validation_type!' => 'none',
|
202 |
+
],
|
203 |
+
]
|
204 |
+
);
|
205 |
|
206 |
// $this->add_control(
|
207 |
// 'mf_input_readonly_status',
|
370 |
],
|
371 |
'default' => '#FF0000',
|
372 |
'selectors' => [
|
373 |
+
'{{WRAPPER}} .mf-input-label .mf-input-required-indicator, {{WRAPPER}} .mf-input-wrapper .error,{{WRAPPER}} .mf-field-error .mf-input-calculation-total, {{WRAPPER}} .mf-field-error .mf-input-rating .star .mf-star' => 'color: {{VALUE}}',
|
374 |
+
'{{WRAPPER}} .mf-input-wrapper.mf-field-error .mf-input, {{WRAPPER}} .mf-input-wrapper.mf-field-error .select2-container .select2-selection--multiple .select2-selection__rendered' => 'border-color: {{VALUE}}',
|
375 |
+
|
376 |
+
'{{WRAPPER}} .mf-input-wrapper.mf-field-error .metform-btn' => 'background-color: {{VALUE}}',
|
377 |
+
|
378 |
+
'{{WRAPPER}} .mf-input-wrapper.mf-field-error .mf-input-switch .mf-input-control-label::before' => 'border: 1px solid {{VALUE}}'
|
379 |
],
|
380 |
+
// 'condition' => [
|
381 |
+
// 'mf_input_required' => 'yes',
|
382 |
+
// ],
|
383 |
]
|
384 |
);
|
385 |
|
397 |
'{{WRAPPER}} .mf-input' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
398 |
'{{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
399 |
'{{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .mf-input-wrapper .range-slider' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important',
|
400 |
+
'{{WRAPPER}} .mf-input-calculation-total' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
401 |
],
|
402 |
]
|
403 |
);
|
410 |
'selectors' => [
|
411 |
'{{WRAPPER}} .mf-input' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
412 |
'{{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .select2-container--open .select2-dropdown--below' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
413 |
+
'{{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .mf-input-wrapper .range-slider' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
414 |
+
'{{WRAPPER}} .mf-input-calculation-total' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
415 |
],
|
416 |
]
|
417 |
);
|
447 |
|
448 |
'{{WRAPPER}} .mf-input-wrapper .asRange .asRange-pointer:before, {{WRAPPER}} .mf-input-wrapper .asRange .asRange-pointer .asRange-tip:before, {{WRAPPER}} .mf-input-wrapper .asRange .asRange-selected' => 'background-color: {{VALUE}}',
|
449 |
'{{WRAPPER}} .mf-input-wrapper .asRange .asRange-pointer .asRange-tip' => 'background-color: {{VALUE}}; border-color: {{VALUE}}',
|
450 |
+
'{{WRAPPER}} .mf-input-file-upload-label, {{WRAPPER}} .mf-input-calculation-total' => 'color: {{VALUE}};',
|
451 |
'{{WRAPPER}} .mf-input-file-upload-label svg path' => 'stroke: {{VALUE}}; fill: {{VALUE}};',
|
452 |
],
|
453 |
'default' => '#000000',
|
461 |
'name' => 'mf_input_background',
|
462 |
'label' => esc_html__( 'Background', 'metform' ),
|
463 |
'types' => [ 'classic', 'gradient' ],
|
464 |
+
'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} span.select2-dropdown, {{WRAPPER}} span.select2-dropdown input, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice, {{WRAPPER}} .select2-container--default .select2-selection--multiple .select2-selection__choice__remove, {{WRAPPER}} .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total',
|
465 |
]
|
466 |
);
|
467 |
}
|
473 |
[
|
474 |
'name' => 'mf_input_border',
|
475 |
'label' => esc_html__( 'Border', 'metform' ),
|
476 |
+
'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .select2-container--default .select2-results>.select2-results__options, {{WRAPPER}} .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total',
|
477 |
]
|
478 |
);
|
479 |
}
|
501 |
'{{WRAPPER}} .mf-input:hover, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-dial-code' => 'color: {{VALUE}}',
|
502 |
'{{WRAPPER}} .irs--round .irs-handle:hover' => 'border-color: {{VALUE}}',
|
503 |
|
504 |
+
'{{WRAPPER}} .select2-container--default .select2-selection--single .select2-selection__rendered:hover,{{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:hover, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default ul.select2-results__options .select2-results__option[aria-selected=true]:hover, {{WRAPPER}} span.select2-dropdown input:hover, {{WRAPPER}} span.select2-dropdown:hover, {{WRAPPER}} span.select2-dropdown input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover .select2-selection__choice__remove,{{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label, {{WRAPPER}} .mf-file-upload-container:hover .mf-image-label, {{WRAPPER}} .mf-input-calculation-total:hover' => 'color: {{VALUE}}',
|
505 |
|
506 |
'{{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label svg path' => 'stroke:{{VALUE}}; fill: {{VALUE}}',
|
507 |
|
518 |
'name' => 'mf_input_background_hover',
|
519 |
'label' => esc_html__( 'Background', 'metform' ),
|
520 |
'types' => [ 'classic', 'gradient' ],
|
521 |
+
'selector' => '{{WRAPPER}} .mf-input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:hover, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:hover, {{WRAPPER}} span.select2-dropdown:hover, {{WRAPPER}} span.select2-dropdown input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover .select2-selection__choice__remove, {{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total:hover',
|
522 |
]
|
523 |
);
|
524 |
}
|
530 |
[
|
531 |
'name' => 'mf_input_border_hover',
|
532 |
'label' => esc_html__( 'Border', 'metform' ),
|
533 |
+
'selector' => '{{WRAPPER}} .mf-input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:hover, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field:hover, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:hover, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered:hover, {{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total:hover',
|
534 |
]
|
535 |
);
|
536 |
}
|
559 |
'{{WRAPPER}} .mf-input:focus, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-dial-code' => 'color: {{VALUE}}',
|
560 |
'{{WRAPPER}} .irs--round .irs-handle:focus' => 'border-color: {{VALUE}}',
|
561 |
|
562 |
+
'{{WRAPPER}} .select2-container--default .select2-selection--single .select2-selection__rendered:focus,{{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:focus, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default ul.select2-results__options .select2-results__option[aria-selected=true]:focus, {{WRAPPER}} span.select2-dropdown input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus .select2-selection__choice__remove, {{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label, {{WRAPPER}} .mf-file-upload-container:focus .mf-image-label, {{WRAPPER}} .mf-input-calculation-total:focus' => 'color: {{VALUE}};',
|
563 |
|
564 |
'{{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label svg path' => 'stroke: {{VALUE}}; fill: {{VALUE}};',
|
565 |
|
577 |
'name' => 'mf_input_background_focus',
|
578 |
'label' => esc_html__( 'Background', 'metform' ),
|
579 |
'types' => [ 'classic', 'gradient' ],
|
580 |
+
'selector' => '{{WRAPPER}} .mf-input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:focus, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:focus, {{WRAPPER}} span.select2-dropdown:focus, {{WRAPPER}} span.select2-dropdown input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus .select2-selection__choice__remove, {{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total:focus',
|
581 |
]
|
582 |
);
|
583 |
|
590 |
[
|
591 |
'name' => 'mf_input_border_focus',
|
592 |
'label' => esc_html__( 'Border', 'metform' ),
|
593 |
+
'selector' => '{{WRAPPER}} .mf-input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:focus, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field:focus, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:focus, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered:focus, {{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total:focus',
|
594 |
]
|
595 |
);
|
596 |
}
|
606 |
'name' => 'mf_input_typgraphy',
|
607 |
'label' => esc_html__( 'Typography', 'metform' ),
|
608 |
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
609 |
+
'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .irs--round .irs-single, {{WRAPPER}} .select2-container--default .select2-selection--single .select2-selection__rendered,{{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown, {{WRAPPER}} .mf-input-wrapper .select2-container--default ul.select2-results__options .select2-results__option[aria-selected=true], {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .asRange .asRange-pointer .asRange-tip, {{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total',
|
610 |
]
|
611 |
);
|
612 |
|
635 |
],
|
636 |
'selectors' => [
|
637 |
'{{WRAPPER}} .mf-input' => 'border-radius: {{SIZE}}{{UNIT}};',
|
638 |
+
'{{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total' => 'border-radius: {{SIZE}}{{UNIT}};',
|
639 |
],
|
640 |
'condition' => [
|
641 |
'mf_input_border_border!' => '',
|
648 |
[
|
649 |
'name' => 'mf_input_box_shadow',
|
650 |
'label' => esc_html__( 'Box Shadow', 'metform' ),
|
651 |
+
'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .irs--round .irs-line, {{WRAPPER}} .select2-container, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .mf-input-switch label.mf-input-control-label:before, {{WRAPPER}} .mf-input-wrapper .asRange, {{WRAPPER}} .asRange .asRange-pointer:before, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total',
|
652 |
]
|
653 |
);
|
654 |
|
widgets/button/button.php
CHANGED
@@ -5,6 +5,7 @@ defined( 'ABSPATH' ) || exit;
|
|
5 |
Class MetForm_Input_Button extends Widget_Base{
|
6 |
|
7 |
use \MetForm\Traits\Button_Controls;
|
|
|
8 |
|
9 |
public function get_name() {
|
10 |
return 'mf-button';
|
@@ -40,6 +41,10 @@ Class MetForm_Input_Button extends Widget_Base{
|
|
40 |
|
41 |
$this->end_controls_section();
|
42 |
|
|
|
|
|
|
|
|
|
43 |
$this->start_controls_section(
|
44 |
'mf_btn_hidden_input_content',
|
45 |
[
|
@@ -115,6 +120,8 @@ Class MetForm_Input_Button extends Widget_Base{
|
|
115 |
$btn_class = ($settings['mf_btn_class'] != '') ? $settings['mf_btn_class'] : '';
|
116 |
$btn_id = ($settings['mf_btn_id'] != '') ? 'id='.$settings['mf_btn_id'] : '';
|
117 |
$icon_align = $settings['mf_btn_icon_align'];
|
|
|
|
|
118 |
|
119 |
$hidden_inputs = isset($settings['mf_hidden_input']) ? $settings['mf_hidden_input'] : '';
|
120 |
|
@@ -126,19 +133,19 @@ Class MetForm_Input_Button extends Widget_Base{
|
|
126 |
}
|
127 |
|
128 |
?>
|
129 |
-
<div class="mf-btn-wraper">
|
130 |
<?php if($icon_align == 'right'): ?>
|
131 |
-
<button type="submit" class="metform-btn <?php echo esc_attr( $btn_class ); ?>" <?php echo esc_attr($btn_id); ?>>
|
132 |
<?php echo esc_html( $btn_text ); ?>
|
133 |
<?php if($settings['mf_btn_icon']['value'] != ''): ?><?php Icons_Manager::render_icon( $settings['mf_btn_icon'], [ 'aria-hidden' => 'true' ] ); ?><?php endif; ?>
|
134 |
</button>
|
135 |
<?php elseif ($icon_align == 'left') : ?>
|
136 |
-
<button type="submit" class="metform-btn <?php echo esc_attr( $btn_class); ?>" <?php echo esc_attr($btn_id); ?>>
|
137 |
<?php if($settings['mf_btn_icon']['value'] != ''): ?><?php Icons_Manager::render_icon( $settings['mf_btn_icon'], [ 'aria-hidden' => 'true' ] ); ?><?php endif; ?>
|
138 |
<?php echo esc_html( $btn_text ); ?>
|
139 |
</button>
|
140 |
<?php else : ?>
|
141 |
-
<button type="submit" class="metform-btn <?php echo esc_attr( $btn_class); ?>" <?php echo esc_attr($btn_id); ?>>
|
142 |
<?php echo esc_html( $btn_text ); ?>
|
143 |
</button>
|
144 |
<?php endif; ?>
|
5 |
Class MetForm_Input_Button extends Widget_Base{
|
6 |
|
7 |
use \MetForm\Traits\Button_Controls;
|
8 |
+
use \MetForm\Traits\Conditional_Controls;
|
9 |
|
10 |
public function get_name() {
|
11 |
return 'mf-button';
|
41 |
|
42 |
$this->end_controls_section();
|
43 |
|
44 |
+
if(class_exists('\MetForm_Pro\Base\Package')){
|
45 |
+
$this->input_conditional_control();
|
46 |
+
}
|
47 |
+
|
48 |
$this->start_controls_section(
|
49 |
'mf_btn_hidden_input_content',
|
50 |
[
|
120 |
$btn_class = ($settings['mf_btn_class'] != '') ? $settings['mf_btn_class'] : '';
|
121 |
$btn_id = ($settings['mf_btn_id'] != '') ? 'id='.$settings['mf_btn_id'] : '';
|
122 |
$icon_align = $settings['mf_btn_icon_align'];
|
123 |
+
|
124 |
+
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|
125 |
|
126 |
$hidden_inputs = isset($settings['mf_hidden_input']) ? $settings['mf_hidden_input'] : '';
|
127 |
|
133 |
}
|
134 |
|
135 |
?>
|
136 |
+
<div class="mf-btn-wraper <?php echo esc_attr($class); ?>" data-mf-form-conditional-logic-requirement="<?php echo esc_attr(isset($settings['mf_conditional_logic_form_and_or_operators']) ? $settings['mf_conditional_logic_form_and_or_operators'] : ''); ?>">
|
137 |
<?php if($icon_align == 'right'): ?>
|
138 |
+
<button type="submit" class="metform-btn metform-submit-btn <?php echo esc_attr( $btn_class ); ?>" <?php echo esc_attr($btn_id); ?>>
|
139 |
<?php echo esc_html( $btn_text ); ?>
|
140 |
<?php if($settings['mf_btn_icon']['value'] != ''): ?><?php Icons_Manager::render_icon( $settings['mf_btn_icon'], [ 'aria-hidden' => 'true' ] ); ?><?php endif; ?>
|
141 |
</button>
|
142 |
<?php elseif ($icon_align == 'left') : ?>
|
143 |
+
<button type="submit" class="metform-btn metform-submit-btn <?php echo esc_attr( $btn_class); ?>" <?php echo esc_attr($btn_id); ?>>
|
144 |
<?php if($settings['mf_btn_icon']['value'] != ''): ?><?php Icons_Manager::render_icon( $settings['mf_btn_icon'], [ 'aria-hidden' => 'true' ] ); ?><?php endif; ?>
|
145 |
<?php echo esc_html( $btn_text ); ?>
|
146 |
</button>
|
147 |
<?php else : ?>
|
148 |
+
<button type="submit" class="metform-btn metform-submit-btn <?php echo esc_attr( $btn_class); ?>" <?php echo esc_attr($btn_id); ?>>
|
149 |
<?php echo esc_html( $btn_text ); ?>
|
150 |
</button>
|
151 |
<?php endif; ?>
|
widgets/checkbox/checkbox.php
CHANGED
@@ -91,7 +91,7 @@ Class MetForm_Input_Checkbox extends Widget_Base{
|
|
91 |
'type' => Controls_Manager::TEXT,
|
92 |
'default' => $this->get_name(),
|
93 |
'title' => esc_html__( 'Enter here name of the input', 'metform' ),
|
94 |
-
'description' => esc_html__('Name is must required. Enter name without space or any special character. use only underscore/ hyphen (_/-) for multiple word.', 'metform'),
|
95 |
]
|
96 |
);
|
97 |
|
@@ -298,11 +298,11 @@ Class MetForm_Input_Checkbox extends Widget_Base{
|
|
298 |
],
|
299 |
'default' => '#FF0000',
|
300 |
'selectors' => [
|
301 |
-
'{{WRAPPER}} .mf-input-label .mf-input-required-indicator' => 'color: {{VALUE}}',
|
302 |
],
|
303 |
-
'condition' => [
|
304 |
-
|
305 |
-
],
|
306 |
]
|
307 |
);
|
308 |
|
@@ -550,6 +550,7 @@ Class MetForm_Input_Checkbox extends Widget_Base{
|
|
550 |
<input type="checkbox" class="mf-input mf-checkbox-input" name="<?php echo esc_attr($mf_input_name); ?>[]"
|
551 |
value="<?php echo esc_attr($option['mf_input_option_value']); ?>"
|
552 |
<?php echo esc_attr($option['mf_input_option_status']); ?>
|
|
|
553 |
>
|
554 |
<span><?php echo esc_html(($mf_input_option_text_position == 'after') ? $option['mf_input_option_text']:''); ?></span>
|
555 |
</label>
|
91 |
'type' => Controls_Manager::TEXT,
|
92 |
'default' => $this->get_name(),
|
93 |
'title' => esc_html__( 'Enter here name of the input', 'metform' ),
|
94 |
+
'description' => esc_html__('Name is must required. Enter name without space or any special character. use only underscore/ hyphen (_/-) for multiple word. Name must be different.', 'metform'),
|
95 |
]
|
96 |
);
|
97 |
|
298 |
],
|
299 |
'default' => '#FF0000',
|
300 |
'selectors' => [
|
301 |
+
'{{WRAPPER}} .mf-input-label .mf-input-required-indicator, {{WRAPPER}} .mf-input-wrapper.mf-field-error .mf-checkbox-option, {{WRAPPER}} .mf-input-wrapper .error' => 'color: {{VALUE}}',
|
302 |
],
|
303 |
+
// 'condition' => [
|
304 |
+
// 'mf_input_required' => 'yes',
|
305 |
+
// ],
|
306 |
]
|
307 |
);
|
308 |
|
550 |
<input type="checkbox" class="mf-input mf-checkbox-input" name="<?php echo esc_attr($mf_input_name); ?>[]"
|
551 |
value="<?php echo esc_attr($option['mf_input_option_value']); ?>"
|
552 |
<?php echo esc_attr($option['mf_input_option_status']); ?>
|
553 |
+
<?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
|
554 |
>
|
555 |
<span><?php echo esc_html(($mf_input_option_text_position == 'after') ? $option['mf_input_option_text']:''); ?></span>
|
556 |
</label>
|
widgets/email/email.php
CHANGED
@@ -49,7 +49,7 @@ Class MetForm_Input_Email extends widget_base{
|
|
49 |
]
|
50 |
);
|
51 |
|
52 |
-
$this->input_setting_controls(['
|
53 |
|
54 |
$this->end_controls_section();
|
55 |
|
@@ -122,8 +122,9 @@ Class MetForm_Input_Email extends widget_base{
|
|
122 |
$validation = [
|
123 |
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
124 |
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
125 |
-
'
|
126 |
'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
|
|
|
127 |
];
|
128 |
|
129 |
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|
49 |
]
|
50 |
);
|
51 |
|
52 |
+
$this->input_setting_controls(['VALIDATION']);
|
53 |
|
54 |
$this->end_controls_section();
|
55 |
|
122 |
$validation = [
|
123 |
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
124 |
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
125 |
+
'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
|
126 |
'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
|
127 |
+
'warning_message' => isset($mf_input_validation_warning_message) ? $mf_input_validation_warning_message : '',
|
128 |
];
|
129 |
|
130 |
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|
widgets/form.php
CHANGED
@@ -41,36 +41,31 @@ class Widget_Met_Form extends Widget_Base {
|
|
41 |
'label' => '',
|
42 |
'type' => \Elementor\Controls_Manager::RAW_HTML,
|
43 |
'raw' => 'See this video tutorial how to use metform. <a href="https://youtu.be/8R4-Q14cu-w" target="_blank">Click here</a>',
|
44 |
-
'content_classes' => 'your-class',
|
45 |
]
|
46 |
);
|
47 |
$this->add_control(
|
48 |
'mf_form_id',
|
49 |
[
|
50 |
-
'label' => esc_html__( 'Select Form
|
51 |
'type' => MetForm_Controls_Manager::FORMPICKER,
|
52 |
'default' => '',
|
53 |
'description' => esc_html__( 'Click on the "red" edit icon to edit form content.', 'metform' )
|
54 |
]
|
55 |
);
|
56 |
|
57 |
-
|
58 |
-
$this->end_controls_section();
|
59 |
|
60 |
}
|
61 |
|
62 |
protected function render( $instance = [] ) {
|
63 |
$settings = $this->get_settings_for_display();
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
|
|
|
|
|
|
67 |
}
|
68 |
-
|
69 |
-
protected function _content_dtemplate2() {
|
70 |
-
?>
|
71 |
-
<# view.addInlineEditingAttributes( 'mf_form', 'none' ); #>
|
72 |
-
<div {{{ view.getRenderAttributeString( 'mf_form' ) }}}>{{{ settings.mf_form }}}</div>
|
73 |
-
<?php
|
74 |
-
}
|
75 |
}
|
76 |
|
41 |
'label' => '',
|
42 |
'type' => \Elementor\Controls_Manager::RAW_HTML,
|
43 |
'raw' => 'See this video tutorial how to use metform. <a href="https://youtu.be/8R4-Q14cu-w" target="_blank">Click here</a>',
|
|
|
44 |
]
|
45 |
);
|
46 |
$this->add_control(
|
47 |
'mf_form_id',
|
48 |
[
|
49 |
+
'label' => esc_html__( 'Select Form: ', 'metform' ),
|
50 |
'type' => MetForm_Controls_Manager::FORMPICKER,
|
51 |
'default' => '',
|
52 |
'description' => esc_html__( 'Click on the "red" edit icon to edit form content.', 'metform' )
|
53 |
]
|
54 |
);
|
55 |
|
56 |
+
$this->end_controls_section();
|
|
|
57 |
|
58 |
}
|
59 |
|
60 |
protected function render( $instance = [] ) {
|
61 |
$settings = $this->get_settings_for_display();
|
62 |
+
$nav = !isset($settings['mf_form_multistep_display_nav']) ? '' : ' mf-form-multistep-nav-'.$settings['mf_form_multistep_display_nav'];
|
63 |
+
$direction = !isset($settings['mf_form_multistep_slide_direction']) ? '' : ' mf_slide_direction_'. $settings['mf_form_multistep_slide_direction'];
|
64 |
+
|
65 |
+
echo '<div class=" ' . $direction .' '. (!isset($settings['mf_form_multistep_status']) ? '' : $settings['mf_form_multistep_status']) . $nav .'">';
|
66 |
+
// echo (!isset($settings['mf_form_multistep_status']) ? '' : $settings['mf_form_multistep_status']); // test//
|
67 |
+
echo \MetForm\Controls\Form_Picker_Utils::parse($settings['mf_form_id'], $this->get_id());
|
68 |
+
echo '</div>';
|
69 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
}
|
71 |
|
widgets/listing-fname/listing-fname.php
CHANGED
@@ -49,7 +49,7 @@ Class MetForm_Input_Listing_Fname extends Widget_Base{
|
|
49 |
]
|
50 |
);
|
51 |
|
52 |
-
$this->input_setting_controls(['
|
53 |
|
54 |
$this->end_controls_section();
|
55 |
|
@@ -121,8 +121,9 @@ Class MetForm_Input_Listing_Fname extends Widget_Base{
|
|
121 |
$validation = [
|
122 |
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
123 |
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
124 |
-
'
|
125 |
'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
|
|
|
126 |
];
|
127 |
|
128 |
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|
49 |
]
|
50 |
);
|
51 |
|
52 |
+
$this->input_setting_controls(['VALIDATION']);
|
53 |
|
54 |
$this->end_controls_section();
|
55 |
|
121 |
$validation = [
|
122 |
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
123 |
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
124 |
+
'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
|
125 |
'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
|
126 |
+
'warning_message' => isset($mf_input_validation_warning_message) ? $mf_input_validation_warning_message : '',
|
127 |
];
|
128 |
|
129 |
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|
widgets/listing-lname/listing-lname.php
CHANGED
@@ -49,7 +49,7 @@ Class MetForm_Input_Listing_Lname extends Widget_Base{
|
|
49 |
]
|
50 |
);
|
51 |
|
52 |
-
$this->input_setting_controls(['
|
53 |
|
54 |
$this->end_controls_section();
|
55 |
|
@@ -121,8 +121,9 @@ Class MetForm_Input_Listing_Lname extends Widget_Base{
|
|
121 |
$validation = [
|
122 |
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
123 |
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
124 |
-
'
|
125 |
'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
|
|
|
126 |
];
|
127 |
|
128 |
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|
@@ -143,6 +144,7 @@ Class MetForm_Input_Listing_Lname extends Widget_Base{
|
|
143 |
data-validation = "<?php echo esc_attr(json_encode($validation)); ?>"
|
144 |
<?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
|
145 |
<?php //echo esc_attr($mf_input_readonly_status); ?>
|
|
|
146 |
>
|
147 |
<?php
|
148 |
if($mf_input_help_text != ''){
|
49 |
]
|
50 |
);
|
51 |
|
52 |
+
$this->input_setting_controls(['VALIDATION']);
|
53 |
|
54 |
$this->end_controls_section();
|
55 |
|
121 |
$validation = [
|
122 |
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
123 |
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
124 |
+
'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
|
125 |
'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
|
126 |
+
'warning_message' => isset($mf_input_validation_warning_message) ? $mf_input_validation_warning_message : '',
|
127 |
];
|
128 |
|
129 |
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|
144 |
data-validation = "<?php echo esc_attr(json_encode($validation)); ?>"
|
145 |
<?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
|
146 |
<?php //echo esc_attr($mf_input_readonly_status); ?>
|
147 |
+
|
148 |
>
|
149 |
<?php
|
150 |
if($mf_input_help_text != ''){
|
widgets/listing-optin/listing-optin.php
CHANGED
@@ -249,7 +249,7 @@ Class MetForm_Input_Listing_Optin extends Widget_Base{
|
|
249 |
$this->add_control(
|
250 |
'mf_input_required_indicator_color',
|
251 |
[
|
252 |
-
'label' => esc_html__( 'Required indicator color
|
253 |
'type' => Controls_Manager::COLOR,
|
254 |
'scheme' => [
|
255 |
'type' => Scheme_Color::get_type(),
|
@@ -257,11 +257,11 @@ Class MetForm_Input_Listing_Optin extends Widget_Base{
|
|
257 |
],
|
258 |
'default' => '#FF0000',
|
259 |
'selectors' => [
|
260 |
-
'{{WRAPPER}} .mf-input-label .mf-input-required-indicator' => 'color: {{VALUE}}',
|
261 |
],
|
262 |
-
'condition' => [
|
263 |
-
|
264 |
-
],
|
265 |
]
|
266 |
);
|
267 |
|
@@ -452,8 +452,9 @@ Class MetForm_Input_Listing_Optin extends Widget_Base{
|
|
452 |
<div class="mf-checkbox" id="mf-input-optin-<?php echo esc_attr($this->get_id()); ?>">
|
453 |
<div class="mf-checkbox-option">
|
454 |
<label><?php echo esc_html(($mf_listing_optin_option_text_position == 'before') ? $mf_listing_optin_option_text :''); ?>
|
455 |
-
<input type="checkbox" class="mf-checkbox-input" name="<?php echo esc_attr($mf_input_name); ?>"
|
456 |
value="1"
|
|
|
457 |
>
|
458 |
<span><?php echo esc_html(($mf_listing_optin_option_text_position == 'after') ? $mf_listing_optin_option_text :''); ?></span>
|
459 |
</label>
|
249 |
$this->add_control(
|
250 |
'mf_input_required_indicator_color',
|
251 |
[
|
252 |
+
'label' => esc_html__( 'Required indicator color:', 'metform' ),
|
253 |
'type' => Controls_Manager::COLOR,
|
254 |
'scheme' => [
|
255 |
'type' => Scheme_Color::get_type(),
|
257 |
],
|
258 |
'default' => '#FF0000',
|
259 |
'selectors' => [
|
260 |
+
'{{WRAPPER}} .mf-input-label .mf-input-required-indicator,{{WRAPPER}} .mf-input-wrapper.mf-field-error .mf-checkbox-option, {{WRAPPER}} .mf-input-wrapper .error' => 'color: {{VALUE}}',
|
261 |
],
|
262 |
+
// 'condition' => [
|
263 |
+
// 'mf_input_required' => 'yes',
|
264 |
+
// ],
|
265 |
]
|
266 |
);
|
267 |
|
452 |
<div class="mf-checkbox" id="mf-input-optin-<?php echo esc_attr($this->get_id()); ?>">
|
453 |
<div class="mf-checkbox-option">
|
454 |
<label><?php echo esc_html(($mf_listing_optin_option_text_position == 'before') ? $mf_listing_optin_option_text :''); ?>
|
455 |
+
<input type="checkbox" class="mf-input mf-checkbox-input" name="<?php echo esc_attr($mf_input_name); ?>"
|
456 |
value="1"
|
457 |
+
<?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
|
458 |
>
|
459 |
<span><?php echo esc_html(($mf_listing_optin_option_text_position == 'after') ? $mf_listing_optin_option_text :''); ?></span>
|
460 |
</label>
|
widgets/manifest.php
CHANGED
@@ -14,7 +14,9 @@ Class Manifest{
|
|
14 |
}
|
15 |
|
16 |
public function init() {
|
17 |
-
|
|
|
|
|
18 |
add_action( 'elementor/widgets/widgets_registered', [ $this, 'register_widgets' ] );
|
19 |
|
20 |
}
|
@@ -75,7 +77,6 @@ Class Manifest{
|
|
75 |
require_once plugin_dir_path(__FILE__) . 'recaptcha/recaptcha.php';
|
76 |
require_once plugin_dir_path(__FILE__) . 'rating/rating.php';
|
77 |
require_once plugin_dir_path(__FILE__) . 'file-upload/file-upload.php';
|
78 |
-
|
79 |
}
|
80 |
|
81 |
public function register_widgets() {
|
@@ -106,11 +107,10 @@ Class Manifest{
|
|
106 |
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Elementor\MetForm_Input_Listing_Optin );
|
107 |
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Elementor\MetForm_Input_Recaptcha() );
|
108 |
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Elementor\MetForm_Input_Rating() );
|
109 |
-
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Elementor\MetForm_Input_File_Upload() );
|
110 |
-
|
111 |
}
|
112 |
|
113 |
-
public function
|
114 |
|
115 |
$elements_manager->add_category(
|
116 |
'metform',
|
@@ -120,5 +120,6 @@ Class Manifest{
|
|
120 |
]
|
121 |
);
|
122 |
}
|
|
|
123 |
}
|
124 |
|
14 |
}
|
15 |
|
16 |
public function init() {
|
17 |
+
|
18 |
+
add_action( 'elementor/elements/categories_registered', [ $this, 'add_metform_widget_categories' ]);
|
19 |
+
|
20 |
add_action( 'elementor/widgets/widgets_registered', [ $this, 'register_widgets' ] );
|
21 |
|
22 |
}
|
77 |
require_once plugin_dir_path(__FILE__) . 'recaptcha/recaptcha.php';
|
78 |
require_once plugin_dir_path(__FILE__) . 'rating/rating.php';
|
79 |
require_once plugin_dir_path(__FILE__) . 'file-upload/file-upload.php';
|
|
|
80 |
}
|
81 |
|
82 |
public function register_widgets() {
|
107 |
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Elementor\MetForm_Input_Listing_Optin );
|
108 |
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Elementor\MetForm_Input_Recaptcha() );
|
109 |
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Elementor\MetForm_Input_Rating() );
|
110 |
+
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Elementor\MetForm_Input_File_Upload() );
|
|
|
111 |
}
|
112 |
|
113 |
+
public function add_metform_widget_categories( $elements_manager ) {
|
114 |
|
115 |
$elements_manager->add_category(
|
116 |
'metform',
|
120 |
]
|
121 |
);
|
122 |
}
|
123 |
+
|
124 |
}
|
125 |
|
widgets/number/number.php
CHANGED
@@ -49,7 +49,7 @@ Class MetForm_Input_Number extends Widget_Base{
|
|
49 |
]
|
50 |
);
|
51 |
|
52 |
-
$this->input_setting_controls(['
|
53 |
|
54 |
$this->end_controls_section();
|
55 |
|
@@ -120,7 +120,9 @@ Class MetForm_Input_Number extends Widget_Base{
|
|
120 |
$validation = [
|
121 |
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
122 |
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
123 |
-
'
|
|
|
|
|
124 |
];
|
125 |
|
126 |
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|
49 |
]
|
50 |
);
|
51 |
|
52 |
+
$this->input_setting_controls(['VALIDATION']);
|
53 |
|
54 |
$this->end_controls_section();
|
55 |
|
120 |
$validation = [
|
121 |
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
122 |
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
123 |
+
'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
|
124 |
+
'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
|
125 |
+
'warning_message' => isset($mf_input_validation_warning_message) ? $mf_input_validation_warning_message : '',
|
126 |
];
|
127 |
|
128 |
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|
widgets/password/password.php
CHANGED
@@ -49,7 +49,7 @@ Class MetForm_Input_Password extends Widget_Base{
|
|
49 |
]
|
50 |
);
|
51 |
|
52 |
-
$this->input_setting_controls(['
|
53 |
|
54 |
$this->end_controls_section();
|
55 |
|
@@ -121,7 +121,7 @@ Class MetForm_Input_Password extends Widget_Base{
|
|
121 |
$validation = [
|
122 |
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
123 |
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
124 |
-
'
|
125 |
'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
|
126 |
];
|
127 |
|
49 |
]
|
50 |
);
|
51 |
|
52 |
+
$this->input_setting_controls(['VALIDATION']);
|
53 |
|
54 |
$this->end_controls_section();
|
55 |
|
121 |
$validation = [
|
122 |
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
123 |
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
124 |
+
'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
|
125 |
'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
|
126 |
];
|
127 |
|
widgets/radio/radio.php
CHANGED
@@ -303,7 +303,7 @@ Class MetForm_Input_Radio extends Widget_Base{
|
|
303 |
$this->add_control(
|
304 |
'mf_input_required_indicator_color',
|
305 |
[
|
306 |
-
'label' => esc_html__( 'Required indicator color
|
307 |
'type' => Controls_Manager::COLOR,
|
308 |
'scheme' => [
|
309 |
'type' => Scheme_Color::get_type(),
|
@@ -311,11 +311,11 @@ Class MetForm_Input_Radio extends Widget_Base{
|
|
311 |
],
|
312 |
'default' => '#FF0000',
|
313 |
'selectors' => [
|
314 |
-
'{{WRAPPER}} .mf-input-label .mf-input-required-indicator' => 'color: {{VALUE}}',
|
315 |
],
|
316 |
-
'condition' => [
|
317 |
-
|
318 |
-
],
|
319 |
]
|
320 |
);
|
321 |
|
@@ -564,6 +564,7 @@ Class MetForm_Input_Radio extends Widget_Base{
|
|
564 |
<input type="radio" class="mf-input mf-radio-input" name="<?php echo esc_attr($mf_input_name); ?>"
|
565 |
value="<?php echo esc_attr($option['mf_input_option_value']); ?>"
|
566 |
<?php echo esc_attr($option['mf_input_option_status']); ?>
|
|
|
567 |
>
|
568 |
<span><?php echo esc_html(($mf_input_option_text_position == 'after') ? $option['mf_input_option_text']:''); ?></span>
|
569 |
</label>
|
303 |
$this->add_control(
|
304 |
'mf_input_required_indicator_color',
|
305 |
[
|
306 |
+
'label' => esc_html__( 'Required indicator color:', 'metform' ),
|
307 |
'type' => Controls_Manager::COLOR,
|
308 |
'scheme' => [
|
309 |
'type' => Scheme_Color::get_type(),
|
311 |
],
|
312 |
'default' => '#FF0000',
|
313 |
'selectors' => [
|
314 |
+
'{{WRAPPER}} .mf-input-label .mf-input-required-indicator, {{WRAPPER}} .mf-input-wrapper.mf-field-error .mf-radio-option, {{WRAPPER}} .mf-input-wrapper .error' => 'color: {{VALUE}}',
|
315 |
],
|
316 |
+
// 'condition' => [
|
317 |
+
// 'mf_input_required' => 'yes',
|
318 |
+
// ],
|
319 |
]
|
320 |
);
|
321 |
|
564 |
<input type="radio" class="mf-input mf-radio-input" name="<?php echo esc_attr($mf_input_name); ?>"
|
565 |
value="<?php echo esc_attr($option['mf_input_option_value']); ?>"
|
566 |
<?php echo esc_attr($option['mf_input_option_status']); ?>
|
567 |
+
<?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
|
568 |
>
|
569 |
<span><?php echo esc_html(($mf_input_option_text_position == 'after') ? $option['mf_input_option_text']:''); ?></span>
|
570 |
</label>
|
widgets/range/range.php
CHANGED
@@ -49,7 +49,24 @@ Class MetForm_Input_Range extends Widget_Base{
|
|
49 |
]
|
50 |
);
|
51 |
|
52 |
-
$this->input_setting_controls(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
$this->add_control(
|
55 |
'mf_input_range_default_value',
|
@@ -223,22 +240,22 @@ Class MetForm_Input_Range extends Widget_Base{
|
|
223 |
}
|
224 |
|
225 |
|
226 |
-
// if(($default_value == $
|
227 |
-
// $default_value = $
|
228 |
-
// } elseif ($default_value >= $
|
229 |
-
// $default_value = $
|
230 |
-
// } elseif ($default_value <= $
|
231 |
-
// $default_value = $
|
232 |
// }
|
233 |
?>
|
234 |
|
235 |
<input class="mf-input mf-rs-range" id="mf-input-range-<?php echo esc_attr($this->get_id()); ?>"
|
236 |
name="<?php echo esc_attr($mf_input_name); ?>"
|
237 |
-
<?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
|
238 |
<?php //echo esc_attr($mf_input_readonly_status); ?>
|
239 |
value="<?php echo esc_attr($default_value); ?>"
|
240 |
-
min="<?php echo esc_attr(($
|
241 |
-
max="<?php echo esc_attr(($
|
242 |
step="<?php echo esc_attr($mf_input_steps_control);?>"
|
243 |
range="<?php echo $mf_input_range_control;?>"
|
244 |
>
|
49 |
]
|
50 |
);
|
51 |
|
52 |
+
$this->input_setting_controls();
|
53 |
+
|
54 |
+
$this->add_control(
|
55 |
+
'mf_input_min_length_range',
|
56 |
+
[
|
57 |
+
'label' => esc_html__( 'Min Length', 'metform' ),
|
58 |
+
'type' => Controls_Manager::NUMBER,
|
59 |
+
'step' => 1,
|
60 |
+
]
|
61 |
+
);
|
62 |
+
$this->add_control(
|
63 |
+
'mf_input_max_length_range',
|
64 |
+
[
|
65 |
+
'label' => esc_html__( 'Max Length', 'metform' ),
|
66 |
+
'type' => Controls_Manager::NUMBER,
|
67 |
+
'step' => 1,
|
68 |
+
]
|
69 |
+
);
|
70 |
|
71 |
$this->add_control(
|
72 |
'mf_input_range_default_value',
|
240 |
}
|
241 |
|
242 |
|
243 |
+
// if(($default_value == $mf_input_min_length_range) && ($default_value == $mf_input_max_length_range)){
|
244 |
+
// $default_value = $mf_input_min_length_range + 1;
|
245 |
+
// } elseif ($default_value >= $mf_input_max_length_range) {
|
246 |
+
// $default_value = $mf_input_max_length_range;
|
247 |
+
// } elseif ($default_value <= $mf_input_min_length_range) {
|
248 |
+
// $default_value = $mf_input_min_length_range - 1;
|
249 |
// }
|
250 |
?>
|
251 |
|
252 |
<input class="mf-input mf-rs-range" id="mf-input-range-<?php echo esc_attr($this->get_id()); ?>"
|
253 |
name="<?php echo esc_attr($mf_input_name); ?>"
|
254 |
+
<?php //echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
|
255 |
<?php //echo esc_attr($mf_input_readonly_status); ?>
|
256 |
value="<?php echo esc_attr($default_value); ?>"
|
257 |
+
min="<?php echo esc_attr(($mf_input_min_length_range != '') ? $mf_input_min_length_range : 1); ?>"
|
258 |
+
max="<?php echo esc_attr(($mf_input_max_length_range != '') ? $mf_input_max_length_range : 100); ?>"
|
259 |
step="<?php echo esc_attr($mf_input_steps_control);?>"
|
260 |
range="<?php echo $mf_input_range_control;?>"
|
261 |
>
|
widgets/rating/rating.php
CHANGED
@@ -315,7 +315,7 @@ Class MetForm_Input_Rating extends Widget_Base{
|
|
315 |
<?php
|
316 |
}
|
317 |
?>
|
318 |
-
<ul class="
|
319 |
<?php for($i = 1; $i <= $mf_input_rating_number; $i++ ):?>
|
320 |
<li class="star-li star <?php if($i == 1){echo 'selected';}?>" data-value="<?php echo esc_attr($i);?>">
|
321 |
<i class="mf-star dashicons-before dashicons-star-filled"></i>
|
@@ -323,7 +323,7 @@ Class MetForm_Input_Rating extends Widget_Base{
|
|
323 |
<?php endfor;?>
|
324 |
</ul>
|
325 |
|
326 |
-
<input type="hidden" class="mf-input-hidden" id="mf-input-<?php echo esc_attr($this->get_id()); ?>"
|
327 |
name="<?php echo esc_attr($mf_input_name); ?>" value="1"
|
328 |
<?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
|
329 |
/>
|
315 |
<?php
|
316 |
}
|
317 |
?>
|
318 |
+
<ul class=" mf-input-rating">
|
319 |
<?php for($i = 1; $i <= $mf_input_rating_number; $i++ ):?>
|
320 |
<li class="star-li star <?php if($i == 1){echo 'selected';}?>" data-value="<?php echo esc_attr($i);?>">
|
321 |
<i class="mf-star dashicons-before dashicons-star-filled"></i>
|
323 |
<?php endfor;?>
|
324 |
</ul>
|
325 |
|
326 |
+
<input type="hidden" class="mf-input mf-input-hidden" id="mf-input-<?php echo esc_attr($this->get_id()); ?>"
|
327 |
name="<?php echo esc_attr($mf_input_name); ?>" value="1"
|
328 |
<?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
|
329 |
/>
|
widgets/switch/switch.php
CHANGED
@@ -37,7 +37,24 @@ Class MetForm_Input_Switch extends Widget_Base{
|
|
37 |
]
|
38 |
);
|
39 |
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
$this->end_controls_section();
|
43 |
|
@@ -48,9 +65,12 @@ Class MetForm_Input_Switch extends Widget_Base{
|
|
48 |
'tab' => Controls_Manager::TAB_CONTENT,
|
49 |
]
|
50 |
);
|
|
|
51 |
|
52 |
$this->input_setting_controls();
|
53 |
|
|
|
|
|
54 |
$this->end_controls_section();
|
55 |
|
56 |
if(class_exists('\MetForm_Pro\Base\Package')){
|
@@ -88,11 +108,12 @@ Class MetForm_Input_Switch extends Widget_Base{
|
|
88 |
'type' => Controls_Manager::SLIDER,
|
89 |
'default' => [
|
90 |
'unit' => 'px',
|
91 |
-
'size' =>
|
92 |
],
|
93 |
'selectors' => [
|
94 |
-
'{{WRAPPER}} .mf-input-switch .mf-input-control-label::before' => 'width: {{SIZE}}{{UNIT}}',
|
95 |
-
'{{WRAPPER}} .mf-input-control-label::after' => 'width: calc(({{SIZE}}{{UNIT}} / 2) -
|
|
|
96 |
]
|
97 |
]
|
98 |
);
|
@@ -104,10 +125,10 @@ Class MetForm_Input_Switch extends Widget_Base{
|
|
104 |
'type' => Controls_Manager::SLIDER,
|
105 |
'default' => [
|
106 |
'unit' => 'px',
|
107 |
-
'size' =>
|
108 |
],
|
109 |
'selectors' => [
|
110 |
-
'{{WRAPPER}} .mf-input-switch .mf-input-control-label::before' => 'height: {{SIZE}}{{UNIT}}',
|
111 |
'{{WRAPPER}} .mf-input-control-label::after' => 'height: calc({{SIZE}}{{UNIT}} - 4px) '
|
112 |
]
|
113 |
]
|
@@ -129,7 +150,106 @@ Class MetForm_Input_Switch extends Widget_Base{
|
|
129 |
]
|
130 |
);
|
131 |
|
132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
$this->end_controls_section();
|
135 |
|
@@ -167,9 +287,9 @@ Class MetForm_Input_Switch extends Widget_Base{
|
|
167 |
<?php
|
168 |
}
|
169 |
?>
|
170 |
-
<span class="mf-input-switch-control mf-input-switch
|
171 |
-
<input type="checkbox" name="<?php echo esc_attr($mf_input_name); ?>" value="1" class="mf-input mf-input-control" id="mf-input-switch-<?php echo esc_attr($this->get_id()); ?>"
|
172 |
-
<label class="mf-input-control-label" for="mf-input-switch-<?php echo esc_attr($this->get_id()); ?>"></label>
|
173 |
</span>
|
174 |
<?php
|
175 |
if($mf_input_help_text != ''){
|
37 |
]
|
38 |
);
|
39 |
|
40 |
+
$this->input_content_controls(['NO_PLACEHOLDER']);
|
41 |
+
|
42 |
+
$this->add_control(
|
43 |
+
'mf_swtich_enable_text',
|
44 |
+
[
|
45 |
+
'label' => esc_html__( 'Active Text', 'metform' ),
|
46 |
+
'type' => Controls_Manager::TEXT,
|
47 |
+
'default' => esc_html__('Yes', 'metform'),
|
48 |
+
]
|
49 |
+
);
|
50 |
+
$this->add_control(
|
51 |
+
'mf_swtich_disable_text',
|
52 |
+
[
|
53 |
+
'label' => esc_html__( 'Inactive Text', 'metform' ),
|
54 |
+
'type' => Controls_Manager::TEXT,
|
55 |
+
'default' => esc_html__('No', 'metform'),
|
56 |
+
]
|
57 |
+
);
|
58 |
|
59 |
$this->end_controls_section();
|
60 |
|
65 |
'tab' => Controls_Manager::TAB_CONTENT,
|
66 |
]
|
67 |
);
|
68 |
+
|
69 |
|
70 |
$this->input_setting_controls();
|
71 |
|
72 |
+
|
73 |
+
|
74 |
$this->end_controls_section();
|
75 |
|
76 |
if(class_exists('\MetForm_Pro\Base\Package')){
|
108 |
'type' => Controls_Manager::SLIDER,
|
109 |
'default' => [
|
110 |
'unit' => 'px',
|
111 |
+
'size' => 55 ,
|
112 |
],
|
113 |
'selectors' => [
|
114 |
+
'{{WRAPPER}} .mf-input-switch .mf-input-control-label::before' => 'width: {{SIZE}}{{UNIT}};',
|
115 |
+
'{{WRAPPER}} .mf-input-control-label::after' => 'width: calc(({{SIZE}}{{UNIT}} / 2) - 7px);',
|
116 |
+
'{{WRAPPER}} .mf-input-control:checked~.mf-input-control-label::after' => 'left: calc({{SIZE}}{{UNIT}} - (({{SIZE}}{{UNIT}} / 2) - 7px) - 2px);'
|
117 |
]
|
118 |
]
|
119 |
);
|
125 |
'type' => Controls_Manager::SLIDER,
|
126 |
'default' => [
|
127 |
'unit' => 'px',
|
128 |
+
'size' => 25,
|
129 |
],
|
130 |
'selectors' => [
|
131 |
+
'{{WRAPPER}} .mf-input-switch .mf-input-control-label::before' => 'height: {{SIZE}}{{UNIT}};',
|
132 |
'{{WRAPPER}} .mf-input-control-label::after' => 'height: calc({{SIZE}}{{UNIT}} - 4px) '
|
133 |
]
|
134 |
]
|
150 |
]
|
151 |
);
|
152 |
|
153 |
+
|
154 |
+
|
155 |
+
$this->input_controls(['ONLY_BOX_SHADOW']);
|
156 |
+
|
157 |
+
$this->add_control(
|
158 |
+
'mf_switch_active_inactive_text_heading',
|
159 |
+
[
|
160 |
+
'label' => esc_html__( 'Active and Inactive Text:', 'metform' ),
|
161 |
+
'type' => Controls_Manager::HEADING,
|
162 |
+
'separator' => 'before',
|
163 |
+
]
|
164 |
+
);
|
165 |
+
|
166 |
+
|
167 |
+
|
168 |
+
$this->start_controls_tabs('mf_switch_active_inactive_text_tabs');
|
169 |
+
$this->start_controls_tab(
|
170 |
+
'mf_switch_inactive_text_tab',
|
171 |
+
[
|
172 |
+
'label' => esc_html__('Inactive', 'metform'),
|
173 |
+
]
|
174 |
+
);
|
175 |
+
|
176 |
+
$this->add_responsive_control(
|
177 |
+
'mf_switch_inactive_text_color',
|
178 |
+
[
|
179 |
+
'label' =>esc_html__( 'Text Color', 'metform' ),
|
180 |
+
'type' => Controls_Manager::COLOR,
|
181 |
+
'default' => '#ffffff',
|
182 |
+
'selectors' => [
|
183 |
+
'{{WRAPPER}} .mf-input-switch .mf-input-control-label::before' => 'color: {{VALUE}};',
|
184 |
+
],
|
185 |
+
]
|
186 |
+
);
|
187 |
+
|
188 |
+
$this->add_group_control(
|
189 |
+
Group_Control_Typography::get_type(),
|
190 |
+
[
|
191 |
+
'name' => 'mf_switch_inactive_text_typo',
|
192 |
+
'label' =>esc_html__( 'Typography', 'metform' ),
|
193 |
+
'selector' => '{{WRAPPER}} .mf-input-switch .mf-input-control-label::before',
|
194 |
+
]
|
195 |
+
);
|
196 |
+
|
197 |
+
$this->add_responsive_control(
|
198 |
+
'mf_switch_inactive_text_padding',
|
199 |
+
[
|
200 |
+
'label' => esc_html__( 'Padding', 'metform' ),
|
201 |
+
'type' => Controls_Manager::DIMENSIONS,
|
202 |
+
'size_units' => [ 'px', '%', 'em' ],
|
203 |
+
'selectors' => [
|
204 |
+
'{{WRAPPER}} .mf-input-switch .mf-input-control-label::before' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
205 |
+
],
|
206 |
+
]
|
207 |
+
);
|
208 |
+
|
209 |
+
$this->end_controls_tab();
|
210 |
+
|
211 |
+
$this->start_controls_tab(
|
212 |
+
'mf_switch_active_text_tab',
|
213 |
+
[
|
214 |
+
'label' => esc_html__('Active', 'metform'),
|
215 |
+
]
|
216 |
+
);
|
217 |
+
|
218 |
+
$this->add_responsive_control(
|
219 |
+
'mf_switch_active_text_color',
|
220 |
+
[
|
221 |
+
'label' =>esc_html__( 'Text Color', 'metform' ),
|
222 |
+
'type' => Controls_Manager::COLOR,
|
223 |
+
'default' => '#ffffff',
|
224 |
+
'selectors' => [
|
225 |
+
'{{WRAPPER}} .mf-input-control:checked~.mf-input-control-label::before' => 'color: {{VALUE}};',
|
226 |
+
],
|
227 |
+
]
|
228 |
+
);
|
229 |
+
|
230 |
+
$this->add_group_control(
|
231 |
+
Group_Control_Typography::get_type(),
|
232 |
+
[
|
233 |
+
'name' => 'mf_switch_active_text_typo',
|
234 |
+
'label' =>esc_html__( 'Typography', 'metform' ),
|
235 |
+
'selector' => '{{WRAPPER}} .mf-input-control:checked~.mf-input-control-label::before',
|
236 |
+
]
|
237 |
+
);
|
238 |
+
|
239 |
+
$this->add_responsive_control(
|
240 |
+
'mf_switch_active_text_padding',
|
241 |
+
[
|
242 |
+
'label' => esc_html__( 'Padding', 'metform' ),
|
243 |
+
'type' => Controls_Manager::DIMENSIONS,
|
244 |
+
'size_units' => [ 'px', '%', 'em' ],
|
245 |
+
'selectors' => [
|
246 |
+
'{{WRAPPER}} .mf-input-control:checked~.mf-input-control-label::before' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
247 |
+
],
|
248 |
+
]
|
249 |
+
);
|
250 |
+
|
251 |
+
$this->end_controls_tab();
|
252 |
+
$this->end_controls_tabs();
|
253 |
|
254 |
$this->end_controls_section();
|
255 |
|
287 |
<?php
|
288 |
}
|
289 |
?>
|
290 |
+
<span class="mf-input-switch-control mf-input-switch">
|
291 |
+
<input type="checkbox" name="<?php echo esc_attr($mf_input_name); ?>" value="1" class="mf-input mf-input-control" id="mf-input-switch-<?php echo esc_attr($this->get_id()); ?>" <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>>
|
292 |
+
<label data-enable="<?php echo esc_attr($mf_swtich_enable_text) ?>" data-disable="<?php echo esc_attr($mf_swtich_disable_text) ?>" class="mf-input-control-label" for="mf-input-switch-<?php echo esc_attr($this->get_id()); ?>"></label>
|
293 |
</span>
|
294 |
<?php
|
295 |
if($mf_input_help_text != ''){
|
widgets/telephone/telephone.php
CHANGED
@@ -49,7 +49,7 @@ Class MetForm_Input_Telephone extends Widget_Base{
|
|
49 |
]
|
50 |
);
|
51 |
|
52 |
-
$this->input_setting_controls(['
|
53 |
|
54 |
$this->end_controls_section();
|
55 |
|
@@ -118,6 +118,14 @@ Class MetForm_Input_Telephone extends Widget_Base{
|
|
118 |
$settings = $this->get_settings_for_display();
|
119 |
extract($settings);
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|
122 |
|
123 |
echo "<div class='mf-input-wrapper ".$class."' data-mf-form-conditional-logic-requirement='".(isset($mf_conditional_logic_form_and_or_operators) ? $mf_conditional_logic_form_and_or_operators : '')."'>";
|
@@ -133,6 +141,7 @@ Class MetForm_Input_Telephone extends Widget_Base{
|
|
133 |
<input type="tel" class="mf-input" id="mf-input-telephone-<?php echo esc_attr($this->get_id()); ?>"
|
134 |
name="<?php echo esc_attr($mf_input_name); ?>"
|
135 |
placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
|
|
|
136 |
<?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
|
137 |
<?php //echo esc_attr($mf_input_readonly_status); ?>
|
138 |
>
|
49 |
]
|
50 |
);
|
51 |
|
52 |
+
$this->input_setting_controls(['VALIDATION']);
|
53 |
|
54 |
$this->end_controls_section();
|
55 |
|
118 |
$settings = $this->get_settings_for_display();
|
119 |
extract($settings);
|
120 |
|
121 |
+
$validation = [
|
122 |
+
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
123 |
+
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
124 |
+
'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
|
125 |
+
'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
|
126 |
+
'warning_message' => isset($mf_input_validation_warning_message) ? $mf_input_validation_warning_message : '',
|
127 |
+
];
|
128 |
+
|
129 |
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|
130 |
|
131 |
echo "<div class='mf-input-wrapper ".$class."' data-mf-form-conditional-logic-requirement='".(isset($mf_conditional_logic_form_and_or_operators) ? $mf_conditional_logic_form_and_or_operators : '')."'>";
|
141 |
<input type="tel" class="mf-input" id="mf-input-telephone-<?php echo esc_attr($this->get_id()); ?>"
|
142 |
name="<?php echo esc_attr($mf_input_name); ?>"
|
143 |
placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
|
144 |
+
data-validation = "<?php echo esc_attr(json_encode($validation)); ?>"
|
145 |
<?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
|
146 |
<?php //echo esc_attr($mf_input_readonly_status); ?>
|
147 |
>
|
widgets/text/text.php
CHANGED
@@ -49,7 +49,7 @@ Class MetForm_Input_Text extends Widget_Base{
|
|
49 |
]
|
50 |
);
|
51 |
|
52 |
-
$this->input_setting_controls(['
|
53 |
|
54 |
$this->end_controls_section();
|
55 |
|
@@ -121,8 +121,9 @@ Class MetForm_Input_Text extends Widget_Base{
|
|
121 |
$validation = [
|
122 |
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
123 |
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
124 |
-
'
|
125 |
'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
|
|
|
126 |
];
|
127 |
|
128 |
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|
49 |
]
|
50 |
);
|
51 |
|
52 |
+
$this->input_setting_controls(['VALIDATION']);
|
53 |
|
54 |
$this->end_controls_section();
|
55 |
|
121 |
$validation = [
|
122 |
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
123 |
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
124 |
+
'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
|
125 |
'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
|
126 |
+
'warning_message' => isset($mf_input_validation_warning_message) ? $mf_input_validation_warning_message : '',
|
127 |
];
|
128 |
|
129 |
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|
widgets/textarea/textarea.php
CHANGED
@@ -50,7 +50,7 @@ Class MetForm_Input_Textarea extends Widget_Base{
|
|
50 |
]
|
51 |
);
|
52 |
|
53 |
-
$this->input_setting_controls(['
|
54 |
|
55 |
$this->end_controls_section();
|
56 |
|
@@ -145,8 +145,9 @@ Class MetForm_Input_Textarea extends Widget_Base{
|
|
145 |
$validation = [
|
146 |
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
147 |
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
148 |
-
'
|
149 |
'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
|
|
|
150 |
];
|
151 |
|
152 |
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|
50 |
]
|
51 |
);
|
52 |
|
53 |
+
$this->input_setting_controls(['VALIDATION']);
|
54 |
|
55 |
$this->end_controls_section();
|
56 |
|
145 |
$validation = [
|
146 |
'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
|
147 |
'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
|
148 |
+
'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
|
149 |
'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
|
150 |
+
'warning_message' => isset($mf_input_validation_warning_message) ? $mf_input_validation_warning_message : '',
|
151 |
];
|
152 |
|
153 |
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
|