Contact Form by WD – responsive drag & drop contact form builder tool - Version 1.13.10

Version Description

  • Fixed: Page title in progress bar.
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Contact Form by WD – responsive drag & drop contact form builder tool
Version 1.13.10
Comparing to
See all releases

Code changes from version 1.13.5 to 1.13.10

Files changed (36) hide show
  1. .gitignore +0 -4
  2. WDFM.php +7 -7
  3. admin/controllers/Addons_fm.php +155 -155
  4. admin/controllers/Blocked_ips_fm.php +288 -288
  5. admin/controllers/Checkpaypal.php +181 -181
  6. admin/controllers/FMShortocde.php +46 -46
  7. admin/controllers/FormMakerEditCountryinPopup.php +31 -31
  8. admin/controllers/FormMakerIpinfoinPopup.php +58 -58
  9. admin/controllers/FormMakerMapEditinPopup.php +35 -35
  10. admin/controllers/FormMakerSQLMapping.php +176 -176
  11. admin/controllers/FormMakerSubmits.php +45 -45
  12. admin/controllers/Formmakerwdcaptcha.php +29 -29
  13. admin/controllers/Formmakerwdmathcaptcha.php +30 -30
  14. admin/controllers/Generete_csv.php +118 -119
  15. admin/controllers/Generete_xml.php +73 -74
  16. admin/controllers/Manage_fm.php +1563 -1564
  17. admin/controllers/Options_fm.php +44 -44
  18. admin/controllers/Paypal_info.php +38 -38
  19. admin/controllers/Pricing_fm.php +53 -53
  20. admin/controllers/Product_option.php +36 -36
  21. admin/controllers/Select_data_from_db.php +105 -105
  22. admin/controllers/Show_matrix.php +27 -27
  23. admin/controllers/Submissions_fm.php +642 -643
  24. admin/controllers/Themes_fm.php +3024 -3024
  25. admin/controllers/Uninstall_fm.php +102 -102
  26. admin/controllers/Widget.php +91 -91
  27. admin/controllers/controller.php +9 -9
  28. admin/controllers/elementorWidget.php +88 -88
  29. admin/models/Blocked_ips_fm.php +115 -115
  30. admin/models/Checkpaypal.php +100 -100
  31. admin/models/FMPaypalInfo.php +19 -19
  32. admin/models/FMSelectDataFromDb.php +142 -142
  33. admin/models/FMShortocde.php +19 -19
  34. admin/models/FMSqlMapping.php +125 -125
  35. admin/models/FormMakerSubmits.php +33 -33
  36. admin/models/Manage_fm.php +2194 -4000
.gitignore DELETED
@@ -1,4 +0,0 @@
1
- .idea
2
- css/frontend/*
3
- js/frontend/*
4
- !.gitignore
 
 
 
 
WDFM.php CHANGED
@@ -1,8 +1,8 @@
1
- <?php
2
-
3
- function WDFM( $version = 0 ) {
4
- if ( $version == 2 ) {
5
- return WDCFM::instance();
6
- }
7
- return WDFM::instance();
8
  }
1
+ <?php
2
+
3
+ function WDFM( $version = 0 ) {
4
+ if ( $version == 2 ) {
5
+ return WDCFM::instance();
6
+ }
7
+ return WDFM::instance();
8
  }
admin/controllers/Addons_fm.php CHANGED
@@ -1,156 +1,156 @@
1
- <?php
2
- /**
3
- * Class FMControllerAddons_fmc
4
- */
5
- class FMControllerAddons_fmc extends CFMAdminController {
6
-
7
- /**
8
- * @var $model
9
- */
10
- private $model;
11
- /**
12
- * @var $view
13
- */
14
- private $view;
15
- /**
16
- * @var string $page
17
- */
18
- private $page;
19
-
20
- public function __construct() {
21
- $this->page = WDW_FM_Library(self::PLUGIN)->get('page');
22
- $this->page_url = add_query_arg( array (
23
- 'page' => $this->page,
24
- WDFMInstance(self::PLUGIN)->nonce => wp_create_nonce(WDFMInstance(self::PLUGIN)->nonce),
25
- ), admin_url('admin.php')
26
- );
27
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Addons_fm.php";
28
- $this->view = new FMViewAddons_fmc();
29
- }
30
-
31
- /**
32
- * Execute.
33
- */
34
- public function execute() {
35
- $task = WDW_FM_Library(self::PLUGIN)->get('task');
36
- $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
37
- if (method_exists($this, $task)) {
38
- $this->$task($id);
39
- }
40
- else {
41
- $this->display();
42
- }
43
- }
44
-
45
- /**
46
- * Display.
47
- */
48
- public function display() {
49
- // Set params for view.
50
- $params = array();
51
- $params['page'] = $this->page;
52
- $params['page_url'] = $this->page_url;
53
- $params['addons'] = array(
54
- 'Form Maker Add-ons' => array(
55
- 'imp_exp' => array(
56
- 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
57
- 'dir' => 'form-maker-export-import/fm_exp_imp.php',
58
- 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/export-import.html',
59
- 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/import_export.svg',
60
- 'name' => __('Import/Export', WDFMInstance(self::PLUGIN)->prefix),
61
- 'description' => __('Form Maker Export/Import WordPress plugin allows exporting and importing forms with/without submissions.', WDFMInstance(self::PLUGIN)->prefix)
62
- ),
63
- 'mailchimp' => array(
64
- 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
65
- 'dir' => 'form-maker-mailchimp/fm_mailchimp.php',
66
- 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/mailchimp.html',
67
- 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/mailchimp.svg',
68
- 'name' => __('MailChimp', WDFMInstance(self::PLUGIN)->prefix),
69
- 'description' => __('This add-on is an integration of the Form Maker with MailChimp which allows to add contacts to your subscription lists just from submitted forms.', WDFMInstance(self::PLUGIN)->prefix)
70
- ),
71
- 'registration' => array(
72
- 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
73
- 'dir' => 'form-maker-reg/fm_reg.php',
74
- 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/registration.html',
75
- 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/registration.svg',
76
- 'name' => __('Registration', WDFMInstance(self::PLUGIN)->prefix),
77
- 'description' => __('User Registration add-on integrates with Form maker forms allowing users to create accounts at your website.', WDFMInstance(self::PLUGIN)->prefix)
78
- ),
79
- 'post_generation' => array(
80
- 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
81
- 'dir' => 'form-maker-post-generation/fm_post_generation.php',
82
- 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/post-generation.html',
83
- 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/post_generation.svg',
84
- 'name' => __('Post Generation', WDFMInstance(self::PLUGIN)->prefix),
85
- 'description' => 'Post Generation add-on allows creating a post, page or custom post based on the submitted data.',
86
- ),
87
- 'conditional_emails' => array(
88
- 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
89
- 'dir' => 'form-maker-conditional-emails/fm_conditional_emails.php',
90
- 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/conditional-emails.html',
91
- 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/conditional_emails.svg',
92
- 'name' => __('Conditional Emails', WDFMInstance(self::PLUGIN)->prefix),
93
- 'description' => __('Conditional Emails add-on allows to send emails to different recipients depending on the submitted data .', WDFMInstance(self::PLUGIN)->prefix)
94
- ),
95
- 'dropbox_integration' => array(
96
- 'pro' => WDFMInstance(self::PLUGIN)->is_free,
97
- 'dir' => 'form-maker-dropbox-integration/fm_dropbox_integration.php',
98
- 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/dropbox.html',
99
- 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/dropbox_integration.svg',
100
- 'name' => __('Dropbox Integration', WDFMInstance(self::PLUGIN)->prefix),
101
- 'description' => __('The Form Maker Dropbox Integration addon is extending the Form Maker capabilities allowing to store the form attachments straight to your Dropbox account.', WDFMInstance(self::PLUGIN)->prefix)
102
- ),
103
- 'gdrive_integration' => array(
104
- 'pro' => WDFMInstance(self::PLUGIN)->is_free,
105
- 'dir' => 'form-maker-gdrive-integration/fm_gdrive_integration.php',
106
- 'name' => 'Google Drive Integration',
107
- 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/google-drive.html',
108
- 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/gdrive_integration.svg',
109
- 'name' => __('Google Drive Integration', WDFMInstance(self::PLUGIN)->prefix),
110
- 'description' => __('The Google Drive Integration add-on integrates Form Maker with Google Drive and allows you to send the file uploads to the Google Drive', WDFMInstance(self::PLUGIN)->prefix)
111
- ),
112
- 'pdf_integration' => array(
113
- 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
114
- 'dir' => 'form-maker-pdf-integration/fm_pdf_integration.php',
115
- 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/pdf.html',
116
- 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/pdf_integration.svg',
117
- 'name' => __('PDF Integration', WDFMInstance(self::PLUGIN)->prefix),
118
- 'description' => __('The Form Maker PDF Integration add-on allows sending submitted forms in PDF format.', WDFMInstance(self::PLUGIN)->prefix)
119
- ),
120
- 'pushover' => array(
121
- 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
122
- 'dir' => 'form-maker-pushover/fm_pushover.php',
123
- 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/pushover.html',
124
- 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/pushover.svg',
125
- 'name' => __('Pushover', WDFMInstance(self::PLUGIN)->prefix),
126
- 'description' => __('Form Maker Pushover integration allows to receive real-time notifications when a user submits a new form. This means messages can be pushed to Android and Apple devices, as well as desktop notification board.', WDFMInstance(self::PLUGIN)->prefix)
127
- ),
128
- 'form-maker-save-progress' => array(
129
- 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
130
- 'dir' => 'form-maker-save-progress/fm_save.php',
131
- 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/save-progress.html',
132
- 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/save_progress.svg',
133
- 'name' => __('Save Progress', WDFMInstance(self::PLUGIN)->prefix),
134
- 'description' => __('The add-on allows to save filled in forms as draft and continue editing them subsequently.', WDFMInstance(self::PLUGIN)->prefix)
135
- ),
136
- 'stripe' => array(
137
- 'pro' => WDFMInstance(self::PLUGIN)->is_free,
138
- 'dir' => 'form-maker-stripe/fm_stripe.php',
139
- 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/stripe.html',
140
- 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/stripe.svg',
141
- 'name' => __('Stripe', WDFMInstance(self::PLUGIN)->prefix),
142
- 'description' => __('Form Maker Stripe Integration Add-on allows to accept direct payments made by Credit Cards. Users will remain on your website during the entire process.', WDFMInstance(self::PLUGIN)->prefix)
143
- ),
144
- 'calculator' => array(
145
- 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
146
- 'dir' => 'form-maker-calculator/fm_calculator.php',
147
- 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/calculator.html',
148
- 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/calculator.svg',
149
- 'name' => __('Calculator', WDFMInstance(self::PLUGIN)->prefix),
150
- 'description' => __('The Form Maker Calculator add-on allows creating forms with dynamically calculated fields.', WDFMInstance(self::PLUGIN)->prefix)
151
- )
152
- )
153
- );
154
- $this->view->display( $params );
155
- }
156
  }
1
+ <?php
2
+ /**
3
+ * Class FMControllerAddons_fmc
4
+ */
5
+ class FMControllerAddons_fmc extends CFMAdminController {
6
+
7
+ /**
8
+ * @var $model
9
+ */
10
+ private $model;
11
+ /**
12
+ * @var $view
13
+ */
14
+ private $view;
15
+ /**
16
+ * @var string $page
17
+ */
18
+ private $page;
19
+
20
+ public function __construct() {
21
+ $this->page = WDW_FM_Library(self::PLUGIN)->get('page');
22
+ $this->page_url = add_query_arg( array (
23
+ 'page' => $this->page,
24
+ WDFMInstance(self::PLUGIN)->nonce => wp_create_nonce(WDFMInstance(self::PLUGIN)->nonce),
25
+ ), admin_url('admin.php')
26
+ );
27
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Addons_fm.php";
28
+ $this->view = new FMViewAddons_fmc();
29
+ }
30
+
31
+ /**
32
+ * Execute.
33
+ */
34
+ public function execute() {
35
+ $task = WDW_FM_Library(self::PLUGIN)->get('task');
36
+ $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
37
+ if (method_exists($this, $task)) {
38
+ $this->$task($id);
39
+ }
40
+ else {
41
+ $this->display();
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Display.
47
+ */
48
+ public function display() {
49
+ // Set params for view.
50
+ $params = array();
51
+ $params['page'] = $this->page;
52
+ $params['page_url'] = $this->page_url;
53
+ $params['addons'] = array(
54
+ 'Form Maker Add-ons' => array(
55
+ 'imp_exp' => array(
56
+ 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
57
+ 'dir' => 'form-maker-export-import/fm_exp_imp.php',
58
+ 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/export-import.html',
59
+ 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/import_export.svg',
60
+ 'name' => __('Import/Export', WDFMInstance(self::PLUGIN)->prefix),
61
+ 'description' => __('Form Maker Export/Import WordPress plugin allows exporting and importing forms with/without submissions.', WDFMInstance(self::PLUGIN)->prefix)
62
+ ),
63
+ 'mailchimp' => array(
64
+ 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
65
+ 'dir' => 'form-maker-mailchimp/fm_mailchimp.php',
66
+ 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/mailchimp.html',
67
+ 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/mailchimp.svg',
68
+ 'name' => __('MailChimp', WDFMInstance(self::PLUGIN)->prefix),
69
+ 'description' => __('This add-on is an integration of the Form Maker with MailChimp which allows to add contacts to your subscription lists just from submitted forms.', WDFMInstance(self::PLUGIN)->prefix)
70
+ ),
71
+ 'registration' => array(
72
+ 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
73
+ 'dir' => 'form-maker-reg/fm_reg.php',
74
+ 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/registration.html',
75
+ 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/registration.svg',
76
+ 'name' => __('Registration', WDFMInstance(self::PLUGIN)->prefix),
77
+ 'description' => __('User Registration add-on integrates with Form maker forms allowing users to create accounts at your website.', WDFMInstance(self::PLUGIN)->prefix)
78
+ ),
79
+ 'post_generation' => array(
80
+ 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
81
+ 'dir' => 'form-maker-post-generation/fm_post_generation.php',
82
+ 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/post-generation.html',
83
+ 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/post_generation.svg',
84
+ 'name' => __('Post Generation', WDFMInstance(self::PLUGIN)->prefix),
85
+ 'description' => 'Post Generation add-on allows creating a post, page or custom post based on the submitted data.',
86
+ ),
87
+ 'conditional_emails' => array(
88
+ 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
89
+ 'dir' => 'form-maker-conditional-emails/fm_conditional_emails.php',
90
+ 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/conditional-emails.html',
91
+ 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/conditional_emails.svg',
92
+ 'name' => __('Conditional Emails', WDFMInstance(self::PLUGIN)->prefix),
93
+ 'description' => __('Conditional Emails add-on allows to send emails to different recipients depending on the submitted data .', WDFMInstance(self::PLUGIN)->prefix)
94
+ ),
95
+ 'dropbox_integration' => array(
96
+ 'pro' => WDFMInstance(self::PLUGIN)->is_free,
97
+ 'dir' => 'form-maker-dropbox-integration/fm_dropbox_integration.php',
98
+ 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/dropbox.html',
99
+ 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/dropbox_integration.svg',
100
+ 'name' => __('Dropbox Integration', WDFMInstance(self::PLUGIN)->prefix),
101
+ 'description' => __('The Form Maker Dropbox Integration addon is extending the Form Maker capabilities allowing to store the form attachments straight to your Dropbox account.', WDFMInstance(self::PLUGIN)->prefix)
102
+ ),
103
+ 'gdrive_integration' => array(
104
+ 'pro' => WDFMInstance(self::PLUGIN)->is_free,
105
+ 'dir' => 'form-maker-gdrive-integration/fm_gdrive_integration.php',
106
+ 'name' => 'Google Drive Integration',
107
+ 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/google-drive.html',
108
+ 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/gdrive_integration.svg',
109
+ 'name' => __('Google Drive Integration', WDFMInstance(self::PLUGIN)->prefix),
110
+ 'description' => __('The Google Drive Integration add-on integrates Form Maker with Google Drive and allows you to send the file uploads to the Google Drive', WDFMInstance(self::PLUGIN)->prefix)
111
+ ),
112
+ 'pdf_integration' => array(
113
+ 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
114
+ 'dir' => 'form-maker-pdf-integration/fm_pdf_integration.php',
115
+ 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/pdf.html',
116
+ 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/pdf_integration.svg',
117
+ 'name' => __('PDF Integration', WDFMInstance(self::PLUGIN)->prefix),
118
+ 'description' => __('The Form Maker PDF Integration add-on allows sending submitted forms in PDF format.', WDFMInstance(self::PLUGIN)->prefix)
119
+ ),
120
+ 'pushover' => array(
121
+ 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
122
+ 'dir' => 'form-maker-pushover/fm_pushover.php',
123
+ 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/pushover.html',
124
+ 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/pushover.svg',
125
+ 'name' => __('Pushover', WDFMInstance(self::PLUGIN)->prefix),
126
+ 'description' => __('Form Maker Pushover integration allows to receive real-time notifications when a user submits a new form. This means messages can be pushed to Android and Apple devices, as well as desktop notification board.', WDFMInstance(self::PLUGIN)->prefix)
127
+ ),
128
+ 'form-maker-save-progress' => array(
129
+ 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
130
+ 'dir' => 'form-maker-save-progress/fm_save.php',
131
+ 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/save-progress.html',
132
+ 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/save_progress.svg',
133
+ 'name' => __('Save Progress', WDFMInstance(self::PLUGIN)->prefix),
134
+ 'description' => __('The add-on allows to save filled in forms as draft and continue editing them subsequently.', WDFMInstance(self::PLUGIN)->prefix)
135
+ ),
136
+ 'stripe' => array(
137
+ 'pro' => WDFMInstance(self::PLUGIN)->is_free,
138
+ 'dir' => 'form-maker-stripe/fm_stripe.php',
139
+ 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/stripe.html',
140
+ 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/stripe.svg',
141
+ 'name' => __('Stripe', WDFMInstance(self::PLUGIN)->prefix),
142
+ 'description' => __('Form Maker Stripe Integration Add-on allows to accept direct payments made by Credit Cards. Users will remain on your website during the entire process.', WDFMInstance(self::PLUGIN)->prefix)
143
+ ),
144
+ 'calculator' => array(
145
+ 'pro' => (WDFMInstance(self::PLUGIN)->is_free == 2),
146
+ 'dir' => 'form-maker-calculator/fm_calculator.php',
147
+ 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/calculator.html',
148
+ 'icon' => WDFMInstance(self::PLUGIN)->plugin_url . '/images/addons/calculator.svg',
149
+ 'name' => __('Calculator', WDFMInstance(self::PLUGIN)->prefix),
150
+ 'description' => __('The Form Maker Calculator add-on allows creating forms with dynamically calculated fields.', WDFMInstance(self::PLUGIN)->prefix)
151
+ )
152
+ )
153
+ );
154
+ $this->view->display( $params );
155
+ }
156
  }
admin/controllers/Blocked_ips_fm.php CHANGED
@@ -1,288 +1,288 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerBlocked_ips_fmc
5
- */
6
- class FMControllerBlocked_ips_fmc extends CFMAdminController {
7
- private $model;
8
- private $view;
9
- private $bulk_action_name = '';
10
- private $items_per_page = 20;
11
- private $actions = array();
12
-
13
- public function __construct() {
14
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Blocked_ips_fm.php";
15
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Blocked_ips_fm.php";
16
- $this->model = new FMModelBlocked_ips_fmc();
17
- $this->view = new FMViewBlocked_ips_fmc();
18
-
19
- $this->page = WDW_FM_Library(self::PLUGIN)->get('page');
20
-
21
- $this->bulk_action_name = 'bulk_action';
22
-
23
- $this->actions = array(
24
- 'delete' => array(
25
- 'title' => __('Delete', WDFMInstance(self::PLUGIN)->prefix),
26
- $this->bulk_action_name => __('deleted', WDFMInstance(self::PLUGIN)->prefix),
27
- ),
28
- );
29
- }
30
-
31
- public function execute() {
32
- $task = WDW_FM_Library(self::PLUGIN)->get('task');
33
- $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
34
-
35
- if ( method_exists($this, $task) ) {
36
- check_admin_referer(WDFMInstance(self::PLUGIN)->nonce, WDFMInstance(self::PLUGIN)->nonce);
37
- $block_action = $this->bulk_action_name;
38
- $action = WDW_FM_Library(self::PLUGIN)->get( $block_action, -1 );
39
- if ( $action != -1 ) {
40
- $this->$block_action($action);
41
- }
42
- else {
43
- $this->$task($id);
44
- }
45
- }
46
- else {
47
- $this->display();
48
- }
49
- }
50
-
51
- public function display() {
52
- $params = array();
53
- $params['order'] = WDW_FM_Library(self::PLUGIN)->get('order', 'desc');
54
- $params['orderby'] = WDW_FM_Library(self::PLUGIN)->get('orderby', 'id');
55
- // To prevent SQL injections.
56
- if ( !in_array($params['orderby'], array( 'id', 'ip' )) ) {
57
- $params['orderby'] = 'id';
58
- }
59
- $params['order'] = $params['order'] == 'desc' ? 'desc' : 'asc';
60
-
61
- $params['items_per_page'] = $this->items_per_page;
62
-
63
- $params['rows_data'] = $this->model->get_rows_data($params);
64
-
65
- $params['total'] = $this->model->total();
66
-
67
- $params['actions'] = $this->actions;
68
- $params['page'] = $this->page;
69
-
70
- $this->view->display($params);
71
- }
72
-
73
- /**
74
- * Bulk actions.
75
- *
76
- * @param string $task
77
- */
78
- public function bulk_action( $task = '' ) {
79
- $message = 0;
80
- $successfully_updated = 0;
81
- $check = WDW_FM_Library(self::PLUGIN)->get('check', '');
82
- if ( $check ) {
83
- foreach ( $check as $id => $item ) {
84
- if ( method_exists($this, $task) ) {
85
- $message = $this->$task($id, TRUE);
86
- if ( $message != 2 ) {
87
- // Increase successfully updated items count, if action doesn't failed.
88
- $successfully_updated++;
89
- }
90
- }
91
- }
92
- if ( $successfully_updated ) {
93
- $block_action = $this->bulk_action_name;
94
- $message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDFMInstance(self::PLUGIN)->prefix), $successfully_updated, $this->actions[$task][$block_action]);
95
- }
96
- }
97
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
98
- 'page' => $this->page,
99
- 'task' => 'display',
100
- ($message === 2 ? 'message' : 'msg') => $message,
101
- ), admin_url('admin.php')));
102
- }
103
-
104
- /**
105
- * Insert blocked ip
106
- */
107
- public function insert_blocked_ip() {
108
-
109
- $page = WDW_FM_Library(self::PLUGIN)->get('page');
110
-
111
- $ip = WDW_FM_Library(self::PLUGIN)->get('ip','');
112
-
113
- $insert = $this->model->insert_fm_blocked(array('ip' => $ip,), array('%s',));
114
- if( !$insert ){
115
- $message = 2;
116
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
117
- 'page' => $page,
118
- 'task' => 'display',
119
- 'message' => $message,
120
- ), admin_url('admin.php')));
121
- }
122
- }
123
-
124
- /**
125
- * Delete blocked ip.
126
- *
127
- * @param int $id
128
- */
129
- public function delete_blocked_ip( $id = 0 ) {
130
- $page = WDW_FM_Library(self::PLUGIN)->get('page');
131
- // check id for db
132
- if(isset($id) && $id != "") {
133
- $id = intval($id);
134
- $delete = $this->model->delete_data($id);
135
-
136
- if( !$delete ){
137
- $message = 2;
138
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
139
- 'page' => $page,
140
- 'task' => 'display',
141
- 'message' => $message,
142
- ), admin_url('admin.php')));
143
- }
144
-
145
- }
146
- else { // return message Failed
147
- $message = 2;
148
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
149
- 'page' => $page,
150
- 'task' => 'display',
151
- 'message' => $message,
152
- ), admin_url('admin.php')));
153
- }
154
-
155
- $total = $this->model->total(); // get total count of blocked IPs
156
- if( ($total % $this->items_per_page) == 0 ) {
157
-
158
- echo '<div id="total_for_paging">'.$total/$this->items_per_page.'</div>'; // send to JS page number
159
- }
160
- }
161
-
162
- /**
163
- * Update blocked ip.
164
- *
165
- * @param int $id
166
- */
167
- public function update_blocked_ip( $id = 0 ) {
168
- $page = WDW_FM_Library(self::PLUGIN)->get('page');
169
-
170
- // check id for db
171
- if(isset($id) && $id != "") {
172
- $id = intval($id);
173
- $ip = WDW_FM_Library(self::PLUGIN)->get('ip', '');
174
- $update = $this->model->update_fm_blocked(array('ip' => $ip,), array('id' => $id));
175
-
176
- if( !$update ){
177
- $message = 2;
178
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
179
- 'page' => $page,
180
- 'task' => 'display',
181
- 'message' => $message,
182
- ), admin_url('admin.php')));
183
- }
184
-
185
- }
186
- else { // return message Failed
187
- $message = 2;
188
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
189
- 'page' => $page,
190
- 'task' => 'display',
191
- 'message' => $message,
192
- ), admin_url('admin.php')));
193
- }
194
- }
195
-
196
- /**
197
- *
198
- * Delete.
199
- *
200
- * @param int $id
201
- * @param bool $bulk
202
- * @return int
203
- */
204
- public function delete( $id = 0, $bulk = FALSE ) {
205
- if ( $this->model->delete_data($id) ) {
206
- $message = 3;
207
- }
208
- else {
209
- $message = 2;
210
- }
211
-
212
- if ( $bulk ) {
213
- return $message;
214
- }
215
- else {
216
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
217
- 'page' => $this->page,
218
- 'task' => 'display',
219
- 'message' => $message,
220
- ), admin_url('admin.php')));
221
- }
222
- }
223
-
224
- public function save() {
225
- $message = $this->save_db();
226
- $page = WDW_FM_Library(self::PLUGIN)->get('page');
227
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
228
- 'page' => $page,
229
- 'task' => 'display',
230
- 'message' => $message,
231
- ), admin_url('admin.php')));
232
- }
233
-
234
- public function save_db() {
235
- $id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
236
- $ip = (isset($_POST['ip']) ? esc_html(stripslashes($_POST['ip'])) : '');
237
- if ( $id != 0 ) {
238
- $save = $this->model->update_fm_blocked(array(
239
- 'ip' => $ip,
240
- ), array( 'id' => $id ));
241
- }
242
- else {
243
- $save = $this->model->insert_fm_blocked(array(
244
- 'ip' => $ip,
245
- ), array(
246
- '%s',
247
- ));
248
- }
249
- if ( $save !== FALSE ) {
250
- $message = 1;
251
- }
252
- else {
253
- $message = 2;
254
- }
255
- return $message;
256
- }
257
-
258
- public function save_all() {
259
- $flag = FALSE;
260
- $ips_id_col = $this->model->get_col_data();
261
- foreach ( $ips_id_col as $ip_id ) {
262
- if ( isset($_POST['ip' . $ip_id]) ) {
263
- $ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
264
- if ( $ip == '' ) {
265
- $this->model->delete_data($ip_id);
266
- }
267
- else {
268
- $flag = TRUE;
269
- $this->model->update_fm_blocked(array(
270
- 'ip' => $ip,
271
- ), array( 'id' => $ip_id ));
272
- }
273
- }
274
- }
275
- if ( $flag ) {
276
- $message = 1;
277
- }
278
- else {
279
- $message = 0;
280
- }
281
- $page = WDW_FM_Library(self::PLUGIN)->get('page');
282
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
283
- 'page' => $page,
284
- 'task' => 'display',
285
- 'message' => $message,
286
- ), admin_url('admin.php')));
287
- }
288
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerBlocked_ips_fmc
5
+ */
6
+ class FMControllerBlocked_ips_fmc extends CFMAdminController {
7
+ private $model;
8
+ private $view;
9
+ private $bulk_action_name = '';
10
+ private $items_per_page = 20;
11
+ private $actions = array();
12
+
13
+ public function __construct() {
14
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Blocked_ips_fm.php";
15
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Blocked_ips_fm.php";
16
+ $this->model = new FMModelBlocked_ips_fmc();
17
+ $this->view = new FMViewBlocked_ips_fmc();
18
+
19
+ $this->page = WDW_FM_Library(self::PLUGIN)->get('page');
20
+
21
+ $this->bulk_action_name = 'bulk_action';
22
+
23
+ $this->actions = array(
24
+ 'delete' => array(
25
+ 'title' => __('Delete', WDFMInstance(self::PLUGIN)->prefix),
26
+ $this->bulk_action_name => __('deleted', WDFMInstance(self::PLUGIN)->prefix),
27
+ ),
28
+ );
29
+ }
30
+
31
+ public function execute() {
32
+ $task = WDW_FM_Library(self::PLUGIN)->get('task');
33
+ $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
34
+
35
+ if ( method_exists($this, $task) ) {
36
+ check_admin_referer(WDFMInstance(self::PLUGIN)->nonce, WDFMInstance(self::PLUGIN)->nonce);
37
+ $block_action = $this->bulk_action_name;
38
+ $action = WDW_FM_Library(self::PLUGIN)->get( $block_action, -1 );
39
+ if ( $action != -1 ) {
40
+ $this->$block_action($action);
41
+ }
42
+ else {
43
+ $this->$task($id);
44
+ }
45
+ }
46
+ else {
47
+ $this->display();
48
+ }
49
+ }
50
+
51
+ public function display() {
52
+ $params = array();
53
+ $params['order'] = WDW_FM_Library(self::PLUGIN)->get('order', 'desc');
54
+ $params['orderby'] = WDW_FM_Library(self::PLUGIN)->get('orderby', 'id');
55
+ // To prevent SQL injections.
56
+ if ( !in_array($params['orderby'], array( 'id', 'ip' )) ) {
57
+ $params['orderby'] = 'id';
58
+ }
59
+ $params['order'] = $params['order'] == 'desc' ? 'desc' : 'asc';
60
+
61
+ $params['items_per_page'] = $this->items_per_page;
62
+
63
+ $params['rows_data'] = $this->model->get_rows_data($params);
64
+
65
+ $params['total'] = $this->model->total();
66
+
67
+ $params['actions'] = $this->actions;
68
+ $params['page'] = $this->page;
69
+
70
+ $this->view->display($params);
71
+ }
72
+
73
+ /**
74
+ * Bulk actions.
75
+ *
76
+ * @param string $task
77
+ */
78
+ public function bulk_action( $task = '' ) {
79
+ $message = 0;
80
+ $successfully_updated = 0;
81
+ $check = WDW_FM_Library(self::PLUGIN)->get('check', '');
82
+ if ( $check ) {
83
+ foreach ( $check as $id => $item ) {
84
+ if ( method_exists($this, $task) ) {
85
+ $message = $this->$task($id, TRUE);
86
+ if ( $message != 2 ) {
87
+ // Increase successfully updated items count, if action doesn't failed.
88
+ $successfully_updated++;
89
+ }
90
+ }
91
+ }
92
+ if ( $successfully_updated ) {
93
+ $block_action = $this->bulk_action_name;
94
+ $message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDFMInstance(self::PLUGIN)->prefix), $successfully_updated, $this->actions[$task][$block_action]);
95
+ }
96
+ }
97
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
98
+ 'page' => $this->page,
99
+ 'task' => 'display',
100
+ ($message === 2 ? 'message' : 'msg') => $message,
101
+ ), admin_url('admin.php')));
102
+ }
103
+
104
+ /**
105
+ * Insert blocked ip
106
+ */
107
+ public function insert_blocked_ip() {
108
+
109
+ $page = WDW_FM_Library(self::PLUGIN)->get('page');
110
+
111
+ $ip = WDW_FM_Library(self::PLUGIN)->get('ip','');
112
+
113
+ $insert = $this->model->insert_fm_blocked(array('ip' => $ip,), array('%s',));
114
+ if( !$insert ){
115
+ $message = 2;
116
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
117
+ 'page' => $page,
118
+ 'task' => 'display',
119
+ 'message' => $message,
120
+ ), admin_url('admin.php')));
121
+ }
122
+ }
123
+
124
+ /**
125
+ * Delete blocked ip.
126
+ *
127
+ * @param int $id
128
+ */
129
+ public function delete_blocked_ip( $id = 0 ) {
130
+ $page = WDW_FM_Library(self::PLUGIN)->get('page');
131
+ // check id for db
132
+ if(isset($id) && $id != "") {
133
+ $id = intval($id);
134
+ $delete = $this->model->delete_data($id);
135
+
136
+ if( !$delete ){
137
+ $message = 2;
138
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
139
+ 'page' => $page,
140
+ 'task' => 'display',
141
+ 'message' => $message,
142
+ ), admin_url('admin.php')));
143
+ }
144
+
145
+ }
146
+ else { // return message Failed
147
+ $message = 2;
148
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
149
+ 'page' => $page,
150
+ 'task' => 'display',
151
+ 'message' => $message,
152
+ ), admin_url('admin.php')));
153
+ }
154
+
155
+ $total = $this->model->total(); // get total count of blocked IPs
156
+ if( ($total % $this->items_per_page) == 0 ) {
157
+
158
+ echo '<div id="total_for_paging">'.$total/$this->items_per_page.'</div>'; // send to JS page number
159
+ }
160
+ }
161
+
162
+ /**
163
+ * Update blocked ip.
164
+ *
165
+ * @param int $id
166
+ */
167
+ public function update_blocked_ip( $id = 0 ) {
168
+ $page = WDW_FM_Library(self::PLUGIN)->get('page');
169
+
170
+ // check id for db
171
+ if(isset($id) && $id != "") {
172
+ $id = intval($id);
173
+ $ip = WDW_FM_Library(self::PLUGIN)->get('ip', '');
174
+ $update = $this->model->update_fm_blocked(array('ip' => $ip,), array('id' => $id));
175
+
176
+ if( !$update ){
177
+ $message = 2;
178
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
179
+ 'page' => $page,
180
+ 'task' => 'display',
181
+ 'message' => $message,
182
+ ), admin_url('admin.php')));
183
+ }
184
+
185
+ }
186
+ else { // return message Failed
187
+ $message = 2;
188
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
189
+ 'page' => $page,
190
+ 'task' => 'display',
191
+ 'message' => $message,
192
+ ), admin_url('admin.php')));
193
+ }
194
+ }
195
+
196
+ /**
197
+ *
198
+ * Delete.
199
+ *
200
+ * @param int $id
201
+ * @param bool $bulk
202
+ * @return int
203
+ */
204
+ public function delete( $id = 0, $bulk = FALSE ) {
205
+ if ( $this->model->delete_data($id) ) {
206
+ $message = 3;
207
+ }
208
+ else {
209
+ $message = 2;
210
+ }
211
+
212
+ if ( $bulk ) {
213
+ return $message;
214
+ }
215
+ else {
216
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
217
+ 'page' => $this->page,
218
+ 'task' => 'display',
219
+ 'message' => $message,
220
+ ), admin_url('admin.php')));
221
+ }
222
+ }
223
+
224
+ public function save() {
225
+ $message = $this->save_db();
226
+ $page = WDW_FM_Library(self::PLUGIN)->get('page');
227
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
228
+ 'page' => $page,
229
+ 'task' => 'display',
230
+ 'message' => $message,
231
+ ), admin_url('admin.php')));
232
+ }
233
+
234
+ public function save_db() {
235
+ $id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
236
+ $ip = (isset($_POST['ip']) ? esc_html(stripslashes($_POST['ip'])) : '');
237
+ if ( $id != 0 ) {
238
+ $save = $this->model->update_fm_blocked(array(
239
+ 'ip' => $ip,
240
+ ), array( 'id' => $id ));
241
+ }
242
+ else {
243
+ $save = $this->model->insert_fm_blocked(array(
244
+ 'ip' => $ip,
245
+ ), array(
246
+ '%s',
247
+ ));
248
+ }
249
+ if ( $save !== FALSE ) {
250
+ $message = 1;
251
+ }
252
+ else {
253
+ $message = 2;
254
+ }
255
+ return $message;
256
+ }
257
+
258
+ public function save_all() {
259
+ $flag = FALSE;
260
+ $ips_id_col = $this->model->get_col_data();
261
+ foreach ( $ips_id_col as $ip_id ) {
262
+ if ( isset($_POST['ip' . $ip_id]) ) {
263
+ $ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
264
+ if ( $ip == '' ) {
265
+ $this->model->delete_data($ip_id);
266
+ }
267
+ else {
268
+ $flag = TRUE;
269
+ $this->model->update_fm_blocked(array(
270
+ 'ip' => $ip,
271
+ ), array( 'id' => $ip_id ));
272
+ }
273
+ }
274
+ }
275
+ if ( $flag ) {
276
+ $message = 1;
277
+ }
278
+ else {
279
+ $message = 0;
280
+ }
281
+ $page = WDW_FM_Library(self::PLUGIN)->get('page');
282
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
283
+ 'page' => $page,
284
+ 'task' => 'display',
285
+ 'message' => $message,
286
+ ), admin_url('admin.php')));
287
+ }
288
+ }
admin/controllers/Checkpaypal.php CHANGED
@@ -1,181 +1,181 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerCheckpaypal
5
- */
6
- class FMControllerCheckpaypal extends FMAdminController {
7
- /**
8
- * @var $model
9
- */
10
- private $model;
11
- /**
12
- * @var $view
13
- */
14
- private $view;
15
-
16
- /**
17
- * FMControllerCheckpaypal constructor.
18
- */
19
- public function __construct() {
20
- // Load FMModelCheckpaypal class.
21
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Checkpaypal.php";
22
- $this->model = new FMModelCheckpaypal();
23
- // Load FMViewCheckpaypal class.
24
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Checkpaypal.php";
25
- $this->view = new FMViewCheckpaypal();
26
- }
27
-
28
- /**
29
- * Execute.
30
- */
31
- public function execute() {
32
- $this->display();
33
- }
34
-
35
- /**
36
- * Display.
37
- */
38
- public function display() {
39
- // Get form by id.
40
- $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
41
- $form = $this->model->get_form_by_id($form_id);
42
- // Get form session by group id.
43
- $group_id = WDW_FM_Library(self::PLUGIN)->get('group_id', 0);
44
- $form_session = $this->model->get_form_session_by_group_id($group_id);
45
- // Connect to paypal.
46
- $post_fields = '';
47
- if ( isset($_POST) && !empty($_POST) ) {
48
- foreach ( $_POST as $key => $value ) {
49
- $post_fields .= $key . '=' . urlencode($value) . '&';
50
- }
51
- }
52
- $post_fields .= 'cmd=_notify-validate';
53
- $paypal_params = array( 'checkout_mode' => $form->checkout_mode, 'post_fields' => $post_fields );
54
- $response = $this->model->connect_to_paypal($paypal_params);
55
- $tax = WDW_FM_Library(self::PLUGIN)->get('tax', 0);
56
- $total = WDW_FM_Library(self::PLUGIN)->get('mc_gross', 0);
57
- $shipping = WDW_FM_Library(self::PLUGIN)->get('mc_shipping', 0);
58
- $payment_status = WDW_FM_Library(self::PLUGIN)->get('payment_status', 0);
59
- // Update payment status for formmaker_submits table.
60
- $this->model->update_submission_status($payment_status, $group_id);
61
- $form_currency = '$';
62
- $currency_code = array(
63
- 'USD',
64
- 'EUR',
65
- 'GBP',
66
- 'JPY',
67
- 'CAD',
68
- 'MXN',
69
- 'HKD',
70
- 'HUF',
71
- 'NOK',
72
- 'NZD',
73
- 'SGD',
74
- 'SEK',
75
- 'PLN',
76
- 'AUD',
77
- 'DKK',
78
- 'CHF',
79
- 'CZK',
80
- 'ILS',
81
- 'BRL',
82
- 'TWD',
83
- 'MYR',
84
- 'PHP',
85
- 'THB',
86
- );
87
- $currency_sign = array(
88
- '$',
89
- '&#8364;',
90
- '&#163;',
91
- '&#165;',
92
- 'C$',
93
- 'Mex$',
94
- 'HK$',
95
- 'Ft',
96
- 'kr',
97
- 'NZ$',
98
- 'S$',
99
- 'kr',
100
- 'zl',
101
- 'A$',
102
- 'kr',
103
- 'CHF',
104
- 'Kc',
105
- '&#8362;',
106
- 'R$',
107
- 'NT$',
108
- 'RM',
109
- '&#8369;',
110
- '&#xe3f;',
111
- );
112
- // Checking payment currency and set new value fo currency.
113
- $payment_currency = !empty($form->payment_currency) ? $form->payment_currency : $form_currency;
114
- if ( !empty($payment_currency) ) {
115
- $form_currency = $currency_sign[array_search($payment_currency, $currency_code)];
116
- }
117
- $currency = $payment_currency . $form_currency;
118
- $email = WDW_FM_Library(self::PLUGIN)->get('payer_email', '');
119
- $first_name = WDW_FM_Library(self::PLUGIN)->get('first_name', '');
120
- $last_name = WDW_FM_Library(self::PLUGIN)->get('last_name', '');
121
- $full_name = (($first_name != '') ? $first_name : '') . (($last_name != '') ? ' ' . $last_name : '');
122
- $phone_a = WDW_FM_Library(self::PLUGIN)->get('night_phone_a', '');
123
- $phone_b = WDW_FM_Library(self::PLUGIN)->get('night_phone_b', '');
124
- $phone_c = WDW_FM_Library(self::PLUGIN)->get('night_phone_c', '');
125
- $phone = (($phone_a != '') ? $phone_a : '') . (($phone_b != '') ? ' - ' . $phone_b : '') . (($phone_c != '') ? ' - ' . $phone_c : '');
126
- $address = '';
127
- $address .= (WDW_FM_Library(self::PLUGIN)->get('address_country', '') != '') ? "Country: " . WDW_FM_Library(self::PLUGIN)->get('address_country', '') : '';
128
- $address .= (WDW_FM_Library(self::PLUGIN)->get('address_state', '') != '') ? "<br>State: " . WDW_FM_Library(self::PLUGIN)->get('address_state', '') : '';
129
- $address .= (WDW_FM_Library(self::PLUGIN)->get('address_city', '') != '') ? "<br>City: " . WDW_FM_Library(self::PLUGIN)->get('address_city', '') : '';
130
- $address .= (WDW_FM_Library(self::PLUGIN)->get('address_street', '') != '') ? "<br>Street: " . WDW_FM_Library(self::PLUGIN)->get('address_street', '') : '';
131
- $address .= (WDW_FM_Library(self::PLUGIN)->get('address_zip', '') != '') ? "<br>Zip Code: " . WDW_FM_Library(self::PLUGIN)->get('address_zip', '') : '';
132
- $address .= (WDW_FM_Library(self::PLUGIN)->get('address_status', '') != '') ? "<br>Address Status: " . WDW_FM_Library(self::PLUGIN)->get('address_status', '') : '';
133
- $address .= (WDW_FM_Library(self::PLUGIN)->get('address_name', '') != '') ? "<br>Name: " . WDW_FM_Library(self::PLUGIN)->get('address_name', '') : '';
134
- $paypal_info = "";
135
- $paypal_info .= (WDW_FM_Library(self::PLUGIN)->get('payer_status', '') != '') ? "<br>Payer Status - " . WDW_FM_Library(self::PLUGIN)->get('payer_status', '') : '';
136
- $paypal_info .= (WDW_FM_Library(self::PLUGIN)->get('payer_email', '') != '') ? "<br>Payer Email - " . WDW_FM_Library(self::PLUGIN)->get('payer_email', '') : '';
137
- $paypal_info .= (WDW_FM_Library(self::PLUGIN)->get('txn_id', '') != '') ? "<br>Transaction - " . WDW_FM_Library(self::PLUGIN)->get('txn_id', '') : '';
138
- $paypal_info .= (WDW_FM_Library(self::PLUGIN)->get('payment_type', '') != '') ? "<br>Payment Type - " . WDW_FM_Library(self::PLUGIN)->get('payment_type', '') : '';
139
- $paypal_info .= (WDW_FM_Library(self::PLUGIN)->get('residence_country', '') != '') ? "<br>Residence Country - " . WDW_FM_Library(self::PLUGIN)->get('residence_country', '') : '';
140
- $post = array(
141
- 'form_id' => $form_id,
142
- 'group_id' => $group_id,
143
- 'full_name' => $full_name,
144
- 'email' => $email,
145
- 'phone' => $phone,
146
- 'address' => $address,
147
- 'status' => $payment_status,
148
- 'ipn' => $response,
149
- 'currency' => $currency,
150
- 'paypal_info' => $paypal_info,
151
- 'tax' => $tax,
152
- 'total' => $total,
153
- 'shipping' => $shipping,
154
- 'ord_last_modified' => date('Y-m-d H:i:s'),
155
- );
156
- if ( !$form_session ) {
157
- $this->model->add_formmaker_sessions($post);
158
- }
159
- else {
160
- $this->model->update_formmaker_sessions_by_group_id($group_id, $post);
161
- }
162
- // Get form session by group id.
163
- $form_session = $this->model->get_form_session_by_group_id($group_id);
164
- // Send mail to payer.
165
- if ( !empty($form_session) ) {
166
- $recipient = $form->mail ? $form->mail : '';
167
- if ( $recipient ) {
168
- $subject = __("Payment information", WDFMInstance(self::PLUGIN)->prefix);
169
- // Get template for payment information.
170
- $template_params = array( 'form_session' => $form_session, 'data' => $post );
171
- $message = $this->view->payment_information_template($template_params);
172
- $header_arr = array();
173
- $header_arr['content_type'] = "text/html";
174
- $header_arr['charset'] = 'UTF-8';
175
- WDW_FM_Library(self::PLUGIN)->mail($recipient, $subject, $message, $header_arr);
176
- }
177
- }
178
-
179
- return 0;
180
- }
181
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerCheckpaypal
5
+ */
6
+ class FMControllerCheckpaypal extends FMAdminController {
7
+ /**
8
+ * @var $model
9
+ */
10
+ private $model;
11
+ /**
12
+ * @var $view
13
+ */
14
+ private $view;
15
+
16
+ /**
17
+ * FMControllerCheckpaypal constructor.
18
+ */
19
+ public function __construct() {
20
+ // Load FMModelCheckpaypal class.
21
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Checkpaypal.php";
22
+ $this->model = new FMModelCheckpaypal();
23
+ // Load FMViewCheckpaypal class.
24
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Checkpaypal.php";
25
+ $this->view = new FMViewCheckpaypal();
26
+ }
27
+
28
+ /**
29
+ * Execute.
30
+ */
31
+ public function execute() {
32
+ $this->display();
33
+ }
34
+
35
+ /**
36
+ * Display.
37
+ */
38
+ public function display() {
39
+ // Get form by id.
40
+ $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
41
+ $form = $this->model->get_form_by_id($form_id);
42
+ // Get form session by group id.
43
+ $group_id = WDW_FM_Library(self::PLUGIN)->get('group_id', 0);
44
+ $form_session = $this->model->get_form_session_by_group_id($group_id);
45
+ // Connect to paypal.
46
+ $post_fields = '';
47
+ if ( isset($_POST) && !empty($_POST) ) {
48
+ foreach ( $_POST as $key => $value ) {
49
+ $post_fields .= $key . '=' . urlencode($value) . '&';
50
+ }
51
+ }
52
+ $post_fields .= 'cmd=_notify-validate';
53
+ $paypal_params = array( 'checkout_mode' => $form->checkout_mode, 'post_fields' => $post_fields );
54
+ $response = $this->model->connect_to_paypal($paypal_params);
55
+ $tax = WDW_FM_Library(self::PLUGIN)->get('tax', 0);
56
+ $total = WDW_FM_Library(self::PLUGIN)->get('mc_gross', 0);
57
+ $shipping = WDW_FM_Library(self::PLUGIN)->get('mc_shipping', 0);
58
+ $payment_status = WDW_FM_Library(self::PLUGIN)->get('payment_status', 0);
59
+ // Update payment status for formmaker_submits table.
60
+ $this->model->update_submission_status($payment_status, $group_id);
61
+ $form_currency = '$';
62
+ $currency_code = array(
63
+ 'USD',
64
+ 'EUR',
65
+ 'GBP',
66
+ 'JPY',
67
+ 'CAD',
68
+ 'MXN',
69
+ 'HKD',
70
+ 'HUF',
71
+ 'NOK',
72
+ 'NZD',
73
+ 'SGD',
74
+ 'SEK',
75
+ 'PLN',
76
+ 'AUD',
77
+ 'DKK',
78
+ 'CHF',
79
+ 'CZK',
80
+ 'ILS',
81
+ 'BRL',
82
+ 'TWD',
83
+ 'MYR',
84
+ 'PHP',
85
+ 'THB',
86
+ );
87
+ $currency_sign = array(
88
+ '$',
89
+ '&#8364;',
90
+ '&#163;',
91
+ '&#165;',
92
+ 'C$',
93
+ 'Mex$',
94
+ 'HK$',
95
+ 'Ft',
96
+ 'kr',
97
+ 'NZ$',
98
+ 'S$',
99
+ 'kr',
100
+ 'zl',
101
+ 'A$',
102
+ 'kr',
103
+ 'CHF',
104
+ 'Kc',
105
+ '&#8362;',
106
+ 'R$',
107
+ 'NT$',
108
+ 'RM',
109
+ '&#8369;',
110
+ '&#xe3f;',
111
+ );
112
+ // Checking payment currency and set new value fo currency.
113
+ $payment_currency = !empty($form->payment_currency) ? $form->payment_currency : $form_currency;
114
+ if ( !empty($payment_currency) ) {
115
+ $form_currency = $currency_sign[array_search($payment_currency, $currency_code)];
116
+ }
117
+ $currency = $payment_currency . $form_currency;
118
+ $email = WDW_FM_Library(self::PLUGIN)->get('payer_email', '');
119
+ $first_name = WDW_FM_Library(self::PLUGIN)->get('first_name', '');
120
+ $last_name = WDW_FM_Library(self::PLUGIN)->get('last_name', '');
121
+ $full_name = (($first_name != '') ? $first_name : '') . (($last_name != '') ? ' ' . $last_name : '');
122
+ $phone_a = WDW_FM_Library(self::PLUGIN)->get('night_phone_a', '');
123
+ $phone_b = WDW_FM_Library(self::PLUGIN)->get('night_phone_b', '');
124
+ $phone_c = WDW_FM_Library(self::PLUGIN)->get('night_phone_c', '');
125
+ $phone = (($phone_a != '') ? $phone_a : '') . (($phone_b != '') ? ' - ' . $phone_b : '') . (($phone_c != '') ? ' - ' . $phone_c : '');
126
+ $address = '';
127
+ $address .= (WDW_FM_Library(self::PLUGIN)->get('address_country', '') != '') ? "Country: " . WDW_FM_Library(self::PLUGIN)->get('address_country', '') : '';
128
+ $address .= (WDW_FM_Library(self::PLUGIN)->get('address_state', '') != '') ? "<br>State: " . WDW_FM_Library(self::PLUGIN)->get('address_state', '') : '';
129
+ $address .= (WDW_FM_Library(self::PLUGIN)->get('address_city', '') != '') ? "<br>City: " . WDW_FM_Library(self::PLUGIN)->get('address_city', '') : '';
130
+ $address .= (WDW_FM_Library(self::PLUGIN)->get('address_street', '') != '') ? "<br>Street: " . WDW_FM_Library(self::PLUGIN)->get('address_street', '') : '';
131
+ $address .= (WDW_FM_Library(self::PLUGIN)->get('address_zip', '') != '') ? "<br>Zip Code: " . WDW_FM_Library(self::PLUGIN)->get('address_zip', '') : '';
132
+ $address .= (WDW_FM_Library(self::PLUGIN)->get('address_status', '') != '') ? "<br>Address Status: " . WDW_FM_Library(self::PLUGIN)->get('address_status', '') : '';
133
+ $address .= (WDW_FM_Library(self::PLUGIN)->get('address_name', '') != '') ? "<br>Name: " . WDW_FM_Library(self::PLUGIN)->get('address_name', '') : '';
134
+ $paypal_info = "";
135
+ $paypal_info .= (WDW_FM_Library(self::PLUGIN)->get('payer_status', '') != '') ? "<br>Payer Status - " . WDW_FM_Library(self::PLUGIN)->get('payer_status', '') : '';
136
+ $paypal_info .= (WDW_FM_Library(self::PLUGIN)->get('payer_email', '') != '') ? "<br>Payer Email - " . WDW_FM_Library(self::PLUGIN)->get('payer_email', '') : '';
137
+ $paypal_info .= (WDW_FM_Library(self::PLUGIN)->get('txn_id', '') != '') ? "<br>Transaction - " . WDW_FM_Library(self::PLUGIN)->get('txn_id', '') : '';
138
+ $paypal_info .= (WDW_FM_Library(self::PLUGIN)->get('payment_type', '') != '') ? "<br>Payment Type - " . WDW_FM_Library(self::PLUGIN)->get('payment_type', '') : '';
139
+ $paypal_info .= (WDW_FM_Library(self::PLUGIN)->get('residence_country', '') != '') ? "<br>Residence Country - " . WDW_FM_Library(self::PLUGIN)->get('residence_country', '') : '';
140
+ $post = array(
141
+ 'form_id' => $form_id,
142
+ 'group_id' => $group_id,
143
+ 'full_name' => $full_name,
144
+ 'email' => $email,
145
+ 'phone' => $phone,
146
+ 'address' => $address,
147
+ 'status' => $payment_status,
148
+ 'ipn' => $response,
149
+ 'currency' => $currency,
150
+ 'paypal_info' => $paypal_info,
151
+ 'tax' => $tax,
152
+ 'total' => $total,
153
+ 'shipping' => $shipping,
154
+ 'ord_last_modified' => date('Y-m-d H:i:s'),
155
+ );
156
+ if ( !$form_session ) {
157
+ $this->model->add_formmaker_sessions($post);
158
+ }
159
+ else {
160
+ $this->model->update_formmaker_sessions_by_group_id($group_id, $post);
161
+ }
162
+ // Get form session by group id.
163
+ $form_session = $this->model->get_form_session_by_group_id($group_id);
164
+ // Send mail to payer.
165
+ if ( !empty($form_session) ) {
166
+ $recipient = $form->mail ? $form->mail : '';
167
+ if ( $recipient ) {
168
+ $subject = __("Payment information", WDFMInstance(self::PLUGIN)->prefix);
169
+ // Get template for payment information.
170
+ $template_params = array( 'form_session' => $form_session, 'data' => $post );
171
+ $message = $this->view->payment_information_template($template_params);
172
+ $header_arr = array();
173
+ $header_arr['content_type'] = "text/html";
174
+ $header_arr['charset'] = 'UTF-8';
175
+ WDW_FM_Library(self::PLUGIN)->mail($recipient, $subject, $message, $header_arr);
176
+ }
177
+ }
178
+
179
+ return 0;
180
+ }
181
+ }
admin/controllers/FMShortocde.php CHANGED
@@ -1,46 +1,46 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerFMShortocde
5
- */
6
- class FMControllerFMShortocde_fmc extends CFMAdminController {
7
-
8
- private $model;
9
- private $view;
10
-
11
- /**
12
- * FMControllerFMShortocde constructor.
13
- */
14
- public function __construct() {
15
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/FMShortocde.php";
16
- $this->model = new FMModelFMShortocde_fmc();
17
-
18
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMShortocde.php";
19
- $this->view = new FMViewFMShortocde_fmc();
20
- }
21
-
22
- /**
23
- * Execute.
24
- */
25
- public function execute() {
26
- $task = WDW_FM_Library(self::PLUGIN)->get('task');
27
- $this->display($task);
28
- }
29
-
30
- /**
31
- * Display.
32
- *
33
- * @param string $task
34
- */
35
- public function display( $task = '' ) {
36
- // Get forms.
37
- $forms = $this->model->get_form_data();
38
-
39
- if ( method_exists($this->view, $task) ) {
40
- $this->view->$task($forms);
41
- }
42
- else {
43
- $this->view->forms($forms);
44
- }
45
- }
46
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerFMShortocde
5
+ */
6
+ class FMControllerFMShortocde_fmc extends CFMAdminController {
7
+
8
+ private $model;
9
+ private $view;
10
+
11
+ /**
12
+ * FMControllerFMShortocde constructor.
13
+ */
14
+ public function __construct() {
15
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/FMShortocde.php";
16
+ $this->model = new FMModelFMShortocde_fmc();
17
+
18
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMShortocde.php";
19
+ $this->view = new FMViewFMShortocde_fmc();
20
+ }
21
+
22
+ /**
23
+ * Execute.
24
+ */
25
+ public function execute() {
26
+ $task = WDW_FM_Library(self::PLUGIN)->get('task');
27
+ $this->display($task);
28
+ }
29
+
30
+ /**
31
+ * Display.
32
+ *
33
+ * @param string $task
34
+ */
35
+ public function display( $task = '' ) {
36
+ // Get forms.
37
+ $forms = $this->model->get_form_data();
38
+
39
+ if ( method_exists($this->view, $task) ) {
40
+ $this->view->$task($forms);
41
+ }
42
+ else {
43
+ $this->view->forms($forms);
44
+ }
45
+ }
46
+ }
admin/controllers/FormMakerEditCountryinPopup.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerFormmakereditcountryinpopup_fmc
5
- */
6
- class FMControllerFormmakereditcountryinpopup_fmc extends CFMAdminController {
7
- /**
8
- * @var $view
9
- */
10
- private $view;
11
-
12
- /**
13
- * Execute.
14
- */
15
- public function execute() {
16
- $this->display();
17
- }
18
-
19
- /**
20
- * Display.
21
- */
22
- public function display() {
23
- // Load FMViewFromeditcountryinpopup class.
24
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMEditCountryinPopup.php";
25
- $this->view = new FMViewFromeditcountryinpopup_fmc();
26
- // Set params for view.
27
- $params = array();
28
- $params['field_id'] = WDW_FM_Library(self::PLUGIN)->get('field_id', 0);
29
- $this->view->display($params);
30
- }
31
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerFormmakereditcountryinpopup_fmc
5
+ */
6
+ class FMControllerFormmakereditcountryinpopup_fmc extends CFMAdminController {
7
+ /**
8
+ * @var $view
9
+ */
10
+ private $view;
11
+
12
+ /**
13
+ * Execute.
14
+ */
15
+ public function execute() {
16
+ $this->display();
17
+ }
18
+
19
+ /**
20
+ * Display.
21
+ */
22
+ public function display() {
23
+ // Load FMViewFromeditcountryinpopup class.
24
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMEditCountryinPopup.php";
25
+ $this->view = new FMViewFromeditcountryinpopup_fmc();
26
+ // Set params for view.
27
+ $params = array();
28
+ $params['field_id'] = WDW_FM_Library(self::PLUGIN)->get('field_id', 0);
29
+ $this->view->display($params);
30
+ }
31
+ }
admin/controllers/FormMakerIpinfoinPopup.php CHANGED
@@ -1,58 +1,58 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerFormmakeripinfoinpopup_fmc
5
- */
6
- class FMControllerFormmakeripinfoinpopup_fmc extends CFMAdminController {
7
- /**
8
- * @var view
9
- */
10
- private $view;
11
-
12
- /**
13
- * Execute.
14
- */
15
- public function execute() {
16
- $this->display();
17
- }
18
-
19
- /**
20
- * Display.
21
- */
22
- public function display() {
23
- // Load FMViewFromipinfoinpopup class.
24
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMIpinfoinPopup.php";
25
- $this->view = new FMViewFromipinfoinpopup_fmc();
26
- // Get IP
27
- $ip = WDW_FM_Library(self::PLUGIN)->get('data_ip', '');
28
- // Connect to IP api service and get IP info.
29
- $ipinfo = @unserialize(file_get_contents('http://ip-api.com/php/' . $ip));
30
- $city = '-';
31
- $country = '-';
32
- $countryCode = '-';
33
- $country_flag = '-';
34
- $timezone = '-';
35
- $lat = '-';
36
- $lon = '-';
37
- if ( $ipinfo && $ipinfo['status'] == 'success' && $ipinfo['countryCode'] ) {
38
- $city = $ipinfo['city'];
39
- $country = $ipinfo['country'];
40
- $countryCode = $ipinfo['countryCode'];
41
- $country_flag = '<img width="16px" src="' . WDFMInstance(self::PLUGIN)->plugin_url . '/images/flags/' . strtolower($ipinfo['countryCode']) . '.png" class="sub-align" alt="' . $ipinfo['country'] . '" title="' . $ipinfo['country'] . '" />';
42
- $timezone = $ipinfo['timezone'];
43
- $lat = $ipinfo['lat'];
44
- $lon = $ipinfo['lon'];
45
- }
46
- // Set params for view.
47
- $params = array();
48
- $params['ip'] = $ip;
49
- $params['city'] = $city;
50
- $params['country'] = $country;
51
- $params['country_flag'] = $country_flag;
52
- $params['countryCode'] = $countryCode;
53
- $params['timezone'] = $timezone;
54
- $params['lat'] = $lat;
55
- $params['lon'] = $lon;
56
- $this->view->display($params);
57
- }
58
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerFormmakeripinfoinpopup_fmc
5
+ */
6
+ class FMControllerFormmakeripinfoinpopup_fmc extends CFMAdminController {
7
+ /**
8
+ * @var view
9
+ */
10
+ private $view;
11
+
12
+ /**
13
+ * Execute.
14
+ */
15
+ public function execute() {
16
+ $this->display();
17
+ }
18
+
19
+ /**
20
+ * Display.
21
+ */
22
+ public function display() {
23
+ // Load FMViewFromipinfoinpopup class.
24
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMIpinfoinPopup.php";
25
+ $this->view = new FMViewFromipinfoinpopup_fmc();
26
+ // Get IP
27
+ $ip = WDW_FM_Library(self::PLUGIN)->get('data_ip', '');
28
+ // Connect to IP api service and get IP info.
29
+ $ipinfo = @unserialize(file_get_contents('http://ip-api.com/php/' . $ip));
30
+ $city = '-';
31
+ $country = '-';
32
+ $countryCode = '-';
33
+ $country_flag = '-';
34
+ $timezone = '-';
35
+ $lat = '-';
36
+ $lon = '-';
37
+ if ( $ipinfo && $ipinfo['status'] == 'success' && $ipinfo['countryCode'] ) {
38
+ $city = $ipinfo['city'];
39
+ $country = $ipinfo['country'];
40
+ $countryCode = $ipinfo['countryCode'];
41
+ $country_flag = '<img width="16px" src="' . WDFMInstance(self::PLUGIN)->plugin_url . '/images/flags/' . strtolower($ipinfo['countryCode']) . '.png" class="sub-align" alt="' . $ipinfo['country'] . '" title="' . $ipinfo['country'] . '" />';
42
+ $timezone = $ipinfo['timezone'];
43
+ $lat = $ipinfo['lat'];
44
+ $lon = $ipinfo['lon'];
45
+ }
46
+ // Set params for view.
47
+ $params = array();
48
+ $params['ip'] = $ip;
49
+ $params['city'] = $city;
50
+ $params['country'] = $country;
51
+ $params['country_flag'] = $country_flag;
52
+ $params['countryCode'] = $countryCode;
53
+ $params['timezone'] = $timezone;
54
+ $params['lat'] = $lat;
55
+ $params['lon'] = $lon;
56
+ $this->view->display($params);
57
+ }
58
+ }
admin/controllers/FormMakerMapEditinPopup.php CHANGED
@@ -1,35 +1,35 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerFormmakermapeditinpopup_fmc
5
- */
6
- class FMControllerFormmakermapeditinpopup_fmc extends CFMAdminController {
7
- /**
8
- * @var view
9
- */
10
- private $view;
11
-
12
- /**
13
- * Execute.
14
- */
15
- public function execute() {
16
- $this->display();
17
- }
18
-
19
- /**
20
- * Display.
21
- */
22
- public function display() {
23
- // Load FMViewFrommapeditinpopup class.
24
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMMapEditinPopup.php";
25
- $this->view = new FMViewFrommapeditinpopup_fmc();
26
- // Get form maker settings.
27
- $fm_settings = get_option(WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
28
- // Set params for view.
29
- $params = array();
30
- $params['map_key'] = !empty($fm_settings['map_key']) ? '&key=' . $fm_settings['map_key'] : '';
31
- $params['long'] = WDW_FM_Library(self::PLUGIN)->get('long', 0);
32
- $params['lat'] = WDW_FM_Library(self::PLUGIN)->get('lat', 0);
33
- $this->view->display($params);
34
- }
35
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerFormmakermapeditinpopup_fmc
5
+ */
6
+ class FMControllerFormmakermapeditinpopup_fmc extends CFMAdminController {
7
+ /**
8
+ * @var view
9
+ */
10
+ private $view;
11
+
12
+ /**
13
+ * Execute.
14
+ */
15
+ public function execute() {
16
+ $this->display();
17
+ }
18
+
19
+ /**
20
+ * Display.
21
+ */
22
+ public function display() {
23
+ // Load FMViewFrommapeditinpopup class.
24
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMMapEditinPopup.php";
25
+ $this->view = new FMViewFrommapeditinpopup_fmc();
26
+ // Get form maker settings.
27
+ $fm_settings = WDFMInstance(self::PLUGIN)->fm_settings;
28
+ // Set params for view.
29
+ $params = array();
30
+ $params['map_key'] = !empty($fm_settings['map_key']) ? '&key=' . $fm_settings['map_key'] : '';
31
+ $params['long'] = WDW_FM_Library(self::PLUGIN)->get('long', 0);
32
+ $params['lat'] = WDW_FM_Library(self::PLUGIN)->get('lat', 0);
33
+ $this->view->display($params);
34
+ }
35
+ }
admin/controllers/FormMakerSQLMapping.php CHANGED
@@ -1,176 +1,176 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerFormMakerSQLMapping_fmc
5
- */
6
- class FMControllerFormMakerSQLMapping_fmc extends CFMAdminController {
7
- /**
8
- * @var $model
9
- */
10
- private $model;
11
- /**
12
- * @var $view
13
- */
14
- private $view;
15
-
16
- /**
17
- * FMControllerFormMakerSQLMapping constructor.
18
- */
19
- public function __construct() {
20
- // Load FMModelFormMakerSQLMapping class.
21
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/FMSqlMapping.php";
22
- $this->model = new FMModelFormMakerSQLMapping_fmc();
23
- // Load FMViewFormMakerSQLMapping class.
24
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMSqlMapping.php";
25
- $this->view = new FMViewFormMakerSQLMapping_fmc();
26
- }
27
-
28
- /**
29
- * Execute.
30
- */
31
- public function execute() {
32
- $id = WDW_FM_Library(self::PLUGIN)->get('id', '');
33
- $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', '');
34
- $task = WDW_FM_Library(self::PLUGIN)->get('task', '');
35
- if ( $task && method_exists($this, $task) ) {
36
- $this->$task($form_id);
37
- }
38
- else {
39
- if ( $id ) {
40
- $this->edit_query($id, $form_id);
41
- }
42
- else {
43
- $this->add_query($form_id);
44
- }
45
- }
46
- }
47
-
48
- /**
49
- * Add query.
50
- *
51
- * @param int $form_id
52
- */
53
- public function add_query( $form_id = 0 ) {
54
- // Get labels by form id.
55
- $label = $this->model->get_labels($form_id);
56
- // Set params for view.
57
- $params = array();
58
- $params['label'] = $label;
59
- $params['form_id'] = $form_id;
60
- $this->view->add_query($params);
61
- }
62
-
63
- /**
64
- * Edit query.
65
- *
66
- * @param int $id
67
- * @param int $form_id
68
- */
69
- public function edit_query( $id = 0, $form_id = 0 ) {
70
- // Get labels by form id.
71
- $label = $this->model->get_labels($form_id);
72
- // Get query by id.
73
- $query_obj = $this->model->get_query($id);
74
- $temp = explode('***wdfcon_typewdf***', $query_obj->details);
75
- $con_type = $temp[0];
76
- $temp = explode('***wdfcon_methodwdf***', $temp[1]);
77
- $con_method = $temp[0];
78
- $temp = explode('***wdftablewdf***', $temp[1]);
79
- $table_cur = $temp[0];
80
- $temp = explode('***wdfhostwdf***', $temp[1]);
81
- $host = $temp[0];
82
- $temp = explode('***wdfportwdf***', $temp[1]);
83
- $port = $temp[0];
84
- if ($port) {
85
- $host .= ':' . $port;
86
- }
87
- $temp = explode('***wdfusernamewdf***', $temp[1]);
88
- $username = $temp[0];
89
- $temp = explode('***wdfpasswordwdf***', $temp[1]);
90
- $password = $temp[0];
91
- $temp = explode('***wdfdatabasewdf***', $temp[1]);
92
- $database = $temp[0];
93
- $details = $temp[1];
94
- $tables = $this->model->get_tables_saved($con_type, $username, $password, $database, $host);
95
- $table_struct = $this->model->get_table_struct_saved($con_type, $username, $password, $database, $host, $table_cur, $con_method);
96
- // Set params for view.
97
- $params = array();
98
- $params['id'] = $id;
99
- $params['form_id'] = $form_id;
100
- $params['label'] = $label;
101
- $params['query_obj'] = $query_obj;
102
- $params['tables'] = $tables;
103
- $params['table_struct'] = $table_struct;
104
- $this->view->edit_query($params);
105
- }
106
-
107
- /**
108
- * DB tables.
109
- *
110
- * @param int $form_id
111
- */
112
- public function db_tables( $form_id = 0 ) {
113
- // Get all tables.
114
- $tables = $this->model->get_tables();
115
- // Set params for view.
116
- $params = array();
117
- $params['tables'] = $tables;
118
- $params['form_id'] = $form_id;
119
- $this->view->db_tables($params);
120
- }
121
-
122
- /**
123
- * DB table struct.
124
- *
125
- * @param int $form_id
126
- */
127
- public function db_table_struct( $form_id = 0 ) {
128
- $con_method = WDW_FM_Library(self::PLUGIN)->get('con_method', '');
129
- // Get labels by form id.
130
- $label = $this->model->get_labels($form_id);
131
- // Get table struct.
132
- $table_struct = $this->model->get_table_struct();
133
- // Set params for view.
134
- $params = array();
135
- $params['form_id'] = $form_id;
136
- $params['label'] = $label;
137
- $params['table_struct'] = $table_struct;
138
- $params['con_method'] = $con_method;
139
- $this->view->db_table_struct($params);
140
- }
141
-
142
- /**
143
- * Save query.
144
- */
145
- public function save_query() {
146
- global $wpdb;
147
- $form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
148
- $query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
149
- $details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
150
- $save = $wpdb->insert($wpdb->prefix . 'formmaker_query', array(
151
- 'form_id' => $form_id,
152
- 'query' => $query,
153
- 'details' => $details,
154
- ), array(
155
- '%d',
156
- '%s',
157
- '%s',
158
- ));
159
- }
160
-
161
- /**
162
- * Update query.
163
- */
164
- public function update_query() {
165
- global $wpdb;
166
- $id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
167
- $form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
168
- $query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
169
- $details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
170
- $save = $wpdb->update($wpdb->prefix . 'formmaker_query', array(
171
- 'form_id' => $form_id,
172
- 'query' => $query,
173
- 'details' => $details,
174
- ), array( 'id' => $id ));
175
- }
176
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerFormMakerSQLMapping_fmc
5
+ */
6
+ class FMControllerFormMakerSQLMapping_fmc extends CFMAdminController {
7
+ /**
8
+ * @var $model
9
+ */
10
+ private $model;
11
+ /**
12
+ * @var $view
13
+ */
14
+ private $view;
15
+
16
+ /**
17
+ * FMControllerFormMakerSQLMapping constructor.
18
+ */
19
+ public function __construct() {
20
+ // Load FMModelFormMakerSQLMapping class.
21
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/FMSqlMapping.php";
22
+ $this->model = new FMModelFormMakerSQLMapping_fmc();
23
+ // Load FMViewFormMakerSQLMapping class.
24
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMSqlMapping.php";
25
+ $this->view = new FMViewFormMakerSQLMapping_fmc();
26
+ }
27
+
28
+ /**
29
+ * Execute.
30
+ */
31
+ public function execute() {
32
+ $id = WDW_FM_Library(self::PLUGIN)->get('id', '');
33
+ $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', '');
34
+ $task = WDW_FM_Library(self::PLUGIN)->get('task', '');
35
+ if ( $task && method_exists($this, $task) ) {
36
+ $this->$task($form_id);
37
+ }
38
+ else {
39
+ if ( $id ) {
40
+ $this->edit_query($id, $form_id);
41
+ }
42
+ else {
43
+ $this->add_query($form_id);
44
+ }
45
+ }
46
+ }
47
+
48
+ /**
49
+ * Add query.
50
+ *
51
+ * @param int $form_id
52
+ */
53
+ public function add_query( $form_id = 0 ) {
54
+ // Get labels by form id.
55
+ $label = $this->model->get_labels($form_id);
56
+ // Set params for view.
57
+ $params = array();
58
+ $params['label'] = $label;
59
+ $params['form_id'] = $form_id;
60
+ $this->view->add_query($params);
61
+ }
62
+
63
+ /**
64
+ * Edit query.
65
+ *
66
+ * @param int $id
67
+ * @param int $form_id
68
+ */
69
+ public function edit_query( $id = 0, $form_id = 0 ) {
70
+ // Get labels by form id.
71
+ $label = $this->model->get_labels($form_id);
72
+ // Get query by id.
73
+ $query_obj = $this->model->get_query($id);
74
+ $temp = explode('***wdfcon_typewdf***', $query_obj->details);
75
+ $con_type = $temp[0];
76
+ $temp = explode('***wdfcon_methodwdf***', $temp[1]);
77
+ $con_method = $temp[0];
78
+ $temp = explode('***wdftablewdf***', $temp[1]);
79
+ $table_cur = $temp[0];
80
+ $temp = explode('***wdfhostwdf***', $temp[1]);
81
+ $host = $temp[0];
82
+ $temp = explode('***wdfportwdf***', $temp[1]);
83
+ $port = $temp[0];
84
+ if ($port) {
85
+ $host .= ':' . $port;
86
+ }
87
+ $temp = explode('***wdfusernamewdf***', $temp[1]);
88
+ $username = $temp[0];
89
+ $temp = explode('***wdfpasswordwdf***', $temp[1]);
90
+ $password = $temp[0];
91
+ $temp = explode('***wdfdatabasewdf***', $temp[1]);
92
+ $database = $temp[0];
93
+ $details = $temp[1];
94
+ $tables = $this->model->get_tables_saved($con_type, $username, $password, $database, $host);
95
+ $table_struct = $this->model->get_table_struct_saved($con_type, $username, $password, $database, $host, $table_cur, $con_method);
96
+ // Set params for view.
97
+ $params = array();
98
+ $params['id'] = $id;
99
+ $params['form_id'] = $form_id;
100
+ $params['label'] = $label;
101
+ $params['query_obj'] = $query_obj;
102
+ $params['tables'] = $tables;
103
+ $params['table_struct'] = $table_struct;
104
+ $this->view->edit_query($params);
105
+ }
106
+
107
+ /**
108
+ * DB tables.
109
+ *
110
+ * @param int $form_id
111
+ */
112
+ public function db_tables( $form_id = 0 ) {
113
+ // Get all tables.
114
+ $tables = $this->model->get_tables();
115
+ // Set params for view.
116
+ $params = array();
117
+ $params['tables'] = $tables;
118
+ $params['form_id'] = $form_id;
119
+ $this->view->db_tables($params);
120
+ }
121
+
122
+ /**
123
+ * DB table struct.
124
+ *
125
+ * @param int $form_id
126
+ */
127
+ public function db_table_struct( $form_id = 0 ) {
128
+ $con_method = WDW_FM_Library(self::PLUGIN)->get('con_method', '');
129
+ // Get labels by form id.
130
+ $label = $this->model->get_labels($form_id);
131
+ // Get table struct.
132
+ $table_struct = $this->model->get_table_struct();
133
+ // Set params for view.
134
+ $params = array();
135
+ $params['form_id'] = $form_id;
136
+ $params['label'] = $label;
137
+ $params['table_struct'] = $table_struct;
138
+ $params['con_method'] = $con_method;
139
+ $this->view->db_table_struct($params);
140
+ }
141
+
142
+ /**
143
+ * Save query.
144
+ */
145
+ public function save_query() {
146
+ global $wpdb;
147
+ $form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
148
+ $query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
149
+ $details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
150
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_query', array(
151
+ 'form_id' => $form_id,
152
+ 'query' => $query,
153
+ 'details' => $details,
154
+ ), array(
155
+ '%d',
156
+ '%s',
157
+ '%s',
158
+ ));
159
+ }
160
+
161
+ /**
162
+ * Update query.
163
+ */
164
+ public function update_query() {
165
+ global $wpdb;
166
+ $id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
167
+ $form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
168
+ $query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
169
+ $details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
170
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_query', array(
171
+ 'form_id' => $form_id,
172
+ 'query' => $query,
173
+ 'details' => $details,
174
+ ), array( 'id' => $id ));
175
+ }
176
+ }
admin/controllers/FormMakerSubmits.php CHANGED
@@ -1,45 +1,45 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerFormMakerSubmits_fmc
5
- */
6
- class FMControllerFormMakerSubmits_fmc extends CFMAdminController {
7
-
8
- private $model;
9
- private $view;
10
-
11
- public function __construct() {
12
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/FormMakerSubmits.php";
13
- $this->model = new FMModelFormMakerSubmits_fmc();
14
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FormMakerSubmits.php";
15
- $this->view = new FMViewFormMakerSubmits_fmc();
16
- }
17
-
18
- public function execute() {
19
- $this->display();
20
- }
21
-
22
- public function display() {
23
- $params = array();
24
- $form_id = esc_html(stripslashes($_GET['form_id']));
25
- $params['label_order'] = $this->model->get_from_label_order($form_id);
26
- $group_id = esc_html(stripslashes($_GET['group_id']));
27
- $params['rows'] = $this->model->get_submissions($group_id);
28
- $labels_id = array();
29
- $labels_name = array();
30
- $labels_type = array();
31
- $label_all = explode('#****#', $params['label_order']);
32
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
33
- foreach ( $label_all as $key => $label_each ) {
34
- $label_id_each = explode('#**id**#', $label_each);
35
- array_push($labels_id, $label_id_each[0]);
36
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
37
- array_push($labels_name, $label_oder_each[0]);
38
- array_push($labels_type, $label_oder_each[1]);
39
- }
40
- $params['labels_id'] = $labels_id;
41
- $params['labels_name'] = $labels_name;
42
- $params['labels_type'] = $labels_type;
43
- $this->view->display($params);
44
- }
45
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerFormMakerSubmits_fmc
5
+ */
6
+ class FMControllerFormMakerSubmits_fmc extends CFMAdminController {
7
+
8
+ private $model;
9
+ private $view;
10
+
11
+ public function __construct() {
12
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/FormMakerSubmits.php";
13
+ $this->model = new FMModelFormMakerSubmits_fmc();
14
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FormMakerSubmits.php";
15
+ $this->view = new FMViewFormMakerSubmits_fmc();
16
+ }
17
+
18
+ public function execute() {
19
+ $this->display();
20
+ }
21
+
22
+ public function display() {
23
+ $params = array();
24
+ $form_id = esc_html(stripslashes($_GET['form_id']));
25
+ $params['label_order'] = $this->model->get_from_label_order($form_id);
26
+ $group_id = esc_html(stripslashes($_GET['group_id']));
27
+ $params['rows'] = $this->model->get_submissions($group_id);
28
+ $labels_id = array();
29
+ $labels_name = array();
30
+ $labels_type = array();
31
+ $label_all = explode('#****#', $params['label_order']);
32
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
33
+ foreach ( $label_all as $key => $label_each ) {
34
+ $label_id_each = explode('#**id**#', $label_each);
35
+ array_push($labels_id, $label_id_each[0]);
36
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
37
+ array_push($labels_name, $label_oder_each[0]);
38
+ array_push($labels_type, $label_oder_each[1]);
39
+ }
40
+ $params['labels_id'] = $labels_id;
41
+ $params['labels_name'] = $labels_name;
42
+ $params['labels_type'] = $labels_type;
43
+ $this->view->display($params);
44
+ }
45
+ }
admin/controllers/Formmakerwdcaptcha.php CHANGED
@@ -1,29 +1,29 @@
1
- <?php
2
- /**
3
- * Class FMControllerFormmakerwdcaptcha_fmc
4
- */
5
- class FMControllerFormmakerwdcaptcha_fmc extends CFMAdminController {
6
- /**
7
- * @var view
8
- */
9
- private $view;
10
-
11
- /**
12
- * Execute.
13
- */
14
- public function execute() {
15
- $this->display();
16
- }
17
-
18
- /**
19
- * Display.
20
- */
21
- public function display() {
22
- // Load FMViewFormmakerwdcaptcha class.
23
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMCaptcha.php";
24
- $this->view = new FMViewFormmakerwdcaptcha_fmc();
25
- // Set params for view.
26
- $params = array();
27
- $this->view->display($params);
28
- }
29
- }
1
+ <?php
2
+ /**
3
+ * Class FMControllerFormmakerwdcaptcha_fmc
4
+ */
5
+ class FMControllerFormmakerwdcaptcha_fmc extends CFMAdminController {
6
+ /**
7
+ * @var view
8
+ */
9
+ private $view;
10
+
11
+ /**
12
+ * Execute.
13
+ */
14
+ public function execute() {
15
+ $this->display();
16
+ }
17
+
18
+ /**
19
+ * Display.
20
+ */
21
+ public function display() {
22
+ // Load FMViewFormmakerwdcaptcha class.
23
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMCaptcha.php";
24
+ $this->view = new FMViewFormmakerwdcaptcha_fmc();
25
+ // Set params for view.
26
+ $params = array();
27
+ $this->view->display($params);
28
+ }
29
+ }
admin/controllers/Formmakerwdmathcaptcha.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerFormmakerwdmathcaptcha_fmc
5
- */
6
- class FMControllerFormmakerwdmathcaptcha_fmc extends CFMAdminController {
7
- /**
8
- * @var $view
9
- */
10
- private $view;
11
-
12
- /**
13
- * Execute.
14
- */
15
- public function execute() {
16
- $this->display();
17
- }
18
-
19
- /**
20
- * Display.
21
- */
22
- public function display() {
23
- // Load FMViewFormmakerwdmathcaptcha class.
24
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMMathCaptcha.php";
25
- $this->view = new FMViewFormmakerwdmathcaptcha_fmc();
26
- // Set params for view.
27
- $params = array();
28
- $this->view->display($params);
29
- }
30
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerFormmakerwdmathcaptcha_fmc
5
+ */
6
+ class FMControllerFormmakerwdmathcaptcha_fmc extends CFMAdminController {
7
+ /**
8
+ * @var $view
9
+ */
10
+ private $view;
11
+
12
+ /**
13
+ * Execute.
14
+ */
15
+ public function execute() {
16
+ $this->display();
17
+ }
18
+
19
+ /**
20
+ * Display.
21
+ */
22
+ public function display() {
23
+ // Load FMViewFormmakerwdmathcaptcha class.
24
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMMathCaptcha.php";
25
+ $this->view = new FMViewFormmakerwdmathcaptcha_fmc();
26
+ // Set params for view.
27
+ $params = array();
28
+ $this->view->display($params);
29
+ }
30
+ }
admin/controllers/Generete_csv.php CHANGED
@@ -1,119 +1,118 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerGenerete_csv_fmc
5
- */
6
- class FMControllerGenerete_csv_fmc extends CFMAdminController {
7
-
8
- /**
9
- * Execute.
10
- */
11
- public function execute() {
12
- $this->display();
13
- die();
14
- }
15
-
16
- /**
17
- * Display.
18
- */
19
- public function display() {
20
- // Get form maker settings
21
- $option_key = WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings';
22
- $fm_settings = get_option($option_key);
23
- // Update export per_page.
24
- $page_num_update = WDW_FM_Library(self::PLUGIN)->get('page_num_update');
25
- if ( $page_num_update ) {
26
- $fm_settings['ajax_export_per_page'] = WDW_FM_Library(self::PLUGIN)->get('page_num');
27
- update_option( $option_key, $fm_settings );
28
- }
29
- $csv_delimiter = isset($fm_settings['csv_delimiter']) ? $fm_settings['csv_delimiter'] : ',';
30
- $form_id = (int) $_REQUEST['form_id'];
31
- $limitstart = (int) $_REQUEST['limitstart'];
32
- $send_header = (int) $_REQUEST['send_header'];
33
- $params = WDW_FM_Library(self::PLUGIN)->get_submissions_to_export();
34
- if ( !empty($params) ) {
35
- $data = $params[0];
36
- $title = $params[1];
37
- if ( !empty( $data ) ) {
38
- $labels_parameters = WDW_FM_Library(self::PLUGIN)->get_labels_parameters( $form_id );
39
-
40
- $sorted_label_names_original = $labels_parameters[4];
41
- $sorted_label_names_original = array_merge(array(
42
- 'ID',
43
- "Submit date",
44
- "Submitter's IP",
45
- "Submitter's Username",
46
- "Submitter's Email Address",
47
- ), $sorted_label_names_original);
48
-
49
- if (($key = array_search('stripe', $sorted_label_names_original)) !== false) {
50
- unset($sorted_label_names_original[$key]);
51
- }
52
-
53
- $sorted_label_names = array();
54
- function unique_label($sorted_label_names, $label) {
55
- if ( in_array($label, $sorted_label_names) ) {
56
- return unique_label($sorted_label_names, $label . '(1)');
57
- }
58
- else {
59
- return $label;
60
- }
61
- }
62
- foreach ( $sorted_label_names_original as $key => $label ) {
63
- $sorted_label_names[] = unique_label($sorted_label_names, $label);
64
- }
65
-
66
- foreach ( $data as $key => $row ) {
67
- $sorted_data = array();
68
- foreach ( $sorted_label_names as $label ) {
69
- if ( !array_key_exists($label, $row) ) {
70
- $sorted_data[$label] = '';
71
- }
72
- else {
73
- $sorted_data[$label] = $row[$label];
74
- }
75
- }
76
- $data[$key] = $sorted_data;
77
- }
78
- $upload_dir = wp_upload_dir();
79
- $file_path = $upload_dir['basedir'] . '/form-maker';
80
- if ( !is_dir($file_path) ) {
81
- mkdir($file_path, 0777);
82
- }
83
- $tempfile = $file_path . '/export' . $form_id . '.txt';
84
- if ( $limitstart == 0 && file_exists($tempfile) ) {
85
- unlink($tempfile);
86
- }
87
- $output = fopen($tempfile, "a");
88
- if ( $limitstart == 0 ) {
89
- foreach ($sorted_label_names_original as $i => $rec) {
90
- $sorted_label_names_original[$i] = ltrim($rec, '=+-@');
91
- }
92
- fputcsv($output, $sorted_label_names_original, $csv_delimiter);
93
- }
94
- foreach ( $data as $index => $record ) {
95
- foreach ( $record as $i => $rec ) {
96
- $record[$i] = ltrim($rec, '=+-@');
97
- }
98
- if ( !empty($index) ) {
99
- fputcsv($output, $record, $csv_delimiter);
100
- }
101
- }
102
- fclose($output);
103
- if ( $send_header == 1 ) {
104
- $txtfile = fopen($tempfile, "r");
105
- $txtfilecontent = fread($txtfile, filesize($tempfile));
106
- fclose($txtfile);
107
- $filename = $title . "_" . date('Ymd') . ".csv";
108
- header('Content-Encoding: UTF-8');
109
- header('content-type: application/csv; charset=UTF-8');
110
- header("Content-Disposition: attachment; filename=\"$filename\"");
111
- // Set UTF-8 BOM
112
- echo "\xEF\xBB\xBF";
113
- echo $txtfilecontent;
114
- unlink($tempfile);
115
- }
116
- }
117
- }
118
- }
119
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerGenerete_csv_fmc
5
+ */
6
+ class FMControllerGenerete_csv_fmc extends CFMAdminController {
7
+
8
+ /**
9
+ * Execute.
10
+ */
11
+ public function execute() {
12
+ $this->display();
13
+ die();
14
+ }
15
+
16
+ /**
17
+ * Display.
18
+ */
19
+ public function display() {
20
+ // Get form maker settings
21
+ $fm_settings = WDFMInstance(self::PLUGIN)->fm_settings;
22
+ // Update export per_page.
23
+ $page_num_update = WDW_FM_Library(self::PLUGIN)->get('page_num_update');
24
+ if ( $page_num_update ) {
25
+ $fm_settings['ajax_export_per_page'] = WDW_FM_Library(self::PLUGIN)->get('page_num');
26
+ update_option( $option_key, $fm_settings );
27
+ }
28
+ $csv_delimiter = isset($fm_settings['csv_delimiter']) ? $fm_settings['csv_delimiter'] : ',';
29
+ $form_id = (int) $_REQUEST['form_id'];
30
+ $limitstart = (int) $_REQUEST['limitstart'];
31
+ $send_header = (int) $_REQUEST['send_header'];
32
+ $params = WDW_FM_Library(self::PLUGIN)->get_submissions_to_export();
33
+ if ( !empty($params) ) {
34
+ $data = $params[0];
35
+ $title = $params[1];
36
+ if ( !empty( $data ) ) {
37
+ $labels_parameters = WDW_FM_Library(self::PLUGIN)->get_labels_parameters( $form_id );
38
+
39
+ $sorted_label_names_original = $labels_parameters[4];
40
+ $sorted_label_names_original = array_merge(array(
41
+ 'ID',
42
+ "Submit date",
43
+ "Submitter's IP",
44
+ "Submitter's Username",
45
+ "Submitter's Email Address",
46
+ ), $sorted_label_names_original);
47
+
48
+ if (($key = array_search('stripe', $sorted_label_names_original)) !== false) {
49
+ unset($sorted_label_names_original[$key]);
50
+ }
51
+
52
+ $sorted_label_names = array();
53
+ function unique_label($sorted_label_names, $label) {
54
+ if ( in_array($label, $sorted_label_names) ) {
55
+ return unique_label($sorted_label_names, $label . '(1)');
56
+ }
57
+ else {
58
+ return $label;
59
+ }
60
+ }
61
+ foreach ( $sorted_label_names_original as $key => $label ) {
62
+ $sorted_label_names[] = unique_label($sorted_label_names, $label);
63
+ }
64
+
65
+ foreach ( $data as $key => $row ) {
66
+ $sorted_data = array();
67
+ foreach ( $sorted_label_names as $label ) {
68
+ if ( !array_key_exists($label, $row) ) {
69
+ $sorted_data[$label] = '';
70
+ }
71
+ else {
72
+ $sorted_data[$label] = $row[$label];
73
+ }
74
+ }
75
+ $data[$key] = $sorted_data;
76
+ }
77
+ $upload_dir = wp_upload_dir();
78
+ $file_path = $upload_dir['basedir'] . '/form-maker';
79
+ if ( !is_dir($file_path) ) {
80
+ mkdir($file_path, 0777);
81
+ }
82
+ $tempfile = $file_path . '/export' . $form_id . '.txt';
83
+ if ( $limitstart == 0 && file_exists($tempfile) ) {
84
+ unlink($tempfile);
85
+ }
86
+ $output = fopen($tempfile, "a");
87
+ if ( $limitstart == 0 ) {
88
+ foreach ($sorted_label_names_original as $i => $rec) {
89
+ $sorted_label_names_original[$i] = ltrim($rec, '=+-@');
90
+ }
91
+ fputcsv($output, $sorted_label_names_original, $csv_delimiter);
92
+ }
93
+ foreach ( $data as $index => $record ) {
94
+ foreach ( $record as $i => $rec ) {
95
+ $record[$i] = ltrim($rec, '=+-@');
96
+ }
97
+ if ( !empty($index) ) {
98
+ fputcsv($output, $record, $csv_delimiter);
99
+ }
100
+ }
101
+ fclose($output);
102
+ if ( $send_header == 1 ) {
103
+ $txtfile = fopen($tempfile, "r");
104
+ $txtfilecontent = fread($txtfile, filesize($tempfile));
105
+ fclose($txtfile);
106
+ $filename = $title . "_" . date('Ymd') . ".csv";
107
+ header('Content-Encoding: UTF-8');
108
+ header('content-type: application/csv; charset=UTF-8');
109
+ header("Content-Disposition: attachment; filename=\"$filename\"");
110
+ // Set UTF-8 BOM
111
+ echo "\xEF\xBB\xBF";
112
+ echo $txtfilecontent;
113
+ unlink($tempfile);
114
+ }
115
+ }
116
+ }
117
+ }
118
+ }
 
admin/controllers/Generete_xml.php CHANGED
@@ -1,74 +1,73 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerGenerete_xml_fmc
5
- */
6
- class FMControllerGenerete_xml_fmc extends CFMAdminController {
7
-
8
- /**
9
- * Execute.
10
- */
11
- public function execute() {
12
- $this->display();
13
- die();
14
- }
15
-
16
- public function display() {
17
- // Get form maker settings
18
- $option_key = WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings';
19
- $fm_settings = get_option($option_key);
20
- // Update export per_page.
21
- $page_num_update = WDW_FM_Library(self::PLUGIN)->get('page_num_update');
22
- if ( $page_num_update ) {
23
- $fm_settings['ajax_export_per_page'] = WDW_FM_Library(self::PLUGIN)->get('page_num');
24
- update_option( $option_key, $fm_settings );
25
- }
26
- $form_id = (int) $_REQUEST['form_id'];
27
- $limitstart = (int) $_REQUEST['limitstart'];
28
- $send_header = (int) $_REQUEST['send_header'];
29
- $params = WDW_FM_Library(self::PLUGIN)->get_submissions_to_export();
30
- if (!empty($params) ) {
31
- $data = $params[0];
32
- $title = $params[1];
33
- define('PHP_TAB', "\t");
34
- $upload_dir = wp_upload_dir();
35
- $file_path = $upload_dir['basedir'] . '/form-maker';
36
- if ( !is_dir($file_path) ) {
37
- mkdir($file_path, 0777);
38
- }
39
- $tempfile = $file_path . '/export' . $form_id . '.txt';
40
- if ( $limitstart == 0 && file_exists($tempfile) ) {
41
- unlink($tempfile);
42
- }
43
- $output = fopen($tempfile, "a");
44
- if ( $limitstart == 0 ) {
45
- fwrite($output, '<?xml version="1.0" encoding="utf-8" ?>' . PHP_EOL);
46
- fwrite($output, '<form title="' . $title . '">' . PHP_EOL);
47
- }
48
- foreach ( $data as $key1 => $value1 ) {
49
- if ( !empty($key1) ) {
50
- fwrite($output, PHP_TAB . '<submission id="' . $key1 . '">' . PHP_EOL);
51
- foreach ( $value1 as $key => $value ) {
52
- fwrite($output, PHP_TAB . PHP_TAB . '<field title="' . $key . '">' . PHP_EOL);
53
- fwrite($output, PHP_TAB . PHP_TAB . PHP_TAB . '<![CDATA[' . $value . ']]>' . PHP_EOL);
54
- fwrite($output, PHP_TAB . PHP_TAB . '</field>' . PHP_EOL);
55
- }
56
- fwrite($output, PHP_TAB . '</submission>' . PHP_EOL);
57
- }
58
- }
59
- if ( $send_header == 1 ) {
60
- fwrite($output, '</form>');
61
- fclose($output);
62
- $txtfile = fopen($tempfile, "r");
63
- $txtfilecontent = fread($txtfile, filesize($tempfile));
64
- fclose($txtfile);
65
- $filename = $title . "_" . date('Ymd') . ".xml";
66
- header('Content-Encoding: Windows-1252');
67
- header('Content-type: text/xml; charset=utf-8');
68
- header("Content-Disposition: attachment; filename=\"$filename\"");
69
- echo $txtfilecontent;
70
- unlink($tempfile);
71
- }
72
- }
73
- }
74
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerGenerete_xml_fmc
5
+ */
6
+ class FMControllerGenerete_xml_fmc extends CFMAdminController {
7
+
8
+ /**
9
+ * Execute.
10
+ */
11
+ public function execute() {
12
+ $this->display();
13
+ die();
14
+ }
15
+
16
+ public function display() {
17
+ // Get form maker settings
18
+ $fm_settings = WDFMInstance(self::PLUGIN)->fm_settings;
19
+ // Update export per_page.
20
+ $page_num_update = WDW_FM_Library(self::PLUGIN)->get('page_num_update');
21
+ if ( $page_num_update ) {
22
+ $fm_settings['ajax_export_per_page'] = WDW_FM_Library(self::PLUGIN)->get('page_num');
23
+ update_option( $option_key, $fm_settings );
24
+ }
25
+ $form_id = (int) $_REQUEST['form_id'];
26
+ $limitstart = (int) $_REQUEST['limitstart'];
27
+ $send_header = (int) $_REQUEST['send_header'];
28
+ $params = WDW_FM_Library(self::PLUGIN)->get_submissions_to_export();
29
+ if (!empty($params) ) {
30
+ $data = $params[0];
31
+ $title = $params[1];
32
+ define('PHP_TAB', "\t");
33
+ $upload_dir = wp_upload_dir();
34
+ $file_path = $upload_dir['basedir'] . '/form-maker';
35
+ if ( !is_dir($file_path) ) {
36
+ mkdir($file_path, 0777);
37
+ }
38
+ $tempfile = $file_path . '/export' . $form_id . '.txt';
39
+ if ( $limitstart == 0 && file_exists($tempfile) ) {
40
+ unlink($tempfile);
41
+ }
42
+ $output = fopen($tempfile, "a");
43
+ if ( $limitstart == 0 ) {
44
+ fwrite($output, '<?xml version="1.0" encoding="utf-8" ?>' . PHP_EOL);
45
+ fwrite($output, '<form title="' . $title . '">' . PHP_EOL);
46
+ }
47
+ foreach ( $data as $key1 => $value1 ) {
48
+ if ( !empty($key1) ) {
49
+ fwrite($output, PHP_TAB . '<submission id="' . $key1 . '">' . PHP_EOL);
50
+ foreach ( $value1 as $key => $value ) {
51
+ fwrite($output, PHP_TAB . PHP_TAB . '<field title="' . $key . '">' . PHP_EOL);
52
+ fwrite($output, PHP_TAB . PHP_TAB . PHP_TAB . '<![CDATA[' . $value . ']]>' . PHP_EOL);
53
+ fwrite($output, PHP_TAB . PHP_TAB . '</field>' . PHP_EOL);
54
+ }
55
+ fwrite($output, PHP_TAB . '</submission>' . PHP_EOL);
56
+ }
57
+ }
58
+ if ( $send_header == 1 ) {
59
+ fwrite($output, '</form>');
60
+ fclose($output);
61
+ $txtfile = fopen($tempfile, "r");
62
+ $txtfilecontent = fread($txtfile, filesize($tempfile));
63
+ fclose($txtfile);
64
+ $filename = $title . "_" . date('Ymd') . ".xml";
65
+ header('Content-Encoding: Windows-1252');
66
+ header('Content-type: text/xml; charset=utf-8');
67
+ header("Content-Disposition: attachment; filename=\"$filename\"");
68
+ echo $txtfilecontent;
69
+ unlink($tempfile);
70
+ }
71
+ }
72
+ }
73
+ }
 
admin/controllers/Manage_fm.php CHANGED
@@ -1,1564 +1,1563 @@
1
- <?php
2
- class FMControllerManage_fmc extends CFMAdminController {
3
-
4
- private $model;
5
- private $view;
6
- private $page;
7
- private $page_url;
8
- private $bulk_action_name = '';
9
- private $items_per_page = 20;
10
- private $animation_effects = array();
11
- private $actions = array();
12
- private $revision = 0;
13
-
14
- function __construct() {
15
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Manage_fm.php";
16
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Manage_fm.php";
17
- $this->model = new FMModelManage_fmc();
18
- $this->view = new FMViewManage_fmc();
19
-
20
- $this->page = WDW_FM_Library(self::PLUGIN)->get('page', 'manage' . WDFMInstance(self::PLUGIN)->menu_postfix);
21
- $this->page_url = add_query_arg(array(
22
- 'page' => $this->page,
23
- WDFMInstance(self::PLUGIN)->nonce => wp_create_nonce(WDFMInstance(self::PLUGIN)->nonce),
24
- ), admin_url('admin.php')
25
- );
26
- $this->bulk_action_name = 'bulk_action';
27
-
28
- $this->actions = array(
29
- 'publish' => array(
30
- 'title' => __('Publish', WDFMInstance(self::PLUGIN)->prefix),
31
- $this->bulk_action_name => __('published', WDFMInstance(self::PLUGIN)->prefix),
32
- ),
33
- 'unpublish' => array(
34
- 'title' => __('Unpublish', WDFMInstance(self::PLUGIN)->prefix),
35
- $this->bulk_action_name => __('unpublished', WDFMInstance(self::PLUGIN)->prefix),
36
- ),
37
- 'duplicate' => array(
38
- 'title' => __('Duplicate', WDFMInstance(self::PLUGIN)->prefix),
39
- $this->bulk_action_name => __('duplicated', WDFMInstance(self::PLUGIN)->prefix),
40
- ),
41
- 'delete' => array(
42
- 'title' => __('Delete', WDFMInstance(self::PLUGIN)->prefix),
43
- $this->bulk_action_name => __('deleted', WDFMInstance(self::PLUGIN)->prefix),
44
- ),
45
- );
46
-
47
- $this->animation_effects = array(
48
- 'none' => 'None',
49
- 'bounce' => 'Bounce',
50
- 'tada' => 'Tada',
51
- 'bounceInDown' => 'BounceInDown',
52
- 'fadeInLeft' => 'FadeInLeft',
53
- 'flash' => 'Flash',
54
- 'pulse' => 'Pulse',
55
- 'rubberBand' => 'RubberBand',
56
- 'shake' => 'Shake',
57
- 'swing' => 'Swing',
58
- 'wobble' => 'Wobble',
59
- 'hinge' => 'Hinge',
60
- 'lightSpeedIn' => 'LightSpeedIn',
61
- 'rollIn' => 'RollIn',
62
- 'bounceIn' => 'BounceIn',
63
- 'bounceInLeft' => 'BounceInLeft',
64
- 'bounceInRight' => 'BounceInRight',
65
- 'bounceInUp' => 'BounceInUp',
66
- 'fadeIn' => 'FadeIn',
67
- 'fadeInDown' => 'FadeInDown',
68
- 'fadeInDownBig' => 'FadeInDownBig',
69
- 'fadeInLeftBig' => 'FadeInLeftBig',
70
- 'fadeInRight' => 'FadeInRight',
71
- 'fadeInRightBig' => 'FadeInRightBig',
72
- 'fadeInUp' => 'FadeInUp',
73
- 'fadeInUpBig' => 'FadeInUpBig',
74
- 'flip' => 'Flip',
75
- 'flipInX' => 'FlipInX',
76
- 'flipInY' => 'FlipInY',
77
- 'rotateIn' => 'RotateIn',
78
- 'rotateInDownLeft' => 'RotateInDownLeft',
79
- 'rotateInDownRight' => 'RotateInDownRight',
80
- 'rotateInUpLeft' => 'RotateInUpLeft',
81
- 'rotateInUpRight' => 'RotateInUpRight',
82
- 'zoomIn' => 'ZoomIn',
83
- 'zoomInDown' => 'ZoomInDown',
84
- 'zoomInLeft' => 'ZoomInLeft',
85
- 'zoomInRight' => 'ZoomInRight',
86
- 'zoomInUp' => 'ZoomInUp',
87
- );
88
- }
89
-
90
- public function execute() {
91
- $task = WDW_FM_Library(self::PLUGIN)->get('task');
92
- $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
93
- if ( method_exists($this, $task) ) {
94
- if ( $task != 'add' && $task != 'edit' && $task != 'display' && $task != 'form_options' && $task != 'email_options' && $task != 'display_options' && $task != 'form_layout' ) {
95
- check_admin_referer(WDFMInstance(self::PLUGIN)->nonce, WDFMInstance(self::PLUGIN)->nonce);
96
- }
97
- $block_action = $this->bulk_action_name;
98
- $action = WDW_FM_Library(self::PLUGIN)->get( $block_action, -1 );
99
- if ( $action != -1 ) {
100
- $this->$block_action($action);
101
- }
102
- else {
103
- $this->$task($id);
104
- }
105
- }
106
- else {
107
- $this->display();
108
- }
109
- }
110
-
111
- public function display() {
112
- $params = array();
113
- $params['order'] = WDW_FM_Library(self::PLUGIN)->get('order', 'asc');
114
- $params['orderby'] = WDW_FM_Library(self::PLUGIN)->get('orderby', 'id');
115
- // To prevent SQL injections.
116
- if ( !in_array($params['orderby'], array( 'id', 'title', 'type' )) ) {
117
- $params['orderby'] = 'id';
118
- }
119
- $params['order'] = $params['order'] == 'desc' ? 'desc' : 'asc';
120
-
121
- $params['items_per_page'] = $this->items_per_page;
122
-
123
- $params['rows_data'] = $this->model->get_rows_data($params);
124
-
125
- $params['total'] = $this->model->total();
126
-
127
- $params['actions'] = $this->actions;
128
- $params['page'] = $this->page;
129
- $params['form_preview_link'] = $this->model->get_form_preview_post();
130
-
131
- $this->view->display($params);
132
- }
133
-
134
- /**
135
- * Bulk actions.
136
- *
137
- * @param string $task
138
- */
139
- public function bulk_action( $task = '' ) {
140
- $message = 0;
141
- $successfully_updated = 0;
142
-
143
- $check = WDW_FM_Library(self::PLUGIN)->get('check', '');
144
-
145
- if ( $check ) {
146
- foreach ( $check as $id => $item ) {
147
- if ( method_exists($this, $task) ) {
148
- $message = $this->$task($id, TRUE);
149
- if ( $message != 2 ) {
150
- // Increase successfully updated items count, if action doesn't failed.
151
- $successfully_updated++;
152
- }
153
- }
154
- }
155
- if ( $successfully_updated ) {
156
- $block_action = $this->bulk_action_name;
157
- $message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDFMInstance(self::PLUGIN)->prefix), $successfully_updated, $this->actions[$task][$block_action]);
158
- }
159
- }
160
-
161
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
162
- 'page' => $this->page,
163
- 'task' => 'display',
164
- ($message === 2 ? 'message' : 'msg') => $message,
165
- ), admin_url('admin.php')));
166
-
167
- }
168
-
169
- /**
170
- * Delete form by id.
171
- *
172
- * @param int $id
173
- * @param bool $bulk
174
- *
175
- * @return int
176
- */
177
- public function delete( $id = 0, $bulk = FALSE ) {
178
- if ( $this->model->delete_rows(array( "table" => "formmaker", "where" => "id = " . $id )) ) {
179
- $this->model->delete_rows(array( "table" => "formmaker_views", "where" => "form_id = " . $id ));
180
- $this->model->delete_rows(array( "table" => "formmaker_submits", "where" => "form_id = " . $id ));
181
- $this->model->delete_rows(array( "table" => "formmaker_sessions", "where" => "form_id = " . $id ));
182
- $this->model->delete_rows(array( "table" => "formmaker_backup", "where" => "id = " . $id ));
183
- $this->model->delete_rows(array( "table" => "formmaker_display_options", "where" => "form_id = " . $id ));
184
- $this->model->delete_rows(array( "table" => "formmaker_query", "where" => "form_id = " . $id ));
185
- if (WDFMInstance(self::PLUGIN)->is_free == 2) {
186
- $arr = explode(',', get_option('contact_form_forms'));
187
- $arr = array_diff($arr, array($id));
188
- $arr = implode(',', $arr);
189
- update_option('contact_form_forms', $arr);
190
- }
191
- // To delete DB rows with form ids from extensions.
192
- if (WDFMInstance(self::PLUGIN)->is_free != 2) {
193
- do_action('fm_delete_addon_init', $id);
194
- }
195
- $message = 3;
196
- }
197
- else {
198
- $message = 2;
199
- }
200
-
201
- if ( $bulk ) {
202
- return $message;
203
- }
204
- else {
205
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
206
- 'page' => $this->page,
207
- 'task' => 'display',
208
- 'message' => $message,
209
- ), admin_url('admin.php')));
210
- }
211
- }
212
-
213
- /**
214
- * Publish by id.
215
- *
216
- * @param int $id
217
- * @param bool $bulk
218
- *
219
- * @return int
220
- */
221
- public function publish( $id = 0, $bulk = FALSE ) {
222
- $updated = $this->model->update_data("formmaker", array('published' => 1), array('id' => $id));
223
- if ( $updated !== FALSE ) {
224
- $message = 9;
225
- }
226
- else {
227
- $message = 2;
228
- }
229
-
230
- if ( $bulk ) {
231
- return $message;
232
- }
233
- else {
234
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
235
- 'page' => $this->page,
236
- 'task' => 'display',
237
- 'message' => $message,
238
- ), admin_url('admin.php')));
239
- }
240
- }
241
-
242
- /**
243
- * Unpublish by id.
244
- *
245
- * @param int $id
246
- * @param bool $bulk
247
- *
248
- * @return int
249
- */
250
- public function unpublish( $id = 0, $bulk = FALSE ) {
251
- $updated = $this->model->update_data("formmaker", array('published' => 0), array('id' => $id));
252
- if ( $updated !== FALSE ) {
253
- $message = 10;
254
- }
255
- else {
256
- $message = 2;
257
- }
258
-
259
- if ( $bulk ) {
260
- return $message;
261
- }
262
- else {
263
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
264
- 'page' => $this->page,
265
- 'task' => 'display',
266
- 'message' => $message,
267
- ), admin_url('admin.php')));
268
- }
269
- }
270
-
271
- /**
272
- * Duplicate by id.
273
- *
274
- * @param int $id
275
- * @param bool $bulk
276
- *
277
- * @return int
278
- */
279
- public function duplicate( $id = 0, $bulk = FALSE ) {
280
- $message = 2;
281
- $row = $this->model->select_rows("get_row", array(
282
- "selection" => "*",
283
- "table" => "formmaker",
284
- "where" => "id=" . (int) $id,
285
- ));
286
-
287
- if ( $row ) {
288
- $row = (array) $row;
289
- unset($row['id']);
290
- $row['title'] = $row['title'] . ' - ' . __('Copy', WDFMInstance(self::PLUGIN)->prefix);
291
- $inserted = $this->model->insert_data_to_db("formmaker", (array) $row);
292
- $new_id = (int) $this->model->get_max_row('formmaker', 'id');
293
-
294
- $row_display_options = $this->model->select_rows("get_row", array(
295
- "selection" => "*",
296
- "table" => "formmaker_display_options",
297
- "where" => "form_id=" . (int) $id,
298
- ));
299
- if ( $row_display_options ) {
300
- $row_display_options = (array) $row_display_options;
301
- unset($row_display_options['id']);
302
- $row_display_options['form_id'] = $new_id;
303
- $inserted = $this->model->insert_data_to_db("formmaker_display_options", (array) $row_display_options);
304
- }
305
-
306
- $row_query = $this->model->select_rows("get_results", array(
307
- "selection" => "*",
308
- "table" => "formmaker_query",
309
- "where" => "form_id=" . (int) $id,
310
- ));
311
- if ( $row_query ) {
312
- foreach ($row_query as $query) {
313
- $query = (array)$query;
314
- unset($query['id']);
315
- $query['form_id'] = $new_id;
316
- $inserted = $this->model->insert_data_to_db("formmaker_query", (array)$query);
317
- }
318
- }
319
-
320
- if (WDFMInstance(self::PLUGIN)->is_free == 2) {
321
- update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $new_id : $new_id));
322
- }
323
- else {
324
- // Duplicate extensions data.
325
- do_action('fm_duplicate_form', $id, $new_id);
326
- }
327
- if ( $inserted !== FALSE ) {
328
- $message = 11;
329
- }
330
- }
331
-
332
- if ( $bulk ) {
333
- return $message;
334
- }
335
- else {
336
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
337
- 'page' => $this->page,
338
- 'task' => 'display',
339
- 'message' => $message,
340
- ), admin_url('admin.php')));
341
- }
342
- }
343
-
344
- public function add() {
345
- $backup_id = 0;
346
- $params = array();
347
- $fm_settings = get_option(WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
348
- $fm_enable_wp_editor = !isset( $fm_settings['fm_enable_wp_editor'] ) ? 1 : $fm_settings['fm_enable_wp_editor'];
349
- $params['fm_enable_wp_editor'] = $fm_enable_wp_editor;
350
- $params['id'] = $backup_id;
351
- $params['row'] = $this->model->get_row_data_new($backup_id);
352
- $params['page_url'] = $this->page_url;
353
- // Check if Stripe extension is active.
354
- $stripe_addon = array('enable' => 0);
355
- $addon_stripe = $this->get_stripe_addon(0);
356
- if( !empty($addon_stripe['html']) ) {
357
- $stripe_addon = $addon_stripe;
358
- }
359
- $params['stripe_addon'] = $stripe_addon;
360
-
361
- $params['themes'] = $this->model->get_theme_rows_data();
362
- $params['default_theme'] = $this->model->get_default_theme_id();
363
- $params['form_preview_link'] = "";
364
-
365
- $params['autogen_layout'] = 1;
366
- $labels = array();
367
- $label_id = array();
368
- $label_order_original = array();
369
- $label_type = array();
370
- $label_all = explode('#****#', $params['row']->label_order);
371
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
372
- foreach ( $label_all as $key => $label_each ) {
373
- $label_id_each = explode('#**id**#', $label_each);
374
- array_push($label_id, $label_id_each[0]);
375
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
376
- array_push($label_order_original, addslashes($label_oder_each[0]));
377
- array_push($label_type, $label_oder_each[1]);
378
- }
379
-
380
- $params[ 'label_label' ] = array();
381
-
382
- $labels['id'] = '"' . implode('","', $label_id) . '"';
383
- $labels['label'] = '"' . implode('","', $label_order_original) . '"';
384
- $labels['type'] = '"' . implode('","', $label_type) . '"';
385
- $params['labels'] = $labels;
386
-
387
- $params['page_title'] = __('Create new form', WDFMInstance(self::PLUGIN)->prefix);
388
- $params['animation_effects'] = $this->animation_effects;
389
-
390
- $this->view->edit($params);
391
- }
392
-
393
- /**
394
- * Edit.
395
- *
396
- * @param int $id
397
- * @param int $backup_id
398
- */
399
- public function edit( $id = 0, $backup_id = 0 ) {
400
-
401
- $fm_settings = get_option(WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
402
- $fm_advanced_layout = isset($fm_settings['fm_advanced_layout']) && $fm_settings['fm_advanced_layout'] == '1' ? 1 : 0;
403
- $fm_enable_wp_editor = !isset( $fm_settings['fm_enable_wp_editor'] ) ? 1 : $fm_settings['fm_enable_wp_editor'];
404
- if ( $id && !$fm_advanced_layout ) {
405
- $fm_advanced_layout = !$this->model->get_autogen_layout($id);
406
- }
407
-
408
- if ( !$backup_id ) {
409
- $backup_id = $this->model->select_rows("get_var", array(
410
- "selection" => "backup_id",
411
- "table" => "formmaker_backup",
412
- "where" => "cur=1 and id=" . $id,
413
- ));
414
-
415
- if ( !$backup_id ) {
416
- $backup_id = $this->model->get_max_row("formmaker_backup", "backup_id");
417
- if ( $backup_id ) {
418
- $backup_id++;
419
- }
420
- else {
421
- $backup_id = 1;
422
- }
423
- $this->model->insert_formmaker_backup($backup_id, $id);
424
- }
425
- }
426
-
427
- $params = array();
428
- $params['id'] = $id;
429
- $params['backup_id'] = $backup_id;
430
- $params['row'] = $this->model->get_row_data_new($backup_id);
431
- if ( empty($params['row']) ) {
432
- WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
433
- }
434
-
435
- // Check stripe extension is active.
436
- $stripe_addon = array( 'enable' => 0 );
437
- $addon_stripe = $this->get_stripe_addon($id);
438
- if ( !empty($addon_stripe['html']) ) {
439
- $stripe_addon = $addon_stripe;
440
- }
441
- $params['stripe_addon'] = $stripe_addon;
442
- $params['page_url'] = $this->page_url;
443
- $params['themes'] = $this->model->get_theme_rows_data();
444
- $params['default_theme'] = $this->model->get_default_theme_id();
445
-
446
- $params['form_preview_link'] = $this->model->get_form_preview_post();
447
- $params['fm_enable_wp_editor'] = $fm_enable_wp_editor;
448
-
449
- if ( $id ) {
450
- $params['form_options_url'] = add_query_arg( array( 'page' => $this->page , 'task' => 'form_options', 'current_id' => $id ), $this->page_url );
451
- $params['display_options_url'] = add_query_arg( array( 'page' => $this->page , 'task' => 'display_options', 'current_id' => $id ), $this->page_url );
452
- $params['advanced_layout_url'] = $fm_advanced_layout ? add_query_arg( array( 'page' => $this->page , 'task' => 'form_layout', 'current_id' => $id ), $this->page_url ) : '';
453
- }
454
-
455
- if ( isset($params['row']->backup_id) ) {
456
- if ( $params['row']->backup_id != "" ) {
457
- $params['next_backup_id'] = $this->model->get_backup_id($params['row']->backup_id, $params['row']->id);
458
- $params['prev_backup_id'] = $this->model->get_prev_backup_id($params['row']->backup_id, $params['row']->id);
459
- }
460
- }
461
-
462
- $labels = array();
463
- $label_id = array();
464
- $label_label = array();
465
- $label_order_original = array();
466
- $label_type = array();
467
- $label_all = explode('#****#', $params['row']->label_order);
468
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
469
- foreach ( $label_all as $key => $label_each ) {
470
- $label_id_each = explode( '#**id**#', $label_each );
471
- $label_order_each = explode( '#**label**#', $label_id_each[ 1 ] );
472
- $labelIds[ $label_id_each[ 0 ] ] = array( 'type' => $label_order_each[ 1 ], 'name' => $label_order_each[ 0 ] );
473
-
474
- array_push($label_id, $label_id_each[0]);
475
- array_push($label_order_original, addslashes($label_order_each[0]));
476
- array_push($label_type, $label_order_each[1]);
477
- array_push( $label_label, $label_order_each[ 0 ] );
478
- }
479
- $params[ 'label_label' ] = WDW_FM_Library(self::PLUGIN)->create_email_options_placeholders( $labelIds );
480
-
481
- $labels['id'] = '"' . implode('","', $label_id) . '"';
482
- $labels['label'] = '"' . implode('","', $label_order_original) . '"';
483
- $labels['type'] = '"' . implode('","', $label_type) . '"';
484
- $params['labels'] = $labels;
485
-
486
- $params[ 'fields' ] = explode( '*:*id*:*type_submitter_mail*:*type*:*', $params[ 'row' ]->form_fields );
487
- $params[ 'fields_count' ] = count( $params[ 'fields' ] );
488
- $params['page_title'] = (($params['id'] != 0) ? 'Edit form ' . $params['row']->title : 'Create new form');
489
- $params['animation_effects'] = $this->animation_effects;
490
-
491
- $rev = $this->model->get_revisions( $id );
492
- $params['revisions'] = $rev['data'];
493
- $params['revisions_total'] = $rev['total'];
494
- $params['revisions_status'] = $this->revision;
495
- $params['current_revision'] = $this->model->get_current_revision( $id );
496
- $params['revision_date'] = $this->model->get_revision_date( $backup_id );
497
- $params['rev_index'] = WDW_FM_Library(self::PLUGIN)->get('rev_id');
498
-
499
- $this->view->edit($params);
500
- }
501
-
502
- public function undo() {
503
- $backup_id = (int) WDW_FM_Library(self::PLUGIN)->get('backup_id');
504
- $id = (int) WDW_FM_Library(self::PLUGIN)->get('id');
505
- $this->revision = 1;
506
- $this->edit($id, $backup_id);
507
- }
508
-
509
- /**
510
- * Form options.
511
- *
512
- * @param int $id
513
- */
514
- public function form_options( $id = 0 ) {
515
- // Set params for view.
516
- $params = array();
517
- $params[ 'id' ] = $id;
518
- $params[ 'page' ] = $this->page;
519
- $params[ 'page_url' ] = $this->page_url;
520
-
521
- $params[ 'back_url' ] = add_query_arg( array(
522
- 'page' => 'manage' . WDFMInstance(self::PLUGIN)->menu_postfix,
523
- 'task' => 'edit',
524
- 'current_id' => $id
525
- ), admin_url( 'admin.php' )
526
- );
527
-
528
- $params[ 'fieldset_id' ] = WDW_FM_Library(self::PLUGIN)->get( 'fieldset_id', 'general' );
529
-
530
- $params[ 'row' ] = $this->model->get_row_data( $id );
531
- if ( empty( $params[ 'row' ] ) ) {
532
- WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array( 'page' => $this->page ), admin_url( 'admin.php' ) ) );
533
- }
534
-
535
- $params[ 'themes' ] = $this->model->get_theme_rows_data();
536
- $params[ 'default_theme' ] = $this->model->get_default_theme_id();
537
- $params[ 'queries' ] = $this->model->get_queries_rows_data( $id );
538
- $params[ 'userGroups' ] = get_editable_roles();
539
- $params[ 'page_title' ] = '"' . $params[ 'row' ]->title . '" ' . __( 'options', WDFMInstance(self::PLUGIN)->prefix );
540
-
541
- $label_id = array();
542
- $label_label = array();
543
- $labelIds = array();
544
- $label_type = array();
545
- $label_all = explode( '#****#', $params[ 'row' ]->label_order_current );
546
- $label_all = array_slice( $label_all, 0, count( $label_all ) - 1 );
547
- foreach ( $label_all as $key => $label_each ) {
548
- $label_id_each = explode( '#**id**#', $label_each );
549
- $label_order_each = explode( '#**label**#', $label_id_each[ 1 ] );
550
- $labelIds[ $label_id_each[ 0 ] ] = array( 'type' => $label_order_each[ 1 ], 'name' => $label_order_each[ 0 ] );
551
- array_push( $label_id, $label_id_each[ 0 ] );
552
- array_push( $label_label, $label_order_each[ 0 ] );
553
- array_push( $label_type, $label_order_each[ 1 ] );
554
- }
555
-
556
- // chechk stripe addon is active.
557
- $stripe_addon = array( 'enable' => 0 );
558
- $addon_stripe = $this->get_stripe_addon( $id );
559
- if ( !empty( $addon_stripe[ 'html' ] ) ) {
560
- $stripe_addon = $addon_stripe;
561
- }
562
- $params[ 'stripe_addon' ] = $stripe_addon;
563
-
564
- /*
565
- TODO.
566
- Remember. 0 => none, 1 => paypal, 2 => stripe
567
- Change. rename paypal_mode name to payment_method of wp_formmaker table.
568
- */
569
- $paypal_mode = $params[ 'row' ]->paypal_mode;
570
- $payment_method = 'none';
571
- if ( $paypal_mode == 1 ) {
572
- $payment_method = 'paypal';
573
- }
574
- if ( $paypal_mode == 2 && isset( $stripe_addon[ 'stripe_enable' ] ) && $stripe_addon[ 'stripe_enable' ] == 1 ) {
575
- $payment_method = 'stripe';
576
- }
577
-
578
- $params[ 'payment_method' ] = $payment_method;
579
- $params[ 'labels_for_submissions' ] = $this->model->get_labels( $id );
580
- $params[ 'payment_info' ] = $this->model->is_paypal( $id );
581
-
582
- $labels_id_for_submissions = array();
583
- $label_titles_for_submissions = array();
584
- $labels_type_for_submissions = array();
585
- if ( $params[ 'labels_for_submissions' ] ) {
586
- $label_id_for_submissions = array();
587
- $label_order_original_for_submissions = array();
588
- $label_type_for_submissions = array();
589
- if ( strpos( $params[ 'row' ]->label_order, 'type_paypal_' ) ) {
590
- $params[ 'row' ]->label_order = $params[ 'row' ]->label_order . "item_total#**id**#Item Total#**label**#type_paypal_payment_total#****#total#**id**#Total#**label**#type_paypal_payment_total#****#0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
591
- }
592
- $label_all_for_submissions = explode( '#****#', $params[ 'row' ]->label_order );
593
- $label_all_for_submissions = array_slice( $label_all_for_submissions, 0, count( $label_all_for_submissions ) - 1 );
594
- foreach ( $label_all_for_submissions as $key => $label_each ) {
595
- $label_id_each = explode( '#**id**#', $label_each );
596
- array_push( $label_id_for_submissions, $label_id_each[ 0 ] );
597
- $label_order_each = explode( '#**label**#', $label_id_each[ 1 ] );
598
- array_push( $label_order_original_for_submissions, $label_order_each[ 0 ] );
599
- array_push( $label_type_for_submissions, $label_order_each[ 1 ] );
600
- }
601
- foreach ( $label_id_for_submissions as $key => $label ) {
602
- if ( in_array( $label, $params[ 'labels_for_submissions' ] ) ) {
603
- array_push( $labels_type_for_submissions, $label_type_for_submissions[ $key ] );
604
- array_push( $labels_id_for_submissions, $label );
605
- array_push( $label_titles_for_submissions, $label_order_original_for_submissions[ $key ] );
606
- }
607
- }
608
- $params[ 'labels_id_for_submissions' ] = $labels_id_for_submissions;
609
- $params[ 'label_titles_for_submissions' ] = $label_titles_for_submissions;
610
- }
611
-
612
- $stats_labels = array();
613
- $stats_labels_ids = array();
614
- foreach ( $labels_type_for_submissions as $key => $label_type_cur ) {
615
- if ( $label_type_cur == "type_checkbox" || $label_type_cur == "type_radio" || $label_type_cur == "type_own_select" || $label_type_cur == "type_country" || $label_type_cur == "type_paypal_select" || $label_type_cur == "type_paypal_radio" || $label_type_cur == "type_paypal_checkbox" || $label_type_cur == "type_paypal_shipping" ) {
616
- $stats_labels_ids[] = $labels_id_for_submissions[ $key ];
617
- $stats_labels[] = $label_titles_for_submissions[ $key ];
618
- }
619
- }
620
-
621
- $params[ 'stats_labels_ids' ] = $stats_labels_ids;
622
- $params[ 'stats_labels' ] = $stats_labels;
623
- $params[ 'mail_ver_id' ] = $this->model->get_emailverification_post_id();
624
-
625
- $params[ 'addons' ] = $this->get_addon_tabs( array( 'form_id' => $id ) );
626
-
627
- $this->view->form_options( $params );
628
- }
629
-
630
- /**
631
- * Email options.
632
- *
633
- * @param int $id
634
- */
635
- public function email_options( $id = 0 ) {
636
- // Set params for view.
637
- $params = array();
638
- $params[ 'id' ] = $id;
639
- $params[ 'page' ] = $this->page;
640
- $params[ 'page_url' ] = $this->page_url;
641
-
642
- $params[ 'back_url' ] = add_query_arg( array(
643
- 'page' => 'manage' . WDFMInstance(self::PLUGIN)->menu_postfix,
644
- 'task' => 'edit',
645
- 'current_id' => $id
646
- ), admin_url( 'admin.php' )
647
- );
648
-
649
- $params[ 'fieldset_id' ] = WDW_FM_Library(self::PLUGIN)->get( 'fieldset_id', 'general' );
650
-
651
- $params[ 'row' ] = $this->model->get_row_data( $id );
652
- if ( empty( $params[ 'row' ] ) ) {
653
- WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array( 'page' => $this->page ), admin_url( 'admin.php' ) ) );
654
- }
655
- $params[ 'fields' ] = explode( '*:*id*:*type_submitter_mail*:*type*:*', $params[ 'row' ]->form_fields );
656
- $params[ 'fields_count' ] = count( $params[ 'fields' ] );
657
- $params[ 'mail_ver_id' ] = $this->model->get_emailverification_post_id();
658
-
659
- $this->view->email_options( $params );
660
- }
661
-
662
- /**
663
- * Get active addons.
664
- *
665
- * @param $params
666
- * @return mixed|void
667
- */
668
- private function get_addon_tabs( $params = array() ) {
669
- $addons = array('tabs' => array(), 'html' => array());
670
- if (WDFMInstance(self::PLUGIN)->is_free != 2) {
671
- $addons = apply_filters('fm_get_addon_init', $addons, $params);
672
- }
673
- return $addons;
674
- }
675
-
676
- /**
677
- * Apply form options.
678
- *
679
- * @param int $id
680
- */
681
- public function apply_form_options( $id = 0 ) {
682
- $fieldset_id = WDW_FM_Library(self::PLUGIN)->get('fieldset_id', 'general');
683
- $message = $this->save_db_form_options( $id );
684
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
685
- 'page' => $this->page,
686
- 'task' => 'edit',
687
- 'current_id' => $id,
688
- 'fieldset_id' => $fieldset_id,
689
- 'message' => $message,
690
- ), admin_url('admin.php')));
691
- }
692
-
693
- /**
694
- * Save db Email options.
695
- *
696
- * @param int $id
697
- * @return int $id_message
698
- */
699
- public function save_db_email_options( $id = 0 ) {
700
- $sendemail = stripslashes(WDW_FM_Library(self::PLUGIN)->get('sendemail', ''));
701
- $mail = stripslashes(WDW_FM_Library(self::PLUGIN)->get('mail', ''));
702
- $from_mail = stripslashes(WDW_FM_Library(self::PLUGIN)->get('from_mail', ''));
703
- $from_name = stripslashes(WDW_FM_Library(self::PLUGIN)->get('from_name', ''));
704
- $reply_to = stripslashes(WDW_FM_Library(self::PLUGIN)->get('reply_to', ''));
705
- if ( $from_mail == "other" ) {
706
- $from_mail = stripslashes(WDW_FM_Library(self::PLUGIN)->get('mail_from_other', ''));
707
- }
708
- if ( $reply_to == "other" ) {
709
- $reply_to = stripslashes(WDW_FM_Library(self::PLUGIN)->get('reply_to_other', ''));
710
- }
711
- $script_mail = WDW_FM_Library(self::PLUGIN)->get('script_mail', '{all}', FALSE);
712
- if ( $script_mail == '' ) {
713
- $script_mail = '{all}';
714
- }
715
- $mail_from_user = WDW_FM_Library(self::PLUGIN)->get('mail_from_user', '');
716
- $mail_from_name_user = WDW_FM_Library(self::PLUGIN)->get('mail_from_name_user', '');
717
- $reply_to_user = WDW_FM_Library(self::PLUGIN)->get('reply_to_user', '');
718
- $mail_cc = WDW_FM_Library(self::PLUGIN)->get('mail_cc', '');
719
- $mail_cc_user = WDW_FM_Library(self::PLUGIN)->get('mail_cc_user', '');
720
- $mail_bcc = WDW_FM_Library(self::PLUGIN)->get('mail_bcc', '');
721
- $mail_bcc_user = WDW_FM_Library(self::PLUGIN)->get('mail_bcc_user', '');
722
- $mail_subject = WDW_FM_Library(self::PLUGIN)->get('mail_subject', '');
723
- $mail_subject_user = WDW_FM_Library(self::PLUGIN)->get('mail_subject_user', '');
724
- $mail_mode = WDW_FM_Library(self::PLUGIN)->get('mail_mode', '');
725
- $mail_mode_user = WDW_FM_Library(self::PLUGIN)->get('mail_mode_user', '');
726
- $mail_attachment = WDW_FM_Library(self::PLUGIN)->get('mail_attachment', '');
727
- $mail_attachment_user = WDW_FM_Library(self::PLUGIN)->get('mail_attachment_user', '');
728
- $script_mail_user = WDW_FM_Library(self::PLUGIN)->get('script_mail_user', '{all}', FALSE);
729
- if ( $script_mail_user == '' ) {
730
- $script_mail_user = '{all}';
731
- }
732
-
733
- $mail_emptyfields = stripslashes(WDW_FM_Library(self::PLUGIN)->get('mail_emptyfields', 0));
734
- $mail_verify = stripslashes(WDW_FM_Library(self::PLUGIN)->get('mail_verify', 0));
735
- $mail_verify_expiretime = stripslashes(WDW_FM_Library(self::PLUGIN)->get('mail_verify_expiretime', ''));
736
- $send_to = '';
737
- for ( $i = 0; $i < 20; $i++ ) {
738
- if ( WDW_FM_Library(self::PLUGIN)->get('send_to' . $i, 0) ) {
739
- $send_to .= '*' . WDW_FM_Library(self::PLUGIN)->get('send_to' . $i, 0) . '*';
740
- }
741
- }
742
-
743
- $mail_verification_post_id = (int) $this->model->get_mail_verification_post_id();
744
-
745
-
746
- if ( $mail_verify ) {
747
- $email_verification_post = array(
748
- 'post_title' => 'Email Verification',
749
- 'post_content' => '[email_verification]',
750
- 'post_status' => 'publish',
751
- 'post_author' => 1,
752
- 'post_type' => 'fmemailverification',
753
- );
754
- if ( !$mail_verification_post_id || get_post($mail_verification_post_id) === NULL ) {
755
- $mail_verification_post_id = wp_insert_post($email_verification_post);
756
- }
757
- }
758
-
759
- $data = array(
760
- 'sendemail' => $sendemail,
761
- 'mail' => $mail,
762
- 'from_mail' => $from_mail,
763
- 'from_name' => $from_name,
764
- 'reply_to' => $reply_to,
765
- 'script_mail' => $script_mail,
766
- 'mail_from_user' => $mail_from_user,
767
- 'mail_from_name_user' => $mail_from_name_user,
768
- 'reply_to_user' => $reply_to_user,
769
- 'mail_cc' => $mail_cc,
770
- 'mail_cc_user' => $mail_cc_user,
771
- 'mail_bcc' => $mail_bcc,
772
- 'mail_bcc_user' => $mail_bcc_user,
773
- 'mail_subject' => $mail_subject,
774
- 'mail_subject_user' => $mail_subject_user,
775
- 'mail_mode' => $mail_mode,
776
- 'mail_mode_user' => $mail_mode_user,
777
- 'mail_attachment' => $mail_attachment,
778
- 'mail_attachment_user' => $mail_attachment_user,
779
- 'script_mail_user' => $script_mail_user,
780
- 'send_to' => $send_to,
781
- 'mail_emptyfields' => $mail_emptyfields,
782
- 'mail_verify' => $mail_verify,
783
- 'mail_verify_expiretime' => $mail_verify_expiretime,
784
- 'mail_verification_post_id' => $mail_verification_post_id,
785
- );
786
-
787
- $message_id = 2;
788
- $save = $this->model->update_data('formmaker', $data, array( 'id' => $id ));
789
- if ( $save !== FALSE ) {
790
- $this->model->create_js($id);
791
- $message_id = 8;
792
- }
793
-
794
- return $message_id;
795
-
796
-
797
-
798
-
799
- }
800
-
801
- /**
802
- * Save db Form options.
803
- *
804
- * @param int $id
805
- * @return int $id_message
806
- */
807
- public function save_db_form_options( $id = 0 ) {
808
- $javascript = "// Occurs before the form is loaded
809
- function before_load() {
810
-
811
- }
812
- // Occurs just before submitting the form
813
- function before_submit() {
814
- // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don't need to return any value if you don't want to stop the submission.
815
- }
816
- // Occurs just before resetting the form
817
- function before_reset() {
818
-
819
- }
820
- // Occurs after form is submitted and reloaded
821
- function after_submit() {
822
-
823
- }";
824
-
825
- $published = stripslashes(WDW_FM_Library(self::PLUGIN)->get('published', ''));
826
- $savedb = stripslashes(WDW_FM_Library(self::PLUGIN)->get('savedb', ''));
827
- $requiredmark = stripslashes(WDW_FM_Library(self::PLUGIN)->get('requiredmark', '*'));
828
- $save_uploads = stripslashes(WDW_FM_Library(self::PLUGIN)->get('save_uploads', ''));
829
- $submit_text = WDW_FM_Library(self::PLUGIN)->get('submit_text', '', FALSE);
830
- $url = WDW_FM_Library(self::PLUGIN)->get('url', '');
831
- $tax = WDW_FM_Library(self::PLUGIN)->get('tax', 0);
832
- $payment_currency = WDW_FM_Library(self::PLUGIN)->get('payment_currency', '');
833
- $paypal_email = WDW_FM_Library(self::PLUGIN)->get('paypal_email', '');
834
- $checkout_mode = WDW_FM_Library(self::PLUGIN)->get('checkout_mode', 'testmode');
835
- $paypal_mode = WDW_FM_Library(self::PLUGIN)->get('paypal_mode', 0);
836
-
837
- // TODO Seclude payment method and payment status.
838
- if ( $paypal_mode == 'paypal' ) {
839
- $paypal_mode = 1;
840
- }
841
- if ( $paypal_mode == 'stripe' ) {
842
- $paypal_mode = 2;
843
- }
844
-
845
- $javascript = stripslashes(WDW_FM_Library(self::PLUGIN)->get('javascript', $javascript, false));
846
- $condition = WDW_FM_Library(self::PLUGIN)->get('condition', '');
847
- $user_id_wd = stripslashes(WDW_FM_Library(self::PLUGIN)->get('user_id_wd', 'administrator,'));
848
- $frontend_submit_fields = stripslashes(WDW_FM_Library(self::PLUGIN)->get('frontend_submit_fields', ''));
849
- $frontend_submit_stat_fields = stripslashes(WDW_FM_Library(self::PLUGIN)->get('frontend_submit_stat_fields', ''));
850
-
851
- if ( WDW_FM_Library(self::PLUGIN)->get('submit_text_type', 0) ) {
852
- $submit_text_type = WDW_FM_Library(self::PLUGIN)->get('submit_text_type', 0);
853
- if ( $submit_text_type == 5 ) {
854
- $article_id = WDW_FM_Library(self::PLUGIN)->get('page_name', 0);
855
- }
856
- else {
857
- $article_id = WDW_FM_Library(self::PLUGIN)->get('post_name', 0);
858
- }
859
- }
860
- else {
861
- $submit_text_type = 1;
862
- $article_id = 0;
863
- }
864
-
865
- $privacy_arr = array(
866
- 'gdpr_checkbox' => WDW_FM_Library(self::PLUGIN)->get('gdpr_checkbox', 0),
867
- 'gdpr_checkbox_text' => WDW_FM_Library(self::PLUGIN)->get('gdpr_checkbox_text', __('I consent collecting this data and processing it according to {{privacy_policy}} of this website.', WDFMInstance(self::PLUGIN)->prefix)),
868
- 'save_ip' => WDW_FM_Library(self::PLUGIN)->get('save_ip', 1),
869
- 'save_user_id' => WDW_FM_Library(self::PLUGIN)->get('save_user_id', 1),
870
- );
871
-
872
- $privacy = json_encode($privacy_arr);
873
-
874
-
875
- $data = array(
876
- 'published' => $published,
877
- 'savedb' => $savedb,
878
- 'requiredmark' => $requiredmark,
879
- 'save_uploads' => $save_uploads,
880
- 'submit_text' => $submit_text,
881
- 'url' => $url,
882
- 'submit_text_type' => $submit_text_type,
883
- 'article_id' => $article_id,
884
- 'tax' => $tax,
885
- 'payment_currency' => $payment_currency,
886
- 'paypal_email' => $paypal_email,
887
- 'checkout_mode' => $checkout_mode,
888
- 'paypal_mode' => $paypal_mode,
889
- 'javascript' => $javascript,
890
- 'condition' => $condition,
891
- 'user_id_wd' => $user_id_wd,
892
- 'frontend_submit_fields' => $frontend_submit_fields,
893
- 'frontend_submit_stat_fields' => $frontend_submit_stat_fields,
894
- 'privacy' => $privacy,
895
- );
896
-
897
- $message_id = 2;
898
- $save = $this->model->update_data('formmaker', $data, array( 'id' => $id ));
899
- if ( $save !== FALSE ) {
900
- $this->model->update_data( 'formmaker_backup', $data, array( 'id' => $id ) );
901
- //save theme in backup
902
- if ( WDFMInstance(self::PLUGIN)->is_free != 2 ) {
903
- $save_addon = do_action('fm_save_addon_init', $id);
904
- }
905
- $this->model->create_js($id);
906
- $message_id = 8;
907
- }
908
-
909
- return $message_id;
910
- }
911
-
912
- /**
913
- * Form layout.
914
- *
915
- * @param int $id
916
- */
917
- public function form_layout( $id = 0 ) {
918
- $ids = array();
919
- $types = array();
920
- $labels = array();
921
-
922
- $row = $this->model->get_row_data( $id );
923
- if ( empty($row) ) {
924
- WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
925
- }
926
- $fields = explode('*:*new_field*:*', $row->form_fields);
927
- $fields = array_slice($fields, 0, count($fields) - 1);
928
- foreach ( $fields as $field ) {
929
- $temp = explode('*:*id*:*', $field);
930
- array_push($ids, $temp[0]);
931
- $temp = explode('*:*type*:*', $temp[1]);
932
- array_push($types, $temp[0]);
933
- $temp = explode('*:*w_field_label*:*', $temp[1]);
934
- array_push($labels, $temp[0]);
935
- }
936
-
937
- // Set params for view.
938
- $params = array();
939
- $params['id'] = $id;
940
- $params['row'] = $row;
941
- $params['page'] = $this->page;
942
- $params['page_url'] = $this->page_url;
943
- $params['page_title'] = '"'. $row->title . '" ' . __('layout', WDFMInstance(self::PLUGIN)->prefix);
944
- $params['back_url'] = add_query_arg( array ('page' => 'manage' . WDFMInstance(self::PLUGIN)->menu_postfix,'task' => 'edit','current_id' => $id ), admin_url('admin.php'));
945
- $params['ids'] = $ids;
946
- $params['types'] = $types;
947
- $params['labels'] = $labels;
948
- $this->view->form_layout($params);
949
- }
950
-
951
- /**
952
- * Apply layout.
953
- *
954
- * @param int $id
955
- */
956
- public function apply_layout( $id = 0 ) {
957
- $message = $this->save_db_layout( $id );
958
- WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'form_layout', 'current_id' => $id, 'message' => $message), admin_url('admin.php') ) );
959
- }
960
-
961
- /**
962
- * Save db layout.
963
- *
964
- * @param int $id
965
- * @return int $id_message
966
- */
967
- public function save_db_layout( $id = 0 ) {
968
- $custom_front = WDW_FM_Library(self::PLUGIN)->get('custom_front', '', false);
969
- $autogen_layout = WDW_FM_Library(self::PLUGIN)->get('autogen_layout', '');
970
-
971
- $update = $this->model->update_data('formmaker', array(
972
- 'custom_front' => $custom_front,
973
- 'autogen_layout' => $autogen_layout,
974
- ), array( 'id' => $id ));
975
- if ( $update !== FALSE ) {
976
- return 1;
977
- }
978
- else {
979
- return 2;
980
- }
981
- }
982
-
983
- public function display_options() {
984
- $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', $this->model->get_max_row("formmaker", "id"));
985
- $params = array();
986
- $params['row_form'] = $this->model->get_row_data($id);
987
- if ( empty($params['row_form']) ) {
988
- WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
989
- }
990
- $params['row'] = $this->model->get_display_options($id);
991
- $row_data = $this->model->get_row_data( $id );
992
- $params['row']->theme = $row_data->theme;
993
- $params['page_title'] = '"'. $params['row_form']->title . '" ' . __('display options', WDFMInstance(self::PLUGIN)->prefix);
994
- $params['animation_effects'] = $this->animation_effects;
995
- $params['display_on_list'] = array('everything' => 'All', 'home' => 'Homepage', 'archive' => 'Archives', 'post' => 'Post', 'page' => 'Page');
996
- $params['posts_and_pages'] = $this->model->fm_posts_query();
997
- $params['categories'] = $this->model->fm_categories_query();
998
- $params['selected_categories'] = explode(',', $params['row']->display_on_categories);
999
- $params['current_categories_array'] = explode(',', $params['row']->current_categories);
1000
- $params['id'] = $id;
1001
- $params['page'] = $this->page;
1002
- $params['page_url'] = $this->page_url;
1003
- $params['back_url'] = add_query_arg( array (
1004
- 'page' => 'manage' . WDFMInstance(self::PLUGIN)->menu_postfix,
1005
- 'task' => 'edit',
1006
- 'current_id' => $id,
1007
- ), admin_url('admin.php')
1008
- );
1009
- $params['themes'] = $this->model->get_theme_rows_data();
1010
- $params['default_theme'] = $this->model->get_default_theme_id();
1011
- $params['fieldset_id'] = WDW_FM_Library(self::PLUGIN)->get('fieldset_id', 'embedded');
1012
- $this->view->display_options($params);
1013
- }
1014
-
1015
- public function save_display_options() {
1016
- $message = $this->save_dis_options();
1017
- $page = WDW_FM_Library(self::PLUGIN)->get('page');
1018
-
1019
- $current_id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
1020
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1021
- 'page' => $page,
1022
- 'task' => 'edit',
1023
- 'current_id' => $current_id,
1024
- 'message' => $message,
1025
- ), admin_url('admin.php')));
1026
- }
1027
-
1028
- public function apply_display_options($id = 0) {
1029
- $message = $this->save_dis_options();
1030
- $page = WDW_FM_Library(self::PLUGIN)->get('page');
1031
- $fieldset_id = WDW_FM_Library(self::PLUGIN)->get('fieldset_id', 'embedded');
1032
- $current_id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
1033
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1034
- 'page' => $page,
1035
- 'task' => 'display_options',
1036
- 'current_id' => $id,
1037
- 'fieldset_id'=> $fieldset_id,
1038
- 'message' => $message,
1039
- ), admin_url('admin.php')));
1040
- }
1041
-
1042
- /**
1043
- * Remove query for MySQL Mapping.
1044
- * @param int $id
1045
- */
1046
- public function remove_query( $id = 0 ) {
1047
- $fieldset_id = WDW_FM_Library(self::PLUGIN)->get('fieldset_id', 'general');
1048
- $query_id = WDW_FM_Library(self::PLUGIN)->get('query_id',0);
1049
- $message = 2;
1050
- if( $this->model->delete_formmaker_query( $query_id ) ) {
1051
- $message = 3;
1052
- }
1053
-
1054
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1055
- 'page' => $this->page,
1056
- 'task' => 'edit',
1057
- 'current_id' => $id,
1058
- 'fieldset_id' => $fieldset_id,
1059
- 'message' => $message,
1060
- ), admin_url('admin.php')));
1061
- }
1062
-
1063
- /**
1064
- * Check if loading_delay or frequency is positive numbers
1065
- *
1066
- * @param int $delay
1067
- * @return int
1068
- */
1069
- public function set_delay_freq_positive_val( $delay = 0 ) {
1070
- if( $delay < 0 ) return 0;
1071
- return $delay;
1072
- }
1073
-
1074
- public function save_dis_options() {
1075
- $theme = (int) WDW_FM_Library(self::PLUGIN)->get('theme', $this->model->get_default_theme_id());
1076
-
1077
- $option_data = array(
1078
- 'form_id' => (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0),
1079
- 'scrollbox_loading_delay' => $this->set_delay_freq_positive_val( WDW_FM_Library(self::PLUGIN)->get('scrollbox_loading_delay', 0) ),
1080
- 'popover_animate_effect' => WDW_FM_Library(self::PLUGIN)->get('popover_animate_effect', ''),
1081
- 'popover_loading_delay' => $this->set_delay_freq_positive_val( WDW_FM_Library(self::PLUGIN)->get('popover_loading_delay', 0) ),
1082
- 'popover_frequency' => $this->set_delay_freq_positive_val( WDW_FM_Library(self::PLUGIN)->get('popover_frequency', 0) ),
1083
- 'topbar_position' => WDW_FM_Library(self::PLUGIN)->get('topbar_position', 1),
1084
- 'topbar_remain_top' => WDW_FM_Library(self::PLUGIN)->get('topbar_remain_top', 1),
1085
- 'topbar_closing' => WDW_FM_Library(self::PLUGIN)->get('topbar_closing', 1),
1086
- 'topbar_hide_duration' => $this->set_delay_freq_positive_val( WDW_FM_Library(self::PLUGIN)->get('topbar_hide_duration', 0) ),
1087
- 'scrollbox_position' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_position', 1),
1088
- 'scrollbox_trigger_point' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_trigger_point', 20),
1089
- 'scrollbox_hide_duration' => $this->set_delay_freq_positive_val( WDW_FM_Library(self::PLUGIN)->get('scrollbox_hide_duration', 0)),
1090
- 'scrollbox_auto_hide' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_auto_hide', 1),
1091
- 'hide_mobile' => WDW_FM_Library(self::PLUGIN)->get('hide_mobile', 0),
1092
- 'scrollbox_closing' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_closing', 1),
1093
- 'scrollbox_minimize' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_minimize', 1),
1094
- 'scrollbox_minimize_text' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_minimize_text', ''),
1095
- 'type' => WDW_FM_Library(self::PLUGIN)->get('form_type', 'embadded'),
1096
- 'display_on' => implode(',', WDW_FM_Library(self::PLUGIN)->get('display_on', array())),
1097
- 'posts_include' => WDW_FM_Library(self::PLUGIN)->get('posts_include', ''),
1098
- 'pages_include' => WDW_FM_Library(self::PLUGIN)->get('pages_include', ''),
1099
- 'display_on_categories' => implode(',', WDW_FM_Library(self::PLUGIN)->get('display_on_categories', array())),
1100
- 'current_categories' => WDW_FM_Library(self::PLUGIN)->get('current_categories', ''),
1101
- 'show_for_admin' => WDW_FM_Library(self::PLUGIN)->get('show_for_admin', 0),
1102
- );
1103
-
1104
- $save = $this->model->replace_display_options($option_data);
1105
- if ( $save !== FALSE ) {
1106
- $this->model->update_data('formmaker_backup', array(
1107
- 'type' => $option_data['type'],
1108
- 'theme' => $theme,
1109
- ), array( 'id' => $option_data['form_id'] ));
1110
- $this->model->update_data('formmaker', array(
1111
- 'type' => $option_data['type'],
1112
- 'theme' => $theme,
1113
- ), array( 'id' => $option_data['form_id'] ));
1114
- $this->model->create_js($option_data['form_id']);
1115
-
1116
- return 8;
1117
- }
1118
- else {
1119
- return 2;
1120
- }
1121
- }
1122
-
1123
- // TODO: remove this function.
1124
- public function save_as_copy() {
1125
- $message = $this->save_db_as_copy();
1126
- $page = WDW_FM_Library(self::PLUGIN)->get('page');
1127
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1128
- 'page' => $page,
1129
- 'task' => 'display',
1130
- 'message' => $message,
1131
- ), admin_url('admin.php')));
1132
- }
1133
-
1134
- public function save() {
1135
- $message = $this->save_db();
1136
- $page = WDW_FM_Library(self::PLUGIN)->get('page');
1137
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1138
- 'page' => $page,
1139
- 'task' => 'display',
1140
- 'message' => $message,
1141
- ), admin_url('admin.php')));
1142
- }
1143
-
1144
- public function apply() {
1145
- $tabs_loaded = json_decode(WDW_FM_Library(self::PLUGIN)->get('fm_tabs_loaded', '[]', false));
1146
- $message = $this->save_db();
1147
- $current_id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
1148
- if ( !$current_id ) {
1149
- $current_id = (int) $this->model->get_max_row('formmaker', 'id');
1150
- }
1151
- if (array_search('form_options_tab', $tabs_loaded) !== false) {
1152
- $this->save_db_form_options($current_id);
1153
- }
1154
- if (array_search('form_display_tab', $tabs_loaded) !== false) {
1155
- $this->save_dis_options();
1156
- }
1157
- if (array_search('form_layout_tab', $tabs_loaded) !== false) {
1158
- $this->save_db_layout($current_id);
1159
- }
1160
- if (array_search('form_email_options_tab', $tabs_loaded) !== false) {
1161
- $this->save_db_email_options($current_id);
1162
- }
1163
- $active_tab = WDW_FM_Library(self::PLUGIN)->get('fm_tab_active', 0);
1164
- $fieldset_id = WDW_FM_Library(self::PLUGIN)->get('fieldset_id', 'general');
1165
- $page = WDW_FM_Library(self::PLUGIN)->get('page');
1166
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1167
- 'page' => $page,
1168
- 'task' => 'edit',
1169
- 'current_id' => $current_id,
1170
- 'message' => $message,
1171
- 'tab' => $active_tab,
1172
- 'fieldset_id' => $fieldset_id,
1173
- ), admin_url('admin.php')));
1174
- }
1175
-
1176
- public function save_db() {
1177
- $javascript = "// Occurs before the form is loaded
1178
- function before_load() {
1179
- }
1180
- // Occurs just before submitting the form
1181
- function before_submit() {
1182
- // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don't need to return any value if you don't want to stop the submission.
1183
- }
1184
- // Occurs just before resetting the form
1185
- function before_reset() {
1186
- }
1187
- // Occurs after form is submitted and reloaded
1188
- function after_submit() {
1189
-
1190
- }";
1191
- $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
1192
- $title = WDW_FM_Library(self::PLUGIN)->get('title', '');
1193
- $form_front = WDW_FM_Library(self::PLUGIN)->get('form_front', '', false);
1194
- $sortable = WDW_FM_Library(self::PLUGIN)->get('sortable', 0);
1195
- $counter = WDW_FM_Library(self::PLUGIN)->get('counter', 0);
1196
- $label_order = WDW_FM_Library(self::PLUGIN)->get('label_order', '');
1197
- $pagination = WDW_FM_Library(self::PLUGIN)->get('pagination', '');
1198
- $show_title = WDW_FM_Library(self::PLUGIN)->get('show_title', '');
1199
- $show_numbers = WDW_FM_Library(self::PLUGIN)->get('show_numbers', '');
1200
- $public_key = WDW_FM_Library(self::PLUGIN)->get('public_key', '');
1201
- $private_key = WDW_FM_Library(self::PLUGIN)->get('private_key', '');
1202
- $recaptcha_theme = WDW_FM_Library(self::PLUGIN)->get('recaptcha_theme', '');
1203
- $label_order_current = WDW_FM_Library(self::PLUGIN)->get('label_order_current', '');
1204
- $form_fields = WDW_FM_Library(self::PLUGIN)->get('form_fields', '', false);
1205
- $header_title = WDW_FM_Library(self::PLUGIN)->get('header_title', '');
1206
- $header_description = WDW_FM_Library(self::PLUGIN)->get('header_description', '', FALSE);
1207
- $header_image_url = WDW_FM_Library(self::PLUGIN)->get('header_image_url', '');
1208
- $header_image_animation = WDW_FM_Library(self::PLUGIN)->get('header_image_animation', '');
1209
- $header_hide_image = WDW_FM_Library(self::PLUGIN)->get('header_hide_image', 0);
1210
- $header_hide = WDW_FM_Library(self::PLUGIN)->get('header_hide', 1);
1211
- $type = WDW_FM_Library(self::PLUGIN)->get('form_type', 'embedded');
1212
- $scrollbox_minimize_text = $header_title ? $header_title : 'The form is minimized.';
1213
- if ( $id != 0 ) {
1214
- $save = $this->model->update_data('formmaker', array(
1215
- 'title' => $title,
1216
- 'form_front' => $form_front,
1217
- 'sortable' => $sortable,
1218
- 'counter' => $counter,
1219
- 'label_order' => $label_order,
1220
- 'label_order_current' => $label_order_current,
1221
- 'pagination' => $pagination,
1222
- 'show_title' => $show_title,
1223
- 'show_numbers' => $show_numbers,
1224
- 'public_key' => $public_key,
1225
- 'private_key' => $private_key,
1226
- 'recaptcha_theme' => $recaptcha_theme,
1227
- 'form_fields' => $form_fields,
1228
- 'header_title' => $header_title,
1229
- 'header_description' => $header_description,
1230
- 'header_image_url' => $header_image_url,
1231
- 'header_image_animation' => $header_image_animation,
1232
- 'header_hide_image' => $header_hide_image,
1233
- 'header_hide' => $header_hide,
1234
- ), array( 'id' => $id ));
1235
- }
1236
- else {
1237
- $theme = (int) WDW_FM_Library(self::PLUGIN)->get('theme', $this->model->get_default_theme_id());
1238
- $this->model->insert_data_to_db('formmaker', array(
1239
- 'title' => $title,
1240
- 'type' => $type,
1241
- 'mail' => '{adminemail}',
1242
- 'form_front' => $form_front,
1243
- 'theme' => $theme,
1244
- 'counter' => $counter,
1245
- 'label_order' => $label_order,
1246
- 'pagination' => $pagination,
1247
- 'show_title' => $show_title,
1248
- 'show_numbers' => $show_numbers,
1249
- 'public_key' => $public_key,
1250
- 'private_key' => $private_key,
1251
- 'recaptcha_theme' => $recaptcha_theme,
1252
- 'javascript' => $javascript,
1253
- 'submit_text' => '',
1254
- 'url' => '',
1255
- 'article_id' => 0,
1256
- 'submit_text_type' => 1,
1257
- 'script_mail' => '{all}',
1258
- 'script_mail_user' => '{all}',
1259
- 'label_order_current' => $label_order_current,
1260
- 'tax' => 0,
1261
- 'payment_currency' => '',
1262
- 'paypal_email' => '',
1263
- 'checkout_mode' => 'testmode',
1264
- 'paypal_mode' => 0,
1265
- 'published' => 1,
1266
- 'form_fields' => $form_fields,
1267
- 'savedb' => 1,
1268
- 'sendemail' => 1,
1269
- 'requiredmark' => '*',
1270
- 'from_mail' => '{adminemail}',
1271
- 'from_name' => '',
1272
- 'reply_to' => '',
1273
- 'send_to' => '',
1274
- 'autogen_layout' => 1,
1275
- 'custom_front' => '',
1276
- 'mail_from_user' => '{adminemail}',
1277
- 'mail_from_name_user' => '',
1278
- 'reply_to_user' => '',
1279
- 'condition' => '',
1280
- 'mail_cc' => '',
1281
- 'mail_cc_user' => '',
1282
- 'mail_bcc' => '',
1283
- 'mail_bcc_user' => '',
1284
- 'mail_subject' => '',
1285
- 'mail_subject_user' => '',
1286
- 'mail_mode' => 1,
1287
- 'mail_mode_user' => 1,
1288
- 'mail_attachment' => 1,
1289
- 'mail_attachment_user' => 1,
1290
- 'sortable' => $sortable,
1291
- 'user_id_wd' => 'administrator,',
1292
- 'frontend_submit_fields' => '',
1293
- 'frontend_submit_stat_fields' => '',
1294
- 'save_uploads' => 1,
1295
- 'header_title' => $header_title,
1296
- 'header_description' => $header_description,
1297
- 'header_image_url' => $header_image_url,
1298
- 'header_image_animation' => $header_image_animation,
1299
- 'header_hide_image' => $header_hide_image,
1300
- 'header_hide' => $header_hide,
1301
- 'privacy' => '',
1302
- ));
1303
- $id = (int) $this->model->get_max_row('formmaker', 'id');
1304
- if (WDFMInstance(self::PLUGIN)->is_free == 2) {
1305
- update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
1306
- }
1307
- $this->model->insert_data_to_db('formmaker_display_options', array(
1308
- 'form_id' => $id,
1309
- 'type' => $type,
1310
- 'scrollbox_loading_delay' => 0,
1311
- 'popover_animate_effect' => '',
1312
- 'popover_loading_delay' => 0,
1313
- 'popover_frequency' => 0,
1314
- 'topbar_position' => 1,
1315
- 'topbar_remain_top' => 1,
1316
- 'topbar_closing' => 1,
1317
- 'topbar_hide_duration' => 0,
1318
- 'scrollbox_position' => 1,
1319
- 'scrollbox_trigger_point' => 20,
1320
- 'scrollbox_hide_duration' => 0,
1321
- 'scrollbox_auto_hide' => 1,
1322
- 'hide_mobile' => 0,
1323
- 'scrollbox_closing' => 1,
1324
- 'scrollbox_minimize' => 1,
1325
- 'scrollbox_minimize_text' => $scrollbox_minimize_text,
1326
- 'display_on' => 'home,post,page',
1327
- 'posts_include' => '',
1328
- 'pages_include' => '',
1329
- 'display_on_categories' => 'select_all_categories',
1330
- 'current_categories' => 'select_all_categories',
1331
- 'show_for_admin' => 0,
1332
- ));
1333
- $this->model->insert_data_to_db('formmaker_views', array(
1334
- 'form_id' => $id,
1335
- 'views' => 0,
1336
- ));
1337
- }
1338
- $backup_id = (int) WDW_FM_Library(self::PLUGIN)->get('backup_id', '');
1339
- if ( $backup_id ) {
1340
- // Set cur 0 before add new current
1341
- $this->model->update_data('formmaker_backup', array( 'cur' => 0 ), array( 'id' => $id ));
1342
- // Get form_fields, form_front
1343
- $row1 = $this->model->select_rows("get_row", array(
1344
- "selection" => "form_fields, form_front",
1345
- "table" => "formmaker_backup",
1346
- "where" => "backup_id = " . $backup_id,
1347
- ));
1348
- if ( $row1->form_fields == $form_fields and $row1->form_front == $form_front ) {
1349
- $save = $this->model->update_data('formmaker_backup', array(
1350
- 'cur' => 1,
1351
- 'title' => $title,
1352
- 'form_front' => $form_front,
1353
- 'sortable' => $sortable,
1354
- 'counter' => $counter,
1355
- 'label_order' => $label_order,
1356
- 'label_order_current' => $label_order_current,
1357
- 'pagination' => $pagination,
1358
- 'show_title' => $show_title,
1359
- 'show_numbers' => $show_numbers,
1360
- 'public_key' => $public_key,
1361
- 'private_key' => $private_key,
1362
- 'recaptcha_theme' => $recaptcha_theme,
1363
- 'form_fields' => $form_fields,
1364
- 'header_title' => $header_title,
1365
- 'header_description' => $header_description,
1366
- 'header_image_url' => $header_image_url,
1367
- 'header_image_animation' => $header_image_animation,
1368
- 'header_hide_image' => $header_hide_image,
1369
- 'header_hide' => $header_hide,
1370
- ), array( 'backup_id' => $backup_id ));
1371
- if ( $save !== FALSE ) {
1372
- $this->model->create_js($id);
1373
-
1374
- return 1;
1375
- }
1376
- else {
1377
- return 2;
1378
- }
1379
- }
1380
- }
1381
- $this->model->update_data('formmaker_backup', array( 'cur' => 0 ), array( 'id' => $id ));
1382
- $fm_cur_date = current_time('timestamp');
1383
- $save = $this->model->insert_data_to_db('formmaker_backup', array(
1384
- 'cur' => 1,
1385
- 'id' => $id,
1386
- 'title' => $title,
1387
- 'mail' => '',
1388
- 'form_front' => $form_front,
1389
- 'counter' => $counter,
1390
- 'label_order' => $label_order,
1391
- 'pagination' => $pagination,
1392
- 'show_title' => $show_title,
1393
- 'show_numbers' => $show_numbers,
1394
- 'public_key' => $public_key,
1395
- 'private_key' => $private_key,
1396
- 'recaptcha_theme' => $recaptcha_theme,
1397
- 'javascript' => $javascript,
1398
- 'submit_text' => '',
1399
- 'url' => '',
1400
- 'article_id' => 0,
1401
- 'submit_text_type' => 1,
1402
- 'script_mail' => '{all}',
1403
- 'script_mail_user' => '{all}',
1404
- 'label_order_current' => $label_order_current,
1405
- 'tax' => 0,
1406
- 'payment_currency' => '',
1407
- 'paypal_email' => '',
1408
- 'checkout_mode' => 'testmode',
1409
- 'paypal_mode' => 0,
1410
- 'published' => 1,
1411
- 'form_fields' => $form_fields,
1412
- 'savedb' => 1,
1413
- 'sendemail' => 1,
1414
- 'requiredmark' => '*',
1415
- 'from_mail' => '',
1416
- 'from_name' => '',
1417
- 'reply_to' => '',
1418
- 'send_to' => '',
1419
- 'autogen_layout' => 1,
1420
- 'custom_front' => '',
1421
- 'mail_from_user' => '',
1422
- 'mail_from_name_user' => '',
1423
- 'reply_to_user' => '',
1424
- 'condition' => '',
1425
- 'mail_cc' => '',
1426
- 'mail_cc_user' => '',
1427
- 'mail_bcc' => '',
1428
- 'mail_bcc_user' => '',
1429
- 'mail_subject' => '',
1430
- 'mail_subject_user' => '',
1431
- 'mail_mode' => 1,
1432
- 'mail_mode_user' => 1,
1433
- 'mail_attachment' => 1,
1434
- 'mail_attachment_user' => 1,
1435
- 'sortable' => $sortable,
1436
- 'user_id_wd' => 'administrator,',
1437
- 'frontend_submit_fields' => '',
1438
- 'frontend_submit_stat_fields' => '',
1439
- 'header_title' => $header_title,
1440
- 'header_description' => $header_description,
1441
- 'header_image_url' => $header_image_url,
1442
- 'header_image_animation' => $header_image_animation,
1443
- 'header_hide_image' => $header_hide_image,
1444
- 'header_hide' => $header_hide,
1445
- 'privacy' => '',
1446
- 'date' => $fm_cur_date,
1447
- ));
1448
-
1449
- if ( $save !== FALSE ) {
1450
- $this->model->create_js($id);
1451
- return 1;
1452
- }
1453
- else {
1454
- return 2;
1455
- }
1456
- }
1457
-
1458
- public function fm_live_search() {
1459
- $search_string = !empty($_POST['pp_live_search']) ? sanitize_text_field($_POST['pp_live_search']) : '';
1460
- $post_type = !empty($_POST['pp_post_type']) ? sanitize_text_field($_POST['pp_post_type']) : 'any';
1461
- $full_content = !empty($_POST['pp_full_content']) ? sanitize_text_field($_POST['pp_full_content']) : 'true';
1462
- $args['s'] = $search_string;
1463
- $results = $this->fm_posts_query($args, $post_type);
1464
- $output = '<ul class="pp_search_results">';
1465
- if ( empty($results) ) {
1466
- $output .= sprintf('<li class="pp_no_res">%1$s</li>', esc_html__('No results found', 'fm-text'));
1467
- }
1468
- else {
1469
- foreach ( $results as $single_post ) {
1470
- $output .= sprintf('<li data-post_id="%2$s">[%3$s] - %1$s</li>', esc_html($single_post['title']), esc_attr($single_post['id']), esc_html($single_post['post_type']));
1471
- }
1472
- }
1473
- $output .= '</ul>';
1474
- die($output);
1475
- }
1476
-
1477
- /**
1478
- * @param array $args
1479
- * @param string $include_post_type
1480
- * @return array|bool
1481
- */
1482
- public function fm_posts_query( $args = array(), $include_post_type = '' ) {
1483
- if ( 'only_pages' === $include_post_type ) {
1484
- $post_type = array('page');
1485
- }
1486
- elseif ( 'any' === $include_post_type || 'only_posts' === $include_post_type ) {
1487
- $post_type = array('post');
1488
- }
1489
- else {
1490
- $post_type = $include_post_type;
1491
- }
1492
- $query = array(
1493
- 'post_type' => $post_type,
1494
- 'suppress_filters' => TRUE,
1495
- 'update_post_term_cache' => FALSE,
1496
- 'update_post_meta_cache' => FALSE,
1497
- 'post_status' => 'publish',
1498
- 'posts_per_page' => -1,
1499
- );
1500
- if ( isset($args['s']) ) {
1501
- $query['s'] = $args['s'];
1502
- }
1503
- $get_posts = new WP_Query;
1504
- $posts = $get_posts->query($query);
1505
- if ( !$get_posts->post_count ) {
1506
- return FALSE;
1507
- }
1508
- $results = array();
1509
- foreach ( $posts as $post ) {
1510
- $results[] = array(
1511
- 'id' => (int) $post->ID,
1512
- 'title' => trim(esc_html(strip_tags(get_the_title($post)))),
1513
- 'post_type' => $post->post_type,
1514
- );
1515
- }
1516
- wp_reset_postdata();
1517
-
1518
- return $results;
1519
- }
1520
-
1521
- /**
1522
- * @param int $id
1523
- * @return int
1524
- */
1525
- public function update_form_title( $id = 0 ) {
1526
- $page = WDW_FM_Library(self::PLUGIN)->get('page');
1527
- $form_name = WDW_FM_Library(self::PLUGIN)->get('form_name', '');
1528
-
1529
- // check id for db
1530
- if(isset($id) && $id != "") {
1531
- $id = intval($id);
1532
- $update = $this->model->update_data( "forms", array('title' => $form_name,), array('id' => $id) );
1533
- if( !$update ){
1534
- $message = 2;
1535
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1536
- 'page' => $page,
1537
- 'task' => 'display',
1538
- 'message' => $message,
1539
- ), admin_url('admin.php')));
1540
- }
1541
-
1542
- }
1543
- else { // return message Failed
1544
- $message = 2;
1545
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1546
- 'page' => $page,
1547
- 'task' => 'display',
1548
- 'message' => $message,
1549
- ), admin_url('admin.php')));
1550
- }
1551
-
1552
- return $message = 1;
1553
- }
1554
-
1555
- /**
1556
- * Get stripe addon.
1557
- *
1558
- * @param int $id
1559
- * @return array $data
1560
- */
1561
- private function get_stripe_addon( $id = 0 ) {
1562
- return apply_filters('fm_stripe_display_init', array('form_id' => $id) );
1563
- }
1564
- }
1
+ <?php
2
+ class FMControllerManage_fmc extends CFMAdminController {
3
+
4
+ private $model;
5
+ private $view;
6
+ private $page;
7
+ private $page_url;
8
+ private $bulk_action_name = '';
9
+ private $items_per_page = 20;
10
+ private $animation_effects = array();
11
+ private $actions = array();
12
+ private $revision = 0;
13
+
14
+ function __construct() {
15
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Manage_fm.php";
16
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Manage_fm.php";
17
+ $this->model = new FMModelManage_fmc();
18
+ $this->view = new FMViewManage_fmc();
19
+
20
+ $this->page = WDW_FM_Library(self::PLUGIN)->get('page', 'manage' . WDFMInstance(self::PLUGIN)->menu_postfix);
21
+ $this->page_url = add_query_arg(array(
22
+ 'page' => $this->page,
23
+ WDFMInstance(self::PLUGIN)->nonce => wp_create_nonce(WDFMInstance(self::PLUGIN)->nonce),
24
+ ), admin_url('admin.php')
25
+ );
26
+ $this->bulk_action_name = 'bulk_action';
27
+
28
+ $this->actions = array(
29
+ 'publish' => array(
30
+ 'title' => __('Publish', WDFMInstance(self::PLUGIN)->prefix),
31
+ $this->bulk_action_name => __('published', WDFMInstance(self::PLUGIN)->prefix),
32
+ ),
33
+ 'unpublish' => array(
34
+ 'title' => __('Unpublish', WDFMInstance(self::PLUGIN)->prefix),
35
+ $this->bulk_action_name => __('unpublished', WDFMInstance(self::PLUGIN)->prefix),
36
+ ),
37
+ 'duplicate' => array(
38
+ 'title' => __('Duplicate', WDFMInstance(self::PLUGIN)->prefix),
39
+ $this->bulk_action_name => __('duplicated', WDFMInstance(self::PLUGIN)->prefix),
40
+ ),
41
+ 'delete' => array(
42
+ 'title' => __('Delete', WDFMInstance(self::PLUGIN)->prefix),
43
+ $this->bulk_action_name => __('deleted', WDFMInstance(self::PLUGIN)->prefix),
44
+ ),
45
+ );
46
+
47
+ $this->animation_effects = array(
48
+ 'none' => 'None',
49
+ 'bounce' => 'Bounce',
50
+ 'tada' => 'Tada',
51
+ 'bounceInDown' => 'BounceInDown',
52
+ 'fadeInLeft' => 'FadeInLeft',
53
+ 'flash' => 'Flash',
54
+ 'pulse' => 'Pulse',
55
+ 'rubberBand' => 'RubberBand',
56
+ 'shake' => 'Shake',
57
+ 'swing' => 'Swing',
58
+ 'wobble' => 'Wobble',
59
+ 'hinge' => 'Hinge',
60
+ 'lightSpeedIn' => 'LightSpeedIn',
61
+ 'rollIn' => 'RollIn',
62
+ 'bounceIn' => 'BounceIn',
63
+ 'bounceInLeft' => 'BounceInLeft',
64
+ 'bounceInRight' => 'BounceInRight',
65
+ 'bounceInUp' => 'BounceInUp',
66
+ 'fadeIn' => 'FadeIn',
67
+ 'fadeInDown' => 'FadeInDown',
68
+ 'fadeInDownBig' => 'FadeInDownBig',
69
+ 'fadeInLeftBig' => 'FadeInLeftBig',
70
+ 'fadeInRight' => 'FadeInRight',
71
+ 'fadeInRightBig' => 'FadeInRightBig',
72
+ 'fadeInUp' => 'FadeInUp',
73
+ 'fadeInUpBig' => 'FadeInUpBig',
74
+ 'flip' => 'Flip',
75
+ 'flipInX' => 'FlipInX',
76
+ 'flipInY' => 'FlipInY',
77
+ 'rotateIn' => 'RotateIn',
78
+ 'rotateInDownLeft' => 'RotateInDownLeft',
79
+ 'rotateInDownRight' => 'RotateInDownRight',
80
+ 'rotateInUpLeft' => 'RotateInUpLeft',
81
+ 'rotateInUpRight' => 'RotateInUpRight',
82
+ 'zoomIn' => 'ZoomIn',
83
+ 'zoomInDown' => 'ZoomInDown',
84
+ 'zoomInLeft' => 'ZoomInLeft',
85
+ 'zoomInRight' => 'ZoomInRight',
86
+ 'zoomInUp' => 'ZoomInUp',
87
+ );
88
+ }
89
+
90
+ public function execute() {
91
+ $task = WDW_FM_Library(self::PLUGIN)->get('task');
92
+ $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
93
+ if ( method_exists($this, $task) ) {
94
+ if ( $task != 'add' && $task != 'edit' && $task != 'display' && $task != 'form_options' && $task != 'email_options' && $task != 'display_options' && $task != 'form_layout' ) {
95
+ check_admin_referer(WDFMInstance(self::PLUGIN)->nonce, WDFMInstance(self::PLUGIN)->nonce);
96
+ }
97
+ $block_action = $this->bulk_action_name;
98
+ $action = WDW_FM_Library(self::PLUGIN)->get( $block_action, -1 );
99
+ if ( $action != -1 ) {
100
+ $this->$block_action($action);
101
+ }
102
+ else {
103
+ $this->$task($id);
104
+ }
105
+ }
106
+ else {
107
+ $this->display();
108
+ }
109
+ }
110
+
111
+ public function display() {
112
+ $params = array();
113
+ $params['order'] = WDW_FM_Library(self::PLUGIN)->get('order', 'asc');
114
+ $params['orderby'] = WDW_FM_Library(self::PLUGIN)->get('orderby', 'id');
115
+ // To prevent SQL injections.
116
+ if ( !in_array($params['orderby'], array( 'id', 'title', 'type' )) ) {
117
+ $params['orderby'] = 'id';
118
+ }
119
+ $params['order'] = $params['order'] == 'desc' ? 'desc' : 'asc';
120
+
121
+ $params['items_per_page'] = $this->items_per_page;
122
+
123
+ $params['rows_data'] = $this->model->get_rows_data($params);
124
+
125
+ $params['total'] = $this->model->total();
126
+
127
+ $params['actions'] = $this->actions;
128
+ $params['page'] = $this->page;
129
+ $params['form_preview_link'] = $this->model->get_form_preview_post();
130
+
131
+ $this->view->display($params);
132
+ }
133
+
134
+ /**
135
+ * Bulk actions.
136
+ *
137
+ * @param string $task
138
+ */
139
+ public function bulk_action( $task = '' ) {
140
+ $message = 0;
141
+ $successfully_updated = 0;
142
+
143
+ $check = WDW_FM_Library(self::PLUGIN)->get('check', '');
144
+
145
+ if ( $check ) {
146
+ foreach ( $check as $id => $item ) {
147
+ if ( method_exists($this, $task) ) {
148
+ $message = $this->$task($id, TRUE);
149
+ if ( $message != 2 ) {
150
+ // Increase successfully updated items count, if action doesn't failed.
151
+ $successfully_updated++;
152
+ }
153
+ }
154
+ }
155
+ if ( $successfully_updated ) {
156
+ $block_action = $this->bulk_action_name;
157
+ $message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDFMInstance(self::PLUGIN)->prefix), $successfully_updated, $this->actions[$task][$block_action]);
158
+ }
159
+ }
160
+
161
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
162
+ 'page' => $this->page,
163
+ 'task' => 'display',
164
+ ($message === 2 ? 'message' : 'msg') => $message,
165
+ ), admin_url('admin.php')));
166
+
167
+ }
168
+
169
+ /**
170
+ * Delete form by id.
171
+ *
172
+ * @param int $id
173
+ * @param bool $bulk
174
+ *
175
+ * @return int
176
+ */
177
+ public function delete( $id = 0, $bulk = FALSE ) {
178
+ if ( $this->model->delete_rows(array( "table" => "formmaker", "where" => "id = " . $id )) ) {
179
+ $this->model->delete_rows(array( "table" => "formmaker_views", "where" => "form_id = " . $id ));
180
+ $this->model->delete_rows(array( "table" => "formmaker_submits", "where" => "form_id = " . $id ));
181
+ $this->model->delete_rows(array( "table" => "formmaker_sessions", "where" => "form_id = " . $id ));
182
+ $this->model->delete_rows(array( "table" => "formmaker_backup", "where" => "id = " . $id ));
183
+ $this->model->delete_rows(array( "table" => "formmaker_display_options", "where" => "form_id = " . $id ));
184
+ $this->model->delete_rows(array( "table" => "formmaker_query", "where" => "form_id = " . $id ));
185
+ if (WDFMInstance(self::PLUGIN)->is_free == 2) {
186
+ $arr = explode(',', get_option('contact_form_forms'));
187
+ $arr = array_diff($arr, array($id));
188
+ $arr = implode(',', $arr);
189
+ update_option('contact_form_forms', $arr);
190
+ }
191
+ // To delete DB rows with form ids from extensions.
192
+ if (WDFMInstance(self::PLUGIN)->is_free != 2) {
193
+ do_action('fm_delete_addon_init', $id);
194
+ }
195
+ $message = 3;
196
+ }
197
+ else {
198
+ $message = 2;
199
+ }
200
+
201
+ if ( $bulk ) {
202
+ return $message;
203
+ }
204
+ else {
205
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
206
+ 'page' => $this->page,
207
+ 'task' => 'display',
208
+ 'message' => $message,
209
+ ), admin_url('admin.php')));
210
+ }
211
+ }
212
+
213
+ /**
214
+ * Publish by id.
215
+ *
216
+ * @param int $id
217
+ * @param bool $bulk
218
+ *
219
+ * @return int
220
+ */
221
+ public function publish( $id = 0, $bulk = FALSE ) {
222
+ $updated = $this->model->update_data("formmaker", array('published' => 1), array('id' => $id));
223
+ if ( $updated !== FALSE ) {
224
+ $message = 9;
225
+ }
226
+ else {
227
+ $message = 2;
228
+ }
229
+
230
+ if ( $bulk ) {
231
+ return $message;
232
+ }
233
+ else {
234
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
235
+ 'page' => $this->page,
236
+ 'task' => 'display',
237
+ 'message' => $message,
238
+ ), admin_url('admin.php')));
239
+ }
240
+ }
241
+
242
+ /**
243
+ * Unpublish by id.
244
+ *
245
+ * @param int $id
246
+ * @param bool $bulk
247
+ *
248
+ * @return int
249
+ */
250
+ public function unpublish( $id = 0, $bulk = FALSE ) {
251
+ $updated = $this->model->update_data("formmaker", array('published' => 0), array('id' => $id));
252
+ if ( $updated !== FALSE ) {
253
+ $message = 10;
254
+ }
255
+ else {
256
+ $message = 2;
257
+ }
258
+
259
+ if ( $bulk ) {
260
+ return $message;
261
+ }
262
+ else {
263
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
264
+ 'page' => $this->page,
265
+ 'task' => 'display',
266
+ 'message' => $message,
267
+ ), admin_url('admin.php')));
268
+ }
269
+ }
270
+
271
+ /**
272
+ * Duplicate by id.
273
+ *
274
+ * @param int $id
275
+ * @param bool $bulk
276
+ *
277
+ * @return int
278
+ */
279
+ public function duplicate( $id = 0, $bulk = FALSE ) {
280
+ $message = 2;
281
+ $row = $this->model->select_rows("get_row", array(
282
+ "selection" => "*",
283
+ "table" => "formmaker",
284
+ "where" => "id=" . (int) $id,
285
+ ));
286
+
287
+ if ( $row ) {
288
+ $row = (array) $row;
289
+ unset($row['id']);
290
+ $row['title'] = $row['title'] . ' - ' . __('Copy', WDFMInstance(self::PLUGIN)->prefix);
291
+ $inserted = $this->model->insert_data_to_db("formmaker", (array) $row);
292
+ $new_id = (int) $this->model->get_max_row('formmaker', 'id');
293
+
294
+ $row_display_options = $this->model->select_rows("get_row", array(
295
+ "selection" => "*",
296
+ "table" => "formmaker_display_options",
297
+ "where" => "form_id=" . (int) $id,
298
+ ));
299
+ if ( $row_display_options ) {
300
+ $row_display_options = (array) $row_display_options;
301
+ unset($row_display_options['id']);
302
+ $row_display_options['form_id'] = $new_id;
303
+ $inserted = $this->model->insert_data_to_db("formmaker_display_options", (array) $row_display_options);
304
+ }
305
+
306
+ $row_query = $this->model->select_rows("get_results", array(
307
+ "selection" => "*",
308
+ "table" => "formmaker_query",
309
+ "where" => "form_id=" . (int) $id,
310
+ ));
311
+ if ( $row_query ) {
312
+ foreach ($row_query as $query) {
313
+ $query = (array)$query;
314
+ unset($query['id']);
315
+ $query['form_id'] = $new_id;
316
+ $inserted = $this->model->insert_data_to_db("formmaker_query", (array)$query);
317
+ }
318
+ }
319
+
320
+ if (WDFMInstance(self::PLUGIN)->is_free == 2) {
321
+ update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $new_id : $new_id));
322
+ }
323
+ else {
324
+ // Duplicate extensions data.
325
+ do_action('fm_duplicate_form', $id, $new_id);
326
+ }
327
+ if ( $inserted !== FALSE ) {
328
+ $message = 11;
329
+ }
330
+ }
331
+
332
+ if ( $bulk ) {
333
+ return $message;
334
+ }
335
+ else {
336
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
337
+ 'page' => $this->page,
338
+ 'task' => 'display',
339
+ 'message' => $message,
340
+ ), admin_url('admin.php')));
341
+ }
342
+ }
343
+
344
+ public function add() {
345
+ $backup_id = 0;
346
+ $params = array();
347
+ $fm_settings = WDFMInstance(self::PLUGIN)->fm_settings;
348
+ $fm_enable_wp_editor = !isset( $fm_settings['fm_enable_wp_editor'] ) ? 1 : $fm_settings['fm_enable_wp_editor'];
349
+ $params['fm_enable_wp_editor'] = $fm_enable_wp_editor;
350
+ $params['id'] = $backup_id;
351
+ $params['row'] = $this->model->get_row_data_new($backup_id);
352
+ $params['page_url'] = $this->page_url;
353
+ // Check if Stripe extension is active.
354
+ $stripe_addon = array('enable' => 0);
355
+ $addon_stripe = $this->get_stripe_addon(0);
356
+ if( !empty($addon_stripe['html']) ) {
357
+ $stripe_addon = $addon_stripe;
358
+ }
359
+ $params['stripe_addon'] = $stripe_addon;
360
+
361
+ $params['themes'] = $this->model->get_theme_rows_data();
362
+ $params['default_theme'] = $this->model->get_default_theme_id();
363
+ $params['form_preview_link'] = "";
364
+
365
+ $params['autogen_layout'] = 1;
366
+ $labels = array();
367
+ $label_id = array();
368
+ $label_order_original = array();
369
+ $label_type = array();
370
+ $label_all = explode('#****#', $params['row']->label_order);
371
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
372
+ foreach ( $label_all as $key => $label_each ) {
373
+ $label_id_each = explode('#**id**#', $label_each);
374
+ array_push($label_id, $label_id_each[0]);
375
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
376
+ array_push($label_order_original, addslashes($label_oder_each[0]));
377
+ array_push($label_type, $label_oder_each[1]);
378
+ }
379
+
380
+ $params[ 'label_label' ] = array();
381
+
382
+ $labels['id'] = '"' . implode('","', $label_id) . '"';
383
+ $labels['label'] = '"' . implode('","', $label_order_original) . '"';
384
+ $labels['type'] = '"' . implode('","', $label_type) . '"';
385
+ $params['labels'] = $labels;
386
+
387
+ $params['page_title'] = __('Create new form', WDFMInstance(self::PLUGIN)->prefix);
388
+ $params['animation_effects'] = $this->animation_effects;
389
+
390
+ $this->view->edit($params);
391
+ }
392
+
393
+ /**
394
+ * Edit.
395
+ *
396
+ * @param int $id
397
+ * @param int $backup_id
398
+ */
399
+ public function edit( $id = 0, $backup_id = 0 ) {
400
+ $fm_settings = WDFMInstance(self::PLUGIN)->fm_settings;
401
+ $fm_advanced_layout = isset($fm_settings['fm_advanced_layout']) && $fm_settings['fm_advanced_layout'] == '1' ? 1 : 0;
402
+ $fm_enable_wp_editor = !isset( $fm_settings['fm_enable_wp_editor'] ) ? 1 : $fm_settings['fm_enable_wp_editor'];
403
+ if ( $id && !$fm_advanced_layout ) {
404
+ $fm_advanced_layout = !$this->model->get_autogen_layout($id);
405
+ }
406
+
407
+ if ( !$backup_id ) {
408
+ $backup_id = $this->model->select_rows("get_var", array(
409
+ "selection" => "backup_id",
410
+ "table" => "formmaker_backup",
411
+ "where" => "cur=1 and id=" . $id,
412
+ ));
413
+
414
+ if ( !$backup_id ) {
415
+ $backup_id = $this->model->get_max_row("formmaker_backup", "backup_id");
416
+ if ( $backup_id ) {
417
+ $backup_id++;
418
+ }
419
+ else {
420
+ $backup_id = 1;
421
+ }
422
+ $this->model->insert_formmaker_backup($backup_id, $id);
423
+ }
424
+ }
425
+
426
+ $params = array();
427
+ $params['id'] = $id;
428
+ $params['backup_id'] = $backup_id;
429
+ $params['row'] = $this->model->get_row_data_new($backup_id);
430
+ if ( empty($params['row']) ) {
431
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
432
+ }
433
+
434
+ // Check stripe extension is active.
435
+ $stripe_addon = array( 'enable' => 0 );
436
+ $addon_stripe = $this->get_stripe_addon($id);
437
+ if ( !empty($addon_stripe['html']) ) {
438
+ $stripe_addon = $addon_stripe;
439
+ }
440
+ $params['stripe_addon'] = $stripe_addon;
441
+ $params['page_url'] = $this->page_url;
442
+ $params['themes'] = $this->model->get_theme_rows_data();
443
+ $params['default_theme'] = $this->model->get_default_theme_id();
444
+
445
+ $params['form_preview_link'] = $this->model->get_form_preview_post();
446
+ $params['fm_enable_wp_editor'] = $fm_enable_wp_editor;
447
+
448
+ if ( $id ) {
449
+ $params['form_options_url'] = add_query_arg( array( 'page' => $this->page , 'task' => 'form_options', 'current_id' => $id ), $this->page_url );
450
+ $params['display_options_url'] = add_query_arg( array( 'page' => $this->page , 'task' => 'display_options', 'current_id' => $id ), $this->page_url );
451
+ $params['advanced_layout_url'] = $fm_advanced_layout ? add_query_arg( array( 'page' => $this->page , 'task' => 'form_layout', 'current_id' => $id ), $this->page_url ) : '';
452
+ }
453
+
454
+ if ( isset($params['row']->backup_id) ) {
455
+ if ( $params['row']->backup_id != "" ) {
456
+ $params['next_backup_id'] = $this->model->get_backup_id($params['row']->backup_id, $params['row']->id);
457
+ $params['prev_backup_id'] = $this->model->get_prev_backup_id($params['row']->backup_id, $params['row']->id);
458
+ }
459
+ }
460
+
461
+ $labels = array();
462
+ $label_id = array();
463
+ $label_label = array();
464
+ $label_order_original = array();
465
+ $label_type = array();
466
+ $label_all = explode('#****#', $params['row']->label_order);
467
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
468
+ foreach ( $label_all as $key => $label_each ) {
469
+ $label_id_each = explode( '#**id**#', $label_each );
470
+ $label_order_each = explode( '#**label**#', $label_id_each[ 1 ] );
471
+ $labelIds[ $label_id_each[ 0 ] ] = array( 'type' => $label_order_each[ 1 ], 'name' => $label_order_each[ 0 ] );
472
+
473
+ array_push($label_id, $label_id_each[0]);
474
+ array_push($label_order_original, addslashes($label_order_each[0]));
475
+ array_push($label_type, $label_order_each[1]);
476
+ array_push( $label_label, $label_order_each[ 0 ] );
477
+ }
478
+ $params[ 'label_label' ] = WDW_FM_Library(self::PLUGIN)->create_email_options_placeholders( $labelIds );
479
+
480
+ $labels['id'] = '"' . implode('","', $label_id) . '"';
481
+ $labels['label'] = '"' . implode('","', $label_order_original) . '"';
482
+ $labels['type'] = '"' . implode('","', $label_type) . '"';
483
+ $params['labels'] = $labels;
484
+
485
+ $params[ 'fields' ] = explode( '*:*id*:*type_submitter_mail*:*type*:*', $params[ 'row' ]->form_fields );
486
+ $params[ 'fields_count' ] = count( $params[ 'fields' ] );
487
+ $params['page_title'] = (($params['id'] != 0) ? 'Edit form ' . $params['row']->title : 'Create new form');
488
+ $params['animation_effects'] = $this->animation_effects;
489
+
490
+ $rev = $this->model->get_revisions( $id );
491
+ $params['revisions'] = $rev['data'];
492
+ $params['revisions_total'] = $rev['total'];
493
+ $params['revisions_status'] = $this->revision;
494
+ $params['current_revision'] = $this->model->get_current_revision( $id );
495
+ $params['revision_date'] = $this->model->get_revision_date( $backup_id );
496
+ $params['rev_index'] = WDW_FM_Library(self::PLUGIN)->get('rev_id');
497
+
498
+ $this->view->edit($params);
499
+ }
500
+
501
+ public function undo() {
502
+ $backup_id = (int) WDW_FM_Library(self::PLUGIN)->get('backup_id');
503
+ $id = (int) WDW_FM_Library(self::PLUGIN)->get('id');
504
+ $this->revision = 1;
505
+ $this->edit($id, $backup_id);
506
+ }
507
+
508
+ /**
509
+ * Form options.
510
+ *
511
+ * @param int $id
512
+ */
513
+ public function form_options( $id = 0 ) {
514
+ // Set params for view.
515
+ $params = array();
516
+ $params[ 'id' ] = $id;
517
+ $params[ 'page' ] = $this->page;
518
+ $params[ 'page_url' ] = $this->page_url;
519
+
520
+ $params[ 'back_url' ] = add_query_arg( array(
521
+ 'page' => 'manage' . WDFMInstance(self::PLUGIN)->menu_postfix,
522
+ 'task' => 'edit',
523
+ 'current_id' => $id
524
+ ), admin_url( 'admin.php' )
525
+ );
526
+
527
+ $params[ 'fieldset_id' ] = WDW_FM_Library(self::PLUGIN)->get( 'fieldset_id', 'general' );
528
+
529
+ $params[ 'row' ] = $this->model->get_row_data( $id );
530
+ if ( empty( $params[ 'row' ] ) ) {
531
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array( 'page' => $this->page ), admin_url( 'admin.php' ) ) );
532
+ }
533
+
534
+ $params[ 'themes' ] = $this->model->get_theme_rows_data();
535
+ $params[ 'default_theme' ] = $this->model->get_default_theme_id();
536
+ $params[ 'queries' ] = $this->model->get_queries_rows_data( $id );
537
+ $params[ 'userGroups' ] = get_editable_roles();
538
+ $params[ 'page_title' ] = '"' . $params[ 'row' ]->title . '" ' . __( 'options', WDFMInstance(self::PLUGIN)->prefix );
539
+
540
+ $label_id = array();
541
+ $label_label = array();
542
+ $labelIds = array();
543
+ $label_type = array();
544
+ $label_all = explode( '#****#', $params[ 'row' ]->label_order_current );
545
+ $label_all = array_slice( $label_all, 0, count( $label_all ) - 1 );
546
+ foreach ( $label_all as $key => $label_each ) {
547
+ $label_id_each = explode( '#**id**#', $label_each );
548
+ $label_order_each = explode( '#**label**#', $label_id_each[ 1 ] );
549
+ $labelIds[ $label_id_each[ 0 ] ] = array( 'type' => $label_order_each[ 1 ], 'name' => $label_order_each[ 0 ] );
550
+ array_push( $label_id, $label_id_each[ 0 ] );
551
+ array_push( $label_label, $label_order_each[ 0 ] );
552
+ array_push( $label_type, $label_order_each[ 1 ] );
553
+ }
554
+
555
+ // chechk stripe addon is active.
556
+ $stripe_addon = array( 'enable' => 0 );
557
+ $addon_stripe = $this->get_stripe_addon( $id );
558
+ if ( !empty( $addon_stripe[ 'html' ] ) ) {
559
+ $stripe_addon = $addon_stripe;
560
+ }
561
+ $params[ 'stripe_addon' ] = $stripe_addon;
562
+
563
+ /*
564
+ TODO.
565
+ Remember. 0 => none, 1 => paypal, 2 => stripe
566
+ Change. rename paypal_mode name to payment_method of wp_formmaker table.
567
+ */
568
+ $paypal_mode = $params[ 'row' ]->paypal_mode;
569
+ $payment_method = 'none';
570
+ if ( $paypal_mode == 1 ) {
571
+ $payment_method = 'paypal';
572
+ }
573
+ if ( $paypal_mode == 2 && isset( $stripe_addon[ 'stripe_enable' ] ) && $stripe_addon[ 'stripe_enable' ] == 1 ) {
574
+ $payment_method = 'stripe';
575
+ }
576
+
577
+ $params[ 'payment_method' ] = $payment_method;
578
+ $params[ 'labels_for_submissions' ] = $this->model->get_labels( $id );
579
+ $params[ 'payment_info' ] = $this->model->is_paypal( $id );
580
+
581
+ $labels_id_for_submissions = array();
582
+ $label_titles_for_submissions = array();
583
+ $labels_type_for_submissions = array();
584
+ if ( $params[ 'labels_for_submissions' ] ) {
585
+ $label_id_for_submissions = array();
586
+ $label_order_original_for_submissions = array();
587
+ $label_type_for_submissions = array();
588
+ if ( strpos( $params[ 'row' ]->label_order, 'type_paypal_' ) ) {
589
+ $params[ 'row' ]->label_order = $params[ 'row' ]->label_order . "item_total#**id**#Item Total#**label**#type_paypal_payment_total#****#total#**id**#Total#**label**#type_paypal_payment_total#****#0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
590
+ }
591
+ $label_all_for_submissions = explode( '#****#', $params[ 'row' ]->label_order );
592
+ $label_all_for_submissions = array_slice( $label_all_for_submissions, 0, count( $label_all_for_submissions ) - 1 );
593
+ foreach ( $label_all_for_submissions as $key => $label_each ) {
594
+ $label_id_each = explode( '#**id**#', $label_each );
595
+ array_push( $label_id_for_submissions, $label_id_each[ 0 ] );
596
+ $label_order_each = explode( '#**label**#', $label_id_each[ 1 ] );
597
+ array_push( $label_order_original_for_submissions, $label_order_each[ 0 ] );
598
+ array_push( $label_type_for_submissions, $label_order_each[ 1 ] );
599
+ }
600
+ foreach ( $label_id_for_submissions as $key => $label ) {
601
+ if ( in_array( $label, $params[ 'labels_for_submissions' ] ) ) {
602
+ array_push( $labels_type_for_submissions, $label_type_for_submissions[ $key ] );
603
+ array_push( $labels_id_for_submissions, $label );
604
+ array_push( $label_titles_for_submissions, $label_order_original_for_submissions[ $key ] );
605
+ }
606
+ }
607
+ $params[ 'labels_id_for_submissions' ] = $labels_id_for_submissions;
608
+ $params[ 'label_titles_for_submissions' ] = $label_titles_for_submissions;
609
+ }
610
+
611
+ $stats_labels = array();
612
+ $stats_labels_ids = array();
613
+ foreach ( $labels_type_for_submissions as $key => $label_type_cur ) {
614
+ if ( $label_type_cur == "type_checkbox" || $label_type_cur == "type_radio" || $label_type_cur == "type_own_select" || $label_type_cur == "type_country" || $label_type_cur == "type_paypal_select" || $label_type_cur == "type_paypal_radio" || $label_type_cur == "type_paypal_checkbox" || $label_type_cur == "type_paypal_shipping" ) {
615
+ $stats_labels_ids[] = $labels_id_for_submissions[ $key ];
616
+ $stats_labels[] = $label_titles_for_submissions[ $key ];
617
+ }
618
+ }
619
+
620
+ $params[ 'stats_labels_ids' ] = $stats_labels_ids;
621
+ $params[ 'stats_labels' ] = $stats_labels;
622
+ $params[ 'mail_ver_id' ] = $this->model->get_emailverification_post_id();
623
+
624
+ $params[ 'addons' ] = $this->get_addon_tabs( array( 'form_id' => $id ) );
625
+
626
+ $this->view->form_options( $params );
627
+ }
628
+
629
+ /**
630
+ * Email options.
631
+ *
632
+ * @param int $id
633
+ */
634
+ public function email_options( $id = 0 ) {
635
+ // Set params for view.
636
+ $params = array();
637
+ $params[ 'id' ] = $id;
638
+ $params[ 'page' ] = $this->page;
639
+ $params[ 'page_url' ] = $this->page_url;
640
+
641
+ $params[ 'back_url' ] = add_query_arg( array(
642
+ 'page' => 'manage' . WDFMInstance(self::PLUGIN)->menu_postfix,
643
+ 'task' => 'edit',
644
+ 'current_id' => $id
645
+ ), admin_url( 'admin.php' )
646
+ );
647
+
648
+ $params[ 'fieldset_id' ] = WDW_FM_Library(self::PLUGIN)->get( 'fieldset_id', 'general' );
649
+
650
+ $params[ 'row' ] = $this->model->get_row_data( $id );
651
+ if ( empty( $params[ 'row' ] ) ) {
652
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array( 'page' => $this->page ), admin_url( 'admin.php' ) ) );
653
+ }
654
+ $params[ 'fields' ] = explode( '*:*id*:*type_submitter_mail*:*type*:*', $params[ 'row' ]->form_fields );
655
+ $params[ 'fields_count' ] = count( $params[ 'fields' ] );
656
+ $params[ 'mail_ver_id' ] = $this->model->get_emailverification_post_id();
657
+
658
+ $this->view->email_options( $params );
659
+ }
660
+
661
+ /**
662
+ * Get active addons.
663
+ *
664
+ * @param $params
665
+ * @return mixed|void
666
+ */
667
+ private function get_addon_tabs( $params = array() ) {
668
+ $addons = array('tabs' => array(), 'html' => array());
669
+ if (WDFMInstance(self::PLUGIN)->is_free != 2) {
670
+ $addons = apply_filters('fm_get_addon_init', $addons, $params);
671
+ }
672
+ return $addons;
673
+ }
674
+
675
+ /**
676
+ * Apply form options.
677
+ *
678
+ * @param int $id
679
+ */
680
+ public function apply_form_options( $id = 0 ) {
681
+ $fieldset_id = WDW_FM_Library(self::PLUGIN)->get('fieldset_id', 'general');
682
+ $message = $this->save_db_form_options( $id );
683
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
684
+ 'page' => $this->page,
685
+ 'task' => 'edit',
686
+ 'current_id' => $id,
687
+ 'fieldset_id' => $fieldset_id,
688
+ 'message' => $message,
689
+ ), admin_url('admin.php')));
690
+ }
691
+
692
+ /**
693
+ * Save db Email options.
694
+ *
695
+ * @param int $id
696
+ * @return int $id_message
697
+ */
698
+ public function save_db_email_options( $id = 0 ) {
699
+ $sendemail = stripslashes(WDW_FM_Library(self::PLUGIN)->get('sendemail', ''));
700
+ $mail = stripslashes(WDW_FM_Library(self::PLUGIN)->get('mail', ''));
701
+ $from_mail = stripslashes(WDW_FM_Library(self::PLUGIN)->get('from_mail', ''));
702
+ $from_name = stripslashes(WDW_FM_Library(self::PLUGIN)->get('from_name', ''));
703
+ $reply_to = stripslashes(WDW_FM_Library(self::PLUGIN)->get('reply_to', ''));
704
+ if ( $from_mail == "other" ) {
705
+ $from_mail = stripslashes(WDW_FM_Library(self::PLUGIN)->get('mail_from_other', ''));
706
+ }
707
+ if ( $reply_to == "other" ) {
708
+ $reply_to = stripslashes(WDW_FM_Library(self::PLUGIN)->get('reply_to_other', ''));
709
+ }
710
+ $script_mail = WDW_FM_Library(self::PLUGIN)->get('script_mail', '{all}', FALSE);
711
+ if ( $script_mail == '' ) {
712
+ $script_mail = '{all}';
713
+ }
714
+ $mail_from_user = WDW_FM_Library(self::PLUGIN)->get('mail_from_user', '');
715
+ $mail_from_name_user = WDW_FM_Library(self::PLUGIN)->get('mail_from_name_user', '');
716
+ $reply_to_user = WDW_FM_Library(self::PLUGIN)->get('reply_to_user', '');
717
+ $mail_cc = WDW_FM_Library(self::PLUGIN)->get('mail_cc', '');
718
+ $mail_cc_user = WDW_FM_Library(self::PLUGIN)->get('mail_cc_user', '');
719
+ $mail_bcc = WDW_FM_Library(self::PLUGIN)->get('mail_bcc', '');
720
+ $mail_bcc_user = WDW_FM_Library(self::PLUGIN)->get('mail_bcc_user', '');
721
+ $mail_subject = WDW_FM_Library(self::PLUGIN)->get('mail_subject', '');
722
+ $mail_subject_user = WDW_FM_Library(self::PLUGIN)->get('mail_subject_user', '');
723
+ $mail_mode = WDW_FM_Library(self::PLUGIN)->get('mail_mode', '');
724
+ $mail_mode_user = WDW_FM_Library(self::PLUGIN)->get('mail_mode_user', '');
725
+ $mail_attachment = WDW_FM_Library(self::PLUGIN)->get('mail_attachment', '');
726
+ $mail_attachment_user = WDW_FM_Library(self::PLUGIN)->get('mail_attachment_user', '');
727
+ $script_mail_user = WDW_FM_Library(self::PLUGIN)->get('script_mail_user', '{all}', FALSE);
728
+ if ( $script_mail_user == '' ) {
729
+ $script_mail_user = '{all}';
730
+ }
731
+
732
+ $mail_emptyfields = stripslashes(WDW_FM_Library(self::PLUGIN)->get('mail_emptyfields', 0));
733
+ $mail_verify = stripslashes(WDW_FM_Library(self::PLUGIN)->get('mail_verify', 0));
734
+ $mail_verify_expiretime = stripslashes(WDW_FM_Library(self::PLUGIN)->get('mail_verify_expiretime', ''));
735
+ $send_to = '';
736
+ for ( $i = 0; $i < 20; $i++ ) {
737
+ if ( WDW_FM_Library(self::PLUGIN)->get('send_to' . $i, 0) ) {
738
+ $send_to .= '*' . WDW_FM_Library(self::PLUGIN)->get('send_to' . $i, 0) . '*';
739
+ }
740
+ }
741
+
742
+ $mail_verification_post_id = (int) $this->model->get_mail_verification_post_id();
743
+
744
+
745
+ if ( $mail_verify ) {
746
+ $email_verification_post = array(
747
+ 'post_title' => 'Email Verification',
748
+ 'post_content' => '[email_verification]',
749
+ 'post_status' => 'publish',
750
+ 'post_author' => 1,
751
+ 'post_type' => 'fmemailverification',
752
+ );
753
+ if ( !$mail_verification_post_id || get_post($mail_verification_post_id) === NULL ) {
754
+ $mail_verification_post_id = wp_insert_post($email_verification_post);
755
+ }
756
+ }
757
+
758
+ $data = array(
759
+ 'sendemail' => $sendemail,
760
+ 'mail' => $mail,
761
+ 'from_mail' => $from_mail,
762
+ 'from_name' => $from_name,
763
+ 'reply_to' => $reply_to,
764
+ 'script_mail' => $script_mail,
765
+ 'mail_from_user' => $mail_from_user,
766
+ 'mail_from_name_user' => $mail_from_name_user,
767
+ 'reply_to_user' => $reply_to_user,
768
+ 'mail_cc' => $mail_cc,
769
+ 'mail_cc_user' => $mail_cc_user,
770
+ 'mail_bcc' => $mail_bcc,
771
+ 'mail_bcc_user' => $mail_bcc_user,
772
+ 'mail_subject' => $mail_subject,
773
+ 'mail_subject_user' => $mail_subject_user,
774
+ 'mail_mode' => $mail_mode,
775
+ 'mail_mode_user' => $mail_mode_user,
776
+ 'mail_attachment' => $mail_attachment,
777
+ 'mail_attachment_user' => $mail_attachment_user,
778
+ 'script_mail_user' => $script_mail_user,
779
+ 'send_to' => $send_to,
780
+ 'mail_emptyfields' => $mail_emptyfields,
781
+ 'mail_verify' => $mail_verify,
782
+ 'mail_verify_expiretime' => $mail_verify_expiretime,
783
+ 'mail_verification_post_id' => $mail_verification_post_id,
784
+ );
785
+
786
+ $message_id = 2;
787
+ $save = $this->model->update_data('formmaker', $data, array( 'id' => $id ));
788
+ if ( $save !== FALSE ) {
789
+ $this->model->create_js($id);
790
+ $message_id = 8;
791
+ }
792
+
793
+ return $message_id;
794
+
795
+
796
+
797
+
798
+ }
799
+
800
+ /**
801
+ * Save db Form options.
802
+ *
803
+ * @param int $id
804
+ * @return int $id_message
805
+ */
806
+ public function save_db_form_options( $id = 0 ) {
807
+ $javascript = "// Occurs before the form is loaded
808
+ function before_load() {
809
+
810
+ }
811
+ // Occurs just before submitting the form
812
+ function before_submit() {
813
+ // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don't need to return any value if you don't want to stop the submission.
814
+ }
815
+ // Occurs just before resetting the form
816
+ function before_reset() {
817
+
818
+ }
819
+ // Occurs after form is submitted and reloaded
820
+ function after_submit() {
821
+
822
+ }";
823
+
824
+ $published = stripslashes(WDW_FM_Library(self::PLUGIN)->get('published', ''));
825
+ $savedb = stripslashes(WDW_FM_Library(self::PLUGIN)->get('savedb', ''));
826
+ $requiredmark = stripslashes(WDW_FM_Library(self::PLUGIN)->get('requiredmark', '*'));
827
+ $save_uploads = stripslashes(WDW_FM_Library(self::PLUGIN)->get('save_uploads', ''));
828
+ $submit_text = WDW_FM_Library(self::PLUGIN)->get('submit_text', '', FALSE);
829
+ $url = WDW_FM_Library(self::PLUGIN)->get('url', '');
830
+ $tax = WDW_FM_Library(self::PLUGIN)->get('tax', 0);
831
+ $payment_currency = WDW_FM_Library(self::PLUGIN)->get('payment_currency', '');
832
+ $paypal_email = WDW_FM_Library(self::PLUGIN)->get('paypal_email', '');
833
+ $checkout_mode = WDW_FM_Library(self::PLUGIN)->get('checkout_mode', 'testmode');
834
+ $paypal_mode = WDW_FM_Library(self::PLUGIN)->get('paypal_mode', 0);
835
+
836
+ // TODO Seclude payment method and payment status.
837
+ if ( $paypal_mode == 'paypal' ) {
838
+ $paypal_mode = 1;
839
+ }
840
+ if ( $paypal_mode == 'stripe' ) {
841
+ $paypal_mode = 2;
842
+ }
843
+
844
+ $javascript = stripslashes(WDW_FM_Library(self::PLUGIN)->get('javascript', $javascript, false));
845
+ $condition = WDW_FM_Library(self::PLUGIN)->get('condition', '');
846
+ $user_id_wd = stripslashes(WDW_FM_Library(self::PLUGIN)->get('user_id_wd', 'administrator,'));
847
+ $frontend_submit_fields = stripslashes(WDW_FM_Library(self::PLUGIN)->get('frontend_submit_fields', ''));
848
+ $frontend_submit_stat_fields = stripslashes(WDW_FM_Library(self::PLUGIN)->get('frontend_submit_stat_fields', ''));
849
+
850
+ if ( WDW_FM_Library(self::PLUGIN)->get('submit_text_type', 0) ) {
851
+ $submit_text_type = WDW_FM_Library(self::PLUGIN)->get('submit_text_type', 0);
852
+ if ( $submit_text_type == 5 ) {
853
+ $article_id = WDW_FM_Library(self::PLUGIN)->get('page_name', 0);
854
+ }
855
+ else {
856
+ $article_id = WDW_FM_Library(self::PLUGIN)->get('post_name', 0);
857
+ }
858
+ }
859
+ else {
860
+ $submit_text_type = 1;
861
+ $article_id = 0;
862
+ }
863
+
864
+ $privacy_arr = array(
865
+ 'gdpr_checkbox' => WDW_FM_Library(self::PLUGIN)->get('gdpr_checkbox', 0),
866
+ 'gdpr_checkbox_text' => WDW_FM_Library(self::PLUGIN)->get('gdpr_checkbox_text', __('I consent collecting this data and processing it according to {{privacy_policy}} of this website.', WDFMInstance(self::PLUGIN)->prefix)),
867
+ 'save_ip' => WDW_FM_Library(self::PLUGIN)->get('save_ip', 1),
868
+ 'save_user_id' => WDW_FM_Library(self::PLUGIN)->get('save_user_id', 1),
869
+ );
870
+
871
+ $privacy = json_encode($privacy_arr);
872
+
873
+
874
+ $data = array(
875
+ 'published' => $published,
876
+ 'savedb' => $savedb,
877
+ 'requiredmark' => $requiredmark,
878
+ 'save_uploads' => $save_uploads,
879
+ 'submit_text' => $submit_text,
880
+ 'url' => $url,
881
+ 'submit_text_type' => $submit_text_type,
882
+ 'article_id' => $article_id,
883
+ 'tax' => $tax,
884
+ 'payment_currency' => $payment_currency,
885
+ 'paypal_email' => $paypal_email,
886
+ 'checkout_mode' => $checkout_mode,
887
+ 'paypal_mode' => $paypal_mode,
888
+ 'javascript' => $javascript,
889
+ 'condition' => $condition,
890
+ 'user_id_wd' => $user_id_wd,
891
+ 'frontend_submit_fields' => $frontend_submit_fields,
892
+ 'frontend_submit_stat_fields' => $frontend_submit_stat_fields,
893
+ 'privacy' => $privacy,
894
+ );
895
+
896
+ $message_id = 2;
897
+ $save = $this->model->update_data('formmaker', $data, array( 'id' => $id ));
898
+ if ( $save !== FALSE ) {
899
+ $this->model->update_data( 'formmaker_backup', $data, array( 'id' => $id ) );
900
+ //save theme in backup
901
+ if ( WDFMInstance(self::PLUGIN)->is_free != 2 ) {
902
+ $save_addon = do_action('fm_save_addon_init', $id);
903
+ }
904
+ $this->model->create_js($id);
905
+ $message_id = 8;
906
+ }
907
+
908
+ return $message_id;
909
+ }
910
+
911
+ /**
912
+ * Form layout.
913
+ *
914
+ * @param int $id
915
+ */
916
+ public function form_layout( $id = 0 ) {
917
+ $ids = array();
918
+ $types = array();
919
+ $labels = array();
920
+
921
+ $row = $this->model->get_row_data( $id );
922
+ if ( empty($row) ) {
923
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
924
+ }
925
+ $fields = explode('*:*new_field*:*', $row->form_fields);
926
+ $fields = array_slice($fields, 0, count($fields) - 1);
927
+ foreach ( $fields as $field ) {
928
+ $temp = explode('*:*id*:*', $field);
929
+ array_push($ids, $temp[0]);
930
+ $temp = explode('*:*type*:*', $temp[1]);
931
+ array_push($types, $temp[0]);
932
+ $temp = explode('*:*w_field_label*:*', $temp[1]);
933
+ array_push($labels, $temp[0]);
934
+ }
935
+
936
+ // Set params for view.
937
+ $params = array();
938
+ $params['id'] = $id;
939
+ $params['row'] = $row;
940
+ $params['page'] = $this->page;
941
+ $params['page_url'] = $this->page_url;
942
+ $params['page_title'] = '"'. $row->title . '" ' . __('layout', WDFMInstance(self::PLUGIN)->prefix);
943
+ $params['back_url'] = add_query_arg( array ('page' => 'manage' . WDFMInstance(self::PLUGIN)->menu_postfix,'task' => 'edit','current_id' => $id ), admin_url('admin.php'));
944
+ $params['ids'] = $ids;
945
+ $params['types'] = $types;
946
+ $params['labels'] = $labels;
947
+ $this->view->form_layout($params);
948
+ }
949
+
950
+ /**
951
+ * Apply layout.
952
+ *
953
+ * @param int $id
954
+ */
955
+ public function apply_layout( $id = 0 ) {
956
+ $message = $this->save_db_layout( $id );
957
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'form_layout', 'current_id' => $id, 'message' => $message), admin_url('admin.php') ) );
958
+ }
959
+
960
+ /**
961
+ * Save db layout.
962
+ *
963
+ * @param int $id
964
+ * @return int $id_message
965
+ */
966
+ public function save_db_layout( $id = 0 ) {
967
+ $custom_front = WDW_FM_Library(self::PLUGIN)->get('custom_front', '', false);
968
+ $autogen_layout = WDW_FM_Library(self::PLUGIN)->get('autogen_layout', '');
969
+
970
+ $update = $this->model->update_data('formmaker', array(
971
+ 'custom_front' => $custom_front,
972
+ 'autogen_layout' => $autogen_layout,
973
+ ), array( 'id' => $id ));
974
+ if ( $update !== FALSE ) {
975
+ return 1;
976
+ }
977
+ else {
978
+ return 2;
979
+ }
980
+ }
981
+
982
+ public function display_options() {
983
+ $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', $this->model->get_max_row("formmaker", "id"));
984
+ $params = array();
985
+ $params['row_form'] = $this->model->get_row_data($id);
986
+ if ( empty($params['row_form']) ) {
987
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
988
+ }
989
+ $params['row'] = $this->model->get_display_options($id);
990
+ $row_data = $this->model->get_row_data( $id );
991
+ $params['row']->theme = $row_data->theme;
992
+ $params['page_title'] = '"'. $params['row_form']->title . '" ' . __('display options', WDFMInstance(self::PLUGIN)->prefix);
993
+ $params['animation_effects'] = $this->animation_effects;
994
+ $params['display_on_list'] = array('everything' => 'All', 'home' => 'Homepage', 'archive' => 'Archives', 'post' => 'Post', 'page' => 'Page');
995
+ $params['posts_and_pages'] = $this->model->fm_posts_query();
996
+ $params['categories'] = $this->model->fm_categories_query();
997
+ $params['selected_categories'] = explode(',', $params['row']->display_on_categories);
998
+ $params['current_categories_array'] = explode(',', $params['row']->current_categories);
999
+ $params['id'] = $id;
1000
+ $params['page'] = $this->page;
1001
+ $params['page_url'] = $this->page_url;
1002
+ $params['back_url'] = add_query_arg( array (
1003
+ 'page' => 'manage' . WDFMInstance(self::PLUGIN)->menu_postfix,
1004
+ 'task' => 'edit',
1005
+ 'current_id' => $id,
1006
+ ), admin_url('admin.php')
1007
+ );
1008
+ $params['themes'] = $this->model->get_theme_rows_data();
1009
+ $params['default_theme'] = $this->model->get_default_theme_id();
1010
+ $params['fieldset_id'] = WDW_FM_Library(self::PLUGIN)->get('fieldset_id', 'embedded');
1011
+ $this->view->display_options($params);
1012
+ }
1013
+
1014
+ public function save_display_options() {
1015
+ $message = $this->save_dis_options();
1016
+ $page = WDW_FM_Library(self::PLUGIN)->get('page');
1017
+
1018
+ $current_id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
1019
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1020
+ 'page' => $page,
1021
+ 'task' => 'edit',
1022
+ 'current_id' => $current_id,
1023
+ 'message' => $message,
1024
+ ), admin_url('admin.php')));
1025
+ }
1026
+
1027
+ public function apply_display_options($id = 0) {
1028
+ $message = $this->save_dis_options();
1029
+ $page = WDW_FM_Library(self::PLUGIN)->get('page');
1030
+ $fieldset_id = WDW_FM_Library(self::PLUGIN)->get('fieldset_id', 'embedded');
1031
+ $current_id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
1032
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1033
+ 'page' => $page,
1034
+ 'task' => 'display_options',
1035
+ 'current_id' => $id,
1036
+ 'fieldset_id'=> $fieldset_id,
1037
+ 'message' => $message,
1038
+ ), admin_url('admin.php')));
1039
+ }
1040
+
1041
+ /**
1042
+ * Remove query for MySQL Mapping.
1043
+ * @param int $id
1044
+ */
1045
+ public function remove_query( $id = 0 ) {
1046
+ $fieldset_id = WDW_FM_Library(self::PLUGIN)->get('fieldset_id', 'general');
1047
+ $query_id = WDW_FM_Library(self::PLUGIN)->get('query_id',0);
1048
+ $message = 2;
1049
+ if( $this->model->delete_formmaker_query( $query_id ) ) {
1050
+ $message = 3;
1051
+ }
1052
+
1053
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1054
+ 'page' => $this->page,
1055
+ 'task' => 'edit',
1056
+ 'current_id' => $id,
1057
+ 'fieldset_id' => $fieldset_id,
1058
+ 'message' => $message,
1059
+ ), admin_url('admin.php')));
1060
+ }
1061
+
1062
+ /**
1063
+ * Check if loading_delay or frequency is positive numbers
1064
+ *
1065
+ * @param int $delay
1066
+ * @return int
1067
+ */
1068
+ public function set_delay_freq_positive_val( $delay = 0 ) {
1069
+ if( $delay < 0 ) return 0;
1070
+ return $delay;
1071
+ }
1072
+
1073
+ public function save_dis_options() {
1074
+ $theme = (int) WDW_FM_Library(self::PLUGIN)->get('theme', $this->model->get_default_theme_id());
1075
+
1076
+ $option_data = array(
1077
+ 'form_id' => (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0),
1078
+ 'scrollbox_loading_delay' => $this->set_delay_freq_positive_val( WDW_FM_Library(self::PLUGIN)->get('scrollbox_loading_delay', 0) ),
1079
+ 'popover_animate_effect' => WDW_FM_Library(self::PLUGIN)->get('popover_animate_effect', ''),
1080
+ 'popover_loading_delay' => $this->set_delay_freq_positive_val( WDW_FM_Library(self::PLUGIN)->get('popover_loading_delay', 0) ),
1081
+ 'popover_frequency' => $this->set_delay_freq_positive_val( WDW_FM_Library(self::PLUGIN)->get('popover_frequency', 0) ),
1082
+ 'topbar_position' => WDW_FM_Library(self::PLUGIN)->get('topbar_position', 1),
1083
+ 'topbar_remain_top' => WDW_FM_Library(self::PLUGIN)->get('topbar_remain_top', 1),
1084
+ 'topbar_closing' => WDW_FM_Library(self::PLUGIN)->get('topbar_closing', 1),
1085
+ 'topbar_hide_duration' => $this->set_delay_freq_positive_val( WDW_FM_Library(self::PLUGIN)->get('topbar_hide_duration', 0) ),
1086
+ 'scrollbox_position' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_position', 1),
1087
+ 'scrollbox_trigger_point' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_trigger_point', 20),
1088
+ 'scrollbox_hide_duration' => $this->set_delay_freq_positive_val( WDW_FM_Library(self::PLUGIN)->get('scrollbox_hide_duration', 0)),
1089
+ 'scrollbox_auto_hide' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_auto_hide', 1),
1090
+ 'hide_mobile' => WDW_FM_Library(self::PLUGIN)->get('hide_mobile', 0),
1091
+ 'scrollbox_closing' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_closing', 1),
1092
+ 'scrollbox_minimize' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_minimize', 1),
1093
+ 'scrollbox_minimize_text' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_minimize_text', ''),
1094
+ 'type' => WDW_FM_Library(self::PLUGIN)->get('form_type', 'embadded'),
1095
+ 'display_on' => implode(',', WDW_FM_Library(self::PLUGIN)->get('display_on', array())),
1096
+ 'posts_include' => WDW_FM_Library(self::PLUGIN)->get('posts_include', ''),
1097
+ 'pages_include' => WDW_FM_Library(self::PLUGIN)->get('pages_include', ''),
1098
+ 'display_on_categories' => implode(',', WDW_FM_Library(self::PLUGIN)->get('display_on_categories', array())),
1099
+ 'current_categories' => WDW_FM_Library(self::PLUGIN)->get('current_categories', ''),
1100
+ 'show_for_admin' => WDW_FM_Library(self::PLUGIN)->get('show_for_admin', 0),
1101
+ );
1102
+
1103
+ $save = $this->model->replace_display_options($option_data);
1104
+ if ( $save !== FALSE ) {
1105
+ $this->model->update_data('formmaker_backup', array(
1106
+ 'type' => $option_data['type'],
1107
+ 'theme' => $theme,
1108
+ ), array( 'id' => $option_data['form_id'] ));
1109
+ $this->model->update_data('formmaker', array(
1110
+ 'type' => $option_data['type'],
1111
+ 'theme' => $theme,
1112
+ ), array( 'id' => $option_data['form_id'] ));
1113
+ $this->model->create_js($option_data['form_id']);
1114
+
1115
+ return 8;
1116
+ }
1117
+ else {
1118
+ return 2;
1119
+ }
1120
+ }
1121
+
1122
+ // TODO: remove this function.
1123
+ public function save_as_copy() {
1124
+ $message = $this->save_db_as_copy();
1125
+ $page = WDW_FM_Library(self::PLUGIN)->get('page');
1126
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1127
+ 'page' => $page,
1128
+ 'task' => 'display',
1129
+ 'message' => $message,
1130
+ ), admin_url('admin.php')));
1131
+ }
1132
+
1133
+ public function save() {
1134
+ $message = $this->save_db();
1135
+ $page = WDW_FM_Library(self::PLUGIN)->get('page');
1136
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1137
+ 'page' => $page,
1138
+ 'task' => 'display',
1139
+ 'message' => $message,
1140
+ ), admin_url('admin.php')));
1141
+ }
1142
+
1143
+ public function apply() {
1144
+ $tabs_loaded = json_decode(WDW_FM_Library(self::PLUGIN)->get('fm_tabs_loaded', '[]', false));
1145
+ $message = $this->save_db();
1146
+ $current_id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
1147
+ if ( !$current_id ) {
1148
+ $current_id = (int) $this->model->get_max_row('formmaker', 'id');
1149
+ }
1150
+ if (array_search('form_options_tab', $tabs_loaded) !== false) {
1151
+ $this->save_db_form_options($current_id);
1152
+ }
1153
+ if (array_search('form_display_tab', $tabs_loaded) !== false) {
1154
+ $this->save_dis_options();
1155
+ }
1156
+ if (array_search('form_layout_tab', $tabs_loaded) !== false) {
1157
+ $this->save_db_layout($current_id);
1158
+ }
1159
+ if (array_search('form_email_options_tab', $tabs_loaded) !== false) {
1160
+ $this->save_db_email_options($current_id);
1161
+ }
1162
+ $active_tab = WDW_FM_Library(self::PLUGIN)->get('fm_tab_active', 0);
1163
+ $fieldset_id = WDW_FM_Library(self::PLUGIN)->get('fieldset_id', 'general');
1164
+ $page = WDW_FM_Library(self::PLUGIN)->get('page');
1165
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1166
+ 'page' => $page,
1167
+ 'task' => 'edit',
1168
+ 'current_id' => $current_id,
1169
+ 'message' => $message,
1170
+ 'tab' => $active_tab,
1171
+ 'fieldset_id' => $fieldset_id,
1172
+ ), admin_url('admin.php')));
1173
+ }
1174
+
1175
+ public function save_db() {
1176
+ $javascript = "// Occurs before the form is loaded
1177
+ function before_load() {
1178
+ }
1179
+ // Occurs just before submitting the form
1180
+ function before_submit() {
1181
+ // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don't need to return any value if you don't want to stop the submission.
1182
+ }
1183
+ // Occurs just before resetting the form
1184
+ function before_reset() {
1185
+ }
1186
+ // Occurs after form is submitted and reloaded
1187
+ function after_submit() {
1188
+
1189
+ }";
1190
+ $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
1191
+ $title = WDW_FM_Library(self::PLUGIN)->get('title', '');
1192
+ $form_front = WDW_FM_Library(self::PLUGIN)->get('form_front', '', false);
1193
+ $sortable = WDW_FM_Library(self::PLUGIN)->get('sortable', 0);
1194
+ $counter = WDW_FM_Library(self::PLUGIN)->get('counter', 0);
1195
+ $label_order = WDW_FM_Library(self::PLUGIN)->get('label_order', '');
1196
+ $pagination = WDW_FM_Library(self::PLUGIN)->get('pagination', '');
1197
+ $show_title = WDW_FM_Library(self::PLUGIN)->get('show_title', '');
1198
+ $show_numbers = WDW_FM_Library(self::PLUGIN)->get('show_numbers', '');
1199
+ $public_key = WDW_FM_Library(self::PLUGIN)->get('public_key', '');
1200
+ $private_key = WDW_FM_Library(self::PLUGIN)->get('private_key', '');
1201
+ $recaptcha_theme = WDW_FM_Library(self::PLUGIN)->get('recaptcha_theme', '');
1202
+ $label_order_current = WDW_FM_Library(self::PLUGIN)->get('label_order_current', '');
1203
+ $form_fields = WDW_FM_Library(self::PLUGIN)->get('form_fields', '', false);
1204
+ $header_title = WDW_FM_Library(self::PLUGIN)->get('header_title', '');
1205
+ $header_description = WDW_FM_Library(self::PLUGIN)->get('header_description', '', FALSE);
1206
+ $header_image_url = WDW_FM_Library(self::PLUGIN)->get('header_image_url', '');
1207
+ $header_image_animation = WDW_FM_Library(self::PLUGIN)->get('header_image_animation', '');
1208
+ $header_hide_image = WDW_FM_Library(self::PLUGIN)->get('header_hide_image', 0);
1209
+ $header_hide = WDW_FM_Library(self::PLUGIN)->get('header_hide', 1);
1210
+ $type = WDW_FM_Library(self::PLUGIN)->get('form_type', 'embedded');
1211
+ $scrollbox_minimize_text = $header_title ? $header_title : 'The form is minimized.';
1212
+ if ( $id != 0 ) {
1213
+ $save = $this->model->update_data('formmaker', array(
1214
+ 'title' => $title,
1215
+ 'form_front' => $form_front,
1216
+ 'sortable' => $sortable,
1217
+ 'counter' => $counter,
1218
+ 'label_order' => $label_order,
1219
+ 'label_order_current' => $label_order_current,
1220
+ 'pagination' => $pagination,
1221
+ 'show_title' => $show_title,
1222
+ 'show_numbers' => $show_numbers,
1223
+ 'public_key' => $public_key,
1224
+ 'private_key' => $private_key,
1225
+ 'recaptcha_theme' => $recaptcha_theme,
1226
+ 'form_fields' => $form_fields,
1227
+ 'header_title' => $header_title,
1228
+ 'header_description' => $header_description,
1229
+ 'header_image_url' => $header_image_url,
1230
+ 'header_image_animation' => $header_image_animation,
1231
+ 'header_hide_image' => $header_hide_image,
1232
+ 'header_hide' => $header_hide,
1233
+ ), array( 'id' => $id ));
1234
+ }
1235
+ else {
1236
+ $theme = (int) WDW_FM_Library(self::PLUGIN)->get('theme', $this->model->get_default_theme_id());
1237
+ $this->model->insert_data_to_db('formmaker', array(
1238
+ 'title' => $title,
1239
+ 'type' => $type,
1240
+ 'mail' => '{adminemail}',
1241
+ 'form_front' => $form_front,
1242
+ 'theme' => $theme,
1243
+ 'counter' => $counter,
1244
+ 'label_order' => $label_order,
1245
+ 'pagination' => $pagination,
1246
+ 'show_title' => $show_title,
1247
+ 'show_numbers' => $show_numbers,
1248
+ 'public_key' => $public_key,
1249
+ 'private_key' => $private_key,
1250
+ 'recaptcha_theme' => $recaptcha_theme,
1251
+ 'javascript' => $javascript,
1252
+ 'submit_text' => '',
1253
+ 'url' => '',
1254
+ 'article_id' => 0,
1255
+ 'submit_text_type' => 1,
1256
+ 'script_mail' => '{all}',
1257
+ 'script_mail_user' => '{all}',
1258
+ 'label_order_current' => $label_order_current,
1259
+ 'tax' => 0,
1260
+ 'payment_currency' => '',
1261
+ 'paypal_email' => '',
1262
+ 'checkout_mode' => 'testmode',
1263
+ 'paypal_mode' => 0,
1264
+ 'published' => 1,
1265
+ 'form_fields' => $form_fields,
1266
+ 'savedb' => 1,
1267
+ 'sendemail' => 1,
1268
+ 'requiredmark' => '*',
1269
+ 'from_mail' => '{adminemail}',
1270
+ 'from_name' => '',
1271
+ 'reply_to' => '',
1272
+ 'send_to' => '',
1273
+ 'autogen_layout' => 1,
1274
+ 'custom_front' => '',
1275
+ 'mail_from_user' => '{adminemail}',
1276
+ 'mail_from_name_user' => '',
1277
+ 'reply_to_user' => '',
1278
+ 'condition' => '',
1279
+ 'mail_cc' => '',
1280
+ 'mail_cc_user' => '',
1281
+ 'mail_bcc' => '',
1282
+ 'mail_bcc_user' => '',
1283
+ 'mail_subject' => '',
1284
+ 'mail_subject_user' => '',
1285
+ 'mail_mode' => 1,
1286
+ 'mail_mode_user' => 1,
1287
+ 'mail_attachment' => 1,
1288
+ 'mail_attachment_user' => 1,
1289
+ 'sortable' => $sortable,
1290
+ 'user_id_wd' => 'administrator,',
1291
+ 'frontend_submit_fields' => '',
1292
+ 'frontend_submit_stat_fields' => '',
1293
+ 'save_uploads' => 1,
1294
+ 'header_title' => $header_title,
1295
+ 'header_description' => $header_description,
1296
+ 'header_image_url' => $header_image_url,
1297
+ 'header_image_animation' => $header_image_animation,
1298
+ 'header_hide_image' => $header_hide_image,
1299
+ 'header_hide' => $header_hide,
1300
+ 'privacy' => '',
1301
+ ));
1302
+ $id = (int) $this->model->get_max_row('formmaker', 'id');
1303
+ if (WDFMInstance(self::PLUGIN)->is_free == 2) {
1304
+ update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
1305
+ }
1306
+ $this->model->insert_data_to_db('formmaker_display_options', array(
1307
+ 'form_id' => $id,
1308
+ 'type' => $type,
1309
+ 'scrollbox_loading_delay' => 0,
1310
+ 'popover_animate_effect' => '',
1311
+ 'popover_loading_delay' => 0,
1312
+ 'popover_frequency' => 0,
1313
+ 'topbar_position' => 1,
1314
+ 'topbar_remain_top' => 1,
1315
+ 'topbar_closing' => 1,
1316
+ 'topbar_hide_duration' => 0,
1317
+ 'scrollbox_position' => 1,
1318
+ 'scrollbox_trigger_point' => 20,
1319
+ 'scrollbox_hide_duration' => 0,
1320
+ 'scrollbox_auto_hide' => 1,
1321
+ 'hide_mobile' => 0,
1322
+ 'scrollbox_closing' => 1,
1323
+ 'scrollbox_minimize' => 1,
1324
+ 'scrollbox_minimize_text' => $scrollbox_minimize_text,
1325
+ 'display_on' => 'home,post,page',
1326
+ 'posts_include' => '',
1327
+ 'pages_include' => '',
1328
+ 'display_on_categories' => 'select_all_categories',
1329
+ 'current_categories' => 'select_all_categories',
1330
+ 'show_for_admin' => 0,
1331
+ ));
1332
+ $this->model->insert_data_to_db('formmaker_views', array(
1333
+ 'form_id' => $id,
1334
+ 'views' => 0,
1335
+ ));
1336
+ }
1337
+ $backup_id = (int) WDW_FM_Library(self::PLUGIN)->get('backup_id', '');
1338
+ if ( $backup_id ) {
1339
+ // Set cur 0 before add new current
1340
+ $this->model->update_data('formmaker_backup', array( 'cur' => 0 ), array( 'id' => $id ));
1341
+ // Get form_fields, form_front
1342
+ $row1 = $this->model->select_rows("get_row", array(
1343
+ "selection" => "form_fields, form_front",
1344
+ "table" => "formmaker_backup",
1345
+ "where" => "backup_id = " . $backup_id,
1346
+ ));
1347
+ if ( $row1->form_fields == $form_fields and $row1->form_front == $form_front ) {
1348
+ $save = $this->model->update_data('formmaker_backup', array(
1349
+ 'cur' => 1,
1350
+ 'title' => $title,
1351
+ 'form_front' => $form_front,
1352
+ 'sortable' => $sortable,
1353
+ 'counter' => $counter,
1354
+ 'label_order' => $label_order,
1355
+ 'label_order_current' => $label_order_current,
1356
+ 'pagination' => $pagination,
1357
+ 'show_title' => $show_title,
1358
+ 'show_numbers' => $show_numbers,
1359
+ 'public_key' => $public_key,
1360
+ 'private_key' => $private_key,
1361
+ 'recaptcha_theme' => $recaptcha_theme,
1362
+ 'form_fields' => $form_fields,
1363
+ 'header_title' => $header_title,
1364
+ 'header_description' => $header_description,
1365
+ 'header_image_url' => $header_image_url,
1366
+ 'header_image_animation' => $header_image_animation,
1367
+ 'header_hide_image' => $header_hide_image,
1368
+ 'header_hide' => $header_hide,
1369
+ ), array( 'backup_id' => $backup_id ));
1370
+ if ( $save !== FALSE ) {
1371
+ $this->model->create_js($id);
1372
+
1373
+ return 1;
1374
+ }
1375
+ else {
1376
+ return 2;
1377
+ }
1378
+ }
1379
+ }
1380
+ $this->model->update_data('formmaker_backup', array( 'cur' => 0 ), array( 'id' => $id ));
1381
+ $fm_cur_date = current_time('timestamp');
1382
+ $save = $this->model->insert_data_to_db('formmaker_backup', array(
1383
+ 'cur' => 1,
1384
+ 'id' => $id,
1385
+ 'title' => $title,
1386
+ 'mail' => '',
1387
+ 'form_front' => $form_front,
1388
+ 'counter' => $counter,
1389
+ 'label_order' => $label_order,
1390
+ 'pagination' => $pagination,
1391
+ 'show_title' => $show_title,
1392
+ 'show_numbers' => $show_numbers,
1393
+ 'public_key' => $public_key,
1394
+ 'private_key' => $private_key,
1395
+ 'recaptcha_theme' => $recaptcha_theme,
1396
+ 'javascript' => $javascript,
1397
+ 'submit_text' => '',
1398
+ 'url' => '',
1399
+ 'article_id' => 0,
1400
+ 'submit_text_type' => 1,
1401
+ 'script_mail' => '{all}',
1402
+ 'script_mail_user' => '{all}',
1403
+ 'label_order_current' => $label_order_current,
1404
+ 'tax' => 0,
1405
+ 'payment_currency' => '',
1406
+ 'paypal_email' => '',
1407
+ 'checkout_mode' => 'testmode',
1408
+ 'paypal_mode' => 0,
1409
+ 'published' => 1,
1410
+ 'form_fields' => $form_fields,
1411
+ 'savedb' => 1,
1412
+ 'sendemail' => 1,
1413
+ 'requiredmark' => '*',
1414
+ 'from_mail' => '',
1415
+ 'from_name' => '',
1416
+ 'reply_to' => '',
1417
+ 'send_to' => '',
1418
+ 'autogen_layout' => 1,
1419
+ 'custom_front' => '',
1420
+ 'mail_from_user' => '',
1421
+ 'mail_from_name_user' => '',
1422
+ 'reply_to_user' => '',
1423
+ 'condition' => '',
1424
+ 'mail_cc' => '',
1425
+ 'mail_cc_user' => '',
1426
+ 'mail_bcc' => '',
1427
+ 'mail_bcc_user' => '',
1428
+ 'mail_subject' => '',
1429
+ 'mail_subject_user' => '',
1430
+ 'mail_mode' => 1,
1431
+ 'mail_mode_user' => 1,
1432
+ 'mail_attachment' => 1,
1433
+ 'mail_attachment_user' => 1,
1434
+ 'sortable' => $sortable,
1435
+ 'user_id_wd' => 'administrator,',
1436
+ 'frontend_submit_fields' => '',
1437
+ 'frontend_submit_stat_fields' => '',
1438
+ 'header_title' => $header_title,
1439
+ 'header_description' => $header_description,
1440
+ 'header_image_url' => $header_image_url,
1441
+ 'header_image_animation' => $header_image_animation,
1442
+ 'header_hide_image' => $header_hide_image,
1443
+ 'header_hide' => $header_hide,
1444
+ 'privacy' => '',
1445
+ 'date' => $fm_cur_date,
1446
+ ));
1447
+
1448
+ if ( $save !== FALSE ) {
1449
+ $this->model->create_js($id);
1450
+ return 1;
1451
+ }
1452
+ else {
1453
+ return 2;
1454
+ }
1455
+ }
1456
+
1457
+ public function fm_live_search() {
1458
+ $search_string = !empty($_POST['pp_live_search']) ? sanitize_text_field($_POST['pp_live_search']) : '';
1459
+ $post_type = !empty($_POST['pp_post_type']) ? sanitize_text_field($_POST['pp_post_type']) : 'any';
1460
+ $full_content = !empty($_POST['pp_full_content']) ? sanitize_text_field($_POST['pp_full_content']) : 'true';
1461
+ $args['s'] = $search_string;
1462
+ $results = $this->fm_posts_query($args, $post_type);
1463
+ $output = '<ul class="pp_search_results">';
1464
+ if ( empty($results) ) {
1465
+ $output .= sprintf('<li class="pp_no_res">%1$s</li>', esc_html__('No results found', 'fm-text'));
1466
+ }
1467
+ else {
1468
+ foreach ( $results as $single_post ) {
1469
+ $output .= sprintf('<li data-post_id="%2$s">[%3$s] - %1$s</li>', esc_html($single_post['title']), esc_attr($single_post['id']), esc_html($single_post['post_type']));
1470
+ }
1471
+ }
1472
+ $output .= '</ul>';
1473
+ die($output);
1474
+ }
1475
+
1476
+ /**
1477
+ * @param array $args
1478
+ * @param string $include_post_type
1479
+ * @return array|bool
1480
+ */
1481
+ public function fm_posts_query( $args = array(), $include_post_type = '' ) {
1482
+ if ( 'only_pages' === $include_post_type ) {
1483
+ $post_type = array('page');
1484
+ }
1485
+ elseif ( 'any' === $include_post_type || 'only_posts' === $include_post_type ) {
1486
+ $post_type = array('post');
1487
+ }
1488
+ else {
1489
+ $post_type = $include_post_type;
1490
+ }
1491
+ $query = array(
1492
+ 'post_type' => $post_type,
1493
+ 'suppress_filters' => TRUE,
1494
+ 'update_post_term_cache' => FALSE,
1495
+ 'update_post_meta_cache' => FALSE,
1496
+ 'post_status' => 'publish',
1497
+ 'posts_per_page' => -1,
1498
+ );
1499
+ if ( isset($args['s']) ) {
1500
+ $query['s'] = $args['s'];
1501
+ }
1502
+ $get_posts = new WP_Query;
1503
+ $posts = $get_posts->query($query);
1504
+ if ( !$get_posts->post_count ) {
1505
+ return FALSE;
1506
+ }
1507
+ $results = array();
1508
+ foreach ( $posts as $post ) {
1509
+ $results[] = array(
1510
+ 'id' => (int) $post->ID,
1511
+ 'title' => trim(esc_html(strip_tags(get_the_title($post)))),
1512
+ 'post_type' => $post->post_type,
1513
+ );
1514
+ }
1515
+ wp_reset_postdata();
1516
+
1517
+ return $results;
1518
+ }
1519
+
1520
+ /**
1521
+ * @param int $id
1522
+ * @return int
1523
+ */
1524
+ public function update_form_title( $id = 0 ) {
1525
+ $page = WDW_FM_Library(self::PLUGIN)->get('page');
1526
+ $form_name = WDW_FM_Library(self::PLUGIN)->get('form_name', '');
1527
+
1528
+ // check id for db
1529
+ if(isset($id) && $id != "") {
1530
+ $id = intval($id);
1531
+ $update = $this->model->update_data( "forms", array('title' => $form_name,), array('id' => $id) );
1532
+ if( !$update ){
1533
+ $message = 2;
1534
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1535
+ 'page' => $page,
1536
+ 'task' => 'display',
1537
+ 'message' => $message,
1538
+ ), admin_url('admin.php')));
1539
+ }
1540
+
1541
+ }
1542
+ else { // return message Failed
1543
+ $message = 2;
1544
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
1545
+ 'page' => $page,
1546
+ 'task' => 'display',
1547
+ 'message' => $message,
1548
+ ), admin_url('admin.php')));
1549
+ }
1550
+
1551
+ return $message = 1;
1552
+ }
1553
+
1554
+ /**
1555
+ * Get stripe addon.
1556
+ *
1557
+ * @param int $id
1558
+ * @return array $data
1559
+ */
1560
+ private function get_stripe_addon( $id = 0 ) {
1561
+ return apply_filters('fm_stripe_display_init', array('form_id' => $id) );
1562
+ }
1563
+ }
 
admin/controllers/Options_fm.php CHANGED
@@ -1,44 +1,44 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerOptions_fmc
5
- */
6
- class FMControllerOptions_fmc extends CFMAdminController {
7
-
8
- private $model;
9
- private $view;
10
-
11
- public function __construct() {
12
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Options_fm.php";
13
- $this->model = new FMModelOptions_fmc();
14
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Options_fm.php";
15
- $this->view = new FMViewOptions_fmc();
16
- }
17
-
18
- public function execute() {
19
- $task = WDW_FM_Library(self::PLUGIN)->get('task');
20
- $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
21
- if ( method_exists($this, $task) ) {
22
- check_admin_referer(WDFMInstance(self::PLUGIN)->nonce, WDFMInstance(self::PLUGIN)->nonce);
23
- $this->$task($id);
24
- }
25
- else {
26
- $this->display();
27
- }
28
- }
29
-
30
- public function display() {
31
- $fm_settings = get_option(WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
32
- $this->view->display($fm_settings);
33
- }
34
-
35
- public function save() {
36
- $message = $this->model->save_db();
37
- $page = WDW_FM_Library(self::PLUGIN)->get('page');
38
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
39
- 'page' => $page,
40
- 'task' => 'display',
41
- 'message' => $message,
42
- ), admin_url('admin.php')));
43
- }
44
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerOptions_fmc
5
+ */
6
+ class FMControllerOptions_fmc extends CFMAdminController {
7
+
8
+ private $model;
9
+ private $view;
10
+
11
+ public function __construct() {
12
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Options_fm.php";
13
+ $this->model = new FMModelOptions_fmc();
14
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Options_fm.php";
15
+ $this->view = new FMViewOptions_fmc();
16
+ }
17
+
18
+ public function execute() {
19
+ $task = WDW_FM_Library(self::PLUGIN)->get('task');
20
+ $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
21
+ if ( method_exists($this, $task) ) {
22
+ check_admin_referer(WDFMInstance(self::PLUGIN)->nonce, WDFMInstance(self::PLUGIN)->nonce);
23
+ $this->$task($id);
24
+ }
25
+ else {
26
+ $this->display();
27
+ }
28
+ }
29
+
30
+ public function display() {
31
+ $fm_settings = WDFMInstance(self::PLUGIN)->fm_settings;
32
+ $this->view->display($fm_settings);
33
+ }
34
+
35
+ public function save() {
36
+ $message = $this->model->save_db();
37
+ $page = WDW_FM_Library(self::PLUGIN)->get('page');
38
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
39
+ 'page' => $page,
40
+ 'task' => 'display',
41
+ 'message' => $message,
42
+ ), admin_url('admin.php')));
43
+ }
44
+ }
admin/controllers/Paypal_info.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
-
3
- class FMControllerPaypal_info extends CFMAdminController {
4
- /**
5
- * @var $model
6
- */
7
- private $model;
8
- /**
9
- * @var $view
10
- */
11
- private $view;
12
-
13
- /**
14
- * Execute.
15
- */
16
- public function execute() {
17
- $this->display();
18
- }
19
-
20
- /**
21
- * Display.
22
- */
23
- public function display() {
24
- // Load FMModelPaypal_info class.
25
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/FMPaypalInfo.php";
26
- $this->model = new FMModelPaypal_info();
27
- // Load FMViewPaypal_info class.
28
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMPaypalInfo.php";
29
- $this->view = new FMViewPaypal_info();
30
- $id = WDW_FM_Library(self::PLUGIN)->get('id', 0);
31
- // Get form session by id.
32
- $row = $this->model->get_form_session($id);
33
- // Set params for view.
34
- $params = array();
35
- $params['row'] = $row;
36
- $this->view->display($params);
37
- }
38
- }
1
+ <?php
2
+
3
+ class FMControllerPaypal_info extends CFMAdminController {
4
+ /**
5
+ * @var $model
6
+ */
7
+ private $model;
8
+ /**
9
+ * @var $view
10
+ */
11
+ private $view;
12
+
13
+ /**
14
+ * Execute.
15
+ */
16
+ public function execute() {
17
+ $this->display();
18
+ }
19
+
20
+ /**
21
+ * Display.
22
+ */
23
+ public function display() {
24
+ // Load FMModelPaypal_info class.
25
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/FMPaypalInfo.php";
26
+ $this->model = new FMModelPaypal_info();
27
+ // Load FMViewPaypal_info class.
28
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMPaypalInfo.php";
29
+ $this->view = new FMViewPaypal_info();
30
+ $id = WDW_FM_Library(self::PLUGIN)->get('id', 0);
31
+ // Get form session by id.
32
+ $row = $this->model->get_form_session($id);
33
+ // Set params for view.
34
+ $params = array();
35
+ $params['row'] = $row;
36
+ $this->view->display($params);
37
+ }
38
+ }
admin/controllers/Pricing_fm.php CHANGED
@@ -1,54 +1,54 @@
1
- <?php
2
- /**
3
- * Class FMControllerPricing_fmc
4
- */
5
- class FMControllerPricing_fmc extends CFMAdminController {
6
- /**
7
- * @var $model
8
- */
9
- private $model;
10
- /**
11
- * @var $view
12
- */
13
- private $view;
14
- /**
15
- * @var string $page
16
- */
17
- private $page;
18
-
19
- public function __construct() {
20
- $this->page = WDW_FM_Library(self::PLUGIN)->get('page');
21
- $this->page_url = add_query_arg( array (
22
- 'page' => $this->page,
23
- WDFMInstance(self::PLUGIN)->nonce => wp_create_nonce(WDFMInstance(self::PLUGIN)->nonce),
24
- ), admin_url('admin.php')
25
- );
26
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Pricing_fm.php";
27
- $this->view = new FMViewpricing_fmc();
28
- }
29
-
30
- /**
31
- * Execute.
32
- */
33
- public function execute() {
34
- $task = WDW_FM_Library(self::PLUGIN)->get('task');
35
- $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
36
- if (method_exists($this, $task)) {
37
- $this->$task($id);
38
- }
39
- else {
40
- $this->display();
41
- }
42
- }
43
-
44
- /**
45
- * Display.
46
- */
47
- public function display() {
48
- // Set params for view.
49
- $params = array();
50
- $params['page'] = $this->page;
51
- $params['page_url'] = $this->page_url;
52
- $this->view->display( $params );
53
- }
54
  }
1
+ <?php
2
+ /**
3
+ * Class FMControllerPricing_fmc
4
+ */
5
+ class FMControllerPricing_fmc extends CFMAdminController {
6
+ /**
7
+ * @var $model
8
+ */
9
+ private $model;
10
+ /**
11
+ * @var $view
12
+ */
13
+ private $view;
14
+ /**
15
+ * @var string $page
16
+ */
17
+ private $page;
18
+
19
+ public function __construct() {
20
+ $this->page = WDW_FM_Library(self::PLUGIN)->get('page');
21
+ $this->page_url = add_query_arg( array (
22
+ 'page' => $this->page,
23
+ WDFMInstance(self::PLUGIN)->nonce => wp_create_nonce(WDFMInstance(self::PLUGIN)->nonce),
24
+ ), admin_url('admin.php')
25
+ );
26
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Pricing_fm.php";
27
+ $this->view = new FMViewpricing_fmc();
28
+ }
29
+
30
+ /**
31
+ * Execute.
32
+ */
33
+ public function execute() {
34
+ $task = WDW_FM_Library(self::PLUGIN)->get('task');
35
+ $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
36
+ if (method_exists($this, $task)) {
37
+ $this->$task($id);
38
+ }
39
+ else {
40
+ $this->display();
41
+ }
42
+ }
43
+
44
+ /**
45
+ * Display.
46
+ */
47
+ public function display() {
48
+ // Set params for view.
49
+ $params = array();
50
+ $params['page'] = $this->page;
51
+ $params['page_url'] = $this->page_url;
52
+ $this->view->display( $params );
53
+ }
54
  }
admin/controllers/Product_option.php CHANGED
@@ -1,36 +1,36 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerProduct_option
5
- */
6
- class FMControllerProduct_option extends CFMAdminController {
7
- /**
8
- * @var $view
9
- */
10
- private $view;
11
-
12
- /**
13
- * Execute.
14
- */
15
- public function execute() {
16
- $this->display();
17
- }
18
-
19
- /**
20
- * Display.
21
- */
22
- public function display() {
23
- // Load FMViewProduct_option class.
24
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMProductOption.php";
25
- $this->view = new FMViewProduct_option();
26
- $field_id = WDW_FM_Library(self::PLUGIN)->get('field_id', 0);
27
- $property_id = WDW_FM_Library(self::PLUGIN)->get('property_id', '-1');
28
- $url_for_ajax = WDW_FM_Library(self::PLUGIN)->get('url_for_ajax', '');
29
- // Set params for view.
30
- $params = array();
31
- $params['field_id'] = $field_id;
32
- $params['property_id'] = $property_id;
33
- $params['url_for_ajax'] = $url_for_ajax;
34
- $this->view->display($params);
35
- }
36
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerProduct_option
5
+ */
6
+ class FMControllerProduct_option extends CFMAdminController {
7
+ /**
8
+ * @var $view
9
+ */
10
+ private $view;
11
+
12
+ /**
13
+ * Execute.
14
+ */
15
+ public function execute() {
16
+ $this->display();
17
+ }
18
+
19
+ /**
20
+ * Display.
21
+ */
22
+ public function display() {
23
+ // Load FMViewProduct_option class.
24
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMProductOption.php";
25
+ $this->view = new FMViewProduct_option();
26
+ $field_id = WDW_FM_Library(self::PLUGIN)->get('field_id', 0);
27
+ $property_id = WDW_FM_Library(self::PLUGIN)->get('property_id', '-1');
28
+ $url_for_ajax = WDW_FM_Library(self::PLUGIN)->get('url_for_ajax', '');
29
+ // Set params for view.
30
+ $params = array();
31
+ $params['field_id'] = $field_id;
32
+ $params['property_id'] = $property_id;
33
+ $params['url_for_ajax'] = $url_for_ajax;
34
+ $this->view->display($params);
35
+ }
36
+ }
admin/controllers/Select_data_from_db.php CHANGED
@@ -1,105 +1,105 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerSelect_data_from_db_fmc
5
- */
6
- class FMControllerSelect_data_from_db_fmc extends CFMAdminController {
7
- /**
8
- * @var $model
9
- */
10
- private $model;
11
- /**
12
- * @var $view
13
- */
14
- private $view;
15
-
16
- public function __construct() {
17
- // Load FMModelSelect_data_from_db class.
18
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/FMSelectDataFromDb.php";
19
- $this->model = new FMModelSelect_data_from_db_fmc();
20
- // Load FMViewSelect_data_from_db class.
21
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMSelectDataFromDb.php";
22
- $this->view = new FMViewSelect_data_from_db_fmc();
23
- }
24
-
25
- /**
26
- * Execute.
27
- */
28
- public function execute() {
29
- $task = WDW_FM_Library(self::PLUGIN)->get('task', 0);
30
- $id = WDW_FM_Library(self::PLUGIN)->get('id', 0);
31
- $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
32
- $field_id = WDW_FM_Library(self::PLUGIN)->get('field_id', 0);
33
- $value_disabled = WDW_FM_Library(self::PLUGIN)->get('value_disabled', 0);
34
- $field_type = WDW_FM_Library(self::PLUGIN)->get('field_type', '');
35
- if ( $task && method_exists($this, $task) ) {
36
- $this->$task($form_id, $field_type = "");
37
- }
38
- else {
39
- $this->display($id, $form_id, $field_id, $field_type, $value_disabled);
40
- }
41
- }
42
-
43
- /**
44
- * Display.
45
- *
46
- * @param int $id
47
- * @param int $form_id
48
- * @param int $field_id
49
- * @param string $field_type
50
- * @param int $value_disabled
51
- */
52
- public function display( $id = 0, $form_id = 0, $field_id = 0, $field_type = '', $value_disabled = 0 ) {
53
- // Set params for view.
54
- $params = array();
55
- $params['id'] = $id;
56
- $params['form_id'] = $form_id;
57
- $params['field_id'] = $field_id;
58
- $params['field_type'] = $field_type;
59
- $params['value_disabled'] = $value_disabled;
60
- $this->view->display($params);
61
- }
62
-
63
- /**
64
- * Data base tables.
65
- *
66
- * @param int $form_id
67
- * @param string $field_type
68
- */
69
- public function db_tables( $form_id = 0, $field_type = '' ) {
70
- // Get tables.
71
- $tables = $this->model->get_tables();
72
- // Set params for view.
73
- $params = array();
74
- $params['form_id'] = $form_id;
75
- $params['field_type'] = $field_type;
76
- $params['tables'] = $tables;
77
- $this->view->db_tables($params);
78
- }
79
-
80
- public function db_table_struct_select( $form_id = 0, $field_type = '' ) {
81
- // Get labels by form id.
82
- $label = $this->model->get_labels($form_id);
83
- // Get table struct.
84
- $table_struct = $this->model->get_table_struct();
85
- // Set params for view.
86
- $params = array();
87
- $params['form_id'] = $form_id;
88
- $params['field_type'] = $field_type;
89
- $params['label'] = $label;
90
- $params['table_struct'] = $table_struct;
91
- // Set placeholders.
92
- $user_fields = array(
93
- "ip" => "Submitter's IP",
94
- "userid" => "User ID",
95
- "username" => "Username",
96
- "useremail" => "User Email"
97
- );
98
- $html_placeholders = '';
99
- foreach ( $user_fields as $user_key => $user_field ) {
100
- $html_placeholders .= '<a onclick="insert_placeholder(\'' . $user_key . '\'); jQuery(\'#fm-placeholder\').hide();" style="display:block; text-decoration:none;">' . $user_field . "</a>\r\n";
101
- }
102
- $params['html_placeholders'] = $html_placeholders;
103
- $this->view->db_table_struct_select($params);
104
- }
105
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerSelect_data_from_db_fmc
5
+ */
6
+ class FMControllerSelect_data_from_db_fmc extends CFMAdminController {
7
+ /**
8
+ * @var $model
9
+ */
10
+ private $model;
11
+ /**
12
+ * @var $view
13
+ */
14
+ private $view;
15
+
16
+ public function __construct() {
17
+ // Load FMModelSelect_data_from_db class.
18
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/FMSelectDataFromDb.php";
19
+ $this->model = new FMModelSelect_data_from_db_fmc();
20
+ // Load FMViewSelect_data_from_db class.
21
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMSelectDataFromDb.php";
22
+ $this->view = new FMViewSelect_data_from_db_fmc();
23
+ }
24
+
25
+ /**
26
+ * Execute.
27
+ */
28
+ public function execute() {
29
+ $task = WDW_FM_Library(self::PLUGIN)->get('task', 0);
30
+ $id = WDW_FM_Library(self::PLUGIN)->get('id', 0);
31
+ $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
32
+ $field_id = WDW_FM_Library(self::PLUGIN)->get('field_id', 0);
33
+ $value_disabled = WDW_FM_Library(self::PLUGIN)->get('value_disabled', 0);
34
+ $field_type = WDW_FM_Library(self::PLUGIN)->get('field_type', '');
35
+ if ( $task && method_exists($this, $task) ) {
36
+ $this->$task($form_id, $field_type = "");
37
+ }
38
+ else {
39
+ $this->display($id, $form_id, $field_id, $field_type, $value_disabled);
40
+ }
41
+ }
42
+
43
+ /**
44
+ * Display.
45
+ *
46
+ * @param int $id
47
+ * @param int $form_id
48
+ * @param int $field_id
49
+ * @param string $field_type
50
+ * @param int $value_disabled
51
+ */
52
+ public function display( $id = 0, $form_id = 0, $field_id = 0, $field_type = '', $value_disabled = 0 ) {
53
+ // Set params for view.
54
+ $params = array();
55
+ $params['id'] = $id;
56
+ $params['form_id'] = $form_id;
57
+ $params['field_id'] = $field_id;
58
+ $params['field_type'] = $field_type;
59
+ $params['value_disabled'] = $value_disabled;
60
+ $this->view->display($params);
61
+ }
62
+
63
+ /**
64
+ * Data base tables.
65
+ *
66
+ * @param int $form_id
67
+ * @param string $field_type
68
+ */
69
+ public function db_tables( $form_id = 0, $field_type = '' ) {
70
+ // Get tables.
71
+ $tables = $this->model->get_tables();
72
+ // Set params for view.
73
+ $params = array();
74
+ $params['form_id'] = $form_id;
75
+ $params['field_type'] = $field_type;
76
+ $params['tables'] = $tables;
77
+ $this->view->db_tables($params);
78
+ }
79
+
80
+ public function db_table_struct_select( $form_id = 0, $field_type = '' ) {
81
+ // Get labels by form id.
82
+ $label = $this->model->get_labels($form_id);
83
+ // Get table struct.
84
+ $table_struct = $this->model->get_table_struct();
85
+ // Set params for view.
86
+ $params = array();
87
+ $params['form_id'] = $form_id;
88
+ $params['field_type'] = $field_type;
89
+ $params['label'] = $label;
90
+ $params['table_struct'] = $table_struct;
91
+ // Set placeholders.
92
+ $user_fields = array(
93
+ "ip" => "Submitter's IP",
94
+ "userid" => "User ID",
95
+ "username" => "Username",
96
+ "useremail" => "User Email"
97
+ );
98
+ $html_placeholders = '';
99
+ foreach ( $user_fields as $user_key => $user_field ) {
100
+ $html_placeholders .= '<a onclick="insert_placeholder(\'' . $user_key . '\'); jQuery(\'#fm-placeholder\').hide();" style="display:block; text-decoration:none;">' . $user_field . "</a>\r\n";
101
+ }
102
+ $params['html_placeholders'] = $html_placeholders;
103
+ $this->view->db_table_struct_select($params);
104
+ }
105
+ }
admin/controllers/Show_matrix.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
-
3
- class FMControllerShow_matrix_fmc extends CFMAdminController {
4
- /**
5
- * @var $view
6
- */
7
- private $view;
8
-
9
- /**
10
- * Execute.
11
- */
12
- public function execute() {
13
- $this->display();
14
- }
15
-
16
- /**
17
- * Display.
18
- */
19
- public function display() {
20
- // Load FMViewShow_matrix class.
21
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMShowMatrix.php";
22
- $this->view = new FMViewShow_matrix_fmc();
23
- // Set params for view.
24
- $params = array();
25
- $this->view->display($params);
26
- }
27
- }
1
+ <?php
2
+
3
+ class FMControllerShow_matrix_fmc extends CFMAdminController {
4
+ /**
5
+ * @var $view
6
+ */
7
+ private $view;
8
+
9
+ /**
10
+ * Execute.
11
+ */
12
+ public function execute() {
13
+ $this->display();
14
+ }
15
+
16
+ /**
17
+ * Display.
18
+ */
19
+ public function display() {
20
+ // Load FMViewShow_matrix class.
21
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMShowMatrix.php";
22
+ $this->view = new FMViewShow_matrix_fmc();
23
+ // Set params for view.
24
+ $params = array();
25
+ $this->view->display($params);
26
+ }
27
+ }
admin/controllers/Submissions_fm.php CHANGED
@@ -1,643 +1,642 @@
1
- <?php
2
- /**
3
- * Class FMControllerSubmissions_fmc
4
- */
5
- class FMControllerSubmissions_fmc extends CFMAdminController {
6
- /**
7
- * @var $model
8
- */
9
- private $model;
10
- /**
11
- * @var $view
12
- */
13
- private $view;
14
- /**
15
- * @var string $page
16
- */
17
- private $page;
18
- /**
19
- * @var string $bulk_action_name
20
- */
21
- private $bulk_action_name;
22
- /**
23
- * @var string $page_url
24
- */
25
- private $page_url;
26
- /**
27
- * @var int $page_per_num
28
- */
29
- private $page_per_num = 20;
30
- /**
31
- * @var array $actions
32
- */
33
- private $actions = array();
34
-
35
- public function __construct() {
36
- // Load FMModelSubmissions_fm class.
37
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Submissions_fm.php";
38
- $this->model = new FMModelSubmissions_fmc();
39
- // Load FMViewSubmissions_fm class.
40
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Submissions_fm.php";
41
- $this->view = new FMViewSubmissions_fmc($this->model);
42
-
43
- $this->page = WDW_FM_Library(self::PLUGIN)->get('page');
44
- $this->page_url = add_query_arg( array (
45
- 'page' => $this->page,
46
- WDFMInstance(self::PLUGIN)->nonce => wp_create_nonce(WDFMInstance(self::PLUGIN)->nonce),
47
- ), admin_url('admin.php')
48
- );
49
-
50
- $this->bulk_action_name = 'bulk_action';
51
- $this->actions = array(
52
- 'block_ip' => array(
53
- 'title' => __('Block IPs', WDFMInstance(self::PLUGIN)->prefix),
54
- $this->bulk_action_name => __('Blocked', WDFMInstance(self::PLUGIN)->prefix),
55
- ),
56
- 'unblock_ip' => array(
57
- 'title' => __('Unblock IPs', WDFMInstance(self::PLUGIN)->prefix),
58
- $this->bulk_action_name => __('Unblocked', WDFMInstance(self::PLUGIN)->prefix),
59
- ),
60
- 'delete' => array(
61
- 'title' => __('Delete', WDFMInstance(self::PLUGIN)->prefix),
62
- $this->bulk_action_name => __('Deleted', WDFMInstance(self::PLUGIN)->prefix),
63
- ),
64
- );
65
-
66
- $user = get_current_user_id();
67
- $screen = get_current_screen();
68
- if ( !empty($user) && !empty($screen) ) {
69
- $option = $screen->get_option('per_page', 'option');
70
- $per_page = get_user_meta($user, $option, true);
71
- if ( $per_page ) {
72
- $this->page_per_num = $per_page;
73
- }
74
- }
75
- }
76
-
77
- /**
78
- * Execute.
79
- */
80
- public function execute() {
81
- $task = WDW_FM_Library(self::PLUGIN)->get('task');
82
- $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
83
- if ( method_exists($this, $task) ) {
84
- if ( $task != 'display' ) {
85
- check_admin_referer(WDFMInstance(self::PLUGIN)->nonce, WDFMInstance(self::PLUGIN)->nonce);
86
- }
87
- $block_action = $this->bulk_action_name;
88
- $action = WDW_FM_Library(self::PLUGIN)->get( $block_action , -1 );
89
- if ( $action != -1 ) {
90
- $this->$block_action($action);
91
- }
92
- else {
93
- $this->$task($id);
94
- }
95
- }
96
- else {
97
- $this->forms($id);
98
- }
99
- }
100
-
101
- /**
102
- * Bulk actions.
103
- *
104
- * @param string $task
105
- */
106
- public function bulk_action( $task = '' ) {
107
- $paged = (int) WDW_FM_Library(self::PLUGIN)->get('current_page', 1);
108
- $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
109
- $check = WDW_FM_Library(self::PLUGIN)->get('check', '');
110
-
111
- $message = 0;
112
- $successfully_updated = 0;
113
-
114
- if ( $check ) {
115
- foreach ( $check as $id => $item ) {
116
- if ( method_exists($this, $task) ) {
117
- $message = $this->$task($id, TRUE);
118
- if ( $message != 2 ) {
119
- // Increase successfully updated items count, if action doesn't failed.
120
- $successfully_updated++;
121
- }
122
- }
123
- }
124
- if ( $successfully_updated ) {
125
- $block_action = $this->bulk_action_name;
126
- $message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDFMInstance(self::PLUGIN)->prefix), $successfully_updated, $this->actions[$task][$block_action]);
127
- }
128
- }
129
-
130
- $url_args = array(
131
- 'page' => $this->page,
132
- 'task' => 'display',
133
- 'current_id' => $form_id,
134
- 'paged' => $paged,
135
- ($message === 2 ? 'message' : 'msg') => $message);
136
-
137
- $delete_keys = array_merge($url_args, array('form_id' => '', WDFMInstance(self::PLUGIN)->nonce => ''));
138
- $new_url_args = WDW_FM_Library(self::PLUGIN)->array_remove_keys($_GET, $delete_keys);
139
- $redirect = add_query_arg( array_merge($url_args, $new_url_args), admin_url('admin.php') );
140
-
141
- WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect, false );
142
-
143
- }
144
-
145
- /**
146
- * Forms.
147
- * @param int $id
148
- */
149
- public function forms( $id = 0 ) {
150
- // Set params for view.
151
- $params = array();
152
- $params['id'] = $id;
153
- $params['page'] = $this->page;
154
- $params['page_url'] = $this->page_url;
155
- $params['page_title'] = __('Submissions', WDFMInstance(self::PLUGIN)->prefix);
156
- $params['forms'] = $this->model->get_forms();
157
- $params['order_by'] = 'group_id';
158
- $params['asc_or_desc'] = 'desc';
159
-
160
- $this->view->forms($params);
161
- }
162
-
163
- /**
164
- * Display.
165
- * @param int $id
166
- */
167
- public function display( $id = 0 ) {
168
- // Set params for view.
169
- $params = array();
170
- $params['id'] = $id;
171
- $params['page'] = $this->page;
172
- $params['page_url'] = $this->page_url;
173
- $params['page_title'] = __('Submissions', WDFMInstance(self::PLUGIN)->prefix);
174
- $params['actions'] = $this->actions;
175
-
176
- // Set pagination params.
177
- $paged = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
178
- $params['page_per_num'] = $this->page_per_num;
179
- $params['page_number'] = $paged;
180
- $page_num = $paged ? ($paged - 1) * $params['page_per_num'] : 0;
181
-
182
- $params['forms'] = $this->model->get_forms();
183
- $params['statistics'] = $this->model->get_statistics( $id );
184
- $params['blocked_ips'] = $this->model->blocked_ips();
185
-
186
- $labels_parameters = $this->model->get_labels_parameters( $id , $page_num, $params['page_per_num'] );
187
- $params['sorted_labels_id'] = $labels_parameters[0];
188
- $params['sorted_label_types'] = $labels_parameters[1];
189
- $params['sorted_label_names'] = $labels_parameters[3];
190
- $params['sorted_label_names_original'] = $labels_parameters[4];
191
-
192
- $label_name_ids = array();
193
- foreach($labels_parameters[0] as $key => $label_id) {
194
- $label_name_ids[$label_id] = $labels_parameters[4][$key];
195
- }
196
- $params['label_name_ids'] = $label_name_ids;
197
- $group_ids = ((isset($labels_parameters[6])) ? $labels_parameters[6] : NULL);
198
- $params['group_id_s'] = $this->model->sort_group_ids(count($params['sorted_label_names']), $group_ids);
199
- $params['where_choices'] = $labels_parameters[7];
200
- $params['searched_ids'] = $labels_parameters[8] ? implode(',', $labels_parameters[8]) : '';
201
- $params['groupids'] = $labels_parameters[8] ? array_reverse($labels_parameters[8]) : array();
202
-
203
- $params['order_by'] = $order_by = WDW_FM_Library(self::PLUGIN)->get('order_by', 'group_id');
204
- $params['asc_or_desc'] = $asc_or_desc = (WDW_FM_Library(self::PLUGIN)->get('asc_or_desc', 'desc') == 'desc' ? 'desc' : 'asc');
205
-
206
- $lists = $labels_parameters[2];
207
- $params['lists'] = $lists;
208
- $params['style_id'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitid@');
209
- $params['style_date'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitdate@');
210
- $params['style_ip'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitterip@');
211
- $params['style_username'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitterusername@');
212
- $params['style_useremail'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitteremail@');
213
- $params['style_payment_info'] = $this->model->hide_or_not($lists['hide_label_list'], '@payment_info@');
214
-
215
- $params['oder_class_default'] = "manage-column column-autor sortable desc";
216
- $params['oder_class'] = "manage-column column-autor column-title sorted " . $params['asc_or_desc'];
217
- $params['m'] = count($params['sorted_label_names']);
218
- /* sort/filter logics */
219
- $is_sort = false;
220
- $is_search = false;
221
- $post_url_args = array();
222
- foreach ( $lists as $list_key => $list_val ) {
223
- if ( !empty($_POST[$list_key]) ) {
224
- $is_search = true;
225
- $post_url_args[$list_key] = urlencode($_POST[$list_key]);
226
- $post_url_args['is_search'] = 1;
227
- }
228
- }
229
- /* Get sorting value on $_POST for redirect */
230
- if ( !empty($_POST['order_by']) || !empty($_POST['asc_or_desc']) ) {
231
- $is_sort = true;
232
- $order_by = $_POST['order_by'];
233
- $asc_or_desc = ($_POST['asc_or_desc'] == 'desc' ? 'desc' : 'asc');
234
- }
235
- if ( !empty($is_search) || $is_sort || isset($_POST['current_page']) ) {
236
- if ( !empty($_POST['fm_is_search']) ) {
237
- $post_url_args['paged'] = 1;
238
- } else {
239
- $post_url_args['paged'] = WDW_FM_Library(self::PLUGIN)->get('current_page', 1);
240
- if ( isset($_POST['current_page']) ) {
241
- $post_url_args['paged'] = $_POST['current_page'];
242
- }
243
- }
244
- $url_args = array_merge(
245
- array('page' => $this->page, 'task' => 'display', 'current_id' => $id, 'order_by' => $order_by, 'asc_or_desc' => $asc_or_desc),
246
- $post_url_args
247
- );
248
- $redirect = add_query_arg( $url_args, admin_url('admin.php') );
249
- WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect, false );
250
- }
251
-
252
- $pagination_url_args = array();
253
- foreach ( $lists as $list_key => $list_val ) {
254
- if ( !empty($_GET[$list_key]) ) {
255
- $lists[$list_key] = urlencode(WDW_FM_Library(self::PLUGIN)->get($list_key));
256
- $pagination_url_args[$list_key] = WDW_FM_Library(self::PLUGIN)->get($list_key);
257
- $pagination_url_args['is_search'] = 1;
258
- }
259
- }
260
- $pagination_url = array_merge(
261
- array('page' => $this->page, 'task' => 'display', 'current_id' => $id, 'order_by' => $order_by, 'asc_or_desc' => $asc_or_desc),
262
- $pagination_url_args
263
- );
264
- $params['pagination_url'] = add_query_arg( $pagination_url , admin_url('admin.php') );
265
- $params['pagination_url_args'] = $pagination_url_args;
266
-
267
- $params['lists'] = $lists;
268
- $params['is_search'] = WDW_FM_Library(self::PLUGIN)->get('is_search', 0);
269
- $params['is_stats'] = FALSE;
270
-
271
- $params['rows_data'] = $lists;
272
- $params['rows'] = $labels_parameters[5];
273
- $params['subs_count'] = $labels_parameters[2]['total'];
274
- /* If not result redirect to first page */
275
- if ( empty($params['group_id_s']) && $paged > 1 ) {
276
- $redirect = add_query_arg( array_merge( $pagination_url, array('paged' => 1) ), admin_url('admin.php') );
277
- WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect );
278
- }
279
-
280
- $option_key = (WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
281
- $params['fm_settings'] = get_option($option_key);
282
-
283
- // Check is active pdf-integration extension.
284
- $params['pdf_data'] = array();
285
- if ( defined('WD_FM_PDF') && is_plugin_active(constant('WD_FM_PDF')) ) {
286
- require_once(WD_FM_PDF_DIR . '/model.php');
287
- $params['pdf_data'] = WD_FM_PDF_model::get_pdf_data( $id );
288
- }
289
-
290
- $this->view->display($params);
291
- }
292
-
293
- /**
294
- * Show stats.
295
- * @param int $id
296
- */
297
- public function show_stats( $id = 0 ) {
298
- ob_clean();
299
- $key = (int) WDW_FM_Library(self::PLUGIN)->get('sorted_label_key', '');
300
-
301
- $page = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
302
- $page_num = $page ? ($page - 1) * $this->page_per_num : 0;
303
-
304
- $labels_parameters = $this->model->get_labels_parameters( $id, $page_num, $this->page_per_num);
305
- $where_choices = $labels_parameters[7];
306
- $sorted_label_names_original = $labels_parameters[4];
307
- $sorted_labels_id = $labels_parameters[0];
308
-
309
- $all = 0;
310
- $choices_labels = array();
311
- $sorted_label_name_original = '';
312
- $choices_count = '';
313
- $unanswered = NULL;
314
- $colors = array();
315
- $choices_colors = array();
316
- if ( count($sorted_labels_id) != 0 ) {
317
- $choices_params = $this->model->statistic_for_radio($where_choices, $sorted_labels_id[$key]);
318
- $sorted_label_name_original = $sorted_label_names_original[$key];
319
- $choices_count = $choices_params[0];
320
- $choices_labels = $choices_params[1];
321
- $unanswered = $choices_params[2];
322
- $all = $choices_params[3];
323
- $colors = $choices_params[4];
324
- $choices_colors = $choices_params[5];
325
- }
326
-
327
- // Set params for view.
328
- $params = array();
329
- $params['key'] = $key;
330
- $params['all'] = $all;
331
- $params['choices_labels'] = $choices_labels;
332
- $params['sorted_label_name_original'] = $sorted_label_name_original;
333
- $params['choices_count'] = $choices_count;
334
- $params['unanswered'] = $unanswered;
335
- $params['colors'] = $colors;
336
- $params['choices_colors'] = $choices_colors;
337
-
338
- $json = array();
339
- $json['html'] = $this->view->show_stats($params);
340
- echo json_encode($json); exit;
341
- }
342
-
343
- /**
344
- * Edit.
345
- * @param int $id
346
- */
347
- public function edit( $id = 0 ) {
348
- $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
349
- $data = $this->model->get_data_of_group_id( $id );
350
- if ( empty($data[0]) ) {
351
- WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display', 'current_id' => $id ), admin_url('admin.php') ) );
352
- }
353
-
354
- $labels_id = '';
355
- $rows = array();
356
- $labels_type = array();
357
- $labels_name = array();
358
- $ispaypal = array();
359
- if ( !empty($data) ) {
360
- $labels_id = $data[1];
361
- $rows = $data[0];
362
- $labels_name = $data[2];
363
- $labels_type = $data[3];
364
- $ispaypal = $data[4];
365
- $form = $data[5];
366
- $userinfo = get_userdata($rows[0]->user_id_wd);
367
- }
368
-
369
- $username = $userinfo ? $userinfo->display_name : "";
370
- $useremail = $userinfo ? $userinfo->user_email : "";
371
-
372
- // Set params for view.
373
- $params = array();
374
- $params['form_id'] = $form_id;
375
- $params['form'] = $form;
376
- $params['current_id'] = $id;
377
- $params['rows'] = $rows;
378
- $params['labels_id'] = $labels_id;
379
- $params['labels_name'] = $labels_name;
380
- $params['labels_type'] = $labels_type;
381
- $params['ispaypal'] = $ispaypal;
382
- $params['username'] = $username;
383
- $params['useremail'] = $useremail;
384
- $this->view->edit($params);
385
- }
386
-
387
- /**
388
- * Save.
389
- * @param int $id
390
- */
391
- public function save( $id = 0 ) {
392
- $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
393
- $this->save_db( $id, $form_id );
394
- }
395
-
396
- /**
397
- * Save.
398
- * @param int $id
399
- * @param int $form_id
400
- */
401
- public function save_db( $id = 0, $form_id = 0 ) {
402
- $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
403
- $date = esc_html($_POST['date']);
404
- $ip = esc_html($_POST['ip']);
405
-
406
- $form = $this->model->get_all($form_id);
407
- $label_id = array();
408
- $label_order_original = array();
409
- $label_type = array();
410
- if ( strpos($form->label_order, 'type_paypal_') ) {
411
- $form->label_order = $form->label_order . "0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
412
- }
413
- $label_all = explode('#****#', $form->label_order);
414
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
415
- foreach ( $label_all as $key => $label_each ) {
416
- $label_id_each = explode('#**id**#', $label_each);
417
- array_push($label_id, $label_id_each[0]);
418
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
419
- array_push($label_order_original, $label_oder_each[0]);
420
- array_push($label_type, $label_oder_each[1]);
421
- }
422
- foreach ( $label_id as $key => $label_id_1 ) {
423
- if ( isset($_POST["submission_" . $label_id_1]) ) {
424
- $element_value = (isset($_POST["submission_" . $label_id_1]) ? esc_html(stripslashes($_POST["submission_" . $label_id_1])) : " ");
425
- $result = $this->model->get_id($id, $label_id_1);
426
- if ( $label_type[$key] == 'type_file_upload' ) {
427
- if ( $element_value ) {
428
- $element_value = $element_value . "*@@url@@*";
429
- }
430
- }
431
- if ( $result ) {
432
- $save = $this->model->update_fm_submits(array(
433
- 'element_value' => stripslashes($element_value),
434
- ), array(
435
- 'group_id' => $id,
436
- 'element_label' => $label_id_1,
437
- ), array(
438
- '%s',
439
- ), array(
440
- '%d',
441
- '%s',
442
- ));
443
- }
444
- else {
445
- $save = $this->model->insert_fm_submits(array(
446
- 'form_id' => $form_id,
447
- 'element_label' => $label_id_1,
448
- 'element_value' => stripslashes($element_value),
449
- 'group_id' => $id,
450
- 'date' => $date,
451
- 'ip' => $ip,
452
- ), array(
453
- '%d',
454
- '%s',
455
- '%s',
456
- '%d',
457
- '%s',
458
- '%s',
459
- ));
460
- }
461
- }
462
- else {
463
- if ( isset($_POST["submission_" . $label_id_1 . '_0']) ) {
464
- $element_value = '';
465
- for ( $z = 0; $z < 21; $z++ ) {
466
- $element_value_ch = isset($_POST["submission_" . $label_id_1 . '_' . $z]) ? $_POST["submission_" . $label_id_1 . '_' . $z] : NULL;
467
- if ( isset($element_value_ch) ) {
468
- $element_value = $element_value . $element_value_ch . '***br***';
469
- }
470
- else {
471
- break;
472
- }
473
- }
474
- $result = $this->model->get_id($id, $label_id_1);
475
- if ( $result ) {
476
- $save = $this->model->update_fm_submits(array(
477
- 'element_value' => stripslashes($element_value),
478
- ), array(
479
- 'group_id' => $id,
480
- 'element_label' => $label_id_1,
481
- ), array(
482
- '%s',
483
- ), array(
484
- '%d',
485
- '%s',
486
- ));
487
- }
488
- else {
489
- $save = $this->model->insert_fm_submits(array(
490
- 'form_id' => $form_id,
491
- 'element_label' => $label_id_1,
492
- 'element_value' => stripslashes($element_value),
493
- 'group_id' => $id,
494
- 'date' => $date,
495
- 'ip' => $ip,
496
- ), array(
497
- '%d',
498
- '%s',
499
- '%s',
500
- '%d',
501
- '%s',
502
- '%s',
503
- ));
504
- }
505
- }
506
- }
507
- }
508
-
509
- $message = 2;
510
- if ( $save !== FALSE ) {
511
- $message = 14;
512
- }
513
- $args = array(
514
- 'page' => $this->page,
515
- 'task' => 'edit',
516
- 'current_id' => $id,
517
- 'form_id' => $form_id,
518
- 'message' => $message,
519
- );
520
-
521
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg( $args, admin_url('admin.php')) );
522
- }
523
-
524
- /**
525
- * Delete form by id.
526
- *
527
- * @param int $id
528
- * @param bool $bulk
529
- *
530
- * @return int
531
- */
532
- public function delete( $id = 0, $bulk = FALSE ) {
533
- $paged = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
534
- $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
535
- $delete = $this->model->delete_row($id);
536
- $message = 2;
537
- if ( $delete ) {
538
- $message = 3;
539
- }
540
-
541
- if ( $bulk ) {
542
- return $message;
543
- }
544
-
545
- $url_args = array(
546
- 'page' => $this->page,
547
- 'task' => 'display',
548
- 'current_id' => $form_id,
549
- 'paged' => $paged,
550
- 'message' => $message);
551
- $delete_keys = array_merge($url_args, array('form_id' => '', WDFMInstance(self::PLUGIN)->nonce => ''));
552
- $new_url_args = WDW_FM_Library(self::PLUGIN)->array_remove_keys($_GET, $delete_keys);
553
-
554
- $redirect = add_query_arg( array_merge($url_args, $new_url_args), admin_url('admin.php') );
555
- WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect );
556
- }
557
-
558
- /**
559
- * Block IP form by id.
560
- *
561
- * @param int $id
562
- * @param bool $bulk
563
- *
564
- * @return int
565
- */
566
- public function block_ip( $id = 0, $bulk = FALSE ) {
567
- global $wpdb;
568
-
569
- $paged = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
570
- $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
571
- $q = $wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id ="%d"', $id);
572
- $row = $wpdb->get_row($q);
573
- $message = 2;
574
-
575
- if( !empty($row) ) {
576
- if( !$this->model->get_ips( $row->ip ) ) {
577
- $save = $this->model->set_ips( array('ip' => $row->ip), array( '%s', ) );
578
-
579
- if($save){
580
- $message = 12;
581
- }
582
- }
583
- }
584
- if ( $bulk ) {
585
- return $message;
586
- }
587
-
588
- $url_args = array(
589
- 'page' => $this->page,
590
- 'task' => 'display',
591
- 'current_id' => $form_id,
592
- 'paged' => $paged,
593
- 'message' => $message);
594
- $delete_keys = array_merge($url_args, array('form_id' => '', WDFMInstance(self::PLUGIN)->nonce => ''));
595
- $new_url_args = WDW_FM_Library(self::PLUGIN)->array_remove_keys($_GET, $delete_keys);
596
-
597
- $redirect = add_query_arg( array_merge($url_args, $new_url_args), admin_url('admin.php') );
598
- WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect );
599
- }
600
-
601
- /**
602
- * Unblock IP form by id.
603
- *
604
- * @param int $id
605
- * @param bool $bulk
606
- *
607
- * @return int
608
- */
609
- public function unblock_ip( $id = 0, $bulk = FALSE ) {
610
- global $wpdb;
611
-
612
- $paged = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
613
- $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
614
- $q = $wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id ="%d"', $id);
615
- $row = $wpdb->get_row($q);
616
- $message = 2;
617
-
618
- if( !empty($row) ) {
619
- if( $this->model->get_ips( $row->ip ) ) {
620
- $delete = $this->model->delete_by_ip( $row->ip );
621
- if($delete){
622
- $message = 13;
623
- }
624
- }
625
- }
626
-
627
- if ( $bulk ) {
628
- return $message;
629
- }
630
-
631
- $url_args = array(
632
- 'page' => $this->page,
633
- 'task' => 'display',
634
- 'current_id' => $form_id,
635
- 'paged' => $paged,
636
- 'message' => $message);
637
- $delete_keys = array_merge($url_args, array('form_id' => '', WDFMInstance(self::PLUGIN)->nonce => ''));
638
- $new_url_args = WDW_FM_Library(self::PLUGIN)->array_remove_keys($_GET, $delete_keys);
639
-
640
- $redirect = add_query_arg( array_merge($url_args, $new_url_args), admin_url('admin.php') );
641
- WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect );
642
- }
643
- }
1
+ <?php
2
+ /**
3
+ * Class FMControllerSubmissions_fmc
4
+ */
5
+ class FMControllerSubmissions_fmc extends CFMAdminController {
6
+ /**
7
+ * @var $model
8
+ */
9
+ private $model;
10
+ /**
11
+ * @var $view
12
+ */
13
+ private $view;
14
+ /**
15
+ * @var string $page
16
+ */
17
+ private $page;
18
+ /**
19
+ * @var string $bulk_action_name
20
+ */
21
+ private $bulk_action_name;
22
+ /**
23
+ * @var string $page_url
24
+ */
25
+ private $page_url;
26
+ /**
27
+ * @var int $page_per_num
28
+ */
29
+ private $page_per_num = 20;
30
+ /**
31
+ * @var array $actions
32
+ */
33
+ private $actions = array();
34
+
35
+ public function __construct() {
36
+ // Load FMModelSubmissions_fm class.
37
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Submissions_fm.php";
38
+ $this->model = new FMModelSubmissions_fmc();
39
+ // Load FMViewSubmissions_fm class.
40
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Submissions_fm.php";
41
+ $this->view = new FMViewSubmissions_fmc($this->model);
42
+
43
+ $this->page = WDW_FM_Library(self::PLUGIN)->get('page');
44
+ $this->page_url = add_query_arg( array (
45
+ 'page' => $this->page,
46
+ WDFMInstance(self::PLUGIN)->nonce => wp_create_nonce(WDFMInstance(self::PLUGIN)->nonce),
47
+ ), admin_url('admin.php')
48
+ );
49
+
50
+ $this->bulk_action_name = 'bulk_action';
51
+ $this->actions = array(
52
+ 'block_ip' => array(
53
+ 'title' => __('Block IPs', WDFMInstance(self::PLUGIN)->prefix),
54
+ $this->bulk_action_name => __('Blocked', WDFMInstance(self::PLUGIN)->prefix),
55
+ ),
56
+ 'unblock_ip' => array(
57
+ 'title' => __('Unblock IPs', WDFMInstance(self::PLUGIN)->prefix),
58
+ $this->bulk_action_name => __('Unblocked', WDFMInstance(self::PLUGIN)->prefix),
59
+ ),
60
+ 'delete' => array(
61
+ 'title' => __('Delete', WDFMInstance(self::PLUGIN)->prefix),
62
+ $this->bulk_action_name => __('Deleted', WDFMInstance(self::PLUGIN)->prefix),
63
+ ),
64
+ );
65
+
66
+ $user = get_current_user_id();
67
+ $screen = get_current_screen();
68
+ if ( !empty($user) && !empty($screen) ) {
69
+ $option = $screen->get_option('per_page', 'option');
70
+ $per_page = get_user_meta($user, $option, true);
71
+ if ( $per_page ) {
72
+ $this->page_per_num = $per_page;
73
+ }
74
+ }
75
+ }
76
+
77
+ /**
78
+ * Execute.
79
+ */
80
+ public function execute() {
81
+ $task = WDW_FM_Library(self::PLUGIN)->get('task');
82
+ $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
83
+ if ( method_exists($this, $task) ) {
84
+ if ( $task != 'display' ) {
85
+ check_admin_referer(WDFMInstance(self::PLUGIN)->nonce, WDFMInstance(self::PLUGIN)->nonce);
86
+ }
87
+ $block_action = $this->bulk_action_name;
88
+ $action = WDW_FM_Library(self::PLUGIN)->get( $block_action , -1 );
89
+ if ( $action != -1 ) {
90
+ $this->$block_action($action);
91
+ }
92
+ else {
93
+ $this->$task($id);
94
+ }
95
+ }
96
+ else {
97
+ $this->forms($id);
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Bulk actions.
103
+ *
104
+ * @param string $task
105
+ */
106
+ public function bulk_action( $task = '' ) {
107
+ $paged = (int) WDW_FM_Library(self::PLUGIN)->get('current_page', 1);
108
+ $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
109
+ $check = WDW_FM_Library(self::PLUGIN)->get('check', '');
110
+
111
+ $message = 0;
112
+ $successfully_updated = 0;
113
+
114
+ if ( $check ) {
115
+ foreach ( $check as $id => $item ) {
116
+ if ( method_exists($this, $task) ) {
117
+ $message = $this->$task($id, TRUE);
118
+ if ( $message != 2 ) {
119
+ // Increase successfully updated items count, if action doesn't failed.
120
+ $successfully_updated++;
121
+ }
122
+ }
123
+ }
124
+ if ( $successfully_updated ) {
125
+ $block_action = $this->bulk_action_name;
126
+ $message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDFMInstance(self::PLUGIN)->prefix), $successfully_updated, $this->actions[$task][$block_action]);
127
+ }
128
+ }
129
+
130
+ $url_args = array(
131
+ 'page' => $this->page,
132
+ 'task' => 'display',
133
+ 'current_id' => $form_id,
134
+ 'paged' => $paged,
135
+ ($message === 2 ? 'message' : 'msg') => $message);
136
+
137
+ $delete_keys = array_merge($url_args, array('form_id' => '', WDFMInstance(self::PLUGIN)->nonce => ''));
138
+ $new_url_args = WDW_FM_Library(self::PLUGIN)->array_remove_keys($_GET, $delete_keys);
139
+ $redirect = add_query_arg( array_merge($url_args, $new_url_args), admin_url('admin.php') );
140
+
141
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect, false );
142
+
143
+ }
144
+
145
+ /**
146
+ * Forms.
147
+ * @param int $id
148
+ */
149
+ public function forms( $id = 0 ) {
150
+ // Set params for view.
151
+ $params = array();
152
+ $params['id'] = $id;
153
+ $params['page'] = $this->page;
154
+ $params['page_url'] = $this->page_url;
155
+ $params['page_title'] = __('Submissions', WDFMInstance(self::PLUGIN)->prefix);
156
+ $params['forms'] = $this->model->get_forms();
157
+ $params['order_by'] = 'group_id';
158
+ $params['asc_or_desc'] = 'desc';
159
+
160
+ $this->view->forms($params);
161
+ }
162
+
163
+ /**
164
+ * Display.
165
+ * @param int $id
166
+ */
167
+ public function display( $id = 0 ) {
168
+ // Set params for view.
169
+ $params = array();
170
+ $params['id'] = $id;
171
+ $params['page'] = $this->page;
172
+ $params['page_url'] = $this->page_url;
173
+ $params['page_title'] = __('Submissions', WDFMInstance(self::PLUGIN)->prefix);
174
+ $params['actions'] = $this->actions;
175
+
176
+ // Set pagination params.
177
+ $paged = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
178
+ $params['page_per_num'] = $this->page_per_num;
179
+ $params['page_number'] = $paged;
180
+ $page_num = $paged ? ($paged - 1) * $params['page_per_num'] : 0;
181
+
182
+ $params['forms'] = $this->model->get_forms();
183
+ $params['statistics'] = $this->model->get_statistics( $id );
184
+ $params['blocked_ips'] = $this->model->blocked_ips();
185
+
186
+ $labels_parameters = $this->model->get_labels_parameters( $id , $page_num, $params['page_per_num'] );
187
+ $params['sorted_labels_id'] = $labels_parameters[0];
188
+ $params['sorted_label_types'] = $labels_parameters[1];
189
+ $params['sorted_label_names'] = $labels_parameters[3];
190
+ $params['sorted_label_names_original'] = $labels_parameters[4];
191
+
192
+ $label_name_ids = array();
193
+ foreach($labels_parameters[0] as $key => $label_id) {
194
+ $label_name_ids[$label_id] = $labels_parameters[4][$key];
195
+ }
196
+ $params['label_name_ids'] = $label_name_ids;
197
+ $group_ids = ((isset($labels_parameters[6])) ? $labels_parameters[6] : NULL);
198
+ $params['group_id_s'] = $this->model->sort_group_ids(count($params['sorted_label_names']), $group_ids);
199
+ $params['where_choices'] = $labels_parameters[7];
200
+ $params['searched_ids'] = $labels_parameters[8] ? implode(',', $labels_parameters[8]) : '';
201
+ $params['groupids'] = $labels_parameters[8] ? array_reverse($labels_parameters[8]) : array();
202
+
203
+ $params['order_by'] = $order_by = WDW_FM_Library(self::PLUGIN)->get('order_by', 'group_id');
204
+ $params['asc_or_desc'] = $asc_or_desc = (WDW_FM_Library(self::PLUGIN)->get('asc_or_desc', 'desc') == 'desc' ? 'desc' : 'asc');
205
+
206
+ $lists = $labels_parameters[2];
207
+ $params['lists'] = $lists;
208
+ $params['style_id'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitid@');
209
+ $params['style_date'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitdate@');
210
+ $params['style_ip'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitterip@');
211
+ $params['style_username'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitterusername@');
212
+ $params['style_useremail'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitteremail@');
213
+ $params['style_payment_info'] = $this->model->hide_or_not($lists['hide_label_list'], '@payment_info@');
214
+
215
+ $params['oder_class_default'] = "manage-column column-autor sortable desc";
216
+ $params['oder_class'] = "manage-column column-autor column-title sorted " . $params['asc_or_desc'];
217
+ $params['m'] = count($params['sorted_label_names']);
218
+ /* sort/filter logics */
219
+ $is_sort = false;
220
+ $is_search = false;
221
+ $post_url_args = array();
222
+ foreach ( $lists as $list_key => $list_val ) {
223
+ if ( !empty($_POST[$list_key]) ) {
224
+ $is_search = true;
225
+ $post_url_args[$list_key] = urlencode($_POST[$list_key]);
226
+ $post_url_args['is_search'] = 1;
227
+ }
228
+ }
229
+ /* Get sorting value on $_POST for redirect */
230
+ if ( !empty($_POST['order_by']) || !empty($_POST['asc_or_desc']) ) {
231
+ $is_sort = true;
232
+ $order_by = $_POST['order_by'];
233
+ $asc_or_desc = ($_POST['asc_or_desc'] == 'desc' ? 'desc' : 'asc');
234
+ }
235
+ if ( !empty($is_search) || $is_sort || isset($_POST['current_page']) ) {
236
+ if ( !empty($_POST['fm_is_search']) ) {
237
+ $post_url_args['paged'] = 1;
238
+ } else {
239
+ $post_url_args['paged'] = WDW_FM_Library(self::PLUGIN)->get('current_page', 1);
240
+ if ( isset($_POST['current_page']) ) {
241
+ $post_url_args['paged'] = $_POST['current_page'];
242
+ }
243
+ }
244
+ $url_args = array_merge(
245
+ array('page' => $this->page, 'task' => 'display', 'current_id' => $id, 'order_by' => $order_by, 'asc_or_desc' => $asc_or_desc),
246
+ $post_url_args
247
+ );
248
+ $redirect = add_query_arg( $url_args, admin_url('admin.php') );
249
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect, false );
250
+ }
251
+
252
+ $pagination_url_args = array();
253
+ foreach ( $lists as $list_key => $list_val ) {
254
+ if ( !empty($_GET[$list_key]) ) {
255
+ $lists[$list_key] = urlencode(WDW_FM_Library(self::PLUGIN)->get($list_key));
256
+ $pagination_url_args[$list_key] = WDW_FM_Library(self::PLUGIN)->get($list_key);
257
+ $pagination_url_args['is_search'] = 1;
258
+ }
259
+ }
260
+ $pagination_url = array_merge(
261
+ array('page' => $this->page, 'task' => 'display', 'current_id' => $id, 'order_by' => $order_by, 'asc_or_desc' => $asc_or_desc),
262
+ $pagination_url_args
263
+ );
264
+ $params['pagination_url'] = add_query_arg( $pagination_url , admin_url('admin.php') );
265
+ $params['pagination_url_args'] = $pagination_url_args;
266
+
267
+ $params['lists'] = $lists;
268
+ $params['is_search'] = WDW_FM_Library(self::PLUGIN)->get('is_search', 0);
269
+ $params['is_stats'] = FALSE;
270
+
271
+ $params['rows_data'] = $lists;
272
+ $params['rows'] = $labels_parameters[5];
273
+ $params['subs_count'] = $labels_parameters[2]['total'];
274
+ /* If not result redirect to first page */
275
+ if ( empty($params['group_id_s']) && $paged > 1 ) {
276
+ $redirect = add_query_arg( array_merge( $pagination_url, array('paged' => 1) ), admin_url('admin.php') );
277
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect );
278
+ }
279
+
280
+ $params['fm_settings'] = WDFMInstance(self::PLUGIN)->fm_settings;
281
+
282
+ // Check is active pdf-integration extension.
283
+ $params['pdf_data'] = array();
284
+ if ( defined('WD_FM_PDF') && is_plugin_active(constant('WD_FM_PDF')) ) {
285
+ require_once(WD_FM_PDF_DIR . '/model.php');
286
+ $params['pdf_data'] = WD_FM_PDF_model::get_pdf_data( $id );
287
+ }
288
+
289
+ $this->view->display($params);
290
+ }
291
+
292
+ /**
293
+ * Show stats.
294
+ * @param int $id
295
+ */
296
+ public function show_stats( $id = 0 ) {
297
+ ob_clean();
298
+ $key = (int) WDW_FM_Library(self::PLUGIN)->get('sorted_label_key', '');
299
+
300
+ $page = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
301
+ $page_num = $page ? ($page - 1) * $this->page_per_num : 0;
302
+
303
+ $labels_parameters = $this->model->get_labels_parameters( $id, $page_num, $this->page_per_num);
304
+ $where_choices = $labels_parameters[7];
305
+ $sorted_label_names_original = $labels_parameters[4];
306
+ $sorted_labels_id = $labels_parameters[0];
307
+
308
+ $all = 0;
309
+ $choices_labels = array();
310
+ $sorted_label_name_original = '';
311
+ $choices_count = '';
312
+ $unanswered = NULL;
313
+ $colors = array();
314
+ $choices_colors = array();
315
+ if ( count($sorted_labels_id) != 0 ) {
316
+ $choices_params = $this->model->statistic_for_radio($where_choices, $sorted_labels_id[$key]);
317
+ $sorted_label_name_original = $sorted_label_names_original[$key];
318
+ $choices_count = $choices_params[0];
319
+ $choices_labels = $choices_params[1];
320
+ $unanswered = $choices_params[2];
321
+ $all = $choices_params[3];
322
+ $colors = $choices_params[4];
323
+ $choices_colors = $choices_params[5];
324
+ }
325
+
326
+ // Set params for view.
327
+ $params = array();
328
+ $params['key'] = $key;
329
+ $params['all'] = $all;
330
+ $params['choices_labels'] = $choices_labels;
331
+ $params['sorted_label_name_original'] = $sorted_label_name_original;
332
+ $params['choices_count'] = $choices_count;
333
+ $params['unanswered'] = $unanswered;
334
+ $params['colors'] = $colors;
335
+ $params['choices_colors'] = $choices_colors;
336
+
337
+ $json = array();
338
+ $json['html'] = $this->view->show_stats($params);
339
+ echo json_encode($json); exit;
340
+ }
341
+
342
+ /**
343
+ * Edit.
344
+ * @param int $id
345
+ */
346
+ public function edit( $id = 0 ) {
347
+ $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
348
+ $data = $this->model->get_data_of_group_id( $id );
349
+ if ( empty($data[0]) ) {
350
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display', 'current_id' => $id ), admin_url('admin.php') ) );
351
+ }
352
+
353
+ $labels_id = '';
354
+ $rows = array();
355
+ $labels_type = array();
356
+ $labels_name = array();
357
+ $ispaypal = array();
358
+ if ( !empty($data) ) {
359
+ $labels_id = $data[1];
360
+ $rows = $data[0];
361
+ $labels_name = $data[2];
362
+ $labels_type = $data[3];
363
+ $ispaypal = $data[4];
364
+ $form = $data[5];
365
+ $userinfo = get_userdata($rows[0]->user_id_wd);
366
+ }
367
+
368
+ $username = $userinfo ? $userinfo->display_name : "";
369
+ $useremail = $userinfo ? $userinfo->user_email : "";
370
+
371
+ // Set params for view.
372
+ $params = array();
373
+ $params['form_id'] = $form_id;
374
+ $params['form'] = $form;
375
+ $params['current_id'] = $id;
376
+ $params['rows'] = $rows;
377
+ $params['labels_id'] = $labels_id;
378
+ $params['labels_name'] = $labels_name;
379
+ $params['labels_type'] = $labels_type;
380
+ $params['ispaypal'] = $ispaypal;
381
+ $params['username'] = $username;
382
+ $params['useremail'] = $useremail;
383
+ $this->view->edit($params);
384
+ }
385
+
386
+ /**
387
+ * Save.
388
+ * @param int $id
389
+ */
390
+ public function save( $id = 0 ) {
391
+ $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
392
+ $this->save_db( $id, $form_id );
393
+ }
394
+
395
+ /**
396
+ * Save.
397
+ * @param int $id
398
+ * @param int $form_id
399
+ */
400
+ public function save_db( $id = 0, $form_id = 0 ) {
401
+ $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
402
+ $date = esc_html($_POST['date']);
403
+ $ip = esc_html($_POST['ip']);
404
+
405
+ $form = $this->model->get_all($form_id);
406
+ $label_id = array();
407
+ $label_order_original = array();
408
+ $label_type = array();
409
+ if ( strpos($form->label_order, 'type_paypal_') ) {
410
+ $form->label_order = $form->label_order . "0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
411
+ }
412
+ $label_all = explode('#****#', $form->label_order);
413
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
414
+ foreach ( $label_all as $key => $label_each ) {
415
+ $label_id_each = explode('#**id**#', $label_each);
416
+ array_push($label_id, $label_id_each[0]);
417
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
418
+ array_push($label_order_original, $label_oder_each[0]);
419
+ array_push($label_type, $label_oder_each[1]);
420
+ }
421
+ foreach ( $label_id as $key => $label_id_1 ) {
422
+ if ( isset($_POST["submission_" . $label_id_1]) ) {
423
+ $element_value = (isset($_POST["submission_" . $label_id_1]) ? esc_html(stripslashes($_POST["submission_" . $label_id_1])) : " ");
424
+ $result = $this->model->get_id($id, $label_id_1);
425
+ if ( $label_type[$key] == 'type_file_upload' ) {
426
+ if ( $element_value ) {
427
+ $element_value = $element_value . "*@@url@@*";
428
+ }
429
+ }
430
+ if ( $result ) {
431
+ $save = $this->model->update_fm_submits(array(
432
+ 'element_value' => stripslashes($element_value),
433
+ ), array(
434
+ 'group_id' => $id,
435
+ 'element_label' => $label_id_1,
436
+ ), array(
437
+ '%s',
438
+ ), array(
439
+ '%d',
440
+ '%s',
441
+ ));
442
+ }
443
+ else {
444
+ $save = $this->model->insert_fm_submits(array(
445
+ 'form_id' => $form_id,
446
+ 'element_label' => $label_id_1,
447
+ 'element_value' => stripslashes($element_value),
448
+ 'group_id' => $id,
449
+ 'date' => $date,
450
+ 'ip' => $ip,
451
+ ), array(
452
+ '%d',
453
+ '%s',
454
+ '%s',
455
+ '%d',
456
+ '%s',
457
+ '%s',
458
+ ));
459
+ }
460
+ }
461
+ else {
462
+ if ( isset($_POST["submission_" . $label_id_1 . '_0']) ) {
463
+ $element_value = '';
464
+ for ( $z = 0; $z < 21; $z++ ) {
465
+ $element_value_ch = isset($_POST["submission_" . $label_id_1 . '_' . $z]) ? $_POST["submission_" . $label_id_1 . '_' . $z] : NULL;
466
+ if ( isset($element_value_ch) ) {
467
+ $element_value = $element_value . $element_value_ch . '***br***';
468
+ }
469
+ else {
470
+ break;
471
+ }
472
+ }
473
+ $result = $this->model->get_id($id, $label_id_1);
474
+ if ( $result ) {
475
+ $save = $this->model->update_fm_submits(array(
476
+ 'element_value' => stripslashes($element_value),
477
+ ), array(
478
+ 'group_id' => $id,
479
+ 'element_label' => $label_id_1,
480
+ ), array(
481
+ '%s',
482
+ ), array(
483
+ '%d',
484
+ '%s',
485
+ ));
486
+ }
487
+ else {
488
+ $save = $this->model->insert_fm_submits(array(
489
+ 'form_id' => $form_id,
490
+ 'element_label' => $label_id_1,
491
+ 'element_value' => stripslashes($element_value),
492
+ 'group_id' => $id,
493
+ 'date' => $date,
494
+ 'ip' => $ip,
495
+ ), array(
496
+ '%d',
497
+ '%s',
498
+ '%s',
499
+ '%d',
500
+ '%s',
501
+ '%s',
502
+ ));
503
+ }
504
+ }
505
+ }
506
+ }
507
+
508
+ $message = 2;
509
+ if ( $save !== FALSE ) {
510
+ $message = 14;
511
+ }
512
+ $args = array(
513
+ 'page' => $this->page,
514
+ 'task' => 'edit',
515
+ 'current_id' => $id,
516
+ 'form_id' => $form_id,
517
+ 'message' => $message,
518
+ );
519
+
520
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg( $args, admin_url('admin.php')) );
521
+ }
522
+
523
+ /**
524
+ * Delete form by id.
525
+ *
526
+ * @param int $id
527
+ * @param bool $bulk
528
+ *
529
+ * @return int
530
+ */
531
+ public function delete( $id = 0, $bulk = FALSE ) {
532
+ $paged = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
533
+ $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
534
+ $delete = $this->model->delete_row($id);
535
+ $message = 2;
536
+ if ( $delete ) {
537
+ $message = 3;
538
+ }
539
+
540
+ if ( $bulk ) {
541
+ return $message;
542
+ }
543
+
544
+ $url_args = array(
545
+ 'page' => $this->page,
546
+ 'task' => 'display',
547
+ 'current_id' => $form_id,
548
+ 'paged' => $paged,
549
+ 'message' => $message);
550
+ $delete_keys = array_merge($url_args, array('form_id' => '', WDFMInstance(self::PLUGIN)->nonce => ''));
551
+ $new_url_args = WDW_FM_Library(self::PLUGIN)->array_remove_keys($_GET, $delete_keys);
552
+
553
+ $redirect = add_query_arg( array_merge($url_args, $new_url_args), admin_url('admin.php') );
554
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect );
555
+ }
556
+
557
+ /**
558
+ * Block IP form by id.
559
+ *
560
+ * @param int $id
561
+ * @param bool $bulk
562
+ *
563
+ * @return int
564
+ */
565
+ public function block_ip( $id = 0, $bulk = FALSE ) {
566
+ global $wpdb;
567
+
568
+ $paged = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
569
+ $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
570
+ $q = $wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id ="%d"', $id);
571
+ $row = $wpdb->get_row($q);
572
+ $message = 2;
573
+
574
+ if( !empty($row) ) {
575
+ if( !$this->model->get_ips( $row->ip ) ) {
576
+ $save = $this->model->set_ips( array('ip' => $row->ip), array( '%s', ) );
577
+
578
+ if($save){
579
+ $message = 12;
580
+ }
581
+ }
582
+ }
583
+ if ( $bulk ) {
584
+ return $message;
585
+ }
586
+
587
+ $url_args = array(
588
+ 'page' => $this->page,
589
+ 'task' => 'display',
590
+ 'current_id' => $form_id,
591
+ 'paged' => $paged,
592
+ 'message' => $message);
593
+ $delete_keys = array_merge($url_args, array('form_id' => '', WDFMInstance(self::PLUGIN)->nonce => ''));
594
+ $new_url_args = WDW_FM_Library(self::PLUGIN)->array_remove_keys($_GET, $delete_keys);
595
+
596
+ $redirect = add_query_arg( array_merge($url_args, $new_url_args), admin_url('admin.php') );
597
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect );
598
+ }
599
+
600
+ /**
601
+ * Unblock IP form by id.
602
+ *
603
+ * @param int $id
604
+ * @param bool $bulk
605
+ *
606
+ * @return int
607
+ */
608
+ public function unblock_ip( $id = 0, $bulk = FALSE ) {
609
+ global $wpdb;
610
+
611
+ $paged = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
612
+ $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
613
+ $q = $wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id ="%d"', $id);
614
+ $row = $wpdb->get_row($q);
615
+ $message = 2;
616
+
617
+ if( !empty($row) ) {
618
+ if( $this->model->get_ips( $row->ip ) ) {
619
+ $delete = $this->model->delete_by_ip( $row->ip );
620
+ if($delete){
621
+ $message = 13;
622
+ }
623
+ }
624
+ }
625
+
626
+ if ( $bulk ) {
627
+ return $message;
628
+ }
629
+
630
+ $url_args = array(
631
+ 'page' => $this->page,
632
+ 'task' => 'display',
633
+ 'current_id' => $form_id,
634
+ 'paged' => $paged,
635
+ 'message' => $message);
636
+ $delete_keys = array_merge($url_args, array('form_id' => '', WDFMInstance(self::PLUGIN)->nonce => ''));
637
+ $new_url_args = WDW_FM_Library(self::PLUGIN)->array_remove_keys($_GET, $delete_keys);
638
+
639
+ $redirect = add_query_arg( array_merge($url_args, $new_url_args), admin_url('admin.php') );
640
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect );
641
+ }
642
+ }
 
admin/controllers/Themes_fm.php CHANGED
@@ -1,3024 +1,3024 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerThemes_fmc
5
- */
6
- class FMControllerThemes_fmc extends CFMAdminController {
7
- /**
8
- * @var $model
9
- */
10
- private $model;
11
- /**
12
- * @var $view
13
- */
14
- private $view;
15
- /**
16
- * @var string $page
17
- */
18
- private $page;
19
- /**
20
- * @var string $bulk_action_name
21
- */
22
- private $bulk_action_name;
23
- /**
24
- * @var int $items_per_page
25
- */
26
- private $items_per_page = 20;
27
- /**
28
- * @var array $actions
29
- */
30
- private $actions = array();
31
-
32
- public function __construct() {
33
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Themes_fm.php";
34
- $this->model = new FMModelThemes_fmc();
35
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Themes_fm.php";
36
- $this->view = new FMViewThemes_fmc();
37
- $this->page = WDW_FM_Library(self::PLUGIN)->get('page');
38
- $this->bulk_action_name = 'bulk_action';
39
-
40
- $this->actions = array(
41
- 'duplicate' => array(
42
- 'title' => __('Duplicate', WDFMInstance(self::PLUGIN)->prefix),
43
- $this->bulk_action_name => __('duplicated', WDFMInstance(self::PLUGIN)->prefix),
44
- ),
45
- 'delete' => array(
46
- 'title' => __('Delete', WDFMInstance(self::PLUGIN)->prefix),
47
- $this->bulk_action_name => __('deleted', WDFMInstance(self::PLUGIN)->prefix),
48
- ),
49
- );
50
- }
51
-
52
- /**
53
- * Execute.
54
- */
55
- public function execute() {
56
- $task = WDW_FM_Library(self::PLUGIN)->get('task');
57
- $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
58
- if ( method_exists($this, $task) ) {
59
- if ( $task != 'add' && $task != 'edit' && $task != 'display' ) {
60
- check_admin_referer(WDFMInstance(self::PLUGIN)->nonce, WDFMInstance(self::PLUGIN)->nonce);
61
- }
62
- $block_action = $this->bulk_action_name;
63
- $action = WDW_FM_Library(self::PLUGIN)->get($block_action, -1);
64
- if ( $action != -1 ) {
65
- $this->$block_action($action);
66
- }
67
- else {
68
- $this->$task($id);
69
- }
70
- }
71
- else {
72
- $this->display();
73
- }
74
- }
75
-
76
- /**
77
- * Display.
78
- */
79
- public function display() {
80
- // Set params for view.
81
- $params = array();
82
- $params['page'] = $this->page;
83
- $params['page_title'] = __('Themes', WDFMInstance(self::PLUGIN)->prefix);
84
- $params['actions'] = $this->actions;
85
- $params['order'] = WDW_FM_Library(self::PLUGIN)->get('order', 'desc');
86
- $params['orderby'] = WDW_FM_Library(self::PLUGIN)->get('orderby', 'default');
87
- // To prevent SQL injections.
88
- $params['order'] = ($params['order'] == 'desc') ? 'desc' : 'asc';
89
- if ( !in_array($params['orderby'], array( 'title', 'default' )) ) {
90
- $params['orderby'] = 'default';
91
- }
92
- $params['items_per_page'] = $this->items_per_page;
93
- $page = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
94
- $page_num = $page ? ($page - 1) * $params['items_per_page'] : 0;
95
- $params['page_num'] = $page_num;
96
- $params['search'] = WDW_FM_Library(self::PLUGIN)->get('s', '');;
97
- $params['total'] = $this->model->total();
98
- $params['rows_data'] = $this->model->get_rows_data($params);
99
- $this->view->display($params);
100
- }
101
-
102
- /**
103
- * Bulk actions.
104
- *
105
- * @param string $task
106
- */
107
- public function bulk_action( $task = '' ) {
108
- $message = 0;
109
- $successfully_updated = 0;
110
-
111
- $check = WDW_FM_Library(self::PLUGIN)->get('check', '');
112
-
113
- if ( $check ) {
114
- foreach ( $check as $form_id => $item ) {
115
- if ( method_exists($this, $task) ) {
116
- $message = $this->$task($form_id, TRUE);
117
- if ( $message != 2 ) {
118
- // Increase successfully updated items count, if action doesn't failed.
119
- $successfully_updated++;
120
- }
121
- }
122
- }
123
- if ( $successfully_updated ) {
124
- $block_action = $this->bulk_action_name;
125
- $message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDFMInstance(self::PLUGIN)->prefix), $successfully_updated, $this->actions[$task][$block_action]);
126
- }
127
- }
128
-
129
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
130
- 'page' => $this->page,
131
- 'task' => 'display',
132
- ($message === 2 ? 'message' : 'msg') => $message,
133
- ), admin_url('admin.php')));
134
-
135
- }
136
-
137
- /**
138
- * Delete form by id.
139
- *
140
- * @param int $id
141
- * @param bool $bulk
142
- *
143
- * @return int
144
- */
145
- public function delete( $id = 0, $bulk = FALSE ) {
146
- $isDefault = $this->model->get_default($id);
147
- if ( $isDefault ) {
148
- $message = 4;
149
- }
150
- else {
151
- $table = 'formmaker_themes';
152
- $delete = $this->model->delete_rows(array(
153
- 'table' => $table,
154
- 'where' => 'id = ' . $id,
155
- ));
156
- if ( $delete ) {
157
- $message = 3;
158
- }
159
- else {
160
- $message = 2;
161
- }
162
- }
163
- if ( $bulk ) {
164
- return $message;
165
- }
166
- WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display', 'message' => $message), admin_url('admin.php') ) );
167
- }
168
-
169
- /**
170
- * Duplicate by id.
171
- *
172
- * @param int $id
173
- * @param bool $bulk
174
- *
175
- * @return int
176
- */
177
- public function duplicate( $id = 0, $bulk = FALSE ) {
178
- $message = 2;
179
- $table = 'formmaker_themes';
180
- $row = $this->model->select_rows("get_row", array(
181
- "selection" => "*",
182
- "table" => $table,
183
- "where" => "id=" . (int) $id,
184
- ));
185
- if ( $row ) {
186
- $row = (array) $row;
187
- unset($row['id']);
188
- $row['title'] = $row['title'] . ' - ' . __('Copy', WDFMInstance(self::PLUGIN)->prefix);
189
- $row['default'] = 0;
190
- $inserted = $this->model->insert_data_to_db($table, (array) $row);
191
- if ( $inserted !== FALSE ) {
192
- $message = 11;
193
- }
194
- }
195
- if ( $bulk ) {
196
- return $message;
197
- }
198
- else {
199
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
200
- 'page' => $this->page,
201
- 'task' => 'display',
202
- 'message' => $message,
203
- ), admin_url('admin.php')));
204
- }
205
- }
206
-
207
- /**
208
- * Edit.
209
- *
210
- * @param int $id
211
- */
212
- public function edit( $id = 0 ) {
213
- $params = array();
214
- $params['id'] = (int) $id;
215
- $params['row'] = $this->model->get_row_data($params['id'], FALSE);
216
-
217
- if ( $id != 0 && empty($params['row']) ) {
218
- WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
219
- }
220
- $params['page_title'] = $params['row']->title;
221
- $params['param_values'] = $params['row']->css;
222
- $params['tabs'] = array(
223
- 'global' => __('Global Parameters', WDFMInstance(self::PLUGIN)->prefix),
224
- 'header' => __('Header', WDFMInstance(self::PLUGIN)->prefix),
225
- 'content' => __('Content', WDFMInstance(self::PLUGIN)->prefix),
226
- 'input_select' => __('Inputbox', WDFMInstance(self::PLUGIN)->prefix),
227
- 'choices' => __('Choices', WDFMInstance(self::PLUGIN)->prefix),
228
- 'subscribe' => __('General Buttons', WDFMInstance(self::PLUGIN)->prefix),
229
- 'paigination' => __('Pagination', WDFMInstance(self::PLUGIN)->prefix),
230
- 'buttons' => __('Buttons', WDFMInstance(self::PLUGIN)->prefix),
231
- 'close_button' => __('Close(Minimize) Button', WDFMInstance(self::PLUGIN)->prefix),
232
- 'minimize' => __('Minimize Text', WDFMInstance(self::PLUGIN)->prefix),
233
- 'other' => __('Other', WDFMInstance(self::PLUGIN)->prefix),
234
- 'custom_css' => __('Custom CSS', WDFMInstance(self::PLUGIN)->prefix),
235
- );
236
- $border_types = array(
237
- '' => '',
238
- 'solid' => 'Solid',
239
- 'dotted' => 'Dotted',
240
- 'dashed' => 'Dashed',
241
- 'double' => 'Double',
242
- 'groove' => 'Groove',
243
- 'ridge' => 'Ridge',
244
- 'inset' => 'Inset',
245
- 'outset' => 'Outset',
246
- 'initial' => 'Initial',
247
- 'inherit' => 'Inherit',
248
- 'hidden' => 'Hidden',
249
- 'none' => 'None',
250
- );
251
- $borders = array(
252
- '' => '',
253
- 'top' => __('Top', WDFMInstance(self::PLUGIN)->prefix),
254
- 'right' => __('Right', WDFMInstance(self::PLUGIN)->prefix),
255
- 'bottom' => __('Bottom', WDFMInstance(self::PLUGIN)->prefix),
256
- 'left' => __('Left', WDFMInstance(self::PLUGIN)->prefix)
257
- );
258
- $position_types = array(
259
- '' => '',
260
- 'static' => 'Static',
261
- 'relative' => 'Relative',
262
- 'fixed' => 'Fixed',
263
- 'absolute' => 'Absolute',
264
- );
265
- $font_weights = array(
266
- '' => '',
267
- 'normal' => 'Normal',
268
- 'bold' => 'Bold',
269
- 'bolder' => 'Bolder',
270
- 'lighter' => 'Lighter',
271
- 'initial' => 'Initial',
272
- );
273
- $aligns = array( '' => '', 'left' => __('Left', WDFMInstance(self::PLUGIN)->prefix), 'center' => __('Center', WDFMInstance(self::PLUGIN)->prefix), 'right' => __('Right', WDFMInstance(self::PLUGIN)->prefix) );
274
- $basic_fonts = array(
275
- '' => '',
276
- 'arial' => 'Arial',
277
- 'lucida grande' => 'Lucida grande',
278
- 'segoe ui' => 'Segoe ui',
279
- 'tahoma' => 'Tahoma',
280
- 'trebuchet ms' => 'Trebuchet ms',
281
- 'verdana' => 'Verdana',
282
- 'cursive' => 'Cursive',
283
- 'fantasy' => 'Fantasy',
284
- 'monospace' => 'Monospace',
285
- 'serif' => 'Serif',
286
- );
287
- $bg_repeats = array(
288
- '' => '',
289
- 'repeat' => 'repeat',
290
- 'repeat-x' => 'repeat-x',
291
- 'repeat-y' => 'repeat-y',
292
- 'no-repeat' => 'no-repeat',
293
- 'initial' => 'initial',
294
- 'inherit' => 'inherit',
295
- );
296
- $google_fonts = WDW_FM_Library(self::PLUGIN)->get_google_fonts();
297
- $font_families = $basic_fonts + $google_fonts;
298
- $params['fonts'] = implode("|", str_replace(' ', '+', $google_fonts));
299
- $params['all_params'] = $this->all_params($params['param_values'], $borders, $border_types, $font_weights, $position_types, $aligns, $bg_repeats, $font_families);
300
-
301
- $this->view->edit($params);
302
- }
303
-
304
- /**
305
- * all params.
306
- *
307
- * @param array $param_values
308
- * @param array $borders
309
- * @param array $border_types
310
- * @param array $font_weights
311
- * @param array $position_types
312
- * @param array $aligns
313
- * @param array $bg_repeats
314
- * @param array $font_families
315
- * @return array
316
- */
317
- public function all_params( $param_values = array(), $borders = array(), $border_types = array(), $font_weights = array(), $position_types = array(), $aligns = array(), $bg_repeats = array(), $font_families = array() ) {
318
- $all_params = array(
319
- 'global' => array(
320
- array(
321
- 'label' => '',
322
- 'type' => 'panel',
323
- 'class' => 'col-md-12',
324
- 'label_class' => '',
325
- 'after' => '',
326
- ),
327
- array(
328
- 'label' => __('Font Family', WDFMInstance(self::PLUGIN)->prefix),
329
- 'name' => 'GPFontFamily',
330
- 'type' => 'select',
331
- 'options' => $font_families,
332
- 'class' => '',
333
- 'value' => isset($param_values->GPFontFamily) ? $param_values->GPFontFamily : '',
334
- 'after' => '',
335
- ),
336
- array(
337
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
338
- 'name' => 'AGPWidth',
339
- 'type' => 'text',
340
- 'class' => '',
341
- 'value' => isset($param_values->AGPWidth) ? $param_values->AGPWidth : '',
342
- 'after' => '%',
343
- ),
344
- array(
345
- 'label' => __('Width (for scrollbox, popup form types)', WDFMInstance(self::PLUGIN)->prefix),
346
- 'name' => 'AGPSPWidth',
347
- 'type' => 'text',
348
- 'class' => '',
349
- 'value' => isset($param_values->AGPSPWidth) ? $param_values->AGPSPWidth : '',
350
- 'after' => '%',
351
- ),
352
- array(
353
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
354
- 'name' => 'AGPPadding',
355
- 'type' => 'text',
356
- 'class' => '',
357
- 'placeholder' => __('e.g. 3px 5px or 3% 5%', WDFMInstance(self::PLUGIN)->prefix),
358
- 'value' => isset($param_values->AGPPadding) ? $param_values->AGPPadding : '',
359
- 'after' => '',
360
- ),
361
- array(
362
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
363
- 'name' => 'AGPMargin',
364
- 'type' => 'text',
365
- 'class' => '',
366
- 'value' => isset($param_values->AGPMargin) ? $param_values->AGPMargin : '',
367
- 'placeholder' => __('e.g. 5px 10px or 5% 10%', WDFMInstance(self::PLUGIN)->prefix),
368
- 'after' => '',
369
- ),
370
- array(
371
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
372
- 'name' => 'AGPBorder',
373
- 'type' => 'checkbox',
374
- 'options' => $borders,
375
- 'class' => '',
376
- 'after' => '',
377
- ),
378
- array(
379
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
380
- 'name' => 'AGPBorderColor',
381
- 'type' => 'text',
382
- 'class' => 'color',
383
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #e5e5e5',
384
- 'value' => isset($param_values->AGPBorderColor) ? $param_values->AGPBorderColor : '',
385
- 'after' => '',
386
- ),
387
- array(
388
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
389
- 'name' => 'AGPBorderType',
390
- 'type' => 'select',
391
- 'options' => $border_types,
392
- 'class' => '',
393
- 'value' => isset($param_values->AGPBorderType) ? $param_values->AGPBorderType : '',
394
- 'after' => '',
395
- ),
396
- array(
397
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
398
- 'name' => 'AGPBorderWidth',
399
- 'type' => 'text',
400
- 'class' => '',
401
- 'value' => isset($param_values->AGPBorderWidth) ? $param_values->AGPBorderWidth : '',
402
- 'after' => 'px',
403
- ),
404
- array(
405
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
406
- 'name' => 'AGPBorderRadius',
407
- 'type' => 'text',
408
- 'class' => '',
409
- 'value' => isset($param_values->AGPBorderRadius) ? $param_values->AGPBorderRadius : '',
410
- 'after' => 'px',
411
- ),
412
- array(
413
- 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
414
- 'name' => 'AGPBoxShadow',
415
- 'type' => 'text',
416
- 'class' => '',
417
- 'value' => isset($param_values->AGPBoxShadow) ? $param_values->AGPBoxShadow : '',
418
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 5px 2px #888888',
419
- 'after' => '</div>',
420
- ),
421
- ),
422
- 'header' => array(
423
- array(
424
- 'label' => __('General Parameters', WDFMInstance(self::PLUGIN)->prefix),
425
- 'type' => 'panel',
426
- 'class' => 'col-md-12',
427
- 'label_class' => 'fm-mini-title',
428
- 'after' => '<br/>',
429
- ),
430
- array(
431
- 'label' => __('Alignment', WDFMInstance(self::PLUGIN)->prefix),
432
- 'name' => 'HPAlign',
433
- 'type' => 'select',
434
- 'options' => $borders,
435
- 'class' => '',
436
- 'value' => isset($param_values->HPAlign) ? $param_values->HPAlign : '',
437
- 'after' => '',
438
- ),
439
- array(
440
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
441
- 'name' => 'HPBGColor',
442
- 'type' => 'text',
443
- 'class' => 'color',
444
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
445
- 'value' => isset($param_values->HPBGColor) ? $param_values->HPBGColor : '',
446
- 'after' => '',
447
- ),
448
- array(
449
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
450
- 'name' => 'HPWidth',
451
- 'type' => 'text',
452
- 'class' => '',
453
- 'value' => isset($param_values->HPWidth) ? $param_values->HPWidth : '',
454
- 'after' => '%',
455
- ),
456
- array(
457
- 'label' => __('Width (for topbar form type)', WDFMInstance(self::PLUGIN)->prefix),
458
- 'name' => 'HTPWidth',
459
- 'type' => 'text',
460
- 'class' => '',
461
- 'value' => isset($param_values->HTPWidth) ? $param_values->HTPWidth : '',
462
- 'after' => '%',
463
- ),
464
- array(
465
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
466
- 'name' => 'HPPadding',
467
- 'type' => 'text',
468
- 'class' => '',
469
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 3px 5px or 3% 5%',
470
- 'value' => isset($param_values->HPPadding) ? $param_values->HPPadding : '',
471
- 'after' => '',
472
- ),
473
- array(
474
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
475
- 'name' => 'HPMargin',
476
- 'type' => 'text',
477
- 'class' => '',
478
- 'value' => isset($param_values->HPMargin) ? $param_values->HPMargin : '',
479
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
480
- 'after' => '',
481
- ),
482
- array(
483
- 'label' => __('Text Align', WDFMInstance(self::PLUGIN)->prefix),
484
- 'name' => 'HPTextAlign',
485
- 'type' => 'select',
486
- 'options' => $aligns,
487
- 'class' => '',
488
- 'value' => isset($param_values->HPTextAlign) ? $param_values->HPTextAlign : '',
489
- 'after' => '',
490
- ),
491
- array(
492
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
493
- 'name' => 'HPBorder',
494
- 'type' => 'checkbox',
495
- 'options' => $borders,
496
- 'class' => '',
497
- 'after' => '',
498
- ),
499
- array(
500
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
501
- 'name' => 'HPBorderColor',
502
- 'type' => 'text',
503
- 'class' => 'color',
504
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
505
- 'value' => isset($param_values->HPBorderColor) ? $param_values->HPBorderColor : '',
506
- 'after' => '',
507
- ),
508
- array(
509
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
510
- 'name' => 'HPBorderType',
511
- 'type' => 'select',
512
- 'options' => $border_types,
513
- 'class' => '',
514
- 'value' => isset($param_values->HPBorderType) ? $param_values->HPBorderType : '',
515
- 'after' => '',
516
- ),
517
- array(
518
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
519
- 'name' => 'HPBorderWidth',
520
- 'type' => 'text',
521
- 'class' => '',
522
- 'value' => isset($param_values->HPBorderWidth) ? $param_values->HPBorderWidth : '',
523
- 'after' => 'px',
524
- ),
525
- array(
526
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
527
- 'name' => 'HPBorderRadius',
528
- 'type' => 'text',
529
- 'class' => '',
530
- 'value' => isset($param_values->HPBorderRadius) ? $param_values->HPBorderRadius : '',
531
- 'after' => 'px</div>',
532
- ),
533
- array(
534
- 'label' => __('Title Parameters', WDFMInstance(self::PLUGIN)->prefix),
535
- 'type' => 'panel',
536
- 'class' => 'col-md-12',
537
- 'label_class' => 'fm-mini-title',
538
- 'after' => '<br/>',
539
- ),
540
- array(
541
- 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
542
- 'name' => 'HTPFontSize',
543
- 'type' => 'text',
544
- 'class' => '',
545
- 'value' => isset($param_values->HTPFontSize) ? $param_values->HTPFontSize : '',
546
- 'after' => 'px',
547
- ),
548
- array(
549
- 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
550
- 'name' => 'HTPWeight',
551
- 'type' => 'select',
552
- 'options' => $font_weights,
553
- 'class' => '',
554
- 'value' => isset($param_values->HTPWeight) ? $param_values->HTPWeight : '',
555
- 'after' => '',
556
- ),
557
- array(
558
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
559
- 'name' => 'HTPColor',
560
- 'type' => 'text',
561
- 'class' => 'color',
562
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
563
- 'value' => isset($param_values->HTPColor) ? $param_values->HTPColor : '',
564
- 'after' => '',
565
- ),
566
- array(
567
- 'label' => __('Description Parameters', WDFMInstance(self::PLUGIN)->prefix),
568
- 'type' => 'label',
569
- 'class' => 'fm-mini-title',
570
- 'after' => '<br/>',
571
- ),
572
- array(
573
- 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
574
- 'name' => 'HDPFontSize',
575
- 'type' => 'text',
576
- 'class' => '',
577
- 'value' => isset($param_values->HDPFontSize) ? $param_values->HDPFontSize : '',
578
- 'after' => 'px',
579
- ),
580
- array(
581
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
582
- 'name' => 'HDPColor',
583
- 'type' => 'text',
584
- 'class' => 'color',
585
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
586
- 'value' => isset($param_values->HDPColor) ? $param_values->HDPColor : '',
587
- 'after' => '',
588
- ),
589
- array(
590
- 'label' => __('Image Parameters', WDFMInstance(self::PLUGIN)->prefix),
591
- 'type' => 'label',
592
- 'class' => 'fm-mini-title',
593
- 'after' => '<br/>',
594
- ),
595
- array(
596
- 'label' => __('Alignment', WDFMInstance(self::PLUGIN)->prefix),
597
- 'name' => 'HIPAlign',
598
- 'type' => 'select',
599
- 'options' => $borders,
600
- 'class' => '',
601
- 'value' => isset($param_values->HIPAlign) ? $param_values->HIPAlign : '',
602
- 'after' => '',
603
- ),
604
- array(
605
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
606
- 'name' => 'HIPWidth',
607
- 'type' => 'text',
608
- 'class' => '',
609
- 'value' => isset($param_values->HIPWidth) ? $param_values->HIPWidth : '',
610
- 'after' => 'px',
611
- ),
612
- array(
613
- 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
614
- 'name' => 'HIPHeight',
615
- 'type' => 'text',
616
- 'class' => '',
617
- 'value' => isset($param_values->HIPHeight) ? $param_values->HIPHeight : '',
618
- 'after' => 'px</div>',
619
- ),
620
- ),
621
- 'content' => array(
622
- array(
623
- 'label' => __('General Parameters', WDFMInstance(self::PLUGIN)->prefix),
624
- 'type' => 'panel',
625
- 'class' => 'col-md-12',
626
- 'label_class' => 'fm-mini-title',
627
- 'after' => '<br/>',
628
- ),
629
- array(
630
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
631
- 'name' => 'GPBGColor',
632
- 'type' => 'text',
633
- 'class' => 'color',
634
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
635
- 'value' => isset($param_values->GPBGColor) ? $param_values->GPBGColor : '',
636
- 'after' => '',
637
- ),
638
- array(
639
- 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
640
- 'name' => 'GPFontSize',
641
- 'type' => 'text',
642
- 'class' => '',
643
- 'value' => isset($param_values->GPFontSize) ? $param_values->GPFontSize : '',
644
- 'after' => 'px',
645
- ),
646
- array(
647
- 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
648
- 'name' => 'GPFontWeight',
649
- 'type' => 'select',
650
- 'options' => $font_weights,
651
- 'class' => '',
652
- 'value' => isset($param_values->GPFontWeight) ? $param_values->GPFontWeight : '',
653
- 'after' => '',
654
- ),
655
- array(
656
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
657
- 'name' => 'GPWidth',
658
- 'type' => 'text',
659
- 'class' => '',
660
- 'value' => isset($param_values->GPWidth) ? $param_values->GPWidth : '',
661
- 'after' => '%',
662
- ),
663
- array(
664
- 'label' => __('Width (for topbar form type)', WDFMInstance(self::PLUGIN)->prefix),
665
- 'name' => 'GTPWidth',
666
- 'type' => 'text',
667
- 'class' => '',
668
- 'value' => isset($param_values->GTPWidth) ? $param_values->GTPWidth : '',
669
- 'after' => '%',
670
- ),
671
- array(
672
- 'label' => __('Alignment', WDFMInstance(self::PLUGIN)->prefix),
673
- 'name' => 'GPAlign',
674
- 'type' => 'select',
675
- 'options' => $aligns,
676
- 'class' => '',
677
- 'value' => isset($param_values->GPAlign) ? $param_values->GPAlign : '',
678
- 'after' => '',
679
- ),
680
- array(
681
- 'label' => __('Background URL', WDFMInstance(self::PLUGIN)->prefix),
682
- 'name' => 'GPBackground',
683
- 'type' => 'text',
684
- 'class' => '',
685
- // 'placeholder' => __('e.g. http:// or https://', WDFMInstance(self::PLUGIN)->prefix),
686
- 'value' => isset($param_values->GPBackground) ? $param_values->GPBackground : '',
687
- 'after' => '',
688
- ),
689
- array(
690
- 'label' => __('Background Repeat', WDFMInstance(self::PLUGIN)->prefix),
691
- 'name' => 'GPBackgroundRepeat',
692
- 'type' => 'select',
693
- 'options' => $bg_repeats,
694
- 'class' => '',
695
- 'value' => isset($param_values->GPBackgroundRepeat) ? $param_values->GPBackgroundRepeat : '',
696
- 'after' => '',
697
- ),
698
- array(
699
- 'label' => __('Background Position', WDFMInstance(self::PLUGIN)->prefix),
700
- 'name1' => 'GPBGPosition1',
701
- 'name2' => 'GPBGPosition2',
702
- 'type' => '2text',
703
- 'class' => 'fm-2text',
704
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' px|%, top|bottom|left|right|center',
705
- 'value1' => isset($param_values->GPBGPosition1) ? $param_values->GPBGPosition1 : '',
706
- 'value2' => isset($param_values->GPBGPosition2) ? $param_values->GPBGPosition2 : '',
707
- 'before1' => '',
708
- 'before2' => '',
709
- 'after' => '',
710
- ),
711
- array(
712
- 'label' => __('Background Size', WDFMInstance(self::PLUGIN)->prefix),
713
- 'name1' => 'GPBGSize1',
714
- 'name2' => 'GPBGSize2',
715
- 'type' => '2text',
716
- 'class' => 'fm-2text',
717
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' px|%, auto|cover|contain',
718
- 'value1' => isset($param_values->GPBGSize1) ? $param_values->GPBGSize1 : '',
719
- 'value2' => isset($param_values->GPBGSize2) ? $param_values->GPBGSize2 : '',
720
- 'before1' => '',
721
- 'before2' => '',
722
- 'after' => '',
723
- ),
724
- array(
725
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
726
- 'name' => 'GPColor',
727
- 'type' => 'text',
728
- 'class' => 'color',
729
- 'value' => isset($param_values->GPColor) ? $param_values->GPColor : '',
730
- 'after' => '',
731
- ),
732
- array(
733
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
734
- 'name' => 'GPPadding',
735
- 'type' => 'text',
736
- 'class' => '',
737
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 3px 5px or 3% 5%',
738
- 'value' => isset($param_values->GPPadding) ? $param_values->GPPadding : '',
739
- 'after' => '',
740
- ),
741
- array(
742
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
743
- 'name' => 'GPMargin',
744
- 'type' => 'text',
745
- 'class' => '',
746
- 'value' => isset($param_values->GPMargin) ? $param_values->GPMargin : '',
747
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
748
- 'after' => '',
749
- ),
750
- array(
751
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
752
- 'name' => 'GPBorder',
753
- 'type' => 'checkbox',
754
- 'options' => $borders,
755
- 'class' => '',
756
- 'after' => '',
757
- ),
758
- array(
759
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
760
- 'name' => 'GPBorderColor',
761
- 'type' => 'text',
762
- 'class' => 'color',
763
- 'value' => isset($param_values->GPBorderColor) ? $param_values->GPBorderColor : '',
764
- 'after' => '',
765
- ),
766
- array(
767
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
768
- 'name' => 'GPBorderType',
769
- 'type' => 'select',
770
- 'options' => $border_types,
771
- 'class' => '',
772
- 'value' => isset($param_values->GPBorderType) ? $param_values->GPBorderType : '',
773
- 'after' => '',
774
- ),
775
- array(
776
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
777
- 'name' => 'GPBorderWidth',
778
- 'type' => 'text',
779
- 'class' => '',
780
- 'value' => isset($param_values->GPBorderWidth) ? $param_values->GPBorderWidth : '',
781
- 'after' => 'px',
782
- ),
783
- array(
784
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
785
- 'name' => 'GPBorderRadius',
786
- 'type' => 'text',
787
- 'class' => '',
788
- 'value' => isset($param_values->GPBorderRadius) ? $param_values->GPBorderRadius : '',
789
- 'after' => 'px</div>',
790
- ),
791
- array(
792
- 'label' => __('Mini labels (name, phone, address, checkbox, radio) Parameters', WDFMInstance(self::PLUGIN)->prefix),
793
- 'type' => 'panel',
794
- 'class' => 'col-md-12',
795
- 'label_class' => 'fm-mini-title',
796
- 'after' => '<br/>',
797
- ),
798
- array(
799
- 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
800
- 'name' => 'GPMLFontSize',
801
- 'type' => 'text',
802
- 'class' => '',
803
- 'value' => isset($param_values->GPMLFontSize) ? $param_values->GPMLFontSize : '',
804
- 'after' => 'px',
805
- ),
806
- array(
807
- 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
808
- 'name' => 'GPMLFontWeight',
809
- 'type' => 'select',
810
- 'options' => $font_weights,
811
- 'class' => '',
812
- 'value' => isset($param_values->GPMLFontWeight) ? $param_values->GPMLFontWeight : '',
813
- 'after' => '',
814
- ),
815
- array(
816
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
817
- 'name' => 'GPMLColor',
818
- 'type' => 'text',
819
- 'class' => 'color',
820
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
821
- 'value' => isset($param_values->GPMLColor) ? $param_values->GPMLColor : '',
822
- 'after' => '',
823
- ),
824
- array(
825
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
826
- 'name' => 'GPMLPadding',
827
- 'type' => 'text',
828
- 'class' => '',
829
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 3px 5px or 3% 5%',
830
- 'value' => isset($param_values->GPMLPadding) ? $param_values->GPMLPadding : '',
831
- 'after' => '',
832
- ),
833
- array(
834
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
835
- 'name' => 'GPMLMargin',
836
- 'type' => 'text',
837
- 'class' => '',
838
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
839
- 'value' => isset($param_values->GPMLMargin) ? $param_values->GPMLMargin : '',
840
- 'after' => '',
841
- ),
842
- array(
843
- 'label' => __('Section Parameters', WDFMInstance(self::PLUGIN)->prefix),
844
- 'type' => 'label',
845
- 'class' => 'fm-mini-title',
846
- 'after' => '<br/>',
847
- ),
848
- array(
849
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
850
- 'name' => 'SEPBGColor',
851
- 'type' => 'text',
852
- 'class' => 'color',
853
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
854
- 'value' => isset($param_values->SEPBGColor) ? $param_values->SEPBGColor : '',
855
- 'after' => '',
856
- ),
857
- array(
858
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
859
- 'name' => 'SEPPadding',
860
- 'type' => 'text',
861
- 'class' => '',
862
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 3px 5px or 3% 5%',
863
- 'value' => isset($param_values->SEPPadding) ? $param_values->SEPPadding : '',
864
- 'after' => '',
865
- ),
866
- array(
867
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
868
- 'name' => 'SEPMargin',
869
- 'type' => 'text',
870
- 'class' => '',
871
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
872
- 'value' => isset($param_values->SEPMargin) ? $param_values->SEPMargin : '',
873
- 'after' => '',
874
- ),
875
- array(
876
- 'label' => __('Section Column Parameters', WDFMInstance(self::PLUGIN)->prefix),
877
- 'type' => 'label',
878
- 'class' => 'fm-mini-title',
879
- 'after' => '<br/>',
880
- ),
881
- array(
882
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
883
- 'name' => 'COPPadding',
884
- 'type' => 'text',
885
- 'class' => '',
886
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 3px 5px or 3% 5%',
887
- 'value' => isset($param_values->COPPadding) ? $param_values->COPPadding : '',
888
- 'after' => '',
889
- ),
890
- array(
891
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
892
- 'name' => 'COPMargin',
893
- 'type' => 'text',
894
- 'class' => '',
895
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
896
- 'value' => isset($param_values->COPMargin) ? $param_values->COPMargin : '',
897
- 'after' => '',
898
- ),
899
- array(
900
- 'label' => __('Footer Parameters', WDFMInstance(self::PLUGIN)->prefix),
901
- 'type' => 'label',
902
- 'class' => 'fm-mini-title',
903
- 'after' => '<br/>',
904
- ),
905
- array(
906
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
907
- 'name' => 'FPWidth',
908
- 'type' => 'text',
909
- 'class' => '',
910
- 'value' => isset($param_values->FPWidth) ? $param_values->FPWidth : '',
911
- 'after' => '%',
912
- ),
913
- array(
914
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
915
- 'name' => 'FPPadding',
916
- 'type' => 'text',
917
- 'class' => '',
918
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 3px 5px or 3% 5%',
919
- 'value' => isset($param_values->FPPadding) ? $param_values->FPPadding : '',
920
- 'after' => '',
921
- ),
922
- array(
923
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
924
- 'name' => 'FPMargin',
925
- 'type' => 'text',
926
- 'class' => '',
927
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
928
- 'value' => isset($param_values->FPMargin) ? $param_values->FPMargin : '',
929
- 'after' => '</div>',
930
- ),
931
- ),
932
- 'input_select' => array(
933
- array(
934
- 'label' => '',
935
- 'type' => 'panel',
936
- 'class' => 'col-md-12',
937
- 'label_class' => '',
938
- 'after' => '',
939
- ),
940
- array(
941
- 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
942
- 'name' => 'IPHeight',
943
- 'type' => 'text',
944
- 'class' => '',
945
- 'value' => isset($param_values->IPHeight) ? $param_values->IPHeight : '',
946
- 'after' => 'px',
947
- ),
948
- array(
949
- 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
950
- 'name' => 'IPFontSize',
951
- 'type' => 'text',
952
- 'class' => '',
953
- 'value' => isset($param_values->IPFontSize) ? $param_values->IPFontSize : '',
954
- 'after' => 'px',
955
- ),
956
- array(
957
- 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
958
- 'name' => 'IPFontWeight',
959
- 'type' => 'select',
960
- 'options' => $font_weights,
961
- 'class' => '',
962
- 'value' => isset($param_values->IPFontWeight) ? $param_values->IPFontWeight : '',
963
- 'after' => '',
964
- ),
965
- array(
966
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
967
- 'name' => 'IPBGColor',
968
- 'type' => 'text',
969
- 'class' => 'color',
970
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
971
- 'value' => isset($param_values->IPBGColor) ? $param_values->IPBGColor : '',
972
- 'after' => '',
973
- ),
974
- array(
975
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
976
- 'name' => 'IPColor',
977
- 'type' => 'text',
978
- 'class' => 'color',
979
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
980
- 'value' => isset($param_values->IPColor) ? $param_values->IPColor : '',
981
- 'after' => '',
982
- ),
983
- array(
984
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
985
- 'name' => 'IPPadding',
986
- 'type' => 'text',
987
- 'class' => '',
988
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 3px 5px or 3% 5%',
989
- 'value' => isset($param_values->IPPadding) ? $param_values->IPPadding : '',
990
- 'after' => '',
991
- ),
992
- array(
993
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
994
- 'name' => 'IPMargin',
995
- 'type' => 'text',
996
- 'class' => '',
997
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
998
- 'value' => isset($param_values->IPMargin) ? $param_values->IPMargin : '',
999
- 'after' => '',
1000
- ),
1001
- array(
1002
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1003
- 'name' => 'IPBorder',
1004
- 'type' => 'checkbox',
1005
- 'options' => $borders,
1006
- 'class' => '',
1007
- 'after' => '',
1008
- ),
1009
- array(
1010
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1011
- 'name' => 'IPBorderColor',
1012
- 'type' => 'text',
1013
- 'class' => 'color',
1014
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
1015
- 'value' => isset($param_values->IPBorderColor) ? $param_values->IPBorderColor : '',
1016
- 'after' => '',
1017
- ),
1018
- array(
1019
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1020
- 'name' => 'IPBorderType',
1021
- 'type' => 'select',
1022
- 'options' => $border_types,
1023
- 'class' => '',
1024
- 'value' => isset($param_values->IPBorderType) ? $param_values->IPBorderType : '',
1025
- 'after' => '',
1026
- ),
1027
- array(
1028
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1029
- 'name' => 'IPBorderWidth',
1030
- 'type' => 'text',
1031
- 'class' => '',
1032
- 'value' => isset($param_values->IPBorderWidth) ? $param_values->IPBorderWidth : '',
1033
- 'after' => 'px',
1034
- ),
1035
- array(
1036
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1037
- 'name' => 'IPBorderRadius',
1038
- 'type' => 'text',
1039
- 'class' => '',
1040
- 'value' => isset($param_values->IPBorderRadius) ? $param_values->IPBorderRadius : '',
1041
- 'after' => 'px',
1042
- ),
1043
- array(
1044
- 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
1045
- 'name' => 'IPBoxShadow',
1046
- 'type' => 'text',
1047
- 'class' => '',
1048
- 'value' => isset($param_values->IPBoxShadow) ? $param_values->IPBoxShadow : '',
1049
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 5px 2px #888888',
1050
- 'after' => '</div>',
1051
- ),
1052
- array(
1053
- 'label' => __('Dropdown additional', WDFMInstance(self::PLUGIN)->prefix),
1054
- 'type' => 'panel',
1055
- 'class' => 'col-md-12',
1056
- 'label_class' => 'fm-mini-title',
1057
- 'after' => '<br/>',
1058
- ),
1059
- array(
1060
- 'label' => __('Appearance', WDFMInstance(self::PLUGIN)->prefix),
1061
- 'name' => 'SBPAppearance',
1062
- 'type' => 'text',
1063
- 'class' => '',
1064
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' normal, icon, window, button, menu, field',
1065
- 'value' => isset($param_values->SBPAppearance) ? $param_values->SBPAppearance : '',
1066
- 'after' => '',
1067
- ),
1068
- array(
1069
- 'label' => __('Background URL', WDFMInstance(self::PLUGIN)->prefix),
1070
- 'name' => 'SBPBackground',
1071
- 'type' => 'text',
1072
- 'class' => '',
1073
- // 'placeholder' => __('e.g. http:// or https://', WDFMInstance(self::PLUGIN)->prefix),
1074
- 'value' => isset($param_values->SBPBackground) ? $param_values->SBPBackground : '',
1075
- 'after' => '',
1076
- ),
1077
- array(
1078
- 'label' => __('Background Repeat', WDFMInstance(self::PLUGIN)->prefix),
1079
- 'name' => 'SBPBGRepeat',
1080
- 'type' => 'select',
1081
- 'options' => $bg_repeats,
1082
- 'class' => '',
1083
- 'value' => isset($param_values->SBPBGRepeat) ? $param_values->SBPBGRepeat : '',
1084
- 'after' => '',
1085
- ),
1086
- array(
1087
- 'label' => '',
1088
- 'type' => 'label',
1089
- 'class' => '',
1090
- 'after' => '</div>',
1091
- ),
1092
- ),
1093
- 'choices' => array(
1094
- array(
1095
- 'label' => __('Single Choice', WDFMInstance(self::PLUGIN)->prefix),
1096
- 'type' => 'panel',
1097
- 'class' => 'col-md-12',
1098
- 'label_class' => 'fm-mini-title',
1099
- 'after' => '<br/>',
1100
- ),
1101
- array(
1102
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1103
- 'name' => 'SCPBGColor',
1104
- 'type' => 'text',
1105
- 'class' => 'color',
1106
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
1107
- 'value' => isset($param_values->SCPBGColor) ? $param_values->SCPBGColor : '',
1108
- 'after' => '',
1109
- ),
1110
- array(
1111
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
1112
- 'name' => 'SCPWidth',
1113
- 'type' => 'text',
1114
- 'class' => '',
1115
- 'value' => isset($param_values->SCPWidth) ? $param_values->SCPWidth : '',
1116
- 'after' => 'px',
1117
- ),
1118
- array(
1119
- 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1120
- 'name' => 'SCPHeight',
1121
- 'type' => 'text',
1122
- 'class' => '',
1123
- 'value' => isset($param_values->SCPHeight) ? $param_values->SCPHeight : '',
1124
- 'after' => 'px',
1125
- ),
1126
- array(
1127
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1128
- 'name' => 'SCPMargin',
1129
- 'type' => 'text',
1130
- 'class' => '5px',
1131
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
1132
- 'value' => isset($param_values->SCPMargin) ? $param_values->SCPMargin : '',
1133
- 'after' => '',
1134
- ),
1135
- array(
1136
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1137
- 'name' => 'SCPBorder',
1138
- 'type' => 'checkbox',
1139
- 'options' => $borders,
1140
- 'class' => '',
1141
- 'after' => '',
1142
- ),
1143
- array(
1144
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1145
- 'name' => 'SCPBorderColor',
1146
- 'type' => 'text',
1147
- 'class' => 'color',
1148
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
1149
- 'value' => isset($param_values->SCPBorderColor) ? $param_values->SCPBorderColor : '',
1150
- 'after' => '',
1151
- ),
1152
- array(
1153
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1154
- 'name' => 'SCPBorderType',
1155
- 'type' => 'select',
1156
- 'options' => $border_types,
1157
- 'class' => '',
1158
- 'value' => isset($param_values->SCPBorderType) ? $param_values->SCPBorderType : '',
1159
- 'after' => '',
1160
- ),
1161
- array(
1162
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1163
- 'name' => 'SCPBorderWidth',
1164
- 'type' => 'text',
1165
- 'class' => '',
1166
- 'value' => isset($param_values->SCPBorderWidth) ? $param_values->SCPBorderWidth : '',
1167
- 'after' => 'px',
1168
- ),
1169
- array(
1170
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1171
- 'name' => 'SCPBorderRadius',
1172
- 'type' => 'text',
1173
- 'class' => '',
1174
- 'value' => isset($param_values->SCPBorderRadius) ? $param_values->SCPBorderRadius : '',
1175
- 'after' => 'px',
1176
- ),
1177
- array(
1178
- 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
1179
- 'name' => 'SCPBoxShadow',
1180
- 'type' => 'text',
1181
- 'class' => '',
1182
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 5px 2px #888888',
1183
- 'value' => isset($param_values->SCPBoxShadow) ? $param_values->SCPBoxShadow : '',
1184
- 'after' => '',
1185
- ),
1186
- array(
1187
- 'label' => __('Checked Parameters', WDFMInstance(self::PLUGIN)->prefix),
1188
- 'type' => 'label',
1189
- 'class' => 'fm-mini-title',
1190
- 'after' => '<br/>',
1191
- ),
1192
- array(
1193
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1194
- 'name' => 'SCCPBGColor',
1195
- 'type' => 'text',
1196
- 'class' => 'color',
1197
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
1198
- 'value' => isset($param_values->SCCPBGColor) ? $param_values->SCCPBGColor : '',
1199
- 'after' => '',
1200
- ),
1201
- array(
1202
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
1203
- 'name' => 'SCCPWidth',
1204
- 'type' => 'text',
1205
- 'class' => '',
1206
- 'value' => isset($param_values->SCCPWidth) ? $param_values->SCCPWidth : '',
1207
- 'after' => 'px',
1208
- ),
1209
- array(
1210
- 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1211
- 'name' => 'SCCPHeight',
1212
- 'type' => 'text',
1213
- 'class' => '',
1214
- 'value' => isset($param_values->SCCPHeight) ? $param_values->SCCPHeight : '',
1215
- 'after' => 'px',
1216
- ),
1217
- array(
1218
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1219
- 'name' => 'SCCPMargin',
1220
- 'type' => 'text',
1221
- 'class' => '',
1222
- 'value' => isset($param_values->SCCPMargin) ? $param_values->SCCPMargin : '',
1223
- 'after' => 'px',
1224
- ),
1225
- array(
1226
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1227
- 'name' => 'SCCPBorderRadius',
1228
- 'type' => 'text',
1229
- 'class' => '',
1230
- 'value' => isset($param_values->SCCPBorderRadius) ? $param_values->SCCPBorderRadius : '',
1231
- 'after' => 'px</div>',
1232
- ),
1233
- array(
1234
- 'label' => __('Multiple Choice', WDFMInstance(self::PLUGIN)->prefix),
1235
- 'type' => 'panel',
1236
- 'class' => 'col-md-12',
1237
- 'label_class' => 'fm-mini-title',
1238
- 'after' => '<br/>',
1239
- ),
1240
- array(
1241
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1242
- 'name' => 'MCPBGColor',
1243
- 'type' => 'text',
1244
- 'class' => 'color',
1245
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
1246
- 'value' => isset($param_values->MCPBGColor) ? $param_values->MCPBGColor : '',
1247
- 'after' => '',
1248
- ),
1249
- array(
1250
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
1251
- 'name' => 'MCPWidth',
1252
- 'type' => 'text',
1253
- 'class' => '',
1254
- 'value' => isset($param_values->MCPWidth) ? $param_values->MCPWidth : '',
1255
- 'after' => 'px',
1256
- ),
1257
- array(
1258
- 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1259
- 'name' => 'MCPHeight',
1260
- 'type' => 'text',
1261
- 'class' => '',
1262
- 'value' => isset($param_values->MCPHeight) ? $param_values->MCPHeight : '',
1263
- 'after' => 'px',
1264
- ),
1265
- array(
1266
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1267
- 'name' => 'MCPMargin',
1268
- 'type' => 'text',
1269
- 'class' => '5px',
1270
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
1271
- 'value' => isset($param_values->MCPMargin) ? $param_values->MCPMargin : '',
1272
- 'after' => '',
1273
- ),
1274
- array(
1275
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1276
- 'name' => 'MCPBorder',
1277
- 'type' => 'checkbox',
1278
- 'options' => $borders,
1279
- 'class' => '',
1280
- 'after' => '',
1281
- ),
1282
- array(
1283
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1284
- 'name' => 'MCPBorderColor',
1285
- 'type' => 'text',
1286
- 'class' => 'color',
1287
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
1288
- 'value' => isset($param_values->MCPBorderColor) ? $param_values->MCPBorderColor : '',
1289
- 'after' => '',
1290
- ),
1291
- array(
1292
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1293
- 'name' => 'MCPBorderType',
1294
- 'type' => 'select',
1295
- 'options' => $border_types,
1296
- 'class' => '',
1297
- 'value' => isset($param_values->MCPBorderType) ? $param_values->MCPBorderType : '',
1298
- 'after' => '',
1299
- ),
1300
- array(
1301
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1302
- 'name' => 'MCPBorderWidth',
1303
- 'type' => 'text',
1304
- 'class' => '',
1305
- 'value' => isset($param_values->MCPBorderWidth) ? $param_values->MCPBorderWidth : '',
1306
- 'after' => 'px',
1307
- ),
1308
-
1309
- array(
1310
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1311
- 'name' => 'MCPBorderRadius',
1312
- 'type' => 'text',
1313
- 'class' => '',
1314
- 'value' => isset($param_values->MCPBorderRadius) ? $param_values->MCPBorderRadius : '',
1315
- 'after' => 'px',
1316
- ),
1317
- array(
1318
- 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
1319
- 'name' => 'MCPBoxShadow',
1320
- 'type' => 'text',
1321
- 'class' => '',
1322
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 5px 2px #888888',
1323
- 'value' => isset($param_values->MCPBoxShadow) ? $param_values->MCPBoxShadow : '',
1324
- 'after' => '',
1325
- ),
1326
- array(
1327
- 'label' => __('Checked Parameters', WDFMInstance(self::PLUGIN)->prefix),
1328
- 'type' => 'label',
1329
- 'class' => 'fm-mini-title',
1330
- 'after' => '<br/>',
1331
- ),
1332
- array(
1333
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1334
- 'name' => 'MCCPBGColor',
1335
- 'type' => 'text',
1336
- 'class' => 'color',
1337
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .'#efefef',
1338
- 'value' => isset($param_values->MCCPBGColor) ? $param_values->MCCPBGColor : '',
1339
- 'after' => '',
1340
- ),
1341
- array(
1342
- 'label' => __('Background URL', WDFMInstance(self::PLUGIN)->prefix),
1343
- 'name' => 'MCCPBackground',
1344
- 'type' => 'text',
1345
- 'class' => '',
1346
- // 'placeholder' => __('e.g. http:// or https://', WDFMInstance(self::PLUGIN)->prefix),
1347
- 'value' => isset($param_values->MCCPBackground) ? $param_values->MCCPBackground : '',
1348
- 'after' => '',
1349
- ),
1350
- array(
1351
- 'label' => __('Background Repeat', WDFMInstance(self::PLUGIN)->prefix),
1352
- 'name' => 'MCCPBGRepeat',
1353
- 'type' => 'select',
1354
- 'options' => $bg_repeats,
1355
- 'class' => '',
1356
- 'value' => isset($param_values->MCCPBGRepeat) ? $param_values->MCCPBGRepeat : '',
1357
- 'after' => '',
1358
- ),
1359
- array(
1360
- 'label' => __('Background Position', WDFMInstance(self::PLUGIN)->prefix),
1361
- 'name1' => 'MCCPBGPos1',
1362
- 'name2' => 'MCCPBGPos2',
1363
- 'type' => '2text',
1364
- 'class' => 'fm-2text',
1365
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' px|%, top|bottom|left|right|center',
1366
- 'value1' => isset($param_values->MCCPBGPos1) ? $param_values->MCCPBGPos1 : '',
1367
- 'value2' => isset($param_values->MCCPBGPos2) ? $param_values->MCCPBGPos2 : '',
1368
- 'before1' => '',
1369
- 'before2' => '',
1370
- 'after' => '',
1371
- ),
1372
- array(
1373
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
1374
- 'name' => 'MCCPWidth',
1375
- 'type' => 'text',
1376
- 'class' => '',
1377
- 'value' => isset($param_values->MCCPWidth) ? $param_values->MCCPWidth : '',
1378
- 'after' => 'px',
1379
- ),
1380
- array(
1381
- 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1382
- 'name' => 'MCCPHeight',
1383
- 'type' => 'text',
1384
- 'class' => '',
1385
- 'value' => isset($param_values->MCCPHeight) ? $param_values->MCCPHeight : '',
1386
- 'after' => 'px',
1387
- ),
1388
- array(
1389
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1390
- 'name' => 'MCCPMargin',
1391
- 'type' => 'text',
1392
- 'class' => '',
1393
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
1394
- 'value' => isset($param_values->MCCPMargin) ? $param_values->MCCPMargin : '',
1395
- 'after' => '',
1396
- ),
1397
- array(
1398
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1399
- 'name' => 'MCCPBorderRadius',
1400
- 'type' => 'text',
1401
- 'class' => '',
1402
- 'value' => isset($param_values->MCCPBorderRadius) ? $param_values->MCCPBorderRadius : '',
1403
- 'after' => 'px</div>',
1404
- ),
1405
- ),
1406
- 'subscribe' => array(
1407
- array(
1408
- 'label' => __('Global Parameters', WDFMInstance(self::PLUGIN)->prefix),
1409
- 'type' => 'panel',
1410
- 'class' => 'col-md-12',
1411
- 'label_class' => 'fm-mini-title',
1412
- 'after' => '<br/>',
1413
- ),
1414
- array(
1415
- 'label' => __('Alignment', WDFMInstance(self::PLUGIN)->prefix),
1416
- 'name' => 'SPAlign',
1417
- 'type' => 'select',
1418
- 'options' => $aligns,
1419
- 'class' => '',
1420
- 'value' => isset($param_values->SPAlign) ? $param_values->SPAlign : '',
1421
- 'after' => '</div>',
1422
- ),
1423
- array(
1424
- 'label' => __('Submit', WDFMInstance(self::PLUGIN)->prefix),
1425
- 'type' => 'panel',
1426
- 'class' => 'col-md-12',
1427
- 'label_class' => 'fm-mini-title',
1428
- 'after' => '<br/>',
1429
- ),
1430
- array(
1431
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1432
- 'name' => 'SPBGColor',
1433
- 'type' => 'text',
1434
- 'class' => 'color',
1435
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1436
- 'value' => isset($param_values->SPBGColor) ? $param_values->SPBGColor : '',
1437
- 'after' => '',
1438
- ),
1439
- array(
1440
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
1441
- 'name' => 'SPWidth',
1442
- 'type' => 'text',
1443
- 'class' => '',
1444
- 'value' => isset($param_values->SPWidth) ? $param_values->SPWidth : '',
1445
- 'after' => 'px',
1446
- ),
1447
- array(
1448
- 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1449
- 'name' => 'SPHeight',
1450
- 'type' => 'text',
1451
- 'class' => '',
1452
- 'value' => isset($param_values->SPHeight) ? $param_values->SPHeight : '',
1453
- 'after' => 'px',
1454
- ),
1455
- array(
1456
- 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
1457
- 'name' => 'SPFontSize',
1458
- 'type' => 'text',
1459
- 'class' => '',
1460
- 'value' => isset($param_values->SPFontSize) ? $param_values->SPFontSize : '',
1461
- 'after' => 'px',
1462
- ),
1463
- array(
1464
- 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
1465
- 'name' => 'SPFontWeight',
1466
- 'type' => 'select',
1467
- 'options' => $font_weights,
1468
- 'class' => '',
1469
- 'value' => isset($param_values->SPFontWeight) ? $param_values->SPFontWeight : '',
1470
- 'after' => '',
1471
- ),
1472
- array(
1473
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
1474
- 'name' => 'SPColor',
1475
- 'type' => 'text',
1476
- 'class' => 'color',
1477
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1478
- 'value' => isset($param_values->SPColor) ? $param_values->SPColor : '',
1479
- 'after' => '',
1480
- ),
1481
- array(
1482
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
1483
- 'name' => 'SPPadding',
1484
- 'type' => 'text',
1485
- 'class' => '',
1486
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5px or 3% 5%',
1487
- 'value' => isset($param_values->SPPadding) ? $param_values->SPPadding : '',
1488
- 'after' => '',
1489
- ),
1490
- array(
1491
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1492
- 'name' => 'SPMargin',
1493
- 'type' => 'text',
1494
- 'class' => '',
1495
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
1496
- 'value' => isset($param_values->SPMargin) ? $param_values->SPMargin : '',
1497
- 'after' => '',
1498
- ),
1499
- array(
1500
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1501
- 'name' => 'SPBorder',
1502
- 'type' => 'checkbox',
1503
- 'options' => $borders,
1504
- 'class' => '',
1505
- 'after' => '',
1506
- ),
1507
- array(
1508
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1509
- 'name' => 'SPBorderColor',
1510
- 'type' => 'text',
1511
- 'class' => 'color',
1512
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1513
- 'value' => isset($param_values->SPBorderColor) ? $param_values->SPBorderColor : '',
1514
- 'after' => '',
1515
- ),
1516
- array(
1517
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1518
- 'name' => 'SPBorderType',
1519
- 'type' => 'select',
1520
- 'options' => $border_types,
1521
- 'class' => '',
1522
- 'value' => isset($param_values->SPBorderType) ? $param_values->SPBorderType : '',
1523
- 'after' => '',
1524
- ),
1525
- array(
1526
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1527
- 'name' => 'SPBorderWidth',
1528
- 'type' => 'text',
1529
- 'class' => '',
1530
- 'value' => isset($param_values->SPBorderWidth) ? $param_values->SPBorderWidth : '',
1531
- 'after' => 'px',
1532
- ),
1533
- array(
1534
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1535
- 'name' => 'SPBorderRadius',
1536
- 'type' => 'text',
1537
- 'class' => '',
1538
- 'value' => isset($param_values->SPBorderRadius) ? $param_values->SPBorderRadius : '',
1539
- 'after' => 'px',
1540
- ),
1541
- array(
1542
- 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
1543
- 'name' => 'SPBoxShadow',
1544
- 'type' => 'text',
1545
- 'class' => '',
1546
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 5px 2px #888888',
1547
- 'value' => isset($param_values->SPBoxShadow) ? $param_values->SPBoxShadow : '',
1548
- 'after' => '',
1549
- ),
1550
- array(
1551
- 'label' => __('Hover Parameters', WDFMInstance(self::PLUGIN)->prefix),
1552
- 'type' => 'label',
1553
- 'class' => 'fm-mini-title',
1554
- 'after' => '<br/>',
1555
- ),
1556
- array(
1557
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1558
- 'name' => 'SHPBGColor',
1559
- 'type' => 'text',
1560
- 'class' => 'color',
1561
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1562
- 'value' => isset($param_values->SHPBGColor) ? $param_values->SHPBGColor : '',
1563
- 'after' => '',
1564
- ),
1565
- array(
1566
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
1567
- 'name' => 'SHPColor',
1568
- 'type' => 'text',
1569
- 'class' => 'color',
1570
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1571
- 'value' => isset($param_values->SHPColor) ? $param_values->SHPColor : '',
1572
- 'after' => '',
1573
- ),
1574
- array(
1575
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1576
- 'name' => 'SHPBorder',
1577
- 'type' => 'checkbox',
1578
- 'options' => $borders,
1579
- 'class' => '',
1580
- 'after' => '',
1581
- ),
1582
- array(
1583
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1584
- 'name' => 'SHPBorderColor',
1585
- 'type' => 'text',
1586
- 'class' => 'color',
1587
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1588
- 'value' => isset($param_values->SHPBorderColor) ? $param_values->SHPBorderColor : '',
1589
- 'after' => '',
1590
- ),
1591
- array(
1592
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1593
- 'name' => 'SHPBorderType',
1594
- 'type' => 'select',
1595
- 'options' => $border_types,
1596
- 'class' => '',
1597
- 'value' => isset($param_values->SHPBorderType) ? $param_values->SHPBorderType : '',
1598
- 'after' => '',
1599
- ),
1600
- array(
1601
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1602
- 'name' => 'SHPBorderWidth',
1603
- 'type' => 'text',
1604
- 'class' => '',
1605
- 'value' => isset($param_values->SHPBorderWidth) ? $param_values->SHPBorderWidth : '',
1606
- 'after' => 'px</div>',
1607
- ),
1608
- array(
1609
- 'label' => __('Reset', WDFMInstance(self::PLUGIN)->prefix),
1610
- 'type' => 'panel',
1611
- 'class' => 'col-md-12',
1612
- 'label_class' => 'fm-mini-title',
1613
- 'after' => '<br/>',
1614
- ),
1615
- array(
1616
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1617
- 'name' => 'BPBGColor',
1618
- 'type' => 'text',
1619
- 'class' => 'color',
1620
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1621
- 'value' => isset($param_values->BPBGColor) ? $param_values->BPBGColor : '',
1622
- 'after' => '',
1623
- ),
1624
- array(
1625
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
1626
- 'name' => 'BPWidth',
1627
- 'type' => 'text',
1628
- 'class' => '',
1629
- 'value' => isset($param_values->BPWidth) ? $param_values->BPWidth : '',
1630
- 'after' => 'px',
1631
- ),
1632
- array(
1633
- 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1634
- 'name' => 'BPHeight',
1635
- 'type' => 'text',
1636
- 'class' => '',
1637
- 'value' => isset($param_values->BPHeight) ? $param_values->BPHeight : '',
1638
- 'after' => 'px',
1639
- ),
1640
- array(
1641
- 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
1642
- 'name' => 'BPFontSize',
1643
- 'type' => 'text',
1644
- 'class' => '',
1645
- 'value' => isset($param_values->BPFontSize) ? $param_values->BPFontSize : '',
1646
- 'after' => 'px',
1647
- ),
1648
- array(
1649
- 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
1650
- 'name' => 'BPFontWeight',
1651
- 'type' => 'select',
1652
- 'options' => $font_weights,
1653
- 'class' => '',
1654
- 'value' => isset($param_values->BPFontWeight) ? $param_values->BPFontWeight : '',
1655
- 'after' => '',
1656
- ),
1657
- array(
1658
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
1659
- 'name' => 'BPColor',
1660
- 'type' => 'text',
1661
- 'class' => 'color',
1662
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1663
- 'value' => isset($param_values->BPColor) ? $param_values->BPColor : '',
1664
- 'after' => '',
1665
- ),
1666
- array(
1667
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
1668
- 'name' => 'BPPadding',
1669
- 'type' => 'text',
1670
- 'class' => '',
1671
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5xp or 3% 5%',
1672
- 'value' => isset($param_values->BPPadding) ? $param_values->BPPadding : '',
1673
- 'after' => '',
1674
- ),
1675
- array(
1676
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1677
- 'name' => 'BPMargin',
1678
- 'type' => 'text',
1679
- 'class' => '',
1680
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10xp or 5% 10%',
1681
- 'value' => isset($param_values->BPMargin) ? $param_values->BPMargin : '',
1682
- 'after' => '',
1683
- ),
1684
- array(
1685
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1686
- 'name' => 'BPBorder',
1687
- 'type' => 'checkbox',
1688
- 'options' => $borders,
1689
- 'class' => '',
1690
- 'after' => '',
1691
- ),
1692
- array(
1693
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1694
- 'name' => 'BPBorderColor',
1695
- 'type' => 'text',
1696
- 'class' => 'color',
1697
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1698
- 'value' => isset($param_values->BPBorderColor) ? $param_values->BPBorderColor : '',
1699
- 'after' => '',
1700
- ),
1701
- array(
1702
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1703
- 'name' => 'BPBorderType',
1704
- 'type' => 'select',
1705
- 'options' => $border_types,
1706
- 'class' => '',
1707
- 'value' => isset($param_values->BPBorderType) ? $param_values->BPBorderType : '',
1708
- 'after' => '',
1709
- ),
1710
- array(
1711
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1712
- 'name' => 'BPBorderWidth',
1713
- 'type' => 'text',
1714
- 'class' => '',
1715
- 'value' => isset($param_values->BPBorderWidth) ? $param_values->BPBorderWidth : '',
1716
- 'after' => 'px',
1717
- ),
1718
- array(
1719
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1720
- 'name' => 'BPBorderRadius',
1721
- 'type' => 'text',
1722
- 'class' => '',
1723
- 'value' => isset($param_values->BPBorderRadius) ? $param_values->BPBorderRadius : '',
1724
- 'after' => 'px',
1725
- ),
1726
- array(
1727
- 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
1728
- 'name' => 'BPBoxShadow',
1729
- 'type' => 'text',
1730
- 'class' => '',
1731
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 5px 2px #888888',
1732
- 'value' => isset($param_values->BPBoxShadow) ? $param_values->BPBoxShadow : '',
1733
- 'after' => '',
1734
- ),
1735
- array(
1736
- 'label' => __('Hover Parameters', WDFMInstance(self::PLUGIN)->prefix),
1737
- 'type' => 'label',
1738
- 'class' => 'fm-mini-title',
1739
- 'after' => '<br/>',
1740
- ),
1741
- array(
1742
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1743
- 'name' => 'BHPBGColor',
1744
- 'type' => 'text',
1745
- 'class' => 'color',
1746
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1747
- 'value' => isset($param_values->BHPBGColor) ? $param_values->BHPBGColor : '',
1748
- 'after' => '',
1749
- ),
1750
- array(
1751
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
1752
- 'name' => 'BHPColor',
1753
- 'type' => 'text',
1754
- 'class' => 'color',
1755
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1756
- 'value' => isset($param_values->BHPColor) ? $param_values->BHPColor : '',
1757
- 'after' => '',
1758
- ),
1759
- array(
1760
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1761
- 'name' => 'BHPBorder',
1762
- 'type' => 'checkbox',
1763
- 'options' => $borders,
1764
- 'class' => '',
1765
- 'after' => '',
1766
- ),
1767
- array(
1768
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1769
- 'name' => 'BHPBorderColor',
1770
- 'type' => 'text',
1771
- 'class' => 'color',
1772
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1773
- 'value' => isset($param_values->BHPBorderColor) ? $param_values->BHPBorderColor : '',
1774
- 'after' => '',
1775
- ),
1776
- array(
1777
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1778
- 'name' => 'BHPBorderType',
1779
- 'type' => 'select',
1780
- 'options' => $border_types,
1781
- 'class' => '',
1782
- 'value' => isset($param_values->BHPBorderType) ? $param_values->BHPBorderType : '',
1783
- 'after' => '',
1784
- ),
1785
- array(
1786
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1787
- 'name' => 'BHPBorderWidth',
1788
- 'type' => 'text',
1789
- 'class' => '',
1790
- 'value' => isset($param_values->BHPBorderWidth) ? $param_values->BHPBorderWidth : '',
1791
- 'after' => 'px</div>',
1792
- ),
1793
- ),
1794
- 'paigination' => array(
1795
- array(
1796
- 'label' => __('Active', WDFMInstance(self::PLUGIN)->prefix),
1797
- 'type' => 'panel',
1798
- 'class' => 'col-md-12',
1799
- 'label_class' => 'fm-mini-title',
1800
- 'after' => '',
1801
- ),
1802
- array(
1803
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1804
- 'name' => 'PSAPBGColor',
1805
- 'type' => 'text',
1806
- 'class' => 'color',
1807
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1808
- 'value' => isset($param_values->PSAPBGColor) ? $param_values->PSAPBGColor : '',
1809
- 'after' => '',
1810
- ),
1811
- array(
1812
- 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
1813
- 'name' => 'PSAPFontSize',
1814
- 'type' => 'text',
1815
- 'class' => '',
1816
- 'value' => isset($param_values->PSAPFontSize) ? $param_values->PSAPFontSize : '',
1817
- 'after' => 'px',
1818
- ),
1819
- array(
1820
- 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
1821
- 'name' => 'PSAPFontWeight',
1822
- 'type' => 'select',
1823
- 'options' => $font_weights,
1824
- 'class' => '',
1825
- 'value' => isset($param_values->PSAPFontWeight) ? $param_values->PSAPFontWeight : '',
1826
- 'after' => '',
1827
- ),
1828
- array(
1829
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
1830
- 'name' => 'PSAPColor',
1831
- 'type' => 'text',
1832
- 'class' => 'color',
1833
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1834
- 'value' => isset($param_values->PSAPColor) ? $param_values->PSAPColor : '',
1835
- 'after' => '',
1836
- ),
1837
- array(
1838
- 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1839
- 'name' => 'PSAPHeight',
1840
- 'type' => 'text',
1841
- 'class' => '',
1842
- 'value' => isset($param_values->PSAPHeight) ? $param_values->PSAPHeight : '',
1843
- 'after' => 'px',
1844
- ),
1845
- array(
1846
- 'label' => __('Line Height', WDFMInstance(self::PLUGIN)->prefix),
1847
- 'name' => 'PSAPLineHeight',
1848
- 'type' => 'text',
1849
- 'class' => '',
1850
- 'value' => isset($param_values->PSAPLineHeight) ? $param_values->PSAPLineHeight : '',
1851
- 'after' => 'px',
1852
- ),
1853
- array(
1854
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
1855
- 'name' => 'PSAPPadding',
1856
- 'type' => 'text',
1857
- 'class' => '',
1858
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5px or 3% 5%',
1859
- 'value' => isset($param_values->PSAPPadding) ? $param_values->PSAPPadding : '',
1860
- 'after' => '',
1861
- ),
1862
- array(
1863
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1864
- 'name' => 'PSAPMargin',
1865
- 'type' => 'text',
1866
- 'class' => '',
1867
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
1868
- 'value' => isset($param_values->PSAPMargin) ? $param_values->PSAPMargin : '',
1869
- 'after' => '',
1870
- ),
1871
- array(
1872
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1873
- 'name' => 'PSAPBorder',
1874
- 'type' => 'checkbox',
1875
- 'options' => $borders,
1876
- 'class' => '',
1877
- 'after' => '',
1878
- ),
1879
- array(
1880
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1881
- 'name' => 'PSAPBorderColor',
1882
- 'type' => 'text',
1883
- 'class' => 'color',
1884
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1885
- 'value' => isset($param_values->PSAPBorderColor) ? $param_values->PSAPBorderColor : '',
1886
- 'after' => '',
1887
- ),
1888
- array(
1889
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1890
- 'name' => 'PSAPBorderType',
1891
- 'type' => 'select',
1892
- 'options' => $border_types,
1893
- 'class' => '',
1894
- 'value' => isset($param_values->PSAPBorderType) ? $param_values->PSAPBorderType : '',
1895
- 'after' => '',
1896
- ),
1897
- array(
1898
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1899
- 'name' => 'PSAPBorderWidth',
1900
- 'type' => 'text',
1901
- 'class' => '',
1902
- 'value' => isset($param_values->PSAPBorderWidth) ? $param_values->PSAPBorderWidth : '',
1903
- 'after' => 'px',
1904
- ),
1905
- array(
1906
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1907
- 'name' => 'PSAPBorderRadius',
1908
- 'type' => 'text',
1909
- 'class' => '',
1910
- 'value' => isset($param_values->PSAPBorderRadius) ? $param_values->PSAPBorderRadius : '',
1911
- 'after' => 'px</div>',
1912
- ),
1913
- array(
1914
- 'label' => __('Inactive', WDFMInstance(self::PLUGIN)->prefix),
1915
- 'type' => 'panel',
1916
- 'class' => 'col-md-12',
1917
- 'label_class' => 'fm-mini-title',
1918
- 'after' => '',
1919
- ),
1920
- array(
1921
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1922
- 'name' => 'PSDPBGColor',
1923
- 'type' => 'text',
1924
- 'class' => 'color',
1925
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1926
- 'value' => isset($param_values->PSDPBGColor) ? $param_values->PSDPBGColor : '',
1927
- 'after' => '',
1928
- ),
1929
- array(
1930
- 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
1931
- 'name' => 'PSDPFontSize',
1932
- 'type' => 'text',
1933
- 'class' => '',
1934
- 'value' => isset($param_values->PSDPFontSize) ? $param_values->PSDPFontSize : '',
1935
- 'after' => 'px',
1936
- ),
1937
- array(
1938
- 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
1939
- 'name' => 'PSDPFontWeight',
1940
- 'type' => 'select',
1941
- 'options' => $font_weights,
1942
- 'class' => '',
1943
- 'value' => isset($param_values->PSDPFontWeight) ? $param_values->PSDPFontWeight : '',
1944
- 'after' => '',
1945
- ),
1946
- array(
1947
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
1948
- 'name' => 'PSDPColor',
1949
- 'type' => 'text',
1950
- 'class' => 'color',
1951
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1952
- 'value' => isset($param_values->PSDPColor) ? $param_values->PSDPColor : '',
1953
- 'after' => '',
1954
- ),
1955
- array(
1956
- 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1957
- 'name' => 'PSDPHeight',
1958
- 'type' => 'text',
1959
- 'class' => '',
1960
- 'value' => isset($param_values->PSDPHeight) ? $param_values->PSDPHeight : '',
1961
- 'after' => 'px',
1962
- ),
1963
- array(
1964
- 'label' => __('Line Height', WDFMInstance(self::PLUGIN)->prefix),
1965
- 'name' => 'PSDPLineHeight',
1966
- 'type' => 'text',
1967
- 'class' => '',
1968
- 'value' => isset($param_values->PSDPLineHeight) ? $param_values->PSDPLineHeight : '',
1969
- 'after' => 'px',
1970
- ),
1971
- array(
1972
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
1973
- 'name' => 'PSDPPadding',
1974
- 'type' => 'text',
1975
- 'class' => '',
1976
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5px or 3% 5%',
1977
- 'value' => isset($param_values->PSDPPadding) ? $param_values->PSDPPadding : '',
1978
- 'after' => '',
1979
- ),
1980
- array(
1981
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1982
- 'name' => 'PSDPMargin',
1983
- 'type' => 'text',
1984
- 'class' => '',
1985
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
1986
- 'value' => isset($param_values->PSDPMargin) ? $param_values->PSDPMargin : '',
1987
- 'after' => '',
1988
- ),
1989
- array(
1990
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1991
- 'name' => 'PSDPBorder',
1992
- 'type' => 'checkbox',
1993
- 'options' => $borders,
1994
- 'class' => '',
1995
- 'after' => '',
1996
- ),
1997
- array(
1998
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1999
- 'name' => 'PSDPBorderColor',
2000
- 'type' => 'text',
2001
- 'class' => 'color',
2002
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2003
- 'value' => isset($param_values->PSDPBorderColor) ? $param_values->PSDPBorderColor : '',
2004
- 'after' => '',
2005
- ),
2006
- array(
2007
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2008
- 'name' => 'PSDPBorderType',
2009
- 'type' => 'select',
2010
- 'options' => $border_types,
2011
- 'class' => '',
2012
- 'value' => isset($param_values->PSDPBorderType) ? $param_values->PSDPBorderType : '',
2013
- 'after' => '',
2014
- ),
2015
- array(
2016
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2017
- 'name' => 'PSDPBorderWidth',
2018
- 'type' => 'text',
2019
- 'class' => '',
2020
- 'value' => isset($param_values->PSDPBorderWidth) ? $param_values->PSDPBorderWidth : '',
2021
- 'after' => 'px',
2022
- ),
2023
- array(
2024
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
2025
- 'name' => 'PSDPBorderRadius',
2026
- 'type' => 'text',
2027
- 'class' => '',
2028
- 'value' => isset($param_values->PSDPBorderRadius) ? $param_values->PSDPBorderRadius : '',
2029
- 'after' => 'px</div>',
2030
- ),
2031
- array(
2032
- 'label' => __('Steps', WDFMInstance(self::PLUGIN)->prefix),
2033
- 'type' => 'panel',
2034
- 'class' => 'col-md-12',
2035
- 'label_class' => 'fm-mini-title',
2036
- 'after' => '',
2037
- ),
2038
- array(
2039
- 'label' => __('Alignment', WDFMInstance(self::PLUGIN)->prefix),
2040
- 'name' => 'PSAPAlign',
2041
- 'type' => 'select',
2042
- 'options' => $aligns,
2043
- 'class' => '',
2044
- 'value' => isset($param_values->PSAPAlign) ? $param_values->PSAPAlign : '',
2045
- 'after' => '',
2046
- ),
2047
- array(
2048
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
2049
- 'name' => 'PSAPWidth',
2050
- 'type' => 'text',
2051
- 'class' => '',
2052
- 'value' => isset($param_values->PSAPWidth) ? $param_values->PSAPWidth : '',
2053
- 'after' => 'px</div>',
2054
- ),
2055
- array(
2056
- 'label' => __('Percentage', WDFMInstance(self::PLUGIN)->prefix),
2057
- 'type' => 'panel',
2058
- 'class' => 'col-md-12',
2059
- 'label_class' => 'fm-mini-title',
2060
- 'after' => '',
2061
- ),
2062
- array(
2063
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
2064
- 'name' => 'PPAPWidth',
2065
- 'type' => 'text',
2066
- 'class' => '',
2067
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 500px or 50%',
2068
- 'value' => isset($param_values->PPAPWidth) ? $param_values->PPAPWidth : '',
2069
- 'after' => '</div>',
2070
- ),
2071
- ),
2072
- 'buttons' => array(
2073
- array(
2074
- 'label' => __('Global Parameters', WDFMInstance(self::PLUGIN)->prefix),
2075
- 'type' => 'panel',
2076
- 'class' => 'col-md-12',
2077
- 'label_class' => 'fm-mini-title',
2078
- 'after' => '<br/>',
2079
- ),
2080
- array(
2081
- 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
2082
- 'name' => 'BPFontSize',
2083
- 'type' => 'text',
2084
- 'class' => '',
2085
- 'value' => isset($param_values->BPFontSize) ? $param_values->BPFontSize : '',
2086
- 'after' => 'px',
2087
- ),
2088
- array(
2089
- 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
2090
- 'name' => 'BPFontWeight',
2091
- 'type' => 'select',
2092
- 'options' => $font_weights,
2093
- 'class' => '',
2094
- 'value' => isset($param_values->BPFontWeight) ? $param_values->BPFontWeight : '',
2095
- 'after' => '</div>',
2096
- ),
2097
- array(
2098
- 'label' => __('Next Button Parameters', WDFMInstance(self::PLUGIN)->prefix),
2099
- 'type' => 'panel',
2100
- 'class' => 'col-md-12',
2101
- 'label_class' => 'fm-mini-title',
2102
- 'after' => '<br/>',
2103
- ),
2104
- array(
2105
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2106
- 'name' => 'NBPBGColor',
2107
- 'type' => 'text',
2108
- 'class' => 'color',
2109
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2110
- 'value' => isset($param_values->NBPBGColor) ? $param_values->NBPBGColor : '',
2111
- 'after' => '',
2112
- ),
2113
- array(
2114
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
2115
- 'name' => 'NBPWidth',
2116
- 'type' => 'text',
2117
- 'class' => '',
2118
- 'value' => isset($param_values->NBPWidth) ? $param_values->NBPWidth : '',
2119
- 'after' => 'px',
2120
- ),
2121
- array(
2122
- 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
2123
- 'name' => 'NBPHeight',
2124
- 'type' => 'text',
2125
- 'class' => '',
2126
- 'value' => isset($param_values->NBPHeight) ? $param_values->NBPHeight : '',
2127
- 'after' => 'px',
2128
- ),
2129
- array(
2130
- 'label' => __('Line Height', WDFMInstance(self::PLUGIN)->prefix),
2131
- 'name' => 'NBPLineHeight',
2132
- 'type' => 'text',
2133
- 'class' => '',
2134
- 'value' => isset($param_values->NBPLineHeight) ? $param_values->NBPLineHeight : '',
2135
- 'after' => 'px',
2136
- ),
2137
- array(
2138
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2139
- 'name' => 'NBPColor',
2140
- 'type' => 'text',
2141
- 'class' => 'color',
2142
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2143
- 'value' => isset($param_values->NBPColor) ? $param_values->NBPColor : '',
2144
- 'after' => '',
2145
- ),
2146
- array(
2147
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
2148
- 'name' => 'NBPPadding',
2149
- 'type' => 'text',
2150
- 'class' => '',
2151
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5px or 3% 5%',
2152
- 'value' => isset($param_values->NBPPadding) ? $param_values->NBPPadding : '',
2153
- 'after' => '',
2154
- ),
2155
- array(
2156
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
2157
- 'name' => 'NBPMargin',
2158
- 'type' => 'text',
2159
- 'class' => '',
2160
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
2161
- 'value' => isset($param_values->NBPMargin) ? $param_values->NBPMargin : '',
2162
- 'after' => '',
2163
- ),
2164
- array(
2165
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2166
- 'name' => 'NBPBorder',
2167
- 'type' => 'checkbox',
2168
- 'options' => $borders,
2169
- 'class' => '',
2170
- 'after' => '',
2171
- ),
2172
- array(
2173
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2174
- 'name' => 'NBPBorderColor',
2175
- 'type' => 'text',
2176
- 'class' => 'color',
2177
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2178
- 'value' => isset($param_values->NBPBorderColor) ? $param_values->NBPBorderColor : '',
2179
- 'after' => '',
2180
- ),
2181
- array(
2182
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2183
- 'name' => 'NBPBorderType',
2184
- 'type' => 'select',
2185
- 'options' => $border_types,
2186
- 'class' => '',
2187
- 'value' => isset($param_values->NBPBorderType) ? $param_values->NBPBorderType : '',
2188
- 'after' => '',
2189
- ),
2190
- array(
2191
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2192
- 'name' => 'NBPBorderWidth',
2193
- 'type' => 'text',
2194
- 'class' => '',
2195
- 'value' => isset($param_values->NBPBorderWidth) ? $param_values->NBPBorderWidth : '',
2196
- 'after' => 'px',
2197
- ),
2198
- array(
2199
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
2200
- 'name' => 'NBPBorderRadius',
2201
- 'type' => 'text',
2202
- 'class' => '',
2203
- 'value' => isset($param_values->NBPBorderRadius) ? $param_values->NBPBorderRadius : '',
2204
- 'after' => 'px',
2205
- ),
2206
- array(
2207
- 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
2208
- 'name' => 'NBPBoxShadow',
2209
- 'type' => 'text',
2210
- 'class' => '',
2211
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 5px 2px #888888',
2212
- 'value' => isset($param_values->NBPBoxShadow) ? $param_values->NBPBoxShadow : '',
2213
- 'after' => '',
2214
- ),
2215
- array(
2216
- 'label' => __('Hover Parameters', WDFMInstance(self::PLUGIN)->prefix),
2217
- 'type' => 'label',
2218
- 'class' => 'fm-mini-title',
2219
- 'after' => '<br/>',
2220
- ),
2221
- array(
2222
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2223
- 'name' => 'NBHPBGColor',
2224
- 'type' => 'text',
2225
- 'class' => 'color',
2226
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2227
- 'value' => isset($param_values->NBHPBGColor) ? $param_values->NBHPBGColor : '',
2228
- 'after' => '',
2229
- ),
2230
- array(
2231
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2232
- 'name' => 'NBHPColor',
2233
- 'type' => 'text',
2234
- 'class' => 'color',
2235
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2236
- 'value' => isset($param_values->NBHPColor) ? $param_values->NBHPColor : '',
2237
- 'after' => '',
2238
- ),
2239
- array(
2240
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2241
- 'name' => 'NBHPBorder',
2242
- 'type' => 'checkbox',
2243
- 'options' => $borders,
2244
- 'class' => '',
2245
- 'after' => '',
2246
- ),
2247
- array(
2248
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2249
- 'name' => 'NBHPBorderColor',
2250
- 'type' => 'text',
2251
- 'class' => 'color',
2252
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2253
- 'value' => isset($param_values->NBHPBorderColor) ? $param_values->NBHPBorderColor : '',
2254
- 'after' => '',
2255
- ),
2256
- array(
2257
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2258
- 'name' => 'NBHPBorderType',
2259
- 'type' => 'select',
2260
- 'options' => $border_types,
2261
- 'class' => '',
2262
- 'value' => isset($param_values->NBHPBorderType) ? $param_values->NBHPBorderType : '',
2263
- 'after' => '',
2264
- ),
2265
- array(
2266
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2267
- 'name' => 'NBHPBorderWidth',
2268
- 'type' => 'text',
2269
- 'class' => '',
2270
- 'value' => isset($param_values->NBHPBorderWidth) ? $param_values->NBHPBorderWidth : '',
2271
- 'after' => 'px</div>',
2272
- ),
2273
- array(
2274
- 'label' => __('Previous Button Parameters', WDFMInstance(self::PLUGIN)->prefix),
2275
- 'type' => 'panel',
2276
- 'class' => 'col-md-12',
2277
- 'label_class' => 'fm-mini-title',
2278
- 'after' => '<br/>',
2279
- ),
2280
- array(
2281
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2282
- 'name' => 'PBPBGColor',
2283
- 'type' => 'text',
2284
- 'class' => 'color',
2285
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2286
- 'value' => isset($param_values->PBPBGColor) ? $param_values->PBPBGColor : '',
2287
- 'after' => '',
2288
- ),
2289
- array(
2290
- 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
2291
- 'name' => 'PBPWidth',
2292
- 'type' => 'text',
2293
- 'class' => '',
2294
- 'value' => isset($param_values->PBPWidth) ? $param_values->PBPWidth : '',
2295
- 'after' => 'px',
2296
- ),
2297
- array(
2298
- 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
2299
- 'name' => 'PBPHeight',
2300
- 'type' => 'text',
2301
- 'class' => '',
2302
- 'value' => isset($param_values->PBPHeight) ? $param_values->PBPHeight : '',
2303
- 'after' => 'px',
2304
- ),
2305
- array(
2306
- 'label' => __('Line Height', WDFMInstance(self::PLUGIN)->prefix),
2307
- 'name' => 'PBPLineHeight',
2308
- 'type' => 'text',
2309
- 'class' => '',
2310
- 'value' => isset($param_values->PBPLineHeight) ? $param_values->PBPLineHeight : '',
2311
- 'after' => 'px',
2312
- ),
2313
- array(
2314
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2315
- 'name' => 'PBPColor',
2316
- 'type' => 'text',
2317
- 'class' => 'color',
2318
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2319
- 'value' => isset($param_values->PBPColor) ? $param_values->PBPColor : '',
2320
- 'after' => '',
2321
- ),
2322
- array(
2323
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
2324
- 'name' => 'PBPPadding',
2325
- 'type' => 'text',
2326
- 'class' => '',
2327
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5px or 3% 5%',
2328
- 'value' => isset($param_values->PBPPadding) ? $param_values->PBPPadding : '',
2329
- 'after' => '',
2330
- ),
2331
- array(
2332
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
2333
- 'name' => 'PBPMargin',
2334
- 'type' => 'text',
2335
- 'class' => '',
2336
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
2337
- 'value' => isset($param_values->PBPMargin) ? $param_values->PBPMargin : '',
2338
- 'after' => '',
2339
- ),
2340
- array(
2341
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2342
- 'name' => 'PBPBorder',
2343
- 'type' => 'checkbox',
2344
- 'options' => $borders,
2345
- 'class' => '',
2346
- 'after' => '',
2347
- ),
2348
- array(
2349
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2350
- 'name' => 'PBPBorderColor',
2351
- 'type' => 'text',
2352
- 'class' => 'color',
2353
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2354
- 'value' => isset($param_values->PBPBorderColor) ? $param_values->PBPBorderColor : '',
2355
- 'after' => '',
2356
- ),
2357
- array(
2358
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2359
- 'name' => 'PBPBorderType',
2360
- 'type' => 'select',
2361
- 'options' => $border_types,
2362
- 'class' => '',
2363
- 'value' => isset($param_values->PBPBorderType) ? $param_values->PBPBorderType : '',
2364
- 'after' => '',
2365
- ),
2366
- array(
2367
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2368
- 'name' => 'PBPBorderWidth',
2369
- 'type' => 'text',
2370
- 'class' => '',
2371
- 'value' => isset($param_values->PBPBorderWidth) ? $param_values->PBPBorderWidth : '',
2372
- 'after' => 'px',
2373
- ),
2374
- array(
2375
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
2376
- 'name' => 'PBPBorderRadius',
2377
- 'type' => 'text',
2378
- 'class' => '',
2379
- 'value' => isset($param_values->PBPBorderRadius) ? $param_values->PBPBorderRadius : '',
2380
- 'after' => 'px',
2381
- ),
2382
- array(
2383
- 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
2384
- 'name' => 'PBPBoxShadow',
2385
- 'type' => 'text',
2386
- 'class' => '',
2387
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 5px 2px #888888',
2388
- 'value' => isset($param_values->PBPBoxShadow) ? $param_values->PBPBoxShadow : '',
2389
- 'after' => '',
2390
- ),
2391
- array(
2392
- 'label' => __('Hover Parameters', WDFMInstance(self::PLUGIN)->prefix),
2393
- 'type' => 'label',
2394
- 'class' => 'fm-mini-title',
2395
- 'after' => '<br/>',
2396
- ),
2397
- array(
2398
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2399
- 'name' => 'PBHPBGColor',
2400
- 'type' => 'text',
2401
- 'class' => 'color',
2402
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2403
- 'value' => isset($param_values->PBHPBGColor) ? $param_values->PBHPBGColor : '',
2404
- 'after' => '',
2405
- ),
2406
- array(
2407
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2408
- 'name' => 'PBHPColor',
2409
- 'type' => 'text',
2410
- 'class' => 'color',
2411
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2412
- 'value' => isset($param_values->PBHPColor) ? $param_values->PBHPColor : '',
2413
- 'after' => '',
2414
- ),
2415
- array(
2416
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2417
- 'name' => 'PBHPBorder',
2418
- 'type' => 'checkbox',
2419
- 'options' => $borders,
2420
- 'class' => '',
2421
- 'after' => '',
2422
- ),
2423
- array(
2424
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2425
- 'name' => 'PBHPBorderColor',
2426
- 'type' => 'text',
2427
- 'class' => 'color',
2428
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2429
- 'value' => isset($param_values->PBHPBorderColor) ? $param_values->PBHPBorderColor : '',
2430
- 'after' => '',
2431
- ),
2432
- array(
2433
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2434
- 'name' => 'PBHPBorderType',
2435
- 'type' => 'select',
2436
- 'options' => $border_types,
2437
- 'class' => '',
2438
- 'value' => isset($param_values->PBHPBorderType) ? $param_values->PBHPBorderType : '',
2439
- 'after' => '',
2440
- ),
2441
- array(
2442
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2443
- 'name' => 'PBHPBorderWidth',
2444
- 'type' => 'text',
2445
- 'class' => '',
2446
- 'value' => isset($param_values->PBHPBorderWidth) ? $param_values->PBHPBorderWidth : '',
2447
- 'after' => 'px</div>',
2448
- ),
2449
- ),
2450
- 'close_button' => array(
2451
- array(
2452
- 'label' => '',
2453
- 'type' => 'panel',
2454
- 'class' => 'col-md-12',
2455
- 'label_class' => '',
2456
- 'after' => '',
2457
- ),
2458
- array(
2459
- 'label' => __('Position', WDFMInstance(self::PLUGIN)->prefix),
2460
- 'name' => 'CBPPosition',
2461
- 'type' => 'select',
2462
- 'options' => $position_types,
2463
- 'class' => '',
2464
- 'value' => isset($param_values->CBPPosition) ? $param_values->CBPPosition : '',
2465
- 'after' => '',
2466
- ),
2467
- array(
2468
- 'label' => __('Top', WDFMInstance(self::PLUGIN)->prefix),
2469
- 'name' => 'CBPTop',
2470
- 'type' => 'text',
2471
- 'class' => '',
2472
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 100px or 10%',
2473
- 'value' => isset($param_values->CBPTop) ? $param_values->CBPTop : '',
2474
- 'after' => '',
2475
- ),
2476
- array(
2477
- 'label' => __('Right', WDFMInstance(self::PLUGIN)->prefix),
2478
- 'name' => 'CBPRight',
2479
- 'type' => 'text',
2480
- 'class' => '',
2481
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 100px or 10%',
2482
- 'value' => isset($param_values->CBPRight) ? $param_values->CBPRight : '',
2483
- 'after' => '',
2484
- ),
2485
- array(
2486
- 'label' => __('Bottom', WDFMInstance(self::PLUGIN)->prefix),
2487
- 'name' => 'CBPBottom',
2488
- 'type' => 'text',
2489
- 'class' => '',
2490
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 100px or 10%',
2491
- 'value' => isset($param_values->CBPBottom) ? $param_values->CBPBottom : '',
2492
- 'after' => '',
2493
- ),
2494
- array(
2495
- 'label' => __('Left', WDFMInstance(self::PLUGIN)->prefix),
2496
- 'name' => 'CBPLeft',
2497
- 'type' => 'text',
2498
- 'class' => '',
2499
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 100px or 10%',
2500
- 'value' => isset($param_values->CBPLeft) ? $param_values->CBPLeft : '',
2501
- 'after' => '',
2502
- ),
2503
- array(
2504
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2505
- 'name' => 'CBPBGColor',
2506
- 'type' => 'text',
2507
- 'class' => 'color',
2508
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2509
- 'value' => isset($param_values->CBPBGColor) ? $param_values->CBPBGColor : '',
2510
- 'after' => '',
2511
- ),
2512
- array(
2513
- 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
2514
- 'name' => 'CBPFontSize',
2515
- 'type' => 'text',
2516
- 'class' => '13',
2517
- 'value' => isset($param_values->CBPFontSize) ? $param_values->CBPFontSize : '',
2518
- 'after' => 'px',
2519
- ),
2520
- array(
2521
- 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
2522
- 'name' => 'CBPFontWeight',
2523
- 'type' => 'select',
2524
- 'options' => $font_weights,
2525
- 'class' => '',
2526
- 'value' => isset($param_values->CBPFontWeight) ? $param_values->CBPFontWeight : '',
2527
- 'after' => '',
2528
- ),
2529
- array(
2530
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2531
- 'name' => 'CBPColor',
2532
- 'type' => 'text',
2533
- 'class' => 'color',
2534
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2535
- 'value' => isset($param_values->CBPColor) ? $param_values->CBPColor : '',
2536
- 'after' => '',
2537
- ),
2538
- array(
2539
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
2540
- 'name' => 'CBPPadding',
2541
- 'type' => 'text',
2542
- 'class' => '',
2543
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5px or 3% 5%',
2544
- 'value' => isset($param_values->CBPPadding) ? $param_values->CBPPadding : '',
2545
- 'after' => '',
2546
- ),
2547
- array(
2548
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
2549
- 'name' => 'CBPMargin',
2550
- 'type' => 'text',
2551
- 'class' => '',
2552
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
2553
- 'value' => isset($param_values->CBPMargin) ? $param_values->CBPMargin : '',
2554
- 'after' => '',
2555
- ),
2556
- array(
2557
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2558
- 'name' => 'CBPBorder',
2559
- 'type' => 'checkbox',
2560
- 'options' => $borders,
2561
- 'class' => '',
2562
- 'after' => '',
2563
- ),
2564
- array(
2565
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2566
- 'name' => 'CBPBorderColor',
2567
- 'type' => 'text',
2568
- 'class' => 'color',
2569
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2570
- 'value' => isset($param_values->CBPBorderColor) ? $param_values->CBPBorderColor : '',
2571
- 'after' => '',
2572
- ),
2573
- array(
2574
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2575
- 'name' => 'CBPBorderType',
2576
- 'type' => 'select',
2577
- 'options' => $border_types,
2578
- 'class' => '',
2579
- 'value' => isset($param_values->CBPBorderType) ? $param_values->CBPBorderType : '',
2580
- 'after' => '',
2581
- ),
2582
- array(
2583
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2584
- 'name' => 'CBPBorderWidth',
2585
- 'type' => 'text',
2586
- 'class' => '',
2587
- 'value' => isset($param_values->CBPBorderWidth) ? $param_values->CBPBorderWidth : '',
2588
- 'after' => 'px',
2589
- ),
2590
- array(
2591
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
2592
- 'name' => 'CBPBorderRadius',
2593
- 'type' => 'text',
2594
- 'class' => '',
2595
- 'value' => isset($param_values->CBPBorderRadius) ? $param_values->CBPBorderRadius : '',
2596
- 'after' => 'px',
2597
- ),
2598
- array(
2599
- 'label' => __('Hover Parameters', WDFMInstance(self::PLUGIN)->prefix),
2600
- 'type' => 'label',
2601
- 'class' => 'fm-mini-title',
2602
- 'after' => '<br/>',
2603
- ),
2604
- array(
2605
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2606
- 'name' => 'CBHPBGColor',
2607
- 'type' => 'text',
2608
- 'class' => 'color',
2609
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2610
- 'value' => isset($param_values->CBHPBGColor) ? $param_values->CBHPBGColor : '',
2611
- 'after' => '',
2612
- ),
2613
- array(
2614
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2615
- 'name' => 'CBHPColor',
2616
- 'type' => 'text',
2617
- 'class' => 'color',
2618
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2619
- 'value' => isset($param_values->CBHPColor) ? $param_values->CBHPColor : '',
2620
- 'after' => '',
2621
- ),
2622
- array(
2623
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2624
- 'name' => 'CBHPBorder',
2625
- 'type' => 'checkbox',
2626
- 'options' => $borders,
2627
- 'class' => '',
2628
- 'after' => '',
2629
- ),
2630
- array(
2631
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2632
- 'name' => 'CBHPBorderColor',
2633
- 'type' => 'text',
2634
- 'class' => 'color',
2635
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2636
- 'value' => isset($param_values->CBHPBorderColor) ? $param_values->CBHPBorderColor : '',
2637
- 'after' => '',
2638
- ),
2639
- array(
2640
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2641
- 'name' => 'CBHPBorderType',
2642
- 'type' => 'select',
2643
- 'options' => $border_types,
2644
- 'class' => '',
2645
- 'value' => isset($param_values->CBHPBorderType) ? $param_values->CBHPBorderType : '',
2646
- 'after' => '',
2647
- ),
2648
- array(
2649
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2650
- 'name' => 'CBHPBorderWidth',
2651
- 'type' => 'text',
2652
- 'class' => '',
2653
- 'value' => isset($param_values->CBHPBorderWidth) ? $param_values->CBHPBorderWidth : '',
2654
- 'after' => 'px</div>',
2655
- ),
2656
- ),
2657
- 'minimize' => array(
2658
- array(
2659
- 'label' => '',
2660
- 'type' => 'panel',
2661
- 'class' => 'col-md-12',
2662
- 'label_class' => '',
2663
- 'after' => '',
2664
- ),
2665
- array(
2666
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2667
- 'name' => 'MBPBGColor',
2668
- 'type' => 'text',
2669
- 'class' => 'color',
2670
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2671
- 'value' => isset($param_values->MBPBGColor) ? $param_values->MBPBGColor : '',
2672
- 'after' => '',
2673
- ),
2674
- array(
2675
- 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
2676
- 'name' => 'MBPFontSize',
2677
- 'type' => 'text',
2678
- 'class' => '13',
2679
- 'value' => isset($param_values->MBPFontSize) ? $param_values->MBPFontSize : '',
2680
- 'after' => 'px',
2681
- ),
2682
- array(
2683
- 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
2684
- 'name' => 'MBPFontWeight',
2685
- 'type' => 'select',
2686
- 'options' => $font_weights,
2687
- 'class' => '',
2688
- 'value' => isset($param_values->MBPFontWeight) ? $param_values->MBPFontWeight : '',
2689
- 'after' => '',
2690
- ),
2691
- array(
2692
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2693
- 'name' => 'MBPColor',
2694
- 'type' => 'text',
2695
- 'class' => 'color',
2696
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2697
- 'value' => isset($param_values->MBPColor) ? $param_values->MBPColor : '',
2698
- 'after' => '',
2699
- ),
2700
- array(
2701
- 'label' => __('Text Align', WDFMInstance(self::PLUGIN)->prefix),
2702
- 'name' => 'MBPTextAlign',
2703
- 'type' => 'select',
2704
- 'options' => $aligns,
2705
- 'class' => '',
2706
- 'value' => isset($param_values->MBPTextAlign) ? $param_values->MBPTextAlign : '',
2707
- 'after' => '',
2708
- ),
2709
- array(
2710
- 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
2711
- 'name' => 'MBPPadding',
2712
- 'type' => 'text',
2713
- 'class' => '',
2714
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5px or 3% 5%',
2715
- 'value' => isset($param_values->MBPPadding) ? $param_values->MBPPadding : '',
2716
- 'after' => 'px|%',
2717
- ),
2718
- array(
2719
- 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
2720
- 'name' => 'MBPMargin',
2721
- 'type' => 'text',
2722
- 'class' => '',
2723
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
2724
- 'value' => isset($param_values->MBPMargin) ? $param_values->MBPMargin : '',
2725
- 'after' => 'px|%',
2726
- ),
2727
- array(
2728
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2729
- 'name' => 'MBPBorder',
2730
- 'type' => 'checkbox',
2731
- 'options' => $borders,
2732
- 'class' => '',
2733
- 'after' => '',
2734
- ),
2735
- array(
2736
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2737
- 'name' => 'MBPBorderColor',
2738
- 'type' => 'text',
2739
- 'class' => 'color',
2740
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2741
- 'value' => isset($param_values->MBPBorderColor) ? $param_values->MBPBorderColor : '',
2742
- 'after' => '',
2743
- ),
2744
- array(
2745
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2746
- 'name' => 'MBPBorderType',
2747
- 'type' => 'select',
2748
- 'options' => $border_types,
2749
- 'class' => '',
2750
- 'value' => isset($param_values->MBPBorderType) ? $param_values->MBPBorderType : '',
2751
- 'after' => '',
2752
- ),
2753
- array(
2754
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2755
- 'name' => 'MBPBorderWidth',
2756
- 'type' => 'text',
2757
- 'class' => '',
2758
- 'value' => isset($param_values->MBPBorderWidth) ? $param_values->MBPBorderWidth : '',
2759
- 'after' => 'px',
2760
- ),
2761
- array(
2762
- 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
2763
- 'name' => 'MBPBorderRadius',
2764
- 'type' => 'text',
2765
- 'class' => '',
2766
- 'value' => isset($param_values->MBPBorderRadius) ? $param_values->MBPBorderRadius : '',
2767
- 'after' => 'px',
2768
- ),
2769
- array(
2770
- 'label' => __('Hover Parameters', WDFMInstance(self::PLUGIN)->prefix),
2771
- 'type' => 'label',
2772
- 'class' => 'fm-mini-title',
2773
- 'after' => '<br/>',
2774
- ),
2775
- array(
2776
- 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2777
- 'name' => 'MBHPBGColor',
2778
- 'type' => 'text',
2779
- 'class' => 'color',
2780
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2781
- 'value' => isset($param_values->MBHPBGColor) ? $param_values->MBHPBGColor : '',
2782
- 'after' => '',
2783
- ),
2784
- array(
2785
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2786
- 'name' => 'MBHPColor',
2787
- 'type' => 'text',
2788
- 'class' => 'color',
2789
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2790
- 'value' => isset($param_values->MBHPColor) ? $param_values->MBHPColor : '',
2791
- 'after' => '',
2792
- ),
2793
- array(
2794
- 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2795
- 'name' => 'MBHPBorder',
2796
- 'type' => 'checkbox',
2797
- 'options' => $borders,
2798
- 'class' => '',
2799
- 'after' => '',
2800
- ),
2801
- array(
2802
- 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2803
- 'name' => 'MBHPBorderColor',
2804
- 'type' => 'text',
2805
- 'class' => 'color',
2806
- 'value' => isset($param_values->MBHPBorderColor) ? $param_values->MBHPBorderColor : '',
2807
- 'after' => '',
2808
- ),
2809
- array(
2810
- 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2811
- 'name' => 'MBHPBorderType',
2812
- 'type' => 'select',
2813
- 'options' => $border_types,
2814
- 'class' => '',
2815
- 'value' => isset($param_values->MBHPBorderType) ? $param_values->MBHPBorderType : '',
2816
- 'after' => '',
2817
- ),
2818
- array(
2819
- 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2820
- 'name' => 'MBHPBorderWidth',
2821
- 'type' => 'text',
2822
- 'class' => '',
2823
- 'value' => isset($param_values->MBHPBorderWidth) ? $param_values->MBHPBorderWidth : '',
2824
- 'after' => 'px</div>',
2825
- ),
2826
- ),
2827
- 'other' => array(
2828
- array(
2829
- 'label' => __('Inactive Text', WDFMInstance(self::PLUGIN)->prefix),
2830
- 'type' => 'panel',
2831
- 'class' => 'col-md-12',
2832
- 'label_class' => 'fm-mini-title',
2833
- 'after' => '<br/>',
2834
- ),
2835
- array(
2836
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2837
- 'name' => 'OPDeInputColor',
2838
- 'type' => 'text',
2839
- 'class' => 'color',
2840
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2841
- 'value' => isset($param_values->OPDeInputColor) ? $param_values->OPDeInputColor : '',
2842
- 'after' => '',
2843
- ),
2844
- array(
2845
- 'label' => __('Font Style', WDFMInstance(self::PLUGIN)->prefix),
2846
- 'name' => 'OPFontStyle',
2847
- 'type' => 'text',
2848
- 'class' => '',
2849
- 'value' => isset($param_values->OPFontStyle) ? $param_values->OPFontStyle : '',
2850
- 'after' => '',
2851
- ),
2852
- array(
2853
- 'label' => __('Required', WDFMInstance(self::PLUGIN)->prefix),
2854
- 'type' => 'label',
2855
- 'class' => 'fm-mini-title',
2856
- 'after' => '<br/>',
2857
- ),
2858
- array(
2859
- 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2860
- 'name' => 'OPRColor',
2861
- 'type' => 'text',
2862
- 'class' => 'color',
2863
- 'value' => isset($param_values->OPRColor) ? $param_values->OPRColor : '',
2864
- 'after' => '',
2865
- ),
2866
- array(
2867
- 'label' => __('File Upload', WDFMInstance(self::PLUGIN)->prefix),
2868
- 'type' => 'label',
2869
- 'class' => 'fm-mini-title',
2870
- 'after' => '<br/>',
2871
- ),
2872
- array(
2873
- 'label' => __('Background URL', WDFMInstance(self::PLUGIN)->prefix),
2874
- 'name' => 'OPFBgUrl',
2875
- 'type' => 'text',
2876
- 'class' => '',
2877
- // 'placeholder' => __('e.g. http:// or https://', WDFMInstance(self::PLUGIN)->prefix),
2878
- 'value' => isset($param_values->OPFBgUrl) ? $param_values->OPFBgUrl : '',
2879
- 'after' => '',
2880
- ),
2881
- array(
2882
- 'label' => __('Background Repeat', WDFMInstance(self::PLUGIN)->prefix),
2883
- 'name' => 'OPFBGRepeat',
2884
- 'type' => 'select',
2885
- 'options' => $bg_repeats,
2886
- 'class' => '',
2887
- 'value' => isset($param_values->OPFBGRepeat) ? $param_values->OPFBGRepeat : '',
2888
- 'after' => '',
2889
- ),
2890
- array(
2891
- 'label' => __('Background Position', WDFMInstance(self::PLUGIN)->prefix),
2892
- 'name1' => 'OPFPos1',
2893
- 'name2' => 'OPFPos2',
2894
- 'type' => '2text',
2895
- 'class' => 'fm-2text',
2896
- 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' px|%, top|bottom|left|right|center',
2897
- 'value1' => isset($param_values->OPFPos1) ? $param_values->OPFPos1 : '',
2898
- 'value2' => isset($param_values->OPFPos2) ? $param_values->OPFPos2 : '',
2899
- 'before1' => '',
2900
- 'before2' => '',
2901
- 'after' => '',
2902
- ),
2903
- array(
2904
- 'label' => __('Grading', WDFMInstance(self::PLUGIN)->prefix),
2905
- 'type' => 'label',
2906
- 'class' => 'fm-mini-title',
2907
- 'after' => '<br/>',
2908
- ),
2909
- array(
2910
- 'label' => __('Text Width', WDFMInstance(self::PLUGIN)->prefix),
2911
- 'name' => 'OPGWidth',
2912
- 'type' => 'text',
2913
- 'class' => '',
2914
- 'value' => isset($param_values->OPGWidth) ? $param_values->OPGWidth : '',
2915
- 'after' => 'px</div>',
2916
- ),
2917
- ),
2918
- 'custom_css' => array(
2919
- array(
2920
- 'label' => '',
2921
- 'type' => 'panel',
2922
- 'class' => 'col-md-12',
2923
- 'label_class' => '',
2924
- 'after' => '',
2925
- ),
2926
- array(
2927
- 'label' => __('Custom CSS', WDFMInstance(self::PLUGIN)->prefix),
2928
- 'name' => 'CUPCSS',
2929
- 'type' => 'textarea',
2930
- 'class' => '',
2931
- 'value' => isset($param_values->CUPCSS) ? $param_values->CUPCSS : '',
2932
- 'after' => '</div>',
2933
- ),
2934
- ),
2935
- );
2936
-
2937
- return $all_params;
2938
- }
2939
-
2940
- /**
2941
- * Save theme.
2942
- */
2943
- public function apply() {
2944
- $data = $this->save_db();
2945
- $page = WDW_FM_Library(self::PLUGIN)->get('page');
2946
- $active_tab = WDW_FM_Library(self::PLUGIN)->get('active_tab');
2947
- $pagination = WDW_FM_Library(self::PLUGIN)->get('pagination-type');
2948
- $form_type = WDW_FM_Library(self::PLUGIN)->get('form_type');
2949
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
2950
- 'page' => $page,
2951
- 'task' => 'edit',
2952
- 'current_id' => $data['id'],
2953
- 'message' => $data['msg'],
2954
- 'active_tab' => $active_tab,
2955
- 'pagination' => $pagination,
2956
- 'form_type' => $form_type,
2957
- ), admin_url('admin.php')));
2958
- }
2959
-
2960
- /**
2961
- * Save theme to DB.
2962
- *
2963
- * @return array
2964
- */
2965
- public function save_db() {
2966
- global $wpdb;
2967
- $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
2968
- $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
2969
- $version = 2;
2970
- $params = (isset($_POST['params']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['params'])) : '');
2971
- $default = (isset($_POST['default']) ? esc_html(stripslashes($_POST['default'])) : 0);
2972
- if ( $id != 0 ) {
2973
- $save = $this->model->update_formmaker_themes(array(
2974
- 'title' => $title,
2975
- 'css' => $params,
2976
- 'default' => $default,
2977
- ), array( 'id' => $id ));
2978
- $version = $this->model->get_theme_version($id);
2979
- }
2980
- else {
2981
- $save = $this->model->insert_theme(array(
2982
- 'title' => $title,
2983
- 'css' => $params,
2984
- 'default' => $default,
2985
- 'version' => $version,
2986
- ));
2987
- $id = $wpdb->insert_id;
2988
- }
2989
- if ( $save !== FALSE ) {
2990
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/frontend/models/form_maker.php";
2991
- $model_frontend = new FMModelForm_maker_fmc();
2992
- $form_theme = json_decode(html_entity_decode($params), TRUE);
2993
- $model_frontend->create_css($id, $form_theme, $version == 1, TRUE);
2994
-
2995
- $msg = 1;
2996
- }
2997
- else {
2998
- $msg = 2;
2999
- }
3000
- return array('id' => $id, 'msg' => $msg);
3001
- }
3002
-
3003
- /**
3004
- * Set default.
3005
- *
3006
- * @param $id
3007
- */
3008
- public function setdefault( $id ) {
3009
- $this->model->update_formmaker_themes( array( 'default' => 0 ), array( 'default' => 1 ) );
3010
- $save = $this->model->update_formmaker_themes( array( 'default' => 1 ), array( 'id' => $id ) );
3011
- if ( $save !== FALSE ) {
3012
- $message = 7;
3013
- }
3014
- else {
3015
- $message = 2;
3016
- }
3017
- $page = WDW_FM_Library(self::PLUGIN)->get('page');
3018
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
3019
- 'page' => $page,
3020
- 'task' => 'display',
3021
- 'message' => $message,
3022
- ), admin_url('admin.php')));
3023
- }
3024
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerThemes_fmc
5
+ */
6
+ class FMControllerThemes_fmc extends CFMAdminController {
7
+ /**
8
+ * @var $model
9
+ */
10
+ private $model;
11
+ /**
12
+ * @var $view
13
+ */
14
+ private $view;
15
+ /**
16
+ * @var string $page
17
+ */
18
+ private $page;
19
+ /**
20
+ * @var string $bulk_action_name
21
+ */
22
+ private $bulk_action_name;
23
+ /**
24
+ * @var int $items_per_page
25
+ */
26
+ private $items_per_page = 20;
27
+ /**
28
+ * @var array $actions
29
+ */
30
+ private $actions = array();
31
+
32
+ public function __construct() {
33
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Themes_fm.php";
34
+ $this->model = new FMModelThemes_fmc();
35
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Themes_fm.php";
36
+ $this->view = new FMViewThemes_fmc();
37
+ $this->page = WDW_FM_Library(self::PLUGIN)->get('page');
38
+ $this->bulk_action_name = 'bulk_action';
39
+
40
+ $this->actions = array(
41
+ 'duplicate' => array(
42
+ 'title' => __('Duplicate', WDFMInstance(self::PLUGIN)->prefix),
43
+ $this->bulk_action_name => __('duplicated', WDFMInstance(self::PLUGIN)->prefix),
44
+ ),
45
+ 'delete' => array(
46
+ 'title' => __('Delete', WDFMInstance(self::PLUGIN)->prefix),
47
+ $this->bulk_action_name => __('deleted', WDFMInstance(self::PLUGIN)->prefix),
48
+ ),
49
+ );
50
+ }
51
+
52
+ /**
53
+ * Execute.
54
+ */
55
+ public function execute() {
56
+ $task = WDW_FM_Library(self::PLUGIN)->get('task');
57
+ $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
58
+ if ( method_exists($this, $task) ) {
59
+ if ( $task != 'add' && $task != 'edit' && $task != 'display' ) {
60
+ check_admin_referer(WDFMInstance(self::PLUGIN)->nonce, WDFMInstance(self::PLUGIN)->nonce);
61
+ }
62
+ $block_action = $this->bulk_action_name;
63
+ $action = WDW_FM_Library(self::PLUGIN)->get($block_action, -1);
64
+ if ( $action != -1 ) {
65
+ $this->$block_action($action);
66
+ }
67
+ else {
68
+ $this->$task($id);
69
+ }
70
+ }
71
+ else {
72
+ $this->display();
73
+ }
74
+ }
75
+
76
+ /**
77
+ * Display.
78
+ */
79
+ public function display() {
80
+ // Set params for view.
81
+ $params = array();
82
+ $params['page'] = $this->page;
83
+ $params['page_title'] = __('Themes', WDFMInstance(self::PLUGIN)->prefix);
84
+ $params['actions'] = $this->actions;
85
+ $params['order'] = WDW_FM_Library(self::PLUGIN)->get('order', 'desc');
86
+ $params['orderby'] = WDW_FM_Library(self::PLUGIN)->get('orderby', 'default');
87
+ // To prevent SQL injections.
88
+ $params['order'] = ($params['order'] == 'desc') ? 'desc' : 'asc';
89
+ if ( !in_array($params['orderby'], array( 'title', 'default' )) ) {
90
+ $params['orderby'] = 'default';
91
+ }
92
+ $params['items_per_page'] = $this->items_per_page;
93
+ $page = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
94
+ $page_num = $page ? ($page - 1) * $params['items_per_page'] : 0;
95
+ $params['page_num'] = $page_num;
96
+ $params['search'] = WDW_FM_Library(self::PLUGIN)->get('s', '');;
97
+ $params['total'] = $this->model->total();
98
+ $params['rows_data'] = $this->model->get_rows_data($params);
99
+ $this->view->display($params);
100
+ }
101
+
102
+ /**
103
+ * Bulk actions.
104
+ *
105
+ * @param string $task
106
+ */
107
+ public function bulk_action( $task = '' ) {
108
+ $message = 0;
109
+ $successfully_updated = 0;
110
+
111
+ $check = WDW_FM_Library(self::PLUGIN)->get('check', '');
112
+
113
+ if ( $check ) {
114
+ foreach ( $check as $form_id => $item ) {
115
+ if ( method_exists($this, $task) ) {
116
+ $message = $this->$task($form_id, TRUE);
117
+ if ( $message != 2 ) {
118
+ // Increase successfully updated items count, if action doesn't failed.
119
+ $successfully_updated++;
120
+ }
121
+ }
122
+ }
123
+ if ( $successfully_updated ) {
124
+ $block_action = $this->bulk_action_name;
125
+ $message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDFMInstance(self::PLUGIN)->prefix), $successfully_updated, $this->actions[$task][$block_action]);
126
+ }
127
+ }
128
+
129
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
130
+ 'page' => $this->page,
131
+ 'task' => 'display',
132
+ ($message === 2 ? 'message' : 'msg') => $message,
133
+ ), admin_url('admin.php')));
134
+
135
+ }
136
+
137
+ /**
138
+ * Delete form by id.
139
+ *
140
+ * @param int $id
141
+ * @param bool $bulk
142
+ *
143
+ * @return int
144
+ */
145
+ public function delete( $id = 0, $bulk = FALSE ) {
146
+ $isDefault = $this->model->get_default($id);
147
+ if ( $isDefault ) {
148
+ $message = 4;
149
+ }
150
+ else {
151
+ $table = 'formmaker_themes';
152
+ $delete = $this->model->delete_rows(array(
153
+ 'table' => $table,
154
+ 'where' => 'id = ' . $id,
155
+ ));
156
+ if ( $delete ) {
157
+ $message = 3;
158
+ }
159
+ else {
160
+ $message = 2;
161
+ }
162
+ }
163
+ if ( $bulk ) {
164
+ return $message;
165
+ }
166
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display', 'message' => $message), admin_url('admin.php') ) );
167
+ }
168
+
169
+ /**
170
+ * Duplicate by id.
171
+ *
172
+ * @param int $id
173
+ * @param bool $bulk
174
+ *
175
+ * @return int
176
+ */
177
+ public function duplicate( $id = 0, $bulk = FALSE ) {
178
+ $message = 2;
179
+ $table = 'formmaker_themes';
180
+ $row = $this->model->select_rows("get_row", array(
181
+ "selection" => "*",
182
+ "table" => $table,
183
+ "where" => "id=" . (int) $id,
184
+ ));
185
+ if ( $row ) {
186
+ $row = (array) $row;
187
+ unset($row['id']);
188
+ $row['title'] = $row['title'] . ' - ' . __('Copy', WDFMInstance(self::PLUGIN)->prefix);
189
+ $row['default'] = 0;
190
+ $inserted = $this->model->insert_data_to_db($table, (array) $row);
191
+ if ( $inserted !== FALSE ) {
192
+ $message = 11;
193
+ }
194
+ }
195
+ if ( $bulk ) {
196
+ return $message;
197
+ }
198
+ else {
199
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
200
+ 'page' => $this->page,
201
+ 'task' => 'display',
202
+ 'message' => $message,
203
+ ), admin_url('admin.php')));
204
+ }
205
+ }
206
+
207
+ /**
208
+ * Edit.
209
+ *
210
+ * @param int $id
211
+ */
212
+ public function edit( $id = 0 ) {
213
+ $params = array();
214
+ $params['id'] = (int) $id;
215
+ $params['row'] = $this->model->get_row_data($params['id'], FALSE);
216
+
217
+ if ( $id != 0 && empty($params['row']) ) {
218
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
219
+ }
220
+ $params['page_title'] = $params['row']->title;
221
+ $params['param_values'] = $params['row']->css;
222
+ $params['tabs'] = array(
223
+ 'global' => __('Global Parameters', WDFMInstance(self::PLUGIN)->prefix),
224
+ 'header' => __('Header', WDFMInstance(self::PLUGIN)->prefix),
225
+ 'content' => __('Content', WDFMInstance(self::PLUGIN)->prefix),
226
+ 'input_select' => __('Inputbox', WDFMInstance(self::PLUGIN)->prefix),
227
+ 'choices' => __('Choices', WDFMInstance(self::PLUGIN)->prefix),
228
+ 'subscribe' => __('General Buttons', WDFMInstance(self::PLUGIN)->prefix),
229
+ 'paigination' => __('Pagination', WDFMInstance(self::PLUGIN)->prefix),
230
+ 'buttons' => __('Buttons', WDFMInstance(self::PLUGIN)->prefix),
231
+ 'close_button' => __('Close(Minimize) Button', WDFMInstance(self::PLUGIN)->prefix),
232
+ 'minimize' => __('Minimize Text', WDFMInstance(self::PLUGIN)->prefix),
233
+ 'other' => __('Other', WDFMInstance(self::PLUGIN)->prefix),
234
+ 'custom_css' => __('Custom CSS', WDFMInstance(self::PLUGIN)->prefix),
235
+ );
236
+ $border_types = array(
237
+ '' => '',
238
+ 'solid' => 'Solid',
239
+ 'dotted' => 'Dotted',
240
+ 'dashed' => 'Dashed',
241
+ 'double' => 'Double',
242
+ 'groove' => 'Groove',
243
+ 'ridge' => 'Ridge',
244
+ 'inset' => 'Inset',
245
+ 'outset' => 'Outset',
246
+ 'initial' => 'Initial',
247
+ 'inherit' => 'Inherit',
248
+ 'hidden' => 'Hidden',
249
+ 'none' => 'None',
250
+ );
251
+ $borders = array(
252
+ '' => '',
253
+ 'top' => __('Top', WDFMInstance(self::PLUGIN)->prefix),
254
+ 'right' => __('Right', WDFMInstance(self::PLUGIN)->prefix),
255
+ 'bottom' => __('Bottom', WDFMInstance(self::PLUGIN)->prefix),
256
+ 'left' => __('Left', WDFMInstance(self::PLUGIN)->prefix)
257
+ );
258
+ $position_types = array(
259
+ '' => '',
260
+ 'static' => 'Static',
261
+ 'relative' => 'Relative',
262
+ 'fixed' => 'Fixed',
263
+ 'absolute' => 'Absolute',
264
+ );
265
+ $font_weights = array(
266
+ '' => '',
267
+ 'normal' => 'Normal',
268
+ 'bold' => 'Bold',
269
+ 'bolder' => 'Bolder',
270
+ 'lighter' => 'Lighter',
271
+ 'initial' => 'Initial',
272
+ );
273
+ $aligns = array( '' => '', 'left' => __('Left', WDFMInstance(self::PLUGIN)->prefix), 'center' => __('Center', WDFMInstance(self::PLUGIN)->prefix), 'right' => __('Right', WDFMInstance(self::PLUGIN)->prefix) );
274
+ $basic_fonts = array(
275
+ '' => '',
276
+ 'arial' => 'Arial',
277
+ 'lucida grande' => 'Lucida grande',
278
+ 'segoe ui' => 'Segoe ui',
279
+ 'tahoma' => 'Tahoma',
280
+ 'trebuchet ms' => 'Trebuchet ms',
281
+ 'verdana' => 'Verdana',
282
+ 'cursive' => 'Cursive',
283
+ 'fantasy' => 'Fantasy',
284
+ 'monospace' => 'Monospace',
285
+ 'serif' => 'Serif',
286
+ );
287
+ $bg_repeats = array(
288
+ '' => '',
289
+ 'repeat' => 'repeat',
290
+ 'repeat-x' => 'repeat-x',
291
+ 'repeat-y' => 'repeat-y',
292
+ 'no-repeat' => 'no-repeat',
293
+ 'initial' => 'initial',
294
+ 'inherit' => 'inherit',
295
+ );
296
+ $google_fonts = WDW_FM_Library(self::PLUGIN)->get_google_fonts();
297
+ $font_families = $basic_fonts + $google_fonts;
298
+ $params['fonts'] = implode("|", str_replace(' ', '+', $google_fonts));
299
+ $params['all_params'] = $this->all_params($params['param_values'], $borders, $border_types, $font_weights, $position_types, $aligns, $bg_repeats, $font_families);
300
+
301
+ $this->view->edit($params);
302
+ }
303
+
304
+ /**
305
+ * all params.
306
+ *
307
+ * @param array $param_values
308
+ * @param array $borders
309
+ * @param array $border_types
310
+ * @param array $font_weights
311
+ * @param array $position_types
312
+ * @param array $aligns
313
+ * @param array $bg_repeats
314
+ * @param array $font_families
315
+ * @return array
316
+ */
317
+ public function all_params( $param_values = array(), $borders = array(), $border_types = array(), $font_weights = array(), $position_types = array(), $aligns = array(), $bg_repeats = array(), $font_families = array() ) {
318
+ $all_params = array(
319
+ 'global' => array(
320
+ array(
321
+ 'label' => '',
322
+ 'type' => 'panel',
323
+ 'class' => 'col-md-12',
324
+ 'label_class' => '',
325
+ 'after' => '',
326
+ ),
327
+ array(
328
+ 'label' => __('Font Family', WDFMInstance(self::PLUGIN)->prefix),
329
+ 'name' => 'GPFontFamily',
330
+ 'type' => 'select',
331
+ 'options' => $font_families,
332
+ 'class' => '',
333
+ 'value' => isset($param_values->GPFontFamily) ? $param_values->GPFontFamily : '',
334
+ 'after' => '',
335
+ ),
336
+ array(
337
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
338
+ 'name' => 'AGPWidth',
339
+ 'type' => 'text',
340
+ 'class' => '',
341
+ 'value' => isset($param_values->AGPWidth) ? $param_values->AGPWidth : '',
342
+ 'after' => '%',
343
+ ),
344
+ array(
345
+ 'label' => __('Width (for scrollbox, popup form types)', WDFMInstance(self::PLUGIN)->prefix),
346
+ 'name' => 'AGPSPWidth',
347
+ 'type' => 'text',
348
+ 'class' => '',
349
+ 'value' => isset($param_values->AGPSPWidth) ? $param_values->AGPSPWidth : '',
350
+ 'after' => '%',
351
+ ),
352
+ array(
353
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
354
+ 'name' => 'AGPPadding',
355
+ 'type' => 'text',
356
+ 'class' => '',
357
+ 'placeholder' => __('e.g. 3px 5px or 3% 5%', WDFMInstance(self::PLUGIN)->prefix),
358
+ 'value' => isset($param_values->AGPPadding) ? $param_values->AGPPadding : '',
359
+ 'after' => '',
360
+ ),
361
+ array(
362
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
363
+ 'name' => 'AGPMargin',
364
+ 'type' => 'text',
365
+ 'class' => '',
366
+ 'value' => isset($param_values->AGPMargin) ? $param_values->AGPMargin : '',
367
+ 'placeholder' => __('e.g. 5px 10px or 5% 10%', WDFMInstance(self::PLUGIN)->prefix),
368
+ 'after' => '',
369
+ ),
370
+ array(
371
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
372
+ 'name' => 'AGPBorder',
373
+ 'type' => 'checkbox',
374
+ 'options' => $borders,
375
+ 'class' => '',
376
+ 'after' => '',
377
+ ),
378
+ array(
379
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
380
+ 'name' => 'AGPBorderColor',
381
+ 'type' => 'text',
382
+ 'class' => 'color',
383
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #e5e5e5',
384
+ 'value' => isset($param_values->AGPBorderColor) ? $param_values->AGPBorderColor : '',
385
+ 'after' => '',
386
+ ),
387
+ array(
388
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
389
+ 'name' => 'AGPBorderType',
390
+ 'type' => 'select',
391
+ 'options' => $border_types,
392
+ 'class' => '',
393
+ 'value' => isset($param_values->AGPBorderType) ? $param_values->AGPBorderType : '',
394
+ 'after' => '',
395
+ ),
396
+ array(
397
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
398
+ 'name' => 'AGPBorderWidth',
399
+ 'type' => 'text',
400
+ 'class' => '',
401
+ 'value' => isset($param_values->AGPBorderWidth) ? $param_values->AGPBorderWidth : '',
402
+ 'after' => 'px',
403
+ ),
404
+ array(
405
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
406
+ 'name' => 'AGPBorderRadius',
407
+ 'type' => 'text',
408
+ 'class' => '',
409
+ 'value' => isset($param_values->AGPBorderRadius) ? $param_values->AGPBorderRadius : '',
410
+ 'after' => 'px',
411
+ ),
412
+ array(
413
+ 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
414
+ 'name' => 'AGPBoxShadow',
415
+ 'type' => 'text',
416
+ 'class' => '',
417
+ 'value' => isset($param_values->AGPBoxShadow) ? $param_values->AGPBoxShadow : '',
418
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 5px 2px #888888',
419
+ 'after' => '</div>',
420
+ ),
421
+ ),
422
+ 'header' => array(
423
+ array(
424
+ 'label' => __('General Parameters', WDFMInstance(self::PLUGIN)->prefix),
425
+ 'type' => 'panel',
426
+ 'class' => 'col-md-12',
427
+ 'label_class' => 'fm-mini-title',
428
+ 'after' => '<br/>',
429
+ ),
430
+ array(
431
+ 'label' => __('Alignment', WDFMInstance(self::PLUGIN)->prefix),
432
+ 'name' => 'HPAlign',
433
+ 'type' => 'select',
434
+ 'options' => $borders,
435
+ 'class' => '',
436
+ 'value' => isset($param_values->HPAlign) ? $param_values->HPAlign : '',
437
+ 'after' => '',
438
+ ),
439
+ array(
440
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
441
+ 'name' => 'HPBGColor',
442
+ 'type' => 'text',
443
+ 'class' => 'color',
444
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
445
+ 'value' => isset($param_values->HPBGColor) ? $param_values->HPBGColor : '',
446
+ 'after' => '',
447
+ ),
448
+ array(
449
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
450
+ 'name' => 'HPWidth',
451
+ 'type' => 'text',
452
+ 'class' => '',
453
+ 'value' => isset($param_values->HPWidth) ? $param_values->HPWidth : '',
454
+ 'after' => '%',
455
+ ),
456
+ array(
457
+ 'label' => __('Width (for topbar form type)', WDFMInstance(self::PLUGIN)->prefix),
458
+ 'name' => 'HTPWidth',
459
+ 'type' => 'text',
460
+ 'class' => '',
461
+ 'value' => isset($param_values->HTPWidth) ? $param_values->HTPWidth : '',
462
+ 'after' => '%',
463
+ ),
464
+ array(
465
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
466
+ 'name' => 'HPPadding',
467
+ 'type' => 'text',
468
+ 'class' => '',
469
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 3px 5px or 3% 5%',
470
+ 'value' => isset($param_values->HPPadding) ? $param_values->HPPadding : '',
471
+ 'after' => '',
472
+ ),
473
+ array(
474
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
475
+ 'name' => 'HPMargin',
476
+ 'type' => 'text',
477
+ 'class' => '',
478
+ 'value' => isset($param_values->HPMargin) ? $param_values->HPMargin : '',
479
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
480
+ 'after' => '',
481
+ ),
482
+ array(
483
+ 'label' => __('Text Align', WDFMInstance(self::PLUGIN)->prefix),
484
+ 'name' => 'HPTextAlign',
485
+ 'type' => 'select',
486
+ 'options' => $aligns,
487
+ 'class' => '',
488
+ 'value' => isset($param_values->HPTextAlign) ? $param_values->HPTextAlign : '',
489
+ 'after' => '',
490
+ ),
491
+ array(
492
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
493
+ 'name' => 'HPBorder',
494
+ 'type' => 'checkbox',
495
+ 'options' => $borders,
496
+ 'class' => '',
497
+ 'after' => '',
498
+ ),
499
+ array(
500
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
501
+ 'name' => 'HPBorderColor',
502
+ 'type' => 'text',
503
+ 'class' => 'color',
504
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
505
+ 'value' => isset($param_values->HPBorderColor) ? $param_values->HPBorderColor : '',
506
+ 'after' => '',
507
+ ),
508
+ array(
509
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
510
+ 'name' => 'HPBorderType',
511
+ 'type' => 'select',
512
+ 'options' => $border_types,
513
+ 'class' => '',
514
+ 'value' => isset($param_values->HPBorderType) ? $param_values->HPBorderType : '',
515
+ 'after' => '',
516
+ ),
517
+ array(
518
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
519
+ 'name' => 'HPBorderWidth',
520
+ 'type' => 'text',
521
+ 'class' => '',
522
+ 'value' => isset($param_values->HPBorderWidth) ? $param_values->HPBorderWidth : '',
523
+ 'after' => 'px',
524
+ ),
525
+ array(
526
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
527
+ 'name' => 'HPBorderRadius',
528
+ 'type' => 'text',
529
+ 'class' => '',
530
+ 'value' => isset($param_values->HPBorderRadius) ? $param_values->HPBorderRadius : '',
531
+ 'after' => 'px</div>',
532
+ ),
533
+ array(
534
+ 'label' => __('Title Parameters', WDFMInstance(self::PLUGIN)->prefix),
535
+ 'type' => 'panel',
536
+ 'class' => 'col-md-12',
537
+ 'label_class' => 'fm-mini-title',
538
+ 'after' => '<br/>',
539
+ ),
540
+ array(
541
+ 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
542
+ 'name' => 'HTPFontSize',
543
+ 'type' => 'text',
544
+ 'class' => '',
545
+ 'value' => isset($param_values->HTPFontSize) ? $param_values->HTPFontSize : '',
546
+ 'after' => 'px',
547
+ ),
548
+ array(
549
+ 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
550
+ 'name' => 'HTPWeight',
551
+ 'type' => 'select',
552
+ 'options' => $font_weights,
553
+ 'class' => '',
554
+ 'value' => isset($param_values->HTPWeight) ? $param_values->HTPWeight : '',
555
+ 'after' => '',
556
+ ),
557
+ array(
558
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
559
+ 'name' => 'HTPColor',
560
+ 'type' => 'text',
561
+ 'class' => 'color',
562
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
563
+ 'value' => isset($param_values->HTPColor) ? $param_values->HTPColor : '',
564
+ 'after' => '',
565
+ ),
566
+ array(
567
+ 'label' => __('Description Parameters', WDFMInstance(self::PLUGIN)->prefix),
568
+ 'type' => 'label',
569
+ 'class' => 'fm-mini-title',
570
+ 'after' => '<br/>',
571
+ ),
572
+ array(
573
+ 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
574
+ 'name' => 'HDPFontSize',
575
+ 'type' => 'text',
576
+ 'class' => '',
577
+ 'value' => isset($param_values->HDPFontSize) ? $param_values->HDPFontSize : '',
578
+ 'after' => 'px',
579
+ ),
580
+ array(
581
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
582
+ 'name' => 'HDPColor',
583
+ 'type' => 'text',
584
+ 'class' => 'color',
585
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
586
+ 'value' => isset($param_values->HDPColor) ? $param_values->HDPColor : '',
587
+ 'after' => '',
588
+ ),
589
+ array(
590
+ 'label' => __('Image Parameters', WDFMInstance(self::PLUGIN)->prefix),
591
+ 'type' => 'label',
592
+ 'class' => 'fm-mini-title',
593
+ 'after' => '<br/>',
594
+ ),
595
+ array(
596
+ 'label' => __('Alignment', WDFMInstance(self::PLUGIN)->prefix),
597
+ 'name' => 'HIPAlign',
598
+ 'type' => 'select',
599
+ 'options' => $borders,
600
+ 'class' => '',
601
+ 'value' => isset($param_values->HIPAlign) ? $param_values->HIPAlign : '',
602
+ 'after' => '',
603
+ ),
604
+ array(
605
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
606
+ 'name' => 'HIPWidth',
607
+ 'type' => 'text',
608
+ 'class' => '',
609
+ 'value' => isset($param_values->HIPWidth) ? $param_values->HIPWidth : '',
610
+ 'after' => 'px',
611
+ ),
612
+ array(
613
+ 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
614
+ 'name' => 'HIPHeight',
615
+ 'type' => 'text',
616
+ 'class' => '',
617
+ 'value' => isset($param_values->HIPHeight) ? $param_values->HIPHeight : '',
618
+ 'after' => 'px</div>',
619
+ ),
620
+ ),
621
+ 'content' => array(
622
+ array(
623
+ 'label' => __('General Parameters', WDFMInstance(self::PLUGIN)->prefix),
624
+ 'type' => 'panel',
625
+ 'class' => 'col-md-12',
626
+ 'label_class' => 'fm-mini-title',
627
+ 'after' => '<br/>',
628
+ ),
629
+ array(
630
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
631
+ 'name' => 'GPBGColor',
632
+ 'type' => 'text',
633
+ 'class' => 'color',
634
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
635
+ 'value' => isset($param_values->GPBGColor) ? $param_values->GPBGColor : '',
636
+ 'after' => '',
637
+ ),
638
+ array(
639
+ 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
640
+ 'name' => 'GPFontSize',
641
+ 'type' => 'text',
642
+ 'class' => '',
643
+ 'value' => isset($param_values->GPFontSize) ? $param_values->GPFontSize : '',
644
+ 'after' => 'px',
645
+ ),
646
+ array(
647
+ 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
648
+ 'name' => 'GPFontWeight',
649
+ 'type' => 'select',
650
+ 'options' => $font_weights,
651
+ 'class' => '',
652
+ 'value' => isset($param_values->GPFontWeight) ? $param_values->GPFontWeight : '',
653
+ 'after' => '',
654
+ ),
655
+ array(
656
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
657
+ 'name' => 'GPWidth',
658
+ 'type' => 'text',
659
+ 'class' => '',
660
+ 'value' => isset($param_values->GPWidth) ? $param_values->GPWidth : '',
661
+ 'after' => '%',
662
+ ),
663
+ array(
664
+ 'label' => __('Width (for topbar form type)', WDFMInstance(self::PLUGIN)->prefix),
665
+ 'name' => 'GTPWidth',
666
+ 'type' => 'text',
667
+ 'class' => '',
668
+ 'value' => isset($param_values->GTPWidth) ? $param_values->GTPWidth : '',
669
+ 'after' => '%',
670
+ ),
671
+ array(
672
+ 'label' => __('Alignment', WDFMInstance(self::PLUGIN)->prefix),
673
+ 'name' => 'GPAlign',
674
+ 'type' => 'select',
675
+ 'options' => $aligns,
676
+ 'class' => '',
677
+ 'value' => isset($param_values->GPAlign) ? $param_values->GPAlign : '',
678
+ 'after' => '',
679
+ ),
680
+ array(
681
+ 'label' => __('Background URL', WDFMInstance(self::PLUGIN)->prefix),
682
+ 'name' => 'GPBackground',
683
+ 'type' => 'text',
684
+ 'class' => '',
685
+ // 'placeholder' => __('e.g. http:// or https://', WDFMInstance(self::PLUGIN)->prefix),
686
+ 'value' => isset($param_values->GPBackground) ? $param_values->GPBackground : '',
687
+ 'after' => '',
688
+ ),
689
+ array(
690
+ 'label' => __('Background Repeat', WDFMInstance(self::PLUGIN)->prefix),
691
+ 'name' => 'GPBackgroundRepeat',
692
+ 'type' => 'select',
693
+ 'options' => $bg_repeats,
694
+ 'class' => '',
695
+ 'value' => isset($param_values->GPBackgroundRepeat) ? $param_values->GPBackgroundRepeat : '',
696
+ 'after' => '',
697
+ ),
698
+ array(
699
+ 'label' => __('Background Position', WDFMInstance(self::PLUGIN)->prefix),
700
+ 'name1' => 'GPBGPosition1',
701
+ 'name2' => 'GPBGPosition2',
702
+ 'type' => '2text',
703
+ 'class' => 'fm-2text',
704
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' px|%, top|bottom|left|right|center',
705
+ 'value1' => isset($param_values->GPBGPosition1) ? $param_values->GPBGPosition1 : '',
706
+ 'value2' => isset($param_values->GPBGPosition2) ? $param_values->GPBGPosition2 : '',
707
+ 'before1' => '',
708
+ 'before2' => '',
709
+ 'after' => '',
710
+ ),
711
+ array(
712
+ 'label' => __('Background Size', WDFMInstance(self::PLUGIN)->prefix),
713
+ 'name1' => 'GPBGSize1',
714
+ 'name2' => 'GPBGSize2',
715
+ 'type' => '2text',
716
+ 'class' => 'fm-2text',
717
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' px|%, auto|cover|contain',
718
+ 'value1' => isset($param_values->GPBGSize1) ? $param_values->GPBGSize1 : '',
719
+ 'value2' => isset($param_values->GPBGSize2) ? $param_values->GPBGSize2 : '',
720
+ 'before1' => '',
721
+ 'before2' => '',
722
+ 'after' => '',
723
+ ),
724
+ array(
725
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
726
+ 'name' => 'GPColor',
727
+ 'type' => 'text',
728
+ 'class' => 'color',
729
+ 'value' => isset($param_values->GPColor) ? $param_values->GPColor : '',
730
+ 'after' => '',
731
+ ),
732
+ array(
733
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
734
+ 'name' => 'GPPadding',
735
+ 'type' => 'text',
736
+ 'class' => '',
737
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 3px 5px or 3% 5%',
738
+ 'value' => isset($param_values->GPPadding) ? $param_values->GPPadding : '',
739
+ 'after' => '',
740
+ ),
741
+ array(
742
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
743
+ 'name' => 'GPMargin',
744
+ 'type' => 'text',
745
+ 'class' => '',
746
+ 'value' => isset($param_values->GPMargin) ? $param_values->GPMargin : '',
747
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
748
+ 'after' => '',
749
+ ),
750
+ array(
751
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
752
+ 'name' => 'GPBorder',
753
+ 'type' => 'checkbox',
754
+ 'options' => $borders,
755
+ 'class' => '',
756
+ 'after' => '',
757
+ ),
758
+ array(
759
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
760
+ 'name' => 'GPBorderColor',
761
+ 'type' => 'text',
762
+ 'class' => 'color',
763
+ 'value' => isset($param_values->GPBorderColor) ? $param_values->GPBorderColor : '',
764
+ 'after' => '',
765
+ ),
766
+ array(
767
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
768
+ 'name' => 'GPBorderType',
769
+ 'type' => 'select',
770
+ 'options' => $border_types,
771
+ 'class' => '',
772
+ 'value' => isset($param_values->GPBorderType) ? $param_values->GPBorderType : '',
773
+ 'after' => '',
774
+ ),
775
+ array(
776
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
777
+ 'name' => 'GPBorderWidth',
778
+ 'type' => 'text',
779
+ 'class' => '',
780
+ 'value' => isset($param_values->GPBorderWidth) ? $param_values->GPBorderWidth : '',
781
+ 'after' => 'px',
782
+ ),
783
+ array(
784
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
785
+ 'name' => 'GPBorderRadius',
786
+ 'type' => 'text',
787
+ 'class' => '',
788
+ 'value' => isset($param_values->GPBorderRadius) ? $param_values->GPBorderRadius : '',
789
+ 'after' => 'px</div>',
790
+ ),
791
+ array(
792
+ 'label' => __('Mini labels (name, phone, address, checkbox, radio) Parameters', WDFMInstance(self::PLUGIN)->prefix),
793
+ 'type' => 'panel',
794
+ 'class' => 'col-md-12',
795
+ 'label_class' => 'fm-mini-title',
796
+ 'after' => '<br/>',
797
+ ),
798
+ array(
799
+ 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
800
+ 'name' => 'GPMLFontSize',
801
+ 'type' => 'text',
802
+ 'class' => '',
803
+ 'value' => isset($param_values->GPMLFontSize) ? $param_values->GPMLFontSize : '',
804
+ 'after' => 'px',
805
+ ),
806
+ array(
807
+ 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
808
+ 'name' => 'GPMLFontWeight',
809
+ 'type' => 'select',
810
+ 'options' => $font_weights,
811
+ 'class' => '',
812
+ 'value' => isset($param_values->GPMLFontWeight) ? $param_values->GPMLFontWeight : '',
813
+ 'after' => '',
814
+ ),
815
+ array(
816
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
817
+ 'name' => 'GPMLColor',
818
+ 'type' => 'text',
819
+ 'class' => 'color',
820
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
821
+ 'value' => isset($param_values->GPMLColor) ? $param_values->GPMLColor : '',
822
+ 'after' => '',
823
+ ),
824
+ array(
825
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
826
+ 'name' => 'GPMLPadding',
827
+ 'type' => 'text',
828
+ 'class' => '',
829
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 3px 5px or 3% 5%',
830
+ 'value' => isset($param_values->GPMLPadding) ? $param_values->GPMLPadding : '',
831
+ 'after' => '',
832
+ ),
833
+ array(
834
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
835
+ 'name' => 'GPMLMargin',
836
+ 'type' => 'text',
837
+ 'class' => '',
838
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
839
+ 'value' => isset($param_values->GPMLMargin) ? $param_values->GPMLMargin : '',
840
+ 'after' => '',
841
+ ),
842
+ array(
843
+ 'label' => __('Section Parameters', WDFMInstance(self::PLUGIN)->prefix),
844
+ 'type' => 'label',
845
+ 'class' => 'fm-mini-title',
846
+ 'after' => '<br/>',
847
+ ),
848
+ array(
849
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
850
+ 'name' => 'SEPBGColor',
851
+ 'type' => 'text',
852
+ 'class' => 'color',
853
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
854
+ 'value' => isset($param_values->SEPBGColor) ? $param_values->SEPBGColor : '',
855
+ 'after' => '',
856
+ ),
857
+ array(
858
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
859
+ 'name' => 'SEPPadding',
860
+ 'type' => 'text',
861
+ 'class' => '',
862
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 3px 5px or 3% 5%',
863
+ 'value' => isset($param_values->SEPPadding) ? $param_values->SEPPadding : '',
864
+ 'after' => '',
865
+ ),
866
+ array(
867
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
868
+ 'name' => 'SEPMargin',
869
+ 'type' => 'text',
870
+ 'class' => '',
871
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
872
+ 'value' => isset($param_values->SEPMargin) ? $param_values->SEPMargin : '',
873
+ 'after' => '',
874
+ ),
875
+ array(
876
+ 'label' => __('Section Column Parameters', WDFMInstance(self::PLUGIN)->prefix),
877
+ 'type' => 'label',
878
+ 'class' => 'fm-mini-title',
879
+ 'after' => '<br/>',
880
+ ),
881
+ array(
882
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
883
+ 'name' => 'COPPadding',
884
+ 'type' => 'text',
885
+ 'class' => '',
886
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 3px 5px or 3% 5%',
887
+ 'value' => isset($param_values->COPPadding) ? $param_values->COPPadding : '',
888
+ 'after' => '',
889
+ ),
890
+ array(
891
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
892
+ 'name' => 'COPMargin',
893
+ 'type' => 'text',
894
+ 'class' => '',
895
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
896
+ 'value' => isset($param_values->COPMargin) ? $param_values->COPMargin : '',
897
+ 'after' => '',
898
+ ),
899
+ array(
900
+ 'label' => __('Footer Parameters', WDFMInstance(self::PLUGIN)->prefix),
901
+ 'type' => 'label',
902
+ 'class' => 'fm-mini-title',
903
+ 'after' => '<br/>',
904
+ ),
905
+ array(
906
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
907
+ 'name' => 'FPWidth',
908
+ 'type' => 'text',
909
+ 'class' => '',
910
+ 'value' => isset($param_values->FPWidth) ? $param_values->FPWidth : '',
911
+ 'after' => '%',
912
+ ),
913
+ array(
914
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
915
+ 'name' => 'FPPadding',
916
+ 'type' => 'text',
917
+ 'class' => '',
918
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 3px 5px or 3% 5%',
919
+ 'value' => isset($param_values->FPPadding) ? $param_values->FPPadding : '',
920
+ 'after' => '',
921
+ ),
922
+ array(
923
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
924
+ 'name' => 'FPMargin',
925
+ 'type' => 'text',
926
+ 'class' => '',
927
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
928
+ 'value' => isset($param_values->FPMargin) ? $param_values->FPMargin : '',
929
+ 'after' => '</div>',
930
+ ),
931
+ ),
932
+ 'input_select' => array(
933
+ array(
934
+ 'label' => '',
935
+ 'type' => 'panel',
936
+ 'class' => 'col-md-12',
937
+ 'label_class' => '',
938
+ 'after' => '',
939
+ ),
940
+ array(
941
+ 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
942
+ 'name' => 'IPHeight',
943
+ 'type' => 'text',
944
+ 'class' => '',
945
+ 'value' => isset($param_values->IPHeight) ? $param_values->IPHeight : '',
946
+ 'after' => 'px',
947
+ ),
948
+ array(
949
+ 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
950
+ 'name' => 'IPFontSize',
951
+ 'type' => 'text',
952
+ 'class' => '',
953
+ 'value' => isset($param_values->IPFontSize) ? $param_values->IPFontSize : '',
954
+ 'after' => 'px',
955
+ ),
956
+ array(
957
+ 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
958
+ 'name' => 'IPFontWeight',
959
+ 'type' => 'select',
960
+ 'options' => $font_weights,
961
+ 'class' => '',
962
+ 'value' => isset($param_values->IPFontWeight) ? $param_values->IPFontWeight : '',
963
+ 'after' => '',
964
+ ),
965
+ array(
966
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
967
+ 'name' => 'IPBGColor',
968
+ 'type' => 'text',
969
+ 'class' => 'color',
970
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
971
+ 'value' => isset($param_values->IPBGColor) ? $param_values->IPBGColor : '',
972
+ 'after' => '',
973
+ ),
974
+ array(
975
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
976
+ 'name' => 'IPColor',
977
+ 'type' => 'text',
978
+ 'class' => 'color',
979
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
980
+ 'value' => isset($param_values->IPColor) ? $param_values->IPColor : '',
981
+ 'after' => '',
982
+ ),
983
+ array(
984
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
985
+ 'name' => 'IPPadding',
986
+ 'type' => 'text',
987
+ 'class' => '',
988
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 3px 5px or 3% 5%',
989
+ 'value' => isset($param_values->IPPadding) ? $param_values->IPPadding : '',
990
+ 'after' => '',
991
+ ),
992
+ array(
993
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
994
+ 'name' => 'IPMargin',
995
+ 'type' => 'text',
996
+ 'class' => '',
997
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
998
+ 'value' => isset($param_values->IPMargin) ? $param_values->IPMargin : '',
999
+ 'after' => '',
1000
+ ),
1001
+ array(
1002
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1003
+ 'name' => 'IPBorder',
1004
+ 'type' => 'checkbox',
1005
+ 'options' => $borders,
1006
+ 'class' => '',
1007
+ 'after' => '',
1008
+ ),
1009
+ array(
1010
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1011
+ 'name' => 'IPBorderColor',
1012
+ 'type' => 'text',
1013
+ 'class' => 'color',
1014
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
1015
+ 'value' => isset($param_values->IPBorderColor) ? $param_values->IPBorderColor : '',
1016
+ 'after' => '',
1017
+ ),
1018
+ array(
1019
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1020
+ 'name' => 'IPBorderType',
1021
+ 'type' => 'select',
1022
+ 'options' => $border_types,
1023
+ 'class' => '',
1024
+ 'value' => isset($param_values->IPBorderType) ? $param_values->IPBorderType : '',
1025
+ 'after' => '',
1026
+ ),
1027
+ array(
1028
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1029
+ 'name' => 'IPBorderWidth',
1030
+ 'type' => 'text',
1031
+ 'class' => '',
1032
+ 'value' => isset($param_values->IPBorderWidth) ? $param_values->IPBorderWidth : '',
1033
+ 'after' => 'px',
1034
+ ),
1035
+ array(
1036
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1037
+ 'name' => 'IPBorderRadius',
1038
+ 'type' => 'text',
1039
+ 'class' => '',
1040
+ 'value' => isset($param_values->IPBorderRadius) ? $param_values->IPBorderRadius : '',
1041
+ 'after' => 'px',
1042
+ ),
1043
+ array(
1044
+ 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
1045
+ 'name' => 'IPBoxShadow',
1046
+ 'type' => 'text',
1047
+ 'class' => '',
1048
+ 'value' => isset($param_values->IPBoxShadow) ? $param_values->IPBoxShadow : '',
1049
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 5px 2px #888888',
1050
+ 'after' => '</div>',
1051
+ ),
1052
+ array(
1053
+ 'label' => __('Dropdown additional', WDFMInstance(self::PLUGIN)->prefix),
1054
+ 'type' => 'panel',
1055
+ 'class' => 'col-md-12',
1056
+ 'label_class' => 'fm-mini-title',
1057
+ 'after' => '<br/>',
1058
+ ),
1059
+ array(
1060
+ 'label' => __('Appearance', WDFMInstance(self::PLUGIN)->prefix),
1061
+ 'name' => 'SBPAppearance',
1062
+ 'type' => 'text',
1063
+ 'class' => '',
1064
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' normal, icon, window, button, menu, field',
1065
+ 'value' => isset($param_values->SBPAppearance) ? $param_values->SBPAppearance : '',
1066
+ 'after' => '',
1067
+ ),
1068
+ array(
1069
+ 'label' => __('Background URL', WDFMInstance(self::PLUGIN)->prefix),
1070
+ 'name' => 'SBPBackground',
1071
+ 'type' => 'text',
1072
+ 'class' => '',
1073
+ // 'placeholder' => __('e.g. http:// or https://', WDFMInstance(self::PLUGIN)->prefix),
1074
+ 'value' => isset($param_values->SBPBackground) ? $param_values->SBPBackground : '',
1075
+ 'after' => '',
1076
+ ),
1077
+ array(
1078
+ 'label' => __('Background Repeat', WDFMInstance(self::PLUGIN)->prefix),
1079
+ 'name' => 'SBPBGRepeat',
1080
+ 'type' => 'select',
1081
+ 'options' => $bg_repeats,
1082
+ 'class' => '',
1083
+ 'value' => isset($param_values->SBPBGRepeat) ? $param_values->SBPBGRepeat : '',
1084
+ 'after' => '',
1085
+ ),
1086
+ array(
1087
+ 'label' => '',
1088
+ 'type' => 'label',
1089
+ 'class' => '',
1090
+ 'after' => '</div>',
1091
+ ),
1092
+ ),
1093
+ 'choices' => array(
1094
+ array(
1095
+ 'label' => __('Single Choice', WDFMInstance(self::PLUGIN)->prefix),
1096
+ 'type' => 'panel',
1097
+ 'class' => 'col-md-12',
1098
+ 'label_class' => 'fm-mini-title',
1099
+ 'after' => '<br/>',
1100
+ ),
1101
+ array(
1102
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1103
+ 'name' => 'SCPBGColor',
1104
+ 'type' => 'text',
1105
+ 'class' => 'color',
1106
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
1107
+ 'value' => isset($param_values->SCPBGColor) ? $param_values->SCPBGColor : '',
1108
+ 'after' => '',
1109
+ ),
1110
+ array(
1111
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
1112
+ 'name' => 'SCPWidth',
1113
+ 'type' => 'text',
1114
+ 'class' => '',
1115
+ 'value' => isset($param_values->SCPWidth) ? $param_values->SCPWidth : '',
1116
+ 'after' => 'px',
1117
+ ),
1118
+ array(
1119
+ 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1120
+ 'name' => 'SCPHeight',
1121
+ 'type' => 'text',
1122
+ 'class' => '',
1123
+ 'value' => isset($param_values->SCPHeight) ? $param_values->SCPHeight : '',
1124
+ 'after' => 'px',
1125
+ ),
1126
+ array(
1127
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1128
+ 'name' => 'SCPMargin',
1129
+ 'type' => 'text',
1130
+ 'class' => '5px',
1131
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
1132
+ 'value' => isset($param_values->SCPMargin) ? $param_values->SCPMargin : '',
1133
+ 'after' => '',
1134
+ ),
1135
+ array(
1136
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1137
+ 'name' => 'SCPBorder',
1138
+ 'type' => 'checkbox',
1139
+ 'options' => $borders,
1140
+ 'class' => '',
1141
+ 'after' => '',
1142
+ ),
1143
+ array(
1144
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1145
+ 'name' => 'SCPBorderColor',
1146
+ 'type' => 'text',
1147
+ 'class' => 'color',
1148
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
1149
+ 'value' => isset($param_values->SCPBorderColor) ? $param_values->SCPBorderColor : '',
1150
+ 'after' => '',
1151
+ ),
1152
+ array(
1153
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1154
+ 'name' => 'SCPBorderType',
1155
+ 'type' => 'select',
1156
+ 'options' => $border_types,
1157
+ 'class' => '',
1158
+ 'value' => isset($param_values->SCPBorderType) ? $param_values->SCPBorderType : '',
1159
+ 'after' => '',
1160
+ ),
1161
+ array(
1162
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1163
+ 'name' => 'SCPBorderWidth',
1164
+ 'type' => 'text',
1165
+ 'class' => '',
1166
+ 'value' => isset($param_values->SCPBorderWidth) ? $param_values->SCPBorderWidth : '',
1167
+ 'after' => 'px',
1168
+ ),
1169
+ array(
1170
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1171
+ 'name' => 'SCPBorderRadius',
1172
+ 'type' => 'text',
1173
+ 'class' => '',
1174
+ 'value' => isset($param_values->SCPBorderRadius) ? $param_values->SCPBorderRadius : '',
1175
+ 'after' => 'px',
1176
+ ),
1177
+ array(
1178
+ 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
1179
+ 'name' => 'SCPBoxShadow',
1180
+ 'type' => 'text',
1181
+ 'class' => '',
1182
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 5px 2px #888888',
1183
+ 'value' => isset($param_values->SCPBoxShadow) ? $param_values->SCPBoxShadow : '',
1184
+ 'after' => '',
1185
+ ),
1186
+ array(
1187
+ 'label' => __('Checked Parameters', WDFMInstance(self::PLUGIN)->prefix),
1188
+ 'type' => 'label',
1189
+ 'class' => 'fm-mini-title',
1190
+ 'after' => '<br/>',
1191
+ ),
1192
+ array(
1193
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1194
+ 'name' => 'SCCPBGColor',
1195
+ 'type' => 'text',
1196
+ 'class' => 'color',
1197
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
1198
+ 'value' => isset($param_values->SCCPBGColor) ? $param_values->SCCPBGColor : '',
1199
+ 'after' => '',
1200
+ ),
1201
+ array(
1202
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
1203
+ 'name' => 'SCCPWidth',
1204
+ 'type' => 'text',
1205
+ 'class' => '',
1206
+ 'value' => isset($param_values->SCCPWidth) ? $param_values->SCCPWidth : '',
1207
+ 'after' => 'px',
1208
+ ),
1209
+ array(
1210
+ 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1211
+ 'name' => 'SCCPHeight',
1212
+ 'type' => 'text',
1213
+ 'class' => '',
1214
+ 'value' => isset($param_values->SCCPHeight) ? $param_values->SCCPHeight : '',
1215
+ 'after' => 'px',
1216
+ ),
1217
+ array(
1218
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1219
+ 'name' => 'SCCPMargin',
1220
+ 'type' => 'text',
1221
+ 'class' => '',
1222
+ 'value' => isset($param_values->SCCPMargin) ? $param_values->SCCPMargin : '',
1223
+ 'after' => 'px',
1224
+ ),
1225
+ array(
1226
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1227
+ 'name' => 'SCCPBorderRadius',
1228
+ 'type' => 'text',
1229
+ 'class' => '',
1230
+ 'value' => isset($param_values->SCCPBorderRadius) ? $param_values->SCCPBorderRadius : '',
1231
+ 'after' => 'px</div>',
1232
+ ),
1233
+ array(
1234
+ 'label' => __('Multiple Choice', WDFMInstance(self::PLUGIN)->prefix),
1235
+ 'type' => 'panel',
1236
+ 'class' => 'col-md-12',
1237
+ 'label_class' => 'fm-mini-title',
1238
+ 'after' => '<br/>',
1239
+ ),
1240
+ array(
1241
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1242
+ 'name' => 'MCPBGColor',
1243
+ 'type' => 'text',
1244
+ 'class' => 'color',
1245
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
1246
+ 'value' => isset($param_values->MCPBGColor) ? $param_values->MCPBGColor : '',
1247
+ 'after' => '',
1248
+ ),
1249
+ array(
1250
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
1251
+ 'name' => 'MCPWidth',
1252
+ 'type' => 'text',
1253
+ 'class' => '',
1254
+ 'value' => isset($param_values->MCPWidth) ? $param_values->MCPWidth : '',
1255
+ 'after' => 'px',
1256
+ ),
1257
+ array(
1258
+ 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1259
+ 'name' => 'MCPHeight',
1260
+ 'type' => 'text',
1261
+ 'class' => '',
1262
+ 'value' => isset($param_values->MCPHeight) ? $param_values->MCPHeight : '',
1263
+ 'after' => 'px',
1264
+ ),
1265
+ array(
1266
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1267
+ 'name' => 'MCPMargin',
1268
+ 'type' => 'text',
1269
+ 'class' => '5px',
1270
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 10px or 5% 10%',
1271
+ 'value' => isset($param_values->MCPMargin) ? $param_values->MCPMargin : '',
1272
+ 'after' => '',
1273
+ ),
1274
+ array(
1275
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1276
+ 'name' => 'MCPBorder',
1277
+ 'type' => 'checkbox',
1278
+ 'options' => $borders,
1279
+ 'class' => '',
1280
+ 'after' => '',
1281
+ ),
1282
+ array(
1283
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1284
+ 'name' => 'MCPBorderColor',
1285
+ 'type' => 'text',
1286
+ 'class' => 'color',
1287
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' #efefef',
1288
+ 'value' => isset($param_values->MCPBorderColor) ? $param_values->MCPBorderColor : '',
1289
+ 'after' => '',
1290
+ ),
1291
+ array(
1292
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1293
+ 'name' => 'MCPBorderType',
1294
+ 'type' => 'select',
1295
+ 'options' => $border_types,
1296
+ 'class' => '',
1297
+ 'value' => isset($param_values->MCPBorderType) ? $param_values->MCPBorderType : '',
1298
+ 'after' => '',
1299
+ ),
1300
+ array(
1301
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1302
+ 'name' => 'MCPBorderWidth',
1303
+ 'type' => 'text',
1304
+ 'class' => '',
1305
+ 'value' => isset($param_values->MCPBorderWidth) ? $param_values->MCPBorderWidth : '',
1306
+ 'after' => 'px',
1307
+ ),
1308
+
1309
+ array(
1310
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1311
+ 'name' => 'MCPBorderRadius',
1312
+ 'type' => 'text',
1313
+ 'class' => '',
1314
+ 'value' => isset($param_values->MCPBorderRadius) ? $param_values->MCPBorderRadius : '',
1315
+ 'after' => 'px',
1316
+ ),
1317
+ array(
1318
+ 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
1319
+ 'name' => 'MCPBoxShadow',
1320
+ 'type' => 'text',
1321
+ 'class' => '',
1322
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .' 5px 5px 2px #888888',
1323
+ 'value' => isset($param_values->MCPBoxShadow) ? $param_values->MCPBoxShadow : '',
1324
+ 'after' => '',
1325
+ ),
1326
+ array(
1327
+ 'label' => __('Checked Parameters', WDFMInstance(self::PLUGIN)->prefix),
1328
+ 'type' => 'label',
1329
+ 'class' => 'fm-mini-title',
1330
+ 'after' => '<br/>',
1331
+ ),
1332
+ array(
1333
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1334
+ 'name' => 'MCCPBGColor',
1335
+ 'type' => 'text',
1336
+ 'class' => 'color',
1337
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) .'#efefef',
1338
+ 'value' => isset($param_values->MCCPBGColor) ? $param_values->MCCPBGColor : '',
1339
+ 'after' => '',
1340
+ ),
1341
+ array(
1342
+ 'label' => __('Background URL', WDFMInstance(self::PLUGIN)->prefix),
1343
+ 'name' => 'MCCPBackground',
1344
+ 'type' => 'text',
1345
+ 'class' => '',
1346
+ // 'placeholder' => __('e.g. http:// or https://', WDFMInstance(self::PLUGIN)->prefix),
1347
+ 'value' => isset($param_values->MCCPBackground) ? $param_values->MCCPBackground : '',
1348
+ 'after' => '',
1349
+ ),
1350
+ array(
1351
+ 'label' => __('Background Repeat', WDFMInstance(self::PLUGIN)->prefix),
1352
+ 'name' => 'MCCPBGRepeat',
1353
+ 'type' => 'select',
1354
+ 'options' => $bg_repeats,
1355
+ 'class' => '',
1356
+ 'value' => isset($param_values->MCCPBGRepeat) ? $param_values->MCCPBGRepeat : '',
1357
+ 'after' => '',
1358
+ ),
1359
+ array(
1360
+ 'label' => __('Background Position', WDFMInstance(self::PLUGIN)->prefix),
1361
+ 'name1' => 'MCCPBGPos1',
1362
+ 'name2' => 'MCCPBGPos2',
1363
+ 'type' => '2text',
1364
+ 'class' => 'fm-2text',
1365
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' px|%, top|bottom|left|right|center',
1366
+ 'value1' => isset($param_values->MCCPBGPos1) ? $param_values->MCCPBGPos1 : '',
1367
+ 'value2' => isset($param_values->MCCPBGPos2) ? $param_values->MCCPBGPos2 : '',
1368
+ 'before1' => '',
1369
+ 'before2' => '',
1370
+ 'after' => '',
1371
+ ),
1372
+ array(
1373
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
1374
+ 'name' => 'MCCPWidth',
1375
+ 'type' => 'text',
1376
+ 'class' => '',
1377
+ 'value' => isset($param_values->MCCPWidth) ? $param_values->MCCPWidth : '',
1378
+ 'after' => 'px',
1379
+ ),
1380
+ array(
1381
+ 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1382
+ 'name' => 'MCCPHeight',
1383
+ 'type' => 'text',
1384
+ 'class' => '',
1385
+ 'value' => isset($param_values->MCCPHeight) ? $param_values->MCCPHeight : '',
1386
+ 'after' => 'px',
1387
+ ),
1388
+ array(
1389
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1390
+ 'name' => 'MCCPMargin',
1391
+ 'type' => 'text',
1392
+ 'class' => '',
1393
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
1394
+ 'value' => isset($param_values->MCCPMargin) ? $param_values->MCCPMargin : '',
1395
+ 'after' => '',
1396
+ ),
1397
+ array(
1398
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1399
+ 'name' => 'MCCPBorderRadius',
1400
+ 'type' => 'text',
1401
+ 'class' => '',
1402
+ 'value' => isset($param_values->MCCPBorderRadius) ? $param_values->MCCPBorderRadius : '',
1403
+ 'after' => 'px</div>',
1404
+ ),
1405
+ ),
1406
+ 'subscribe' => array(
1407
+ array(
1408
+ 'label' => __('Global Parameters', WDFMInstance(self::PLUGIN)->prefix),
1409
+ 'type' => 'panel',
1410
+ 'class' => 'col-md-12',
1411
+ 'label_class' => 'fm-mini-title',
1412
+ 'after' => '<br/>',
1413
+ ),
1414
+ array(
1415
+ 'label' => __('Alignment', WDFMInstance(self::PLUGIN)->prefix),
1416
+ 'name' => 'SPAlign',
1417
+ 'type' => 'select',
1418
+ 'options' => $aligns,
1419
+ 'class' => '',
1420
+ 'value' => isset($param_values->SPAlign) ? $param_values->SPAlign : '',
1421
+ 'after' => '</div>',
1422
+ ),
1423
+ array(
1424
+ 'label' => __('Submit', WDFMInstance(self::PLUGIN)->prefix),
1425
+ 'type' => 'panel',
1426
+ 'class' => 'col-md-12',
1427
+ 'label_class' => 'fm-mini-title',
1428
+ 'after' => '<br/>',
1429
+ ),
1430
+ array(
1431
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1432
+ 'name' => 'SPBGColor',
1433
+ 'type' => 'text',
1434
+ 'class' => 'color',
1435
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1436
+ 'value' => isset($param_values->SPBGColor) ? $param_values->SPBGColor : '',
1437
+ 'after' => '',
1438
+ ),
1439
+ array(
1440
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
1441
+ 'name' => 'SPWidth',
1442
+ 'type' => 'text',
1443
+ 'class' => '',
1444
+ 'value' => isset($param_values->SPWidth) ? $param_values->SPWidth : '',
1445
+ 'after' => 'px',
1446
+ ),
1447
+ array(
1448
+ 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1449
+ 'name' => 'SPHeight',
1450
+ 'type' => 'text',
1451
+ 'class' => '',
1452
+ 'value' => isset($param_values->SPHeight) ? $param_values->SPHeight : '',
1453
+ 'after' => 'px',
1454
+ ),
1455
+ array(
1456
+ 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
1457
+ 'name' => 'SPFontSize',
1458
+ 'type' => 'text',
1459
+ 'class' => '',
1460
+ 'value' => isset($param_values->SPFontSize) ? $param_values->SPFontSize : '',
1461
+ 'after' => 'px',
1462
+ ),
1463
+ array(
1464
+ 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
1465
+ 'name' => 'SPFontWeight',
1466
+ 'type' => 'select',
1467
+ 'options' => $font_weights,
1468
+ 'class' => '',
1469
+ 'value' => isset($param_values->SPFontWeight) ? $param_values->SPFontWeight : '',
1470
+ 'after' => '',
1471
+ ),
1472
+ array(
1473
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
1474
+ 'name' => 'SPColor',
1475
+ 'type' => 'text',
1476
+ 'class' => 'color',
1477
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1478
+ 'value' => isset($param_values->SPColor) ? $param_values->SPColor : '',
1479
+ 'after' => '',
1480
+ ),
1481
+ array(
1482
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
1483
+ 'name' => 'SPPadding',
1484
+ 'type' => 'text',
1485
+ 'class' => '',
1486
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5px or 3% 5%',
1487
+ 'value' => isset($param_values->SPPadding) ? $param_values->SPPadding : '',
1488
+ 'after' => '',
1489
+ ),
1490
+ array(
1491
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1492
+ 'name' => 'SPMargin',
1493
+ 'type' => 'text',
1494
+ 'class' => '',
1495
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
1496
+ 'value' => isset($param_values->SPMargin) ? $param_values->SPMargin : '',
1497
+ 'after' => '',
1498
+ ),
1499
+ array(
1500
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1501
+ 'name' => 'SPBorder',
1502
+ 'type' => 'checkbox',
1503
+ 'options' => $borders,
1504
+ 'class' => '',
1505
+ 'after' => '',
1506
+ ),
1507
+ array(
1508
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1509
+ 'name' => 'SPBorderColor',
1510
+ 'type' => 'text',
1511
+ 'class' => 'color',
1512
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1513
+ 'value' => isset($param_values->SPBorderColor) ? $param_values->SPBorderColor : '',
1514
+ 'after' => '',
1515
+ ),
1516
+ array(
1517
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1518
+ 'name' => 'SPBorderType',
1519
+ 'type' => 'select',
1520
+ 'options' => $border_types,
1521
+ 'class' => '',
1522
+ 'value' => isset($param_values->SPBorderType) ? $param_values->SPBorderType : '',
1523
+ 'after' => '',
1524
+ ),
1525
+ array(
1526
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1527
+ 'name' => 'SPBorderWidth',
1528
+ 'type' => 'text',
1529
+ 'class' => '',
1530
+ 'value' => isset($param_values->SPBorderWidth) ? $param_values->SPBorderWidth : '',
1531
+ 'after' => 'px',
1532
+ ),
1533
+ array(
1534
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1535
+ 'name' => 'SPBorderRadius',
1536
+ 'type' => 'text',
1537
+ 'class' => '',
1538
+ 'value' => isset($param_values->SPBorderRadius) ? $param_values->SPBorderRadius : '',
1539
+ 'after' => 'px',
1540
+ ),
1541
+ array(
1542
+ 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
1543
+ 'name' => 'SPBoxShadow',
1544
+ 'type' => 'text',
1545
+ 'class' => '',
1546
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 5px 2px #888888',
1547
+ 'value' => isset($param_values->SPBoxShadow) ? $param_values->SPBoxShadow : '',
1548
+ 'after' => '',
1549
+ ),
1550
+ array(
1551
+ 'label' => __('Hover Parameters', WDFMInstance(self::PLUGIN)->prefix),
1552
+ 'type' => 'label',
1553
+ 'class' => 'fm-mini-title',
1554
+ 'after' => '<br/>',
1555
+ ),
1556
+ array(
1557
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1558
+ 'name' => 'SHPBGColor',
1559
+ 'type' => 'text',
1560
+ 'class' => 'color',
1561
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1562
+ 'value' => isset($param_values->SHPBGColor) ? $param_values->SHPBGColor : '',
1563
+ 'after' => '',
1564
+ ),
1565
+ array(
1566
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
1567
+ 'name' => 'SHPColor',
1568
+ 'type' => 'text',
1569
+ 'class' => 'color',
1570
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1571
+ 'value' => isset($param_values->SHPColor) ? $param_values->SHPColor : '',
1572
+ 'after' => '',
1573
+ ),
1574
+ array(
1575
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1576
+ 'name' => 'SHPBorder',
1577
+ 'type' => 'checkbox',
1578
+ 'options' => $borders,
1579
+ 'class' => '',
1580
+ 'after' => '',
1581
+ ),
1582
+ array(
1583
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1584
+ 'name' => 'SHPBorderColor',
1585
+ 'type' => 'text',
1586
+ 'class' => 'color',
1587
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1588
+ 'value' => isset($param_values->SHPBorderColor) ? $param_values->SHPBorderColor : '',
1589
+ 'after' => '',
1590
+ ),
1591
+ array(
1592
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1593
+ 'name' => 'SHPBorderType',
1594
+ 'type' => 'select',
1595
+ 'options' => $border_types,
1596
+ 'class' => '',
1597
+ 'value' => isset($param_values->SHPBorderType) ? $param_values->SHPBorderType : '',
1598
+ 'after' => '',
1599
+ ),
1600
+ array(
1601
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1602
+ 'name' => 'SHPBorderWidth',
1603
+ 'type' => 'text',
1604
+ 'class' => '',
1605
+ 'value' => isset($param_values->SHPBorderWidth) ? $param_values->SHPBorderWidth : '',
1606
+ 'after' => 'px</div>',
1607
+ ),
1608
+ array(
1609
+ 'label' => __('Reset', WDFMInstance(self::PLUGIN)->prefix),
1610
+ 'type' => 'panel',
1611
+ 'class' => 'col-md-12',
1612
+ 'label_class' => 'fm-mini-title',
1613
+ 'after' => '<br/>',
1614
+ ),
1615
+ array(
1616
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1617
+ 'name' => 'BPBGColor',
1618
+ 'type' => 'text',
1619
+ 'class' => 'color',
1620
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1621
+ 'value' => isset($param_values->BPBGColor) ? $param_values->BPBGColor : '',
1622
+ 'after' => '',
1623
+ ),
1624
+ array(
1625
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
1626
+ 'name' => 'BPWidth',
1627
+ 'type' => 'text',
1628
+ 'class' => '',
1629
+ 'value' => isset($param_values->BPWidth) ? $param_values->BPWidth : '',
1630
+ 'after' => 'px',
1631
+ ),
1632
+ array(
1633
+ 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1634
+ 'name' => 'BPHeight',
1635
+ 'type' => 'text',
1636
+ 'class' => '',
1637
+ 'value' => isset($param_values->BPHeight) ? $param_values->BPHeight : '',
1638
+ 'after' => 'px',
1639
+ ),
1640
+ array(
1641
+ 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
1642
+ 'name' => 'BPFontSize',
1643
+ 'type' => 'text',
1644
+ 'class' => '',
1645
+ 'value' => isset($param_values->BPFontSize) ? $param_values->BPFontSize : '',
1646
+ 'after' => 'px',
1647
+ ),
1648
+ array(
1649
+ 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
1650
+ 'name' => 'BPFontWeight',
1651
+ 'type' => 'select',
1652
+ 'options' => $font_weights,
1653
+ 'class' => '',
1654
+ 'value' => isset($param_values->BPFontWeight) ? $param_values->BPFontWeight : '',
1655
+ 'after' => '',
1656
+ ),
1657
+ array(
1658
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
1659
+ 'name' => 'BPColor',
1660
+ 'type' => 'text',
1661
+ 'class' => 'color',
1662
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1663
+ 'value' => isset($param_values->BPColor) ? $param_values->BPColor : '',
1664
+ 'after' => '',
1665
+ ),
1666
+ array(
1667
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
1668
+ 'name' => 'BPPadding',
1669
+ 'type' => 'text',
1670
+ 'class' => '',
1671
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5xp or 3% 5%',
1672
+ 'value' => isset($param_values->BPPadding) ? $param_values->BPPadding : '',
1673
+ 'after' => '',
1674
+ ),
1675
+ array(
1676
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1677
+ 'name' => 'BPMargin',
1678
+ 'type' => 'text',
1679
+ 'class' => '',
1680
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10xp or 5% 10%',
1681
+ 'value' => isset($param_values->BPMargin) ? $param_values->BPMargin : '',
1682
+ 'after' => '',
1683
+ ),
1684
+ array(
1685
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1686
+ 'name' => 'BPBorder',
1687
+ 'type' => 'checkbox',
1688
+ 'options' => $borders,
1689
+ 'class' => '',
1690
+ 'after' => '',
1691
+ ),
1692
+ array(
1693
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1694
+ 'name' => 'BPBorderColor',
1695
+ 'type' => 'text',
1696
+ 'class' => 'color',
1697
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1698
+ 'value' => isset($param_values->BPBorderColor) ? $param_values->BPBorderColor : '',
1699
+ 'after' => '',
1700
+ ),
1701
+ array(
1702
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1703
+ 'name' => 'BPBorderType',
1704
+ 'type' => 'select',
1705
+ 'options' => $border_types,
1706
+ 'class' => '',
1707
+ 'value' => isset($param_values->BPBorderType) ? $param_values->BPBorderType : '',
1708
+ 'after' => '',
1709
+ ),
1710
+ array(
1711
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1712
+ 'name' => 'BPBorderWidth',
1713
+ 'type' => 'text',
1714
+ 'class' => '',
1715
+ 'value' => isset($param_values->BPBorderWidth) ? $param_values->BPBorderWidth : '',
1716
+ 'after' => 'px',
1717
+ ),
1718
+ array(
1719
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1720
+ 'name' => 'BPBorderRadius',
1721
+ 'type' => 'text',
1722
+ 'class' => '',
1723
+ 'value' => isset($param_values->BPBorderRadius) ? $param_values->BPBorderRadius : '',
1724
+ 'after' => 'px',
1725
+ ),
1726
+ array(
1727
+ 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
1728
+ 'name' => 'BPBoxShadow',
1729
+ 'type' => 'text',
1730
+ 'class' => '',
1731
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 5px 2px #888888',
1732
+ 'value' => isset($param_values->BPBoxShadow) ? $param_values->BPBoxShadow : '',
1733
+ 'after' => '',
1734
+ ),
1735
+ array(
1736
+ 'label' => __('Hover Parameters', WDFMInstance(self::PLUGIN)->prefix),
1737
+ 'type' => 'label',
1738
+ 'class' => 'fm-mini-title',
1739
+ 'after' => '<br/>',
1740
+ ),
1741
+ array(
1742
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1743
+ 'name' => 'BHPBGColor',
1744
+ 'type' => 'text',
1745
+ 'class' => 'color',
1746
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1747
+ 'value' => isset($param_values->BHPBGColor) ? $param_values->BHPBGColor : '',
1748
+ 'after' => '',
1749
+ ),
1750
+ array(
1751
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
1752
+ 'name' => 'BHPColor',
1753
+ 'type' => 'text',
1754
+ 'class' => 'color',
1755
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1756
+ 'value' => isset($param_values->BHPColor) ? $param_values->BHPColor : '',
1757
+ 'after' => '',
1758
+ ),
1759
+ array(
1760
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1761
+ 'name' => 'BHPBorder',
1762
+ 'type' => 'checkbox',
1763
+ 'options' => $borders,
1764
+ 'class' => '',
1765
+ 'after' => '',
1766
+ ),
1767
+ array(
1768
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1769
+ 'name' => 'BHPBorderColor',
1770
+ 'type' => 'text',
1771
+ 'class' => 'color',
1772
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1773
+ 'value' => isset($param_values->BHPBorderColor) ? $param_values->BHPBorderColor : '',
1774
+ 'after' => '',
1775
+ ),
1776
+ array(
1777
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1778
+ 'name' => 'BHPBorderType',
1779
+ 'type' => 'select',
1780
+ 'options' => $border_types,
1781
+ 'class' => '',
1782
+ 'value' => isset($param_values->BHPBorderType) ? $param_values->BHPBorderType : '',
1783
+ 'after' => '',
1784
+ ),
1785
+ array(
1786
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1787
+ 'name' => 'BHPBorderWidth',
1788
+ 'type' => 'text',
1789
+ 'class' => '',
1790
+ 'value' => isset($param_values->BHPBorderWidth) ? $param_values->BHPBorderWidth : '',
1791
+ 'after' => 'px</div>',
1792
+ ),
1793
+ ),
1794
+ 'paigination' => array(
1795
+ array(
1796
+ 'label' => __('Active', WDFMInstance(self::PLUGIN)->prefix),
1797
+ 'type' => 'panel',
1798
+ 'class' => 'col-md-12',
1799
+ 'label_class' => 'fm-mini-title',
1800
+ 'after' => '',
1801
+ ),
1802
+ array(
1803
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1804
+ 'name' => 'PSAPBGColor',
1805
+ 'type' => 'text',
1806
+ 'class' => 'color',
1807
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1808
+ 'value' => isset($param_values->PSAPBGColor) ? $param_values->PSAPBGColor : '',
1809
+ 'after' => '',
1810
+ ),
1811
+ array(
1812
+ 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
1813
+ 'name' => 'PSAPFontSize',
1814
+ 'type' => 'text',
1815
+ 'class' => '',
1816
+ 'value' => isset($param_values->PSAPFontSize) ? $param_values->PSAPFontSize : '',
1817
+ 'after' => 'px',
1818
+ ),
1819
+ array(
1820
+ 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
1821
+ 'name' => 'PSAPFontWeight',
1822
+ 'type' => 'select',
1823
+ 'options' => $font_weights,
1824
+ 'class' => '',
1825
+ 'value' => isset($param_values->PSAPFontWeight) ? $param_values->PSAPFontWeight : '',
1826
+ 'after' => '',
1827
+ ),
1828
+ array(
1829
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
1830
+ 'name' => 'PSAPColor',
1831
+ 'type' => 'text',
1832
+ 'class' => 'color',
1833
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1834
+ 'value' => isset($param_values->PSAPColor) ? $param_values->PSAPColor : '',
1835
+ 'after' => '',
1836
+ ),
1837
+ array(
1838
+ 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1839
+ 'name' => 'PSAPHeight',
1840
+ 'type' => 'text',
1841
+ 'class' => '',
1842
+ 'value' => isset($param_values->PSAPHeight) ? $param_values->PSAPHeight : '',
1843
+ 'after' => 'px',
1844
+ ),
1845
+ array(
1846
+ 'label' => __('Line Height', WDFMInstance(self::PLUGIN)->prefix),
1847
+ 'name' => 'PSAPLineHeight',
1848
+ 'type' => 'text',
1849
+ 'class' => '',
1850
+ 'value' => isset($param_values->PSAPLineHeight) ? $param_values->PSAPLineHeight : '',
1851
+ 'after' => 'px',
1852
+ ),
1853
+ array(
1854
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
1855
+ 'name' => 'PSAPPadding',
1856
+ 'type' => 'text',
1857
+ 'class' => '',
1858
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5px or 3% 5%',
1859
+ 'value' => isset($param_values->PSAPPadding) ? $param_values->PSAPPadding : '',
1860
+ 'after' => '',
1861
+ ),
1862
+ array(
1863
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1864
+ 'name' => 'PSAPMargin',
1865
+ 'type' => 'text',
1866
+ 'class' => '',
1867
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
1868
+ 'value' => isset($param_values->PSAPMargin) ? $param_values->PSAPMargin : '',
1869
+ 'after' => '',
1870
+ ),
1871
+ array(
1872
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1873
+ 'name' => 'PSAPBorder',
1874
+ 'type' => 'checkbox',
1875
+ 'options' => $borders,
1876
+ 'class' => '',
1877
+ 'after' => '',
1878
+ ),
1879
+ array(
1880
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1881
+ 'name' => 'PSAPBorderColor',
1882
+ 'type' => 'text',
1883
+ 'class' => 'color',
1884
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1885
+ 'value' => isset($param_values->PSAPBorderColor) ? $param_values->PSAPBorderColor : '',
1886
+ 'after' => '',
1887
+ ),
1888
+ array(
1889
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
1890
+ 'name' => 'PSAPBorderType',
1891
+ 'type' => 'select',
1892
+ 'options' => $border_types,
1893
+ 'class' => '',
1894
+ 'value' => isset($param_values->PSAPBorderType) ? $param_values->PSAPBorderType : '',
1895
+ 'after' => '',
1896
+ ),
1897
+ array(
1898
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
1899
+ 'name' => 'PSAPBorderWidth',
1900
+ 'type' => 'text',
1901
+ 'class' => '',
1902
+ 'value' => isset($param_values->PSAPBorderWidth) ? $param_values->PSAPBorderWidth : '',
1903
+ 'after' => 'px',
1904
+ ),
1905
+ array(
1906
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
1907
+ 'name' => 'PSAPBorderRadius',
1908
+ 'type' => 'text',
1909
+ 'class' => '',
1910
+ 'value' => isset($param_values->PSAPBorderRadius) ? $param_values->PSAPBorderRadius : '',
1911
+ 'after' => 'px</div>',
1912
+ ),
1913
+ array(
1914
+ 'label' => __('Inactive', WDFMInstance(self::PLUGIN)->prefix),
1915
+ 'type' => 'panel',
1916
+ 'class' => 'col-md-12',
1917
+ 'label_class' => 'fm-mini-title',
1918
+ 'after' => '',
1919
+ ),
1920
+ array(
1921
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
1922
+ 'name' => 'PSDPBGColor',
1923
+ 'type' => 'text',
1924
+ 'class' => 'color',
1925
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1926
+ 'value' => isset($param_values->PSDPBGColor) ? $param_values->PSDPBGColor : '',
1927
+ 'after' => '',
1928
+ ),
1929
+ array(
1930
+ 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
1931
+ 'name' => 'PSDPFontSize',
1932
+ 'type' => 'text',
1933
+ 'class' => '',
1934
+ 'value' => isset($param_values->PSDPFontSize) ? $param_values->PSDPFontSize : '',
1935
+ 'after' => 'px',
1936
+ ),
1937
+ array(
1938
+ 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
1939
+ 'name' => 'PSDPFontWeight',
1940
+ 'type' => 'select',
1941
+ 'options' => $font_weights,
1942
+ 'class' => '',
1943
+ 'value' => isset($param_values->PSDPFontWeight) ? $param_values->PSDPFontWeight : '',
1944
+ 'after' => '',
1945
+ ),
1946
+ array(
1947
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
1948
+ 'name' => 'PSDPColor',
1949
+ 'type' => 'text',
1950
+ 'class' => 'color',
1951
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
1952
+ 'value' => isset($param_values->PSDPColor) ? $param_values->PSDPColor : '',
1953
+ 'after' => '',
1954
+ ),
1955
+ array(
1956
+ 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
1957
+ 'name' => 'PSDPHeight',
1958
+ 'type' => 'text',
1959
+ 'class' => '',
1960
+ 'value' => isset($param_values->PSDPHeight) ? $param_values->PSDPHeight : '',
1961
+ 'after' => 'px',
1962
+ ),
1963
+ array(
1964
+ 'label' => __('Line Height', WDFMInstance(self::PLUGIN)->prefix),
1965
+ 'name' => 'PSDPLineHeight',
1966
+ 'type' => 'text',
1967
+ 'class' => '',
1968
+ 'value' => isset($param_values->PSDPLineHeight) ? $param_values->PSDPLineHeight : '',
1969
+ 'after' => 'px',
1970
+ ),
1971
+ array(
1972
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
1973
+ 'name' => 'PSDPPadding',
1974
+ 'type' => 'text',
1975
+ 'class' => '',
1976
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5px or 3% 5%',
1977
+ 'value' => isset($param_values->PSDPPadding) ? $param_values->PSDPPadding : '',
1978
+ 'after' => '',
1979
+ ),
1980
+ array(
1981
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
1982
+ 'name' => 'PSDPMargin',
1983
+ 'type' => 'text',
1984
+ 'class' => '',
1985
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
1986
+ 'value' => isset($param_values->PSDPMargin) ? $param_values->PSDPMargin : '',
1987
+ 'after' => '',
1988
+ ),
1989
+ array(
1990
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
1991
+ 'name' => 'PSDPBorder',
1992
+ 'type' => 'checkbox',
1993
+ 'options' => $borders,
1994
+ 'class' => '',
1995
+ 'after' => '',
1996
+ ),
1997
+ array(
1998
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
1999
+ 'name' => 'PSDPBorderColor',
2000
+ 'type' => 'text',
2001
+ 'class' => 'color',
2002
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2003
+ 'value' => isset($param_values->PSDPBorderColor) ? $param_values->PSDPBorderColor : '',
2004
+ 'after' => '',
2005
+ ),
2006
+ array(
2007
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2008
+ 'name' => 'PSDPBorderType',
2009
+ 'type' => 'select',
2010
+ 'options' => $border_types,
2011
+ 'class' => '',
2012
+ 'value' => isset($param_values->PSDPBorderType) ? $param_values->PSDPBorderType : '',
2013
+ 'after' => '',
2014
+ ),
2015
+ array(
2016
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2017
+ 'name' => 'PSDPBorderWidth',
2018
+ 'type' => 'text',
2019
+ 'class' => '',
2020
+ 'value' => isset($param_values->PSDPBorderWidth) ? $param_values->PSDPBorderWidth : '',
2021
+ 'after' => 'px',
2022
+ ),
2023
+ array(
2024
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
2025
+ 'name' => 'PSDPBorderRadius',
2026
+ 'type' => 'text',
2027
+ 'class' => '',
2028
+ 'value' => isset($param_values->PSDPBorderRadius) ? $param_values->PSDPBorderRadius : '',
2029
+ 'after' => 'px</div>',
2030
+ ),
2031
+ array(
2032
+ 'label' => __('Steps', WDFMInstance(self::PLUGIN)->prefix),
2033
+ 'type' => 'panel',
2034
+ 'class' => 'col-md-12',
2035
+ 'label_class' => 'fm-mini-title',
2036
+ 'after' => '',
2037
+ ),
2038
+ array(
2039
+ 'label' => __('Alignment', WDFMInstance(self::PLUGIN)->prefix),
2040
+ 'name' => 'PSAPAlign',
2041
+ 'type' => 'select',
2042
+ 'options' => $aligns,
2043
+ 'class' => '',
2044
+ 'value' => isset($param_values->PSAPAlign) ? $param_values->PSAPAlign : '',
2045
+ 'after' => '',
2046
+ ),
2047
+ array(
2048
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
2049
+ 'name' => 'PSAPWidth',
2050
+ 'type' => 'text',
2051
+ 'class' => '',
2052
+ 'value' => isset($param_values->PSAPWidth) ? $param_values->PSAPWidth : '',
2053
+ 'after' => 'px</div>',
2054
+ ),
2055
+ array(
2056
+ 'label' => __('Percentage', WDFMInstance(self::PLUGIN)->prefix),
2057
+ 'type' => 'panel',
2058
+ 'class' => 'col-md-12',
2059
+ 'label_class' => 'fm-mini-title',
2060
+ 'after' => '',
2061
+ ),
2062
+ array(
2063
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
2064
+ 'name' => 'PPAPWidth',
2065
+ 'type' => 'text',
2066
+ 'class' => '',
2067
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 500px or 50%',
2068
+ 'value' => isset($param_values->PPAPWidth) ? $param_values->PPAPWidth : '',
2069
+ 'after' => '</div>',
2070
+ ),
2071
+ ),
2072
+ 'buttons' => array(
2073
+ array(
2074
+ 'label' => __('Global Parameters', WDFMInstance(self::PLUGIN)->prefix),
2075
+ 'type' => 'panel',
2076
+ 'class' => 'col-md-12',
2077
+ 'label_class' => 'fm-mini-title',
2078
+ 'after' => '<br/>',
2079
+ ),
2080
+ array(
2081
+ 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
2082
+ 'name' => 'BPFontSize',
2083
+ 'type' => 'text',
2084
+ 'class' => '',
2085
+ 'value' => isset($param_values->BPFontSize) ? $param_values->BPFontSize : '',
2086
+ 'after' => 'px',
2087
+ ),
2088
+ array(
2089
+ 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
2090
+ 'name' => 'BPFontWeight',
2091
+ 'type' => 'select',
2092
+ 'options' => $font_weights,
2093
+ 'class' => '',
2094
+ 'value' => isset($param_values->BPFontWeight) ? $param_values->BPFontWeight : '',
2095
+ 'after' => '</div>',
2096
+ ),
2097
+ array(
2098
+ 'label' => __('Next Button Parameters', WDFMInstance(self::PLUGIN)->prefix),
2099
+ 'type' => 'panel',
2100
+ 'class' => 'col-md-12',
2101
+ 'label_class' => 'fm-mini-title',
2102
+ 'after' => '<br/>',
2103
+ ),
2104
+ array(
2105
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2106
+ 'name' => 'NBPBGColor',
2107
+ 'type' => 'text',
2108
+ 'class' => 'color',
2109
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2110
+ 'value' => isset($param_values->NBPBGColor) ? $param_values->NBPBGColor : '',
2111
+ 'after' => '',
2112
+ ),
2113
+ array(
2114
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
2115
+ 'name' => 'NBPWidth',
2116
+ 'type' => 'text',
2117
+ 'class' => '',
2118
+ 'value' => isset($param_values->NBPWidth) ? $param_values->NBPWidth : '',
2119
+ 'after' => 'px',
2120
+ ),
2121
+ array(
2122
+ 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
2123
+ 'name' => 'NBPHeight',
2124
+ 'type' => 'text',
2125
+ 'class' => '',
2126
+ 'value' => isset($param_values->NBPHeight) ? $param_values->NBPHeight : '',
2127
+ 'after' => 'px',
2128
+ ),
2129
+ array(
2130
+ 'label' => __('Line Height', WDFMInstance(self::PLUGIN)->prefix),
2131
+ 'name' => 'NBPLineHeight',
2132
+ 'type' => 'text',
2133
+ 'class' => '',
2134
+ 'value' => isset($param_values->NBPLineHeight) ? $param_values->NBPLineHeight : '',
2135
+ 'after' => 'px',
2136
+ ),
2137
+ array(
2138
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2139
+ 'name' => 'NBPColor',
2140
+ 'type' => 'text',
2141
+ 'class' => 'color',
2142
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2143
+ 'value' => isset($param_values->NBPColor) ? $param_values->NBPColor : '',
2144
+ 'after' => '',
2145
+ ),
2146
+ array(
2147
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
2148
+ 'name' => 'NBPPadding',
2149
+ 'type' => 'text',
2150
+ 'class' => '',
2151
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5px or 3% 5%',
2152
+ 'value' => isset($param_values->NBPPadding) ? $param_values->NBPPadding : '',
2153
+ 'after' => '',
2154
+ ),
2155
+ array(
2156
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
2157
+ 'name' => 'NBPMargin',
2158
+ 'type' => 'text',
2159
+ 'class' => '',
2160
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
2161
+ 'value' => isset($param_values->NBPMargin) ? $param_values->NBPMargin : '',
2162
+ 'after' => '',
2163
+ ),
2164
+ array(
2165
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2166
+ 'name' => 'NBPBorder',
2167
+ 'type' => 'checkbox',
2168
+ 'options' => $borders,
2169
+ 'class' => '',
2170
+ 'after' => '',
2171
+ ),
2172
+ array(
2173
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2174
+ 'name' => 'NBPBorderColor',
2175
+ 'type' => 'text',
2176
+ 'class' => 'color',
2177
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2178
+ 'value' => isset($param_values->NBPBorderColor) ? $param_values->NBPBorderColor : '',
2179
+ 'after' => '',
2180
+ ),
2181
+ array(
2182
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2183
+ 'name' => 'NBPBorderType',
2184
+ 'type' => 'select',
2185
+ 'options' => $border_types,
2186
+ 'class' => '',
2187
+ 'value' => isset($param_values->NBPBorderType) ? $param_values->NBPBorderType : '',
2188
+ 'after' => '',
2189
+ ),
2190
+ array(
2191
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2192
+ 'name' => 'NBPBorderWidth',
2193
+ 'type' => 'text',
2194
+ 'class' => '',
2195
+ 'value' => isset($param_values->NBPBorderWidth) ? $param_values->NBPBorderWidth : '',
2196
+ 'after' => 'px',
2197
+ ),
2198
+ array(
2199
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
2200
+ 'name' => 'NBPBorderRadius',
2201
+ 'type' => 'text',
2202
+ 'class' => '',
2203
+ 'value' => isset($param_values->NBPBorderRadius) ? $param_values->NBPBorderRadius : '',
2204
+ 'after' => 'px',
2205
+ ),
2206
+ array(
2207
+ 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
2208
+ 'name' => 'NBPBoxShadow',
2209
+ 'type' => 'text',
2210
+ 'class' => '',
2211
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 5px 2px #888888',
2212
+ 'value' => isset($param_values->NBPBoxShadow) ? $param_values->NBPBoxShadow : '',
2213
+ 'after' => '',
2214
+ ),
2215
+ array(
2216
+ 'label' => __('Hover Parameters', WDFMInstance(self::PLUGIN)->prefix),
2217
+ 'type' => 'label',
2218
+ 'class' => 'fm-mini-title',
2219
+ 'after' => '<br/>',
2220
+ ),
2221
+ array(
2222
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2223
+ 'name' => 'NBHPBGColor',
2224
+ 'type' => 'text',
2225
+ 'class' => 'color',
2226
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2227
+ 'value' => isset($param_values->NBHPBGColor) ? $param_values->NBHPBGColor : '',
2228
+ 'after' => '',
2229
+ ),
2230
+ array(
2231
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2232
+ 'name' => 'NBHPColor',
2233
+ 'type' => 'text',
2234
+ 'class' => 'color',
2235
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2236
+ 'value' => isset($param_values->NBHPColor) ? $param_values->NBHPColor : '',
2237
+ 'after' => '',
2238
+ ),
2239
+ array(
2240
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2241
+ 'name' => 'NBHPBorder',
2242
+ 'type' => 'checkbox',
2243
+ 'options' => $borders,
2244
+ 'class' => '',
2245
+ 'after' => '',
2246
+ ),
2247
+ array(
2248
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2249
+ 'name' => 'NBHPBorderColor',
2250
+ 'type' => 'text',
2251
+ 'class' => 'color',
2252
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2253
+ 'value' => isset($param_values->NBHPBorderColor) ? $param_values->NBHPBorderColor : '',
2254
+ 'after' => '',
2255
+ ),
2256
+ array(
2257
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2258
+ 'name' => 'NBHPBorderType',
2259
+ 'type' => 'select',
2260
+ 'options' => $border_types,
2261
+ 'class' => '',
2262
+ 'value' => isset($param_values->NBHPBorderType) ? $param_values->NBHPBorderType : '',
2263
+ 'after' => '',
2264
+ ),
2265
+ array(
2266
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2267
+ 'name' => 'NBHPBorderWidth',
2268
+ 'type' => 'text',
2269
+ 'class' => '',
2270
+ 'value' => isset($param_values->NBHPBorderWidth) ? $param_values->NBHPBorderWidth : '',
2271
+ 'after' => 'px</div>',
2272
+ ),
2273
+ array(
2274
+ 'label' => __('Previous Button Parameters', WDFMInstance(self::PLUGIN)->prefix),
2275
+ 'type' => 'panel',
2276
+ 'class' => 'col-md-12',
2277
+ 'label_class' => 'fm-mini-title',
2278
+ 'after' => '<br/>',
2279
+ ),
2280
+ array(
2281
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2282
+ 'name' => 'PBPBGColor',
2283
+ 'type' => 'text',
2284
+ 'class' => 'color',
2285
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2286
+ 'value' => isset($param_values->PBPBGColor) ? $param_values->PBPBGColor : '',
2287
+ 'after' => '',
2288
+ ),
2289
+ array(
2290
+ 'label' => __('Width', WDFMInstance(self::PLUGIN)->prefix),
2291
+ 'name' => 'PBPWidth',
2292
+ 'type' => 'text',
2293
+ 'class' => '',
2294
+ 'value' => isset($param_values->PBPWidth) ? $param_values->PBPWidth : '',
2295
+ 'after' => 'px',
2296
+ ),
2297
+ array(
2298
+ 'label' => __('Height', WDFMInstance(self::PLUGIN)->prefix),
2299
+ 'name' => 'PBPHeight',
2300
+ 'type' => 'text',
2301
+ 'class' => '',
2302
+ 'value' => isset($param_values->PBPHeight) ? $param_values->PBPHeight : '',
2303
+ 'after' => 'px',
2304
+ ),
2305
+ array(
2306
+ 'label' => __('Line Height', WDFMInstance(self::PLUGIN)->prefix),
2307
+ 'name' => 'PBPLineHeight',
2308
+ 'type' => 'text',
2309
+ 'class' => '',
2310
+ 'value' => isset($param_values->PBPLineHeight) ? $param_values->PBPLineHeight : '',
2311
+ 'after' => 'px',
2312
+ ),
2313
+ array(
2314
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2315
+ 'name' => 'PBPColor',
2316
+ 'type' => 'text',
2317
+ 'class' => 'color',
2318
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2319
+ 'value' => isset($param_values->PBPColor) ? $param_values->PBPColor : '',
2320
+ 'after' => '',
2321
+ ),
2322
+ array(
2323
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
2324
+ 'name' => 'PBPPadding',
2325
+ 'type' => 'text',
2326
+ 'class' => '',
2327
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5px or 3% 5%',
2328
+ 'value' => isset($param_values->PBPPadding) ? $param_values->PBPPadding : '',
2329
+ 'after' => '',
2330
+ ),
2331
+ array(
2332
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
2333
+ 'name' => 'PBPMargin',
2334
+ 'type' => 'text',
2335
+ 'class' => '',
2336
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
2337
+ 'value' => isset($param_values->PBPMargin) ? $param_values->PBPMargin : '',
2338
+ 'after' => '',
2339
+ ),
2340
+ array(
2341
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2342
+ 'name' => 'PBPBorder',
2343
+ 'type' => 'checkbox',
2344
+ 'options' => $borders,
2345
+ 'class' => '',
2346
+ 'after' => '',
2347
+ ),
2348
+ array(
2349
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2350
+ 'name' => 'PBPBorderColor',
2351
+ 'type' => 'text',
2352
+ 'class' => 'color',
2353
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2354
+ 'value' => isset($param_values->PBPBorderColor) ? $param_values->PBPBorderColor : '',
2355
+ 'after' => '',
2356
+ ),
2357
+ array(
2358
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2359
+ 'name' => 'PBPBorderType',
2360
+ 'type' => 'select',
2361
+ 'options' => $border_types,
2362
+ 'class' => '',
2363
+ 'value' => isset($param_values->PBPBorderType) ? $param_values->PBPBorderType : '',
2364
+ 'after' => '',
2365
+ ),
2366
+ array(
2367
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2368
+ 'name' => 'PBPBorderWidth',
2369
+ 'type' => 'text',
2370
+ 'class' => '',
2371
+ 'value' => isset($param_values->PBPBorderWidth) ? $param_values->PBPBorderWidth : '',
2372
+ 'after' => 'px',
2373
+ ),
2374
+ array(
2375
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
2376
+ 'name' => 'PBPBorderRadius',
2377
+ 'type' => 'text',
2378
+ 'class' => '',
2379
+ 'value' => isset($param_values->PBPBorderRadius) ? $param_values->PBPBorderRadius : '',
2380
+ 'after' => 'px',
2381
+ ),
2382
+ array(
2383
+ 'label' => __('Box Shadow', WDFMInstance(self::PLUGIN)->prefix),
2384
+ 'name' => 'PBPBoxShadow',
2385
+ 'type' => 'text',
2386
+ 'class' => '',
2387
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 5px 2px #888888',
2388
+ 'value' => isset($param_values->PBPBoxShadow) ? $param_values->PBPBoxShadow : '',
2389
+ 'after' => '',
2390
+ ),
2391
+ array(
2392
+ 'label' => __('Hover Parameters', WDFMInstance(self::PLUGIN)->prefix),
2393
+ 'type' => 'label',
2394
+ 'class' => 'fm-mini-title',
2395
+ 'after' => '<br/>',
2396
+ ),
2397
+ array(
2398
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2399
+ 'name' => 'PBHPBGColor',
2400
+ 'type' => 'text',
2401
+ 'class' => 'color',
2402
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2403
+ 'value' => isset($param_values->PBHPBGColor) ? $param_values->PBHPBGColor : '',
2404
+ 'after' => '',
2405
+ ),
2406
+ array(
2407
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2408
+ 'name' => 'PBHPColor',
2409
+ 'type' => 'text',
2410
+ 'class' => 'color',
2411
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2412
+ 'value' => isset($param_values->PBHPColor) ? $param_values->PBHPColor : '',
2413
+ 'after' => '',
2414
+ ),
2415
+ array(
2416
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2417
+ 'name' => 'PBHPBorder',
2418
+ 'type' => 'checkbox',
2419
+ 'options' => $borders,
2420
+ 'class' => '',
2421
+ 'after' => '',
2422
+ ),
2423
+ array(
2424
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2425
+ 'name' => 'PBHPBorderColor',
2426
+ 'type' => 'text',
2427
+ 'class' => 'color',
2428
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2429
+ 'value' => isset($param_values->PBHPBorderColor) ? $param_values->PBHPBorderColor : '',
2430
+ 'after' => '',
2431
+ ),
2432
+ array(
2433
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2434
+ 'name' => 'PBHPBorderType',
2435
+ 'type' => 'select',
2436
+ 'options' => $border_types,
2437
+ 'class' => '',
2438
+ 'value' => isset($param_values->PBHPBorderType) ? $param_values->PBHPBorderType : '',
2439
+ 'after' => '',
2440
+ ),
2441
+ array(
2442
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2443
+ 'name' => 'PBHPBorderWidth',
2444
+ 'type' => 'text',
2445
+ 'class' => '',
2446
+ 'value' => isset($param_values->PBHPBorderWidth) ? $param_values->PBHPBorderWidth : '',
2447
+ 'after' => 'px</div>',
2448
+ ),
2449
+ ),
2450
+ 'close_button' => array(
2451
+ array(
2452
+ 'label' => '',
2453
+ 'type' => 'panel',
2454
+ 'class' => 'col-md-12',
2455
+ 'label_class' => '',
2456
+ 'after' => '',
2457
+ ),
2458
+ array(
2459
+ 'label' => __('Position', WDFMInstance(self::PLUGIN)->prefix),
2460
+ 'name' => 'CBPPosition',
2461
+ 'type' => 'select',
2462
+ 'options' => $position_types,
2463
+ 'class' => '',
2464
+ 'value' => isset($param_values->CBPPosition) ? $param_values->CBPPosition : '',
2465
+ 'after' => '',
2466
+ ),
2467
+ array(
2468
+ 'label' => __('Top', WDFMInstance(self::PLUGIN)->prefix),
2469
+ 'name' => 'CBPTop',
2470
+ 'type' => 'text',
2471
+ 'class' => '',
2472
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 100px or 10%',
2473
+ 'value' => isset($param_values->CBPTop) ? $param_values->CBPTop : '',
2474
+ 'after' => '',
2475
+ ),
2476
+ array(
2477
+ 'label' => __('Right', WDFMInstance(self::PLUGIN)->prefix),
2478
+ 'name' => 'CBPRight',
2479
+ 'type' => 'text',
2480
+ 'class' => '',
2481
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 100px or 10%',
2482
+ 'value' => isset($param_values->CBPRight) ? $param_values->CBPRight : '',
2483
+ 'after' => '',
2484
+ ),
2485
+ array(
2486
+ 'label' => __('Bottom', WDFMInstance(self::PLUGIN)->prefix),
2487
+ 'name' => 'CBPBottom',
2488
+ 'type' => 'text',
2489
+ 'class' => '',
2490
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 100px or 10%',
2491
+ 'value' => isset($param_values->CBPBottom) ? $param_values->CBPBottom : '',
2492
+ 'after' => '',
2493
+ ),
2494
+ array(
2495
+ 'label' => __('Left', WDFMInstance(self::PLUGIN)->prefix),
2496
+ 'name' => 'CBPLeft',
2497
+ 'type' => 'text',
2498
+ 'class' => '',
2499
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 100px or 10%',
2500
+ 'value' => isset($param_values->CBPLeft) ? $param_values->CBPLeft : '',
2501
+ 'after' => '',
2502
+ ),
2503
+ array(
2504
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2505
+ 'name' => 'CBPBGColor',
2506
+ 'type' => 'text',
2507
+ 'class' => 'color',
2508
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2509
+ 'value' => isset($param_values->CBPBGColor) ? $param_values->CBPBGColor : '',
2510
+ 'after' => '',
2511
+ ),
2512
+ array(
2513
+ 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
2514
+ 'name' => 'CBPFontSize',
2515
+ 'type' => 'text',
2516
+ 'class' => '13',
2517
+ 'value' => isset($param_values->CBPFontSize) ? $param_values->CBPFontSize : '',
2518
+ 'after' => 'px',
2519
+ ),
2520
+ array(
2521
+ 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
2522
+ 'name' => 'CBPFontWeight',
2523
+ 'type' => 'select',
2524
+ 'options' => $font_weights,
2525
+ 'class' => '',
2526
+ 'value' => isset($param_values->CBPFontWeight) ? $param_values->CBPFontWeight : '',
2527
+ 'after' => '',
2528
+ ),
2529
+ array(
2530
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2531
+ 'name' => 'CBPColor',
2532
+ 'type' => 'text',
2533
+ 'class' => 'color',
2534
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2535
+ 'value' => isset($param_values->CBPColor) ? $param_values->CBPColor : '',
2536
+ 'after' => '',
2537
+ ),
2538
+ array(
2539
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
2540
+ 'name' => 'CBPPadding',
2541
+ 'type' => 'text',
2542
+ 'class' => '',
2543
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5px or 3% 5%',
2544
+ 'value' => isset($param_values->CBPPadding) ? $param_values->CBPPadding : '',
2545
+ 'after' => '',
2546
+ ),
2547
+ array(
2548
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
2549
+ 'name' => 'CBPMargin',
2550
+ 'type' => 'text',
2551
+ 'class' => '',
2552
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
2553
+ 'value' => isset($param_values->CBPMargin) ? $param_values->CBPMargin : '',
2554
+ 'after' => '',
2555
+ ),
2556
+ array(
2557
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2558
+ 'name' => 'CBPBorder',
2559
+ 'type' => 'checkbox',
2560
+ 'options' => $borders,
2561
+ 'class' => '',
2562
+ 'after' => '',
2563
+ ),
2564
+ array(
2565
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2566
+ 'name' => 'CBPBorderColor',
2567
+ 'type' => 'text',
2568
+ 'class' => 'color',
2569
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2570
+ 'value' => isset($param_values->CBPBorderColor) ? $param_values->CBPBorderColor : '',
2571
+ 'after' => '',
2572
+ ),
2573
+ array(
2574
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2575
+ 'name' => 'CBPBorderType',
2576
+ 'type' => 'select',
2577
+ 'options' => $border_types,
2578
+ 'class' => '',
2579
+ 'value' => isset($param_values->CBPBorderType) ? $param_values->CBPBorderType : '',
2580
+ 'after' => '',
2581
+ ),
2582
+ array(
2583
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2584
+ 'name' => 'CBPBorderWidth',
2585
+ 'type' => 'text',
2586
+ 'class' => '',
2587
+ 'value' => isset($param_values->CBPBorderWidth) ? $param_values->CBPBorderWidth : '',
2588
+ 'after' => 'px',
2589
+ ),
2590
+ array(
2591
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
2592
+ 'name' => 'CBPBorderRadius',
2593
+ 'type' => 'text',
2594
+ 'class' => '',
2595
+ 'value' => isset($param_values->CBPBorderRadius) ? $param_values->CBPBorderRadius : '',
2596
+ 'after' => 'px',
2597
+ ),
2598
+ array(
2599
+ 'label' => __('Hover Parameters', WDFMInstance(self::PLUGIN)->prefix),
2600
+ 'type' => 'label',
2601
+ 'class' => 'fm-mini-title',
2602
+ 'after' => '<br/>',
2603
+ ),
2604
+ array(
2605
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2606
+ 'name' => 'CBHPBGColor',
2607
+ 'type' => 'text',
2608
+ 'class' => 'color',
2609
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2610
+ 'value' => isset($param_values->CBHPBGColor) ? $param_values->CBHPBGColor : '',
2611
+ 'after' => '',
2612
+ ),
2613
+ array(
2614
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2615
+ 'name' => 'CBHPColor',
2616
+ 'type' => 'text',
2617
+ 'class' => 'color',
2618
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2619
+ 'value' => isset($param_values->CBHPColor) ? $param_values->CBHPColor : '',
2620
+ 'after' => '',
2621
+ ),
2622
+ array(
2623
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2624
+ 'name' => 'CBHPBorder',
2625
+ 'type' => 'checkbox',
2626
+ 'options' => $borders,
2627
+ 'class' => '',
2628
+ 'after' => '',
2629
+ ),
2630
+ array(
2631
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2632
+ 'name' => 'CBHPBorderColor',
2633
+ 'type' => 'text',
2634
+ 'class' => 'color',
2635
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2636
+ 'value' => isset($param_values->CBHPBorderColor) ? $param_values->CBHPBorderColor : '',
2637
+ 'after' => '',
2638
+ ),
2639
+ array(
2640
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2641
+ 'name' => 'CBHPBorderType',
2642
+ 'type' => 'select',
2643
+ 'options' => $border_types,
2644
+ 'class' => '',
2645
+ 'value' => isset($param_values->CBHPBorderType) ? $param_values->CBHPBorderType : '',
2646
+ 'after' => '',
2647
+ ),
2648
+ array(
2649
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2650
+ 'name' => 'CBHPBorderWidth',
2651
+ 'type' => 'text',
2652
+ 'class' => '',
2653
+ 'value' => isset($param_values->CBHPBorderWidth) ? $param_values->CBHPBorderWidth : '',
2654
+ 'after' => 'px</div>',
2655
+ ),
2656
+ ),
2657
+ 'minimize' => array(
2658
+ array(
2659
+ 'label' => '',
2660
+ 'type' => 'panel',
2661
+ 'class' => 'col-md-12',
2662
+ 'label_class' => '',
2663
+ 'after' => '',
2664
+ ),
2665
+ array(
2666
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2667
+ 'name' => 'MBPBGColor',
2668
+ 'type' => 'text',
2669
+ 'class' => 'color',
2670
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2671
+ 'value' => isset($param_values->MBPBGColor) ? $param_values->MBPBGColor : '',
2672
+ 'after' => '',
2673
+ ),
2674
+ array(
2675
+ 'label' => __('Font Size', WDFMInstance(self::PLUGIN)->prefix),
2676
+ 'name' => 'MBPFontSize',
2677
+ 'type' => 'text',
2678
+ 'class' => '13',
2679
+ 'value' => isset($param_values->MBPFontSize) ? $param_values->MBPFontSize : '',
2680
+ 'after' => 'px',
2681
+ ),
2682
+ array(
2683
+ 'label' => __('Font Weight', WDFMInstance(self::PLUGIN)->prefix),
2684
+ 'name' => 'MBPFontWeight',
2685
+ 'type' => 'select',
2686
+ 'options' => $font_weights,
2687
+ 'class' => '',
2688
+ 'value' => isset($param_values->MBPFontWeight) ? $param_values->MBPFontWeight : '',
2689
+ 'after' => '',
2690
+ ),
2691
+ array(
2692
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2693
+ 'name' => 'MBPColor',
2694
+ 'type' => 'text',
2695
+ 'class' => 'color',
2696
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2697
+ 'value' => isset($param_values->MBPColor) ? $param_values->MBPColor : '',
2698
+ 'after' => '',
2699
+ ),
2700
+ array(
2701
+ 'label' => __('Text Align', WDFMInstance(self::PLUGIN)->prefix),
2702
+ 'name' => 'MBPTextAlign',
2703
+ 'type' => 'select',
2704
+ 'options' => $aligns,
2705
+ 'class' => '',
2706
+ 'value' => isset($param_values->MBPTextAlign) ? $param_values->MBPTextAlign : '',
2707
+ 'after' => '',
2708
+ ),
2709
+ array(
2710
+ 'label' => __('Padding', WDFMInstance(self::PLUGIN)->prefix),
2711
+ 'name' => 'MBPPadding',
2712
+ 'type' => 'text',
2713
+ 'class' => '',
2714
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 3px 5px or 3% 5%',
2715
+ 'value' => isset($param_values->MBPPadding) ? $param_values->MBPPadding : '',
2716
+ 'after' => 'px|%',
2717
+ ),
2718
+ array(
2719
+ 'label' => __('Margin', WDFMInstance(self::PLUGIN)->prefix),
2720
+ 'name' => 'MBPMargin',
2721
+ 'type' => 'text',
2722
+ 'class' => '',
2723
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' 5px 10px or 5% 10%',
2724
+ 'value' => isset($param_values->MBPMargin) ? $param_values->MBPMargin : '',
2725
+ 'after' => 'px|%',
2726
+ ),
2727
+ array(
2728
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2729
+ 'name' => 'MBPBorder',
2730
+ 'type' => 'checkbox',
2731
+ 'options' => $borders,
2732
+ 'class' => '',
2733
+ 'after' => '',
2734
+ ),
2735
+ array(
2736
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2737
+ 'name' => 'MBPBorderColor',
2738
+ 'type' => 'text',
2739
+ 'class' => 'color',
2740
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2741
+ 'value' => isset($param_values->MBPBorderColor) ? $param_values->MBPBorderColor : '',
2742
+ 'after' => '',
2743
+ ),
2744
+ array(
2745
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2746
+ 'name' => 'MBPBorderType',
2747
+ 'type' => 'select',
2748
+ 'options' => $border_types,
2749
+ 'class' => '',
2750
+ 'value' => isset($param_values->MBPBorderType) ? $param_values->MBPBorderType : '',
2751
+ 'after' => '',
2752
+ ),
2753
+ array(
2754
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2755
+ 'name' => 'MBPBorderWidth',
2756
+ 'type' => 'text',
2757
+ 'class' => '',
2758
+ 'value' => isset($param_values->MBPBorderWidth) ? $param_values->MBPBorderWidth : '',
2759
+ 'after' => 'px',
2760
+ ),
2761
+ array(
2762
+ 'label' => __('Border Radius', WDFMInstance(self::PLUGIN)->prefix),
2763
+ 'name' => 'MBPBorderRadius',
2764
+ 'type' => 'text',
2765
+ 'class' => '',
2766
+ 'value' => isset($param_values->MBPBorderRadius) ? $param_values->MBPBorderRadius : '',
2767
+ 'after' => 'px',
2768
+ ),
2769
+ array(
2770
+ 'label' => __('Hover Parameters', WDFMInstance(self::PLUGIN)->prefix),
2771
+ 'type' => 'label',
2772
+ 'class' => 'fm-mini-title',
2773
+ 'after' => '<br/>',
2774
+ ),
2775
+ array(
2776
+ 'label' => __('Background Color', WDFMInstance(self::PLUGIN)->prefix),
2777
+ 'name' => 'MBHPBGColor',
2778
+ 'type' => 'text',
2779
+ 'class' => 'color',
2780
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2781
+ 'value' => isset($param_values->MBHPBGColor) ? $param_values->MBHPBGColor : '',
2782
+ 'after' => '',
2783
+ ),
2784
+ array(
2785
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2786
+ 'name' => 'MBHPColor',
2787
+ 'type' => 'text',
2788
+ 'class' => 'color',
2789
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2790
+ 'value' => isset($param_values->MBHPColor) ? $param_values->MBHPColor : '',
2791
+ 'after' => '',
2792
+ ),
2793
+ array(
2794
+ 'label' => __('Border', WDFMInstance(self::PLUGIN)->prefix),
2795
+ 'name' => 'MBHPBorder',
2796
+ 'type' => 'checkbox',
2797
+ 'options' => $borders,
2798
+ 'class' => '',
2799
+ 'after' => '',
2800
+ ),
2801
+ array(
2802
+ 'label' => __('Border Color', WDFMInstance(self::PLUGIN)->prefix),
2803
+ 'name' => 'MBHPBorderColor',
2804
+ 'type' => 'text',
2805
+ 'class' => 'color',
2806
+ 'value' => isset($param_values->MBHPBorderColor) ? $param_values->MBHPBorderColor : '',
2807
+ 'after' => '',
2808
+ ),
2809
+ array(
2810
+ 'label' => __('Border Type', WDFMInstance(self::PLUGIN)->prefix),
2811
+ 'name' => 'MBHPBorderType',
2812
+ 'type' => 'select',
2813
+ 'options' => $border_types,
2814
+ 'class' => '',
2815
+ 'value' => isset($param_values->MBHPBorderType) ? $param_values->MBHPBorderType : '',
2816
+ 'after' => '',
2817
+ ),
2818
+ array(
2819
+ 'label' => __('Border Width', WDFMInstance(self::PLUGIN)->prefix),
2820
+ 'name' => 'MBHPBorderWidth',
2821
+ 'type' => 'text',
2822
+ 'class' => '',
2823
+ 'value' => isset($param_values->MBHPBorderWidth) ? $param_values->MBHPBorderWidth : '',
2824
+ 'after' => 'px</div>',
2825
+ ),
2826
+ ),
2827
+ 'other' => array(
2828
+ array(
2829
+ 'label' => __('Inactive Text', WDFMInstance(self::PLUGIN)->prefix),
2830
+ 'type' => 'panel',
2831
+ 'class' => 'col-md-12',
2832
+ 'label_class' => 'fm-mini-title',
2833
+ 'after' => '<br/>',
2834
+ ),
2835
+ array(
2836
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2837
+ 'name' => 'OPDeInputColor',
2838
+ 'type' => 'text',
2839
+ 'class' => 'color',
2840
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' #efefef',
2841
+ 'value' => isset($param_values->OPDeInputColor) ? $param_values->OPDeInputColor : '',
2842
+ 'after' => '',
2843
+ ),
2844
+ array(
2845
+ 'label' => __('Font Style', WDFMInstance(self::PLUGIN)->prefix),
2846
+ 'name' => 'OPFontStyle',
2847
+ 'type' => 'text',
2848
+ 'class' => '',
2849
+ 'value' => isset($param_values->OPFontStyle) ? $param_values->OPFontStyle : '',
2850
+ 'after' => '',
2851
+ ),
2852
+ array(
2853
+ 'label' => __('Required', WDFMInstance(self::PLUGIN)->prefix),
2854
+ 'type' => 'label',
2855
+ 'class' => 'fm-mini-title',
2856
+ 'after' => '<br/>',
2857
+ ),
2858
+ array(
2859
+ 'label' => __('Color', WDFMInstance(self::PLUGIN)->prefix),
2860
+ 'name' => 'OPRColor',
2861
+ 'type' => 'text',
2862
+ 'class' => 'color',
2863
+ 'value' => isset($param_values->OPRColor) ? $param_values->OPRColor : '',
2864
+ 'after' => '',
2865
+ ),
2866
+ array(
2867
+ 'label' => __('File Upload', WDFMInstance(self::PLUGIN)->prefix),
2868
+ 'type' => 'label',
2869
+ 'class' => 'fm-mini-title',
2870
+ 'after' => '<br/>',
2871
+ ),
2872
+ array(
2873
+ 'label' => __('Background URL', WDFMInstance(self::PLUGIN)->prefix),
2874
+ 'name' => 'OPFBgUrl',
2875
+ 'type' => 'text',
2876
+ 'class' => '',
2877
+ // 'placeholder' => __('e.g. http:// or https://', WDFMInstance(self::PLUGIN)->prefix),
2878
+ 'value' => isset($param_values->OPFBgUrl) ? $param_values->OPFBgUrl : '',
2879
+ 'after' => '',
2880
+ ),
2881
+ array(
2882
+ 'label' => __('Background Repeat', WDFMInstance(self::PLUGIN)->prefix),
2883
+ 'name' => 'OPFBGRepeat',
2884
+ 'type' => 'select',
2885
+ 'options' => $bg_repeats,
2886
+ 'class' => '',
2887
+ 'value' => isset($param_values->OPFBGRepeat) ? $param_values->OPFBGRepeat : '',
2888
+ 'after' => '',
2889
+ ),
2890
+ array(
2891
+ 'label' => __('Background Position', WDFMInstance(self::PLUGIN)->prefix),
2892
+ 'name1' => 'OPFPos1',
2893
+ 'name2' => 'OPFPos2',
2894
+ 'type' => '2text',
2895
+ 'class' => 'fm-2text',
2896
+ 'placeholder' => __('e.g.', WDFMInstance(self::PLUGIN)->prefix) . ' px|%, top|bottom|left|right|center',
2897
+ 'value1' => isset($param_values->OPFPos1) ? $param_values->OPFPos1 : '',
2898
+ 'value2' => isset($param_values->OPFPos2) ? $param_values->OPFPos2 : '',
2899
+ 'before1' => '',
2900
+ 'before2' => '',
2901
+ 'after' => '',
2902
+ ),
2903
+ array(
2904
+ 'label' => __('Grading', WDFMInstance(self::PLUGIN)->prefix),
2905
+ 'type' => 'label',
2906
+ 'class' => 'fm-mini-title',
2907
+ 'after' => '<br/>',
2908
+ ),
2909
+ array(
2910
+ 'label' => __('Text Width', WDFMInstance(self::PLUGIN)->prefix),
2911
+ 'name' => 'OPGWidth',
2912
+ 'type' => 'text',
2913
+ 'class' => '',
2914
+ 'value' => isset($param_values->OPGWidth) ? $param_values->OPGWidth : '',
2915
+ 'after' => 'px</div>',
2916
+ ),
2917
+ ),
2918
+ 'custom_css' => array(
2919
+ array(
2920
+ 'label' => '',
2921
+ 'type' => 'panel',
2922
+ 'class' => 'col-md-12',
2923
+ 'label_class' => '',
2924
+ 'after' => '',
2925
+ ),
2926
+ array(
2927
+ 'label' => __('Custom CSS', WDFMInstance(self::PLUGIN)->prefix),
2928
+ 'name' => 'CUPCSS',
2929
+ 'type' => 'textarea',
2930
+ 'class' => '',
2931
+ 'value' => isset($param_values->CUPCSS) ? $param_values->CUPCSS : '',
2932
+ 'after' => '</div>',
2933
+ ),
2934
+ ),
2935
+ );
2936
+
2937
+ return $all_params;
2938
+ }
2939
+
2940
+ /**
2941
+ * Save theme.
2942
+ */
2943
+ public function apply() {
2944
+ $data = $this->save_db();
2945
+ $page = WDW_FM_Library(self::PLUGIN)->get('page');
2946
+ $active_tab = WDW_FM_Library(self::PLUGIN)->get('active_tab');
2947
+ $pagination = WDW_FM_Library(self::PLUGIN)->get('pagination-type');
2948
+ $form_type = WDW_FM_Library(self::PLUGIN)->get('form_type');
2949
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
2950
+ 'page' => $page,
2951
+ 'task' => 'edit',
2952
+ 'current_id' => $data['id'],
2953
+ 'message' => $data['msg'],
2954
+ 'active_tab' => $active_tab,
2955
+ 'pagination' => $pagination,
2956
+ 'form_type' => $form_type,
2957
+ ), admin_url('admin.php')));
2958
+ }
2959
+
2960
+ /**
2961
+ * Save theme to DB.
2962
+ *
2963
+ * @return array
2964
+ */
2965
+ public function save_db() {
2966
+ global $wpdb;
2967
+ $id = (int) WDW_FM_Library(self::PLUGIN)->get('current_id', 0);
2968
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
2969
+ $version = 2;
2970
+ $params = (isset($_POST['params']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['params'])) : '');
2971
+ $default = (isset($_POST['default']) ? esc_html(stripslashes($_POST['default'])) : 0);
2972
+ if ( $id != 0 ) {
2973
+ $save = $this->model->update_formmaker_themes(array(
2974
+ 'title' => $title,
2975
+ 'css' => $params,
2976
+ 'default' => $default,
2977
+ ), array( 'id' => $id ));
2978
+ $version = $this->model->get_theme_version($id);
2979
+ }
2980
+ else {
2981
+ $save = $this->model->insert_theme(array(
2982
+ 'title' => $title,
2983
+ 'css' => $params,
2984
+ 'default' => $default,
2985
+ 'version' => $version,
2986
+ ));
2987
+ $id = $wpdb->insert_id;
2988
+ }
2989
+ if ( $save !== FALSE ) {
2990
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/frontend/models/form_maker.php";
2991
+ $model_frontend = new FMModelForm_maker_fmc();
2992
+ $form_theme = json_decode(html_entity_decode($params), TRUE);
2993
+ $model_frontend->create_css($id, $form_theme, $version == 1, TRUE);
2994
+
2995
+ $msg = 1;
2996
+ }
2997
+ else {
2998
+ $msg = 2;
2999
+ }
3000
+ return array('id' => $id, 'msg' => $msg);
3001
+ }
3002
+
3003
+ /**
3004
+ * Set default.
3005
+ *
3006
+ * @param $id
3007
+ */
3008
+ public function setdefault( $id ) {
3009
+ $this->model->update_formmaker_themes( array( 'default' => 0 ), array( 'default' => 1 ) );
3010
+ $save = $this->model->update_formmaker_themes( array( 'default' => 1 ), array( 'id' => $id ) );
3011
+ if ( $save !== FALSE ) {
3012
+ $message = 7;
3013
+ }
3014
+ else {
3015
+ $message = 2;
3016
+ }
3017
+ $page = WDW_FM_Library(self::PLUGIN)->get('page');
3018
+ WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
3019
+ 'page' => $page,
3020
+ 'task' => 'display',
3021
+ 'message' => $message,
3022
+ ), admin_url('admin.php')));
3023
+ }
3024
+ }
admin/controllers/Uninstall_fm.php CHANGED
@@ -1,102 +1,102 @@
1
- <?php
2
-
3
- class FMControllerUninstall_fmc extends CFMAdminController {
4
- private $model;
5
- private $view;
6
- private $addons = array(
7
- 'WD_FM_MAILCHIMP' => 'mailchimp',
8
- 'WD_FM_REG' => 'reg',
9
- 'WD_FM_POST_GEN' => 'post_gen_options',
10
- 'WD_FM_EMAIL_COND' => 'email_conditions',
11
- 'WD_FM_DBOX_INT' => 'dbox_int',
12
- 'WD_FM_GDRIVE_INT' => 'formmaker_gdrive_int',
13
- 'WD_FM_PDF' => array( 'pdf_options', 'pdf' ),
14
- 'WD_FM_PUSHOVER' => 'pushover',
15
- 'WD_FM_SAVE_PROG' => array( 'save_options', 'saved_entries', 'saved_attributes' ),
16
- 'WD_FM_STRIPE' => 'stripe',
17
- 'WD_FM_CALCULATOR' => 'calculator',
18
- );
19
-
20
- public function __construct() {
21
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Uninstall_fm.php";
22
- $this->model = new FMModelUninstall_fmc();
23
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Uninstall_fm.php";
24
- $this->view = new FMViewUninstall_fmc();
25
- if ( WDFMInstance(self::PLUGIN)->is_free ) {
26
- global $fm_options;
27
- global $cfm_options;
28
- if ( !class_exists("DoradoWebConfig") ) {
29
- include_once(WDFMInstance(self::PLUGIN)->plugin_dir . "/wd/config.php");
30
- }
31
- $config = new DoradoWebConfig();
32
- $config->set_options(WDFMInstance(self::PLUGIN)->is_free == 1 ? $fm_options : $cfm_options);
33
- $deactivate_reasons = new DoradoWebDeactivate($config);
34
- $deactivate_reasons->submit_and_deactivate();
35
- }
36
- }
37
-
38
- public function execute() {
39
- $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
40
- if ( method_exists($this, $task) ) {
41
- check_admin_referer(WDFMInstance(self::PLUGIN)->nonce, WDFMInstance(self::PLUGIN)->nonce);
42
- $this->$task();
43
- }
44
- else {
45
- $this->display();
46
- }
47
- }
48
-
49
- public function display() {
50
- $params = array();
51
- $params['addons'] = $this->addons;
52
- $params['page_title'] = sprintf(__('Uninstall %s', WDFMInstance(self::PLUGIN)->prefix), WDFMInstance(self::PLUGIN)->nicename);
53
- $params['tables'] = $this->get_tables();
54
- global $wpdb;
55
- foreach ( $params['addons'] as $addon => $addon_name ) {
56
- if ( is_array($addon_name) ) {
57
- // If there are more than one db tables in an extension.
58
- foreach ( $addon_name as $ad_name ) {
59
- array_push($params['tables'], $wpdb->prefix . 'formmaker_' . $ad_name);
60
- }
61
- }
62
- else {
63
- array_push($params['tables'], $wpdb->prefix . 'formmaker_' . $addon_name);
64
- }
65
- }
66
- $this->view->display($params);
67
- }
68
-
69
- /**
70
- * Return DB tables names.
71
- *
72
- * @return array
73
- */
74
- private function get_tables() {
75
- global $wpdb;
76
- $tables = array(
77
- $wpdb->prefix . 'formmaker',
78
- $wpdb->prefix . 'formmaker_backup',
79
- $wpdb->prefix . 'formmaker_blocked',
80
- $wpdb->prefix . 'formmaker_groups',
81
- $wpdb->prefix . 'formmaker_submits',
82
- $wpdb->prefix . 'formmaker_views',
83
- $wpdb->prefix . 'formmaker_themes',
84
- $wpdb->prefix . 'formmaker_sessions',
85
- $wpdb->prefix . 'formmaker_query',
86
- $wpdb->prefix . 'formmaker_display_options',
87
- );
88
-
89
- return $tables;
90
- }
91
-
92
- public function uninstall() {
93
- $params['tables'] = $this->get_tables();
94
- $this->model->delete_db_tables();
95
-
96
- // Deactivate all extensions and form maker.
97
- WDW_FM_Library(self::PLUGIN)->deactivate_all_addons(WDFMInstance(self::PLUGIN)->main_file);
98
-
99
- wp_redirect(admin_url('plugins.php'));
100
- exit();
101
- }
102
- }
1
+ <?php
2
+
3
+ class FMControllerUninstall_fmc extends CFMAdminController {
4
+ private $model;
5
+ private $view;
6
+ private $addons = array(
7
+ 'WD_FM_MAILCHIMP' => 'mailchimp',
8
+ 'WD_FM_REG' => 'reg',
9
+ 'WD_FM_POST_GEN' => 'post_gen_options',
10
+ 'WD_FM_EMAIL_COND' => 'email_conditions',
11
+ 'WD_FM_DBOX_INT' => 'dbox_int',
12
+ 'WD_FM_GDRIVE_INT' => 'formmaker_gdrive_int',
13
+ 'WD_FM_PDF' => array( 'pdf_options', 'pdf' ),
14
+ 'WD_FM_PUSHOVER' => 'pushover',
15
+ 'WD_FM_SAVE_PROG' => array( 'save_options', 'saved_entries', 'saved_attributes' ),
16
+ 'WD_FM_STRIPE' => 'stripe',
17
+ 'WD_FM_CALCULATOR' => 'calculator',
18
+ );
19
+
20
+ public function __construct() {
21
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Uninstall_fm.php";
22
+ $this->model = new FMModelUninstall_fmc();
23
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Uninstall_fm.php";
24
+ $this->view = new FMViewUninstall_fmc();
25
+ if ( WDFMInstance(self::PLUGIN)->is_free ) {
26
+ global $fm_options;
27
+ global $cfm_options;
28
+ if ( !class_exists("DoradoWebConfig") ) {
29
+ include_once(WDFMInstance(self::PLUGIN)->plugin_dir . "/wd/config.php");
30
+ }
31
+ $config = new DoradoWebConfig();
32
+ $config->set_options(WDFMInstance(self::PLUGIN)->is_free == 1 ? $fm_options : $cfm_options);
33
+ $deactivate_reasons = new DoradoWebDeactivate($config);
34
+ $deactivate_reasons->submit_and_deactivate();
35
+ }
36
+ }
37
+
38
+ public function execute() {
39
+ $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
40
+ if ( method_exists($this, $task) ) {
41
+ check_admin_referer(WDFMInstance(self::PLUGIN)->nonce, WDFMInstance(self::PLUGIN)->nonce);
42
+ $this->$task();
43
+ }
44
+ else {
45
+ $this->display();
46
+ }
47
+ }
48
+
49
+ public function display() {
50
+ $params = array();
51
+ $params['addons'] = $this->addons;
52
+ $params['page_title'] = sprintf(__('Uninstall %s', WDFMInstance(self::PLUGIN)->prefix), WDFMInstance(self::PLUGIN)->nicename);
53
+ $params['tables'] = $this->get_tables();
54
+ global $wpdb;
55
+ foreach ( $params['addons'] as $addon => $addon_name ) {
56
+ if ( is_array($addon_name) ) {
57
+ // If there are more than one db tables in an extension.
58
+ foreach ( $addon_name as $ad_name ) {
59
+ array_push($params['tables'], $wpdb->prefix . 'formmaker_' . $ad_name);
60
+ }
61
+ }
62
+ else {
63
+ array_push($params['tables'], $wpdb->prefix . 'formmaker_' . $addon_name);
64
+ }
65
+ }
66
+ $this->view->display($params);
67
+ }
68
+
69
+ /**
70
+ * Return DB tables names.
71
+ *
72
+ * @return array
73
+ */
74
+ private function get_tables() {
75
+ global $wpdb;
76
+ $tables = array(
77
+ $wpdb->prefix . 'formmaker',
78
+ $wpdb->prefix . 'formmaker_backup',
79
+ $wpdb->prefix . 'formmaker_blocked',
80
+ $wpdb->prefix . 'formmaker_groups',
81
+ $wpdb->prefix . 'formmaker_submits',
82
+ $wpdb->prefix . 'formmaker_views',
83
+ $wpdb->prefix . 'formmaker_themes',
84
+ $wpdb->prefix . 'formmaker_sessions',
85
+ $wpdb->prefix . 'formmaker_query',
86
+ $wpdb->prefix . 'formmaker_display_options',
87
+ );
88
+
89
+ return $tables;
90
+ }
91
+
92
+ public function uninstall() {
93
+ $params['tables'] = $this->get_tables();
94
+ $this->model->delete_db_tables();
95
+
96
+ // Deactivate all extensions and form maker.
97
+ WDW_FM_Library(self::PLUGIN)->deactivate_all_addons(WDFMInstance(self::PLUGIN)->main_file);
98
+
99
+ wp_redirect(admin_url('plugins.php'));
100
+ exit();
101
+ }
102
+ }
admin/controllers/Widget.php CHANGED
@@ -1,91 +1,91 @@
1
- <?php
2
-
3
- /**
4
- * Class FMControllerWidget_fmc
5
- */
6
- class FMControllerWidget_fmc extends WP_Widget {
7
- /**
8
- * PLUGIN = 2 points to Contact Form Maker
9
- */
10
- const PLUGIN = 2;
11
-
12
- private $view;
13
- private $model;
14
-
15
- public function __construct() {
16
- $widget_ops = array(
17
- 'classname' => 'form_maker_widget',
18
- 'description' => sprintf(__('Add %s widget.', WDFMInstance(self::PLUGIN)->prefix), WDFMInstance(self::PLUGIN)->nicename),
19
- );
20
- // Widget Control Settings.
21
- $control_ops = array( 'id_base' => 'form_maker_widget' );
22
- // Create the widget.
23
- parent::__construct('form_maker_widget', WDFMInstance(self::PLUGIN)->nicename, $widget_ops, $control_ops);
24
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Widget.php";
25
- $this->model = new FMModelWidget_fmc();
26
- require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Widget.php";
27
- $this->view = new FMViewWidget_fmc($this->model);
28
- }
29
-
30
- /**
31
- * Widget.
32
- *
33
- * @param array $args
34
- * @param array $instance
35
- */
36
- public function widget( $args = array(), $instance = array() ) {
37
- if( get_the_title() == 'Preview' && get_post_type() == 'form-maker' . WDFMInstance(self::PLUGIN)->plugin_postfix ) {
38
- return;
39
- }
40
- $contact_form_forms = explode(',', get_option('contact_form_forms'));
41
-
42
- $instance['title'] = isset($instance['title']) ? $instance['title'] : '';
43
- $instance['form_id'] = isset($instance['form_id']) ? $instance['form_id'] : 0;
44
-
45
- if ( !WDFMInstance(self::PLUGIN)->is_free || !in_array($instance['form_id'], $contact_form_forms) ) {
46
- if ( class_exists('WDFM') ) {
47
- require_once(WDFMInstance(self::PLUGIN)->plugin_dir . '/frontend/controllers/form_maker.php');
48
- $controller_class = 'FMControllerForm_maker';
49
- }
50
- else {
51
- return;
52
- }
53
- }
54
- else {
55
- if ( class_exists('WDCFM') ) {
56
- require_once(WDFMInstance(2)->plugin_dir . '/frontend/controllers/form_maker.php');
57
- $controller_class = 'FMControllerForm_maker_fmc';
58
- }
59
- else {
60
- return;
61
- }
62
- }
63
- $controller = new $controller_class();
64
- $execute = $controller->execute($instance['form_id']);
65
- $this->view->widget($args, $instance, $execute);
66
- }
67
-
68
- /**
69
- * Form.
70
- *
71
- * @param array $instance
72
- */
73
- public function form( $instance = array() ) {
74
- $ids_FM = $this->model->get_gallery_rows_data(); // ids_Form_Maker
75
- $this->view->form($instance, $ids_FM, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
76
- }
77
-
78
- /**
79
- * Update.
80
- *
81
- * @param $new_instance
82
- * @param $old_instance
83
- * @return mixed
84
- */
85
- public function update( $new_instance = array(), $old_instance = array() ) {
86
- $instance['title'] = isset($new_instance['title']) ? $new_instance['title'] : '';
87
- $instance['form_id'] = isset($new_instance['form_id']) ? $new_instance['form_id'] : 0;
88
-
89
- return $instance;
90
- }
91
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMControllerWidget_fmc
5
+ */
6
+ class FMControllerWidget_fmc extends WP_Widget {
7
+ /**
8
+ * PLUGIN = 2 points to Contact Form Maker
9
+ */
10
+ const PLUGIN = 2;
11
+
12
+ private $view;
13
+ private $model;
14
+
15
+ public function __construct() {
16
+ $widget_ops = array(
17
+ 'classname' => 'form_maker_widget',
18
+ 'description' => sprintf(__('Add %s widget.', WDFMInstance(self::PLUGIN)->prefix), WDFMInstance(self::PLUGIN)->nicename),
19
+ );
20
+ // Widget Control Settings.
21
+ $control_ops = array( 'id_base' => 'form_maker_widget' );
22
+ // Create the widget.
23
+ parent::__construct('form_maker_widget', WDFMInstance(self::PLUGIN)->nicename, $widget_ops, $control_ops);
24
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/Widget.php";
25
+ $this->model = new FMModelWidget_fmc();
26
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Widget.php";
27
+ $this->view = new FMViewWidget_fmc($this->model);
28
+ }
29
+
30
+ /**
31
+ * Widget.
32
+ *
33
+ * @param array $args
34
+ * @param array $instance
35
+ */
36
+ public function widget( $args = array(), $instance = array() ) {
37
+ if( get_the_title() == 'Preview' && get_post_type() == 'form-maker' . WDFMInstance(self::PLUGIN)->plugin_postfix ) {
38
+ return;
39
+ }
40
+ $contact_form_forms = explode(',', get_option('contact_form_forms'));
41
+
42
+ $instance['title'] = isset($instance['title']) ? $instance['title'] : '';
43
+ $instance['form_id'] = isset($instance['form_id']) ? $instance['form_id'] : 0;
44
+
45
+ if ( !WDFMInstance(self::PLUGIN)->is_free || !in_array($instance['form_id'], $contact_form_forms) ) {
46
+ if ( class_exists('WDFM') ) {
47
+ require_once(WDFMInstance(self::PLUGIN)->plugin_dir . '/frontend/controllers/form_maker.php');
48
+ $controller_class = 'FMControllerForm_maker';
49
+ }
50
+ else {
51
+ return;
52
+ }
53
+ }
54
+ else {
55
+ if ( class_exists('WDCFM') ) {
56
+ require_once(WDFMInstance(2)->plugin_dir . '/frontend/controllers/form_maker.php');
57
+ $controller_class = 'FMControllerForm_maker_fmc';
58
+ }
59
+ else {
60
+ return;
61
+ }
62
+ }
63
+ $controller = new $controller_class();
64
+ $execute = $controller->execute($instance['form_id']);
65
+ $this->view->widget($args, $instance, $execute);
66
+ }
67
+
68
+ /**
69
+ * Form.
70
+ *
71
+ * @param array $instance
72
+ */
73
+ public function form( $instance = array() ) {
74
+ $ids_FM = $this->model->get_gallery_rows_data(); // ids_Form_Maker
75
+ $this->view->form($instance, $ids_FM, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
76
+ }
77
+
78
+ /**
79
+ * Update.
80
+ *
81
+ * @param $new_instance
82
+ * @param $old_instance
83
+ * @return mixed
84
+ */
85
+ public function update( $new_instance = array(), $old_instance = array() ) {
86
+ $instance['title'] = isset($new_instance['title']) ? $new_instance['title'] : '';
87
+ $instance['form_id'] = isset($new_instance['form_id']) ? $new_instance['form_id'] : 0;
88
+
89
+ return $instance;
90
+ }
91
+ }
admin/controllers/controller.php CHANGED
@@ -1,10 +1,10 @@
1
- <?php
2
- /**
3
- * Admin controller class.
4
- */
5
- class CFMAdminController {
6
- /**
7
- * PLUGIN = 2 points to Contact Form Maker
8
- */
9
- const PLUGIN = 2;
10
  }
1
+ <?php
2
+ /**
3
+ * Admin controller class.
4
+ */
5
+ class CFMAdminController {
6
+ /**
7
+ * PLUGIN = 2 points to Contact Form Maker
8
+ */
9
+ const PLUGIN = 2;
10
  }
admin/controllers/elementorWidget.php CHANGED
@@ -1,88 +1,88 @@
1
- <?php
2
-
3
- class FMCElementor extends \Elementor\Widget_Base {
4
- /**
5
- * PLUGIN = 2 points to Contact Form Maker
6
- */
7
- const PLUGIN = 2;
8
-
9
- /**
10
- * Get widget name.
11
- *
12
- * @return string Widget name.
13
- */
14
- public function get_name() {
15
- return 'fm-elementor';
16
- }
17
-
18
- /**
19
- * Get widget title.
20
- *
21
- * @return string Widget title.
22
- */
23
- public function get_title() {
24
- return __('Form', WDFMInstance(self::PLUGIN)->prefix);
25
- }
26
-
27
- /**
28
- * Get widget icon.
29
- *
30
- * @return string Widget icon.
31
- */
32
- public function get_icon() {
33
- return 'fa fm-ico-form-maker';
34
- }
35
-
36
- /**
37
- * Get widget categories.
38
- *
39
- * @return array Widget categories.
40
- */
41
- public function get_categories() {
42
- return [ 'tenweb-plugins-widgets' ];
43
- }
44
-
45
- /**
46
- * Register widget controls.
47
- */
48
- protected function _register_controls() {
49
- $this->start_controls_section(
50
- 'general',
51
- [
52
- 'label' => __('Form', WDFMInstance(self::PLUGIN)->prefix),
53
- ]
54
- );
55
-
56
- $this->add_control(
57
- 'form_id',
58
- [
59
- 'label_block' => TRUE,
60
- 'show_label' => FALSE,
61
- 'description' => __('Select the form to display.', WDFMInstance(self::PLUGIN)->prefix) . ' <a target="_balnk" href="' . add_query_arg(array( 'page' => 'manage_fmc' ), admin_url('admin.php')) . '">' . __('Edit form', WDFMInstance(self::PLUGIN)->prefix) . '</a>',
62
- 'type' => \Elementor\Controls_Manager::SELECT,
63
- 'default' => 0,
64
- 'options' => WDW_FM_Library(self::PLUGIN)->get_forms(),
65
- ]
66
- );
67
-
68
- $this->end_controls_section();
69
- }
70
-
71
- /**
72
- * Render widget output on the frontend.
73
- */
74
- protected function render() {
75
- $font_class = new \Elementor\Scheme_Typography();
76
- $font = $font_class->get_scheme_value();
77
- $color_class = new \Elementor\Scheme_Color();
78
- $color = $color_class->get_scheme();
79
- if ( isset($font[3]) && isset($font[3]["font_family"]) && isset($font[3]["font_weight"]) && isset($color[3]) && isset($color[3]["value"]) ) {
80
- echo '<style>.elementor-widget-container .fm-form-container, .elementor-widget-container .fm-form-container label, .elementor-widget-container .fm-form-container input, .elementor-widget-container .fm-form-container textarea, .elementor-widget-container .fm-form-container select, .elementor-widget-container .fm-form-container button, .elementor-widget-container .fm-form-container .fm-message { font-family: ' . $font[3]["font_family"] . '; font-weight: ' . $font[3]["font_weight"] . '; color: ' . $color[3]["value"] . '}</style>';
81
- }
82
- $settings = $this->get_settings_for_display();
83
-
84
- echo WDFMInstance(self::PLUGIN)->fm_shortcode(array('id' => $settings['form_id']));
85
- }
86
- }
87
-
88
- \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new FMCElementor());
1
+ <?php
2
+
3
+ class FMCElementor extends \Elementor\Widget_Base {
4
+ /**
5
+ * PLUGIN = 2 points to Contact Form Maker
6
+ */
7
+ const PLUGIN = 2;
8
+
9
+ /**
10
+ * Get widget name.
11
+ *
12
+ * @return string Widget name.
13
+ */
14
+ public function get_name() {
15
+ return 'fm-elementor';
16
+ }
17
+
18
+ /**
19
+ * Get widget title.
20
+ *
21
+ * @return string Widget title.
22
+ */
23
+ public function get_title() {
24
+ return __('Form', WDFMInstance(self::PLUGIN)->prefix);
25
+ }
26
+
27
+ /**
28
+ * Get widget icon.
29
+ *
30
+ * @return string Widget icon.
31
+ */
32
+ public function get_icon() {
33
+ return 'fa fm-ico-form-maker';
34
+ }
35
+
36
+ /**
37
+ * Get widget categories.
38
+ *
39
+ * @return array Widget categories.
40
+ */
41
+ public function get_categories() {
42
+ return [ 'tenweb-plugins-widgets' ];
43
+ }
44
+
45
+ /**
46
+ * Register widget controls.
47
+ */
48
+ protected function _register_controls() {
49
+ $this->start_controls_section(
50
+ 'general',
51
+ [
52
+ 'label' => __('Form', WDFMInstance(self::PLUGIN)->prefix),
53
+ ]
54
+ );
55
+
56
+ $this->add_control(
57
+ 'form_id',
58
+ [
59
+ 'label_block' => TRUE,
60
+ 'show_label' => FALSE,
61
+ 'description' => __('Select the form to display.', WDFMInstance(self::PLUGIN)->prefix) . ' <a target="_balnk" href="' . add_query_arg(array( 'page' => 'manage_fmc' ), admin_url('admin.php')) . '">' . __('Edit form', WDFMInstance(self::PLUGIN)->prefix) . '</a>',
62
+ 'type' => \Elementor\Controls_Manager::SELECT,
63
+ 'default' => 0,
64
+ 'options' => WDW_FM_Library(self::PLUGIN)->get_forms(),
65
+ ]
66
+ );
67
+
68
+ $this->end_controls_section();
69
+ }
70
+
71
+ /**
72
+ * Render widget output on the frontend.
73
+ */
74
+ protected function render() {
75
+ $font_class = new \Elementor\Scheme_Typography();
76
+ $font = $font_class->get_scheme_value();
77
+ $color_class = new \Elementor\Scheme_Color();
78
+ $color = $color_class->get_scheme();
79
+ if ( isset($font[3]) && isset($font[3]["font_family"]) && isset($font[3]["font_weight"]) && isset($color[3]) && isset($color[3]["value"]) ) {
80
+ echo '<style>.elementor-widget-container .fm-form-container, .elementor-widget-container .fm-form-container label, .elementor-widget-container .fm-form-container input, .elementor-widget-container .fm-form-container textarea, .elementor-widget-container .fm-form-container select, .elementor-widget-container .fm-form-container button, .elementor-widget-container .fm-form-container .fm-message { font-family: ' . $font[3]["font_family"] . '; font-weight: ' . $font[3]["font_weight"] . '; color: ' . $color[3]["value"] . '}</style>';
81
+ }
82
+ $settings = $this->get_settings_for_display();
83
+
84
+ echo WDFMInstance(self::PLUGIN)->fm_shortcode(array('id' => $settings['form_id']));
85
+ }
86
+ }
87
+
88
+ \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new FMCElementor());
admin/models/Blocked_ips_fm.php CHANGED
@@ -1,115 +1,115 @@
1
- <?php
2
-
3
- /**
4
- * Class FMModelBlocked_ips_fmc
5
- */
6
- class FMModelBlocked_ips_fmc extends CFMAdminModel {
7
- /**
8
- * Get blocked Ips.
9
- *
10
- * @param $params
11
- * @return array|null|object
12
- */
13
- public function get_rows_data( $params = array() ) {
14
- $order = $params['order'];
15
- $orderby = $params['orderby'];
16
- $items_per_page = $params['items_per_page'];
17
- $search = WDW_FM_Library(self::PLUGIN)->get('s', '');
18
- $page = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
19
- $limit = $page ? ($page - 1) * $items_per_page : 0;
20
-
21
- global $wpdb;
22
- $query = "SELECT * FROM `" . $wpdb->prefix . "formmaker_blocked` ";
23
- if ( $search ) {
24
- $query .= 'WHERE `ip` LIKE "%' . $search . '%"';
25
- }
26
- $query .= ' ORDER BY `' . $orderby . '` ' . $order;
27
- $query .= " LIMIT " . $limit . "," . $items_per_page;
28
- $rows = $wpdb->get_results($query);
29
-
30
- return $rows;
31
- }
32
-
33
- /**
34
- * Get row data.
35
- *
36
- * @param int $id
37
- * @return stdClass
38
- */
39
- public function get_row_data( $id = 0 ) {
40
- global $wpdb;
41
- if ( $id != 0 ) {
42
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id));
43
- }
44
- else {
45
- $row = new stdClass();
46
- $row->id = 0;
47
- $row->ip = '';
48
- }
49
-
50
- return $row;
51
- }
52
-
53
- /**
54
- * Return total count of blocked IPs.
55
- *
56
- * @return null|string
57
- */
58
- public function total() {
59
- global $wpdb;
60
- $query = "SELECT COUNT(*) FROM `" . $wpdb->prefix . "formmaker_blocked`";
61
-
62
- $search = WDW_FM_Library(self::PLUGIN)->get('s', '');
63
- if ( $search ) {
64
- $query .= ' WHERE `ip` LIKE "%' . $search . '%"';
65
- }
66
-
67
- $total = $wpdb->get_var($query);
68
- return $total;
69
- }
70
-
71
- /**
72
- * Update formmaker_blocked table.
73
- *
74
- * @param array $params
75
- * @param array $where
76
- * @return bool
77
- */
78
- public function update_fm_blocked( $params = array(), $where = array() ) {
79
- global $wpdb;
80
- return $wpdb->update($wpdb->prefix . 'formmaker_blocked', $params, $where);
81
- }
82
-
83
- /**
84
- * Insert to formmaker_blocked table.
85
- *
86
- * @param array $param_ins
87
- * @param array $param_type
88
- * @return bool
89
- */
90
- public function insert_fm_blocked( $param_ins = array(), $param_type = array() ) {
91
- global $wpdb;
92
- return $wpdb->insert($wpdb->prefix . 'formmaker_blocked', $param_ins, $param_type);
93
- }
94
-
95
- /**
96
- * Get col id from formmaker_blocked table.
97
- *
98
- * @return array
99
- */
100
- public function get_col_data() {
101
- global $wpdb;
102
- return $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
103
- }
104
-
105
- /**
106
- * Delete blocked IP.
107
- *
108
- * @param int $id
109
- * @return array
110
- */
111
- public function delete_data( $id = 0 ) {
112
- global $wpdb;
113
- return $wpdb->query($wpdb->prepare('DELETE FROM `' . $wpdb->prefix . 'formmaker_blocked` WHERE id="%d"', $id));
114
- }
115
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMModelBlocked_ips_fmc
5
+ */
6
+ class FMModelBlocked_ips_fmc extends CFMAdminModel {
7
+ /**
8
+ * Get blocked Ips.
9
+ *
10
+ * @param $params
11
+ * @return array|null|object
12
+ */
13
+ public function get_rows_data( $params = array() ) {
14
+ $order = $params['order'];
15
+ $orderby = $params['orderby'];
16
+ $items_per_page = $params['items_per_page'];
17
+ $search = WDW_FM_Library(self::PLUGIN)->get('s', '');
18
+ $page = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
19
+ $limit = $page ? ($page - 1) * $items_per_page : 0;
20
+
21
+ global $wpdb;
22
+ $query = "SELECT * FROM `" . $wpdb->prefix . "formmaker_blocked` ";
23
+ if ( $search ) {
24
+ $query .= 'WHERE `ip` LIKE "%' . $search . '%"';
25
+ }
26
+ $query .= ' ORDER BY `' . $orderby . '` ' . $order;
27
+ $query .= " LIMIT " . $limit . "," . $items_per_page;
28
+ $rows = $wpdb->get_results($query);
29
+
30
+ return $rows;
31
+ }
32
+
33
+ /**
34
+ * Get row data.
35
+ *
36
+ * @param int $id
37
+ * @return stdClass
38
+ */
39
+ public function get_row_data( $id = 0 ) {
40
+ global $wpdb;
41
+ if ( $id != 0 ) {
42
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id));
43
+ }
44
+ else {
45
+ $row = new stdClass();
46
+ $row->id = 0;
47
+ $row->ip = '';
48
+ }
49
+
50
+ return $row;
51
+ }
52
+
53
+ /**
54
+ * Return total count of blocked IPs.
55
+ *
56
+ * @return null|string
57
+ */
58
+ public function total() {
59
+ global $wpdb;
60
+ $query = "SELECT COUNT(*) FROM `" . $wpdb->prefix . "formmaker_blocked`";
61
+
62
+ $search = WDW_FM_Library(self::PLUGIN)->get('s', '');
63
+ if ( $search ) {
64
+ $query .= ' WHERE `ip` LIKE "%' . $search . '%"';
65
+ }
66
+
67
+ $total = $wpdb->get_var($query);
68
+ return $total;
69
+ }
70
+
71
+ /**
72
+ * Update formmaker_blocked table.
73
+ *
74
+ * @param array $params
75
+ * @param array $where
76
+ * @return bool
77
+ */
78
+ public function update_fm_blocked( $params = array(), $where = array() ) {
79
+ global $wpdb;
80
+ return $wpdb->update($wpdb->prefix . 'formmaker_blocked', $params, $where);
81
+ }
82
+
83
+ /**
84
+ * Insert to formmaker_blocked table.
85
+ *
86
+ * @param array $param_ins
87
+ * @param array $param_type
88
+ * @return bool
89
+ */
90
+ public function insert_fm_blocked( $param_ins = array(), $param_type = array() ) {
91
+ global $wpdb;
92
+ return $wpdb->insert($wpdb->prefix . 'formmaker_blocked', $param_ins, $param_type);
93
+ }
94
+
95
+ /**
96
+ * Get col id from formmaker_blocked table.
97
+ *
98
+ * @return array
99
+ */
100
+ public function get_col_data() {
101
+ global $wpdb;
102
+ return $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
103
+ }
104
+
105
+ /**
106
+ * Delete blocked IP.
107
+ *
108
+ * @param int $id
109
+ * @return array
110
+ */
111
+ public function delete_data( $id = 0 ) {
112
+ global $wpdb;
113
+ return $wpdb->query($wpdb->prepare('DELETE FROM `' . $wpdb->prefix . 'formmaker_blocked` WHERE id="%d"', $id));
114
+ }
115
+ }
admin/models/Checkpaypal.php CHANGED
@@ -1,100 +1,100 @@
1
- <?php
2
-
3
- /**
4
- * Class FMModelCheckpaypal
5
- */
6
- class FMModelCheckpaypal extends FMAdminModel {
7
- /**
8
- * Get form by id.
9
- *
10
- * @param int $id
11
- * @return object $row
12
- */
13
- public function get_form_by_id( $id = 0 ) {
14
- global $wpdb;
15
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
16
-
17
- return $row;
18
- }
19
-
20
- /**
21
- * Get form session by group id.
22
- *
23
- * @param int $id
24
- * @return object $row
25
- */
26
- public function get_form_session_by_group_id( $id = 0 ) {
27
- global $wpdb;
28
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE group_id="%d"', $id));
29
-
30
- return $row;
31
- }
32
-
33
- /**
34
- * Update submission status.
35
- *
36
- * @param int $payment_status
37
- * @param int $group_id
38
- */
39
- public function update_submission_status( $payment_status = 0, $group_id = 0 ) {
40
- global $wpdb;
41
- $wpdb->update($wpdb->prefix . "formmaker_submits", array(
42
- 'element_value' => $payment_status,
43
- ), array(
44
- 'group_id' => $group_id,
45
- 'element_label' => 0,
46
- ));
47
-
48
- return;
49
- }
50
-
51
- /**
52
- * Connect PayPal.
53
- *
54
- * @param array $params
55
- * @return array $response
56
- */
57
- public function connect_to_paypal( $params = array() ) {
58
- // Set paypal action, default connect to sandbox.
59
- if ( $params['checkout_mode'] == 1 || $params['checkout_mode'] == 'production' ) {
60
- $action = "https://www.paypal.com/cgi-bin/webscr";
61
- }
62
- else {
63
- $action = "https://www.sandbox.paypal.com/cgi-bin/webscr";
64
- }
65
- $post_fields = $params['post_fields'];
66
- $response = wp_remote_post( $action, array('body' => $post_fields) );
67
- if ( is_wp_error( $response ) ) {
68
- $response = "";
69
- } else {
70
- $response = $response['body'];
71
- }
72
-
73
- return $response;
74
- }
75
-
76
- /**
77
- * Add form maker sessions.
78
- *
79
- * @param array $data
80
- */
81
- public function add_formmaker_sessions( $data = array() ) {
82
- global $wpdb;
83
- $wpdb->insert($wpdb->prefix . "formmaker_sessions", $data);
84
-
85
- return;
86
- }
87
-
88
- /**
89
- * Update form maker sessions by group_id.
90
- *
91
- * @param int $group_id
92
- * @param array $data
93
- */
94
- public function update_formmaker_sessions_by_group_id( $group_id = 0, $data = array() ) {
95
- global $wpdb;
96
- $wpdb->update($wpdb->prefix . "formmaker_sessions", $data, array( 'group_id' => $group_id ));
97
-
98
- return;
99
- }
100
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMModelCheckpaypal
5
+ */
6
+ class FMModelCheckpaypal extends FMAdminModel {
7
+ /**
8
+ * Get form by id.
9
+ *
10
+ * @param int $id
11
+ * @return object $row
12
+ */
13
+ public function get_form_by_id( $id = 0 ) {
14
+ global $wpdb;
15
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
16
+
17
+ return $row;
18
+ }
19
+
20
+ /**
21
+ * Get form session by group id.
22
+ *
23
+ * @param int $id
24
+ * @return object $row
25
+ */
26
+ public function get_form_session_by_group_id( $id = 0 ) {
27
+ global $wpdb;
28
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE group_id="%d"', $id));
29
+
30
+ return $row;
31
+ }
32
+
33
+ /**
34
+ * Update submission status.
35
+ *
36
+ * @param int $payment_status
37
+ * @param int $group_id
38
+ */
39
+ public function update_submission_status( $payment_status = 0, $group_id = 0 ) {
40
+ global $wpdb;
41
+ $wpdb->update($wpdb->prefix . "formmaker_submits", array(
42
+ 'element_value' => $payment_status,
43
+ ), array(
44
+ 'group_id' => $group_id,
45
+ 'element_label' => 0,
46
+ ));
47
+
48
+ return;
49
+ }
50
+
51
+ /**
52
+ * Connect PayPal.
53
+ *
54
+ * @param array $params
55
+ * @return array $response
56
+ */
57
+ public function connect_to_paypal( $params = array() ) {
58
+ // Set paypal action, default connect to sandbox.
59
+ if ( $params['checkout_mode'] == 1 || $params['checkout_mode'] == 'production' ) {
60
+ $action = "https://www.paypal.com/cgi-bin/webscr";
61
+ }
62
+ else {
63
+ $action = "https://www.sandbox.paypal.com/cgi-bin/webscr";
64
+ }
65
+ $post_fields = $params['post_fields'];
66
+ $response = wp_remote_post( $action, array('body' => $post_fields) );
67
+ if ( is_wp_error( $response ) ) {
68
+ $response = "";
69
+ } else {
70
+ $response = $response['body'];
71
+ }
72
+
73
+ return $response;
74
+ }
75
+
76
+ /**
77
+ * Add form maker sessions.
78
+ *
79
+ * @param array $data
80
+ */
81
+ public function add_formmaker_sessions( $data = array() ) {
82
+ global $wpdb;
83
+ $wpdb->insert($wpdb->prefix . "formmaker_sessions", $data);
84
+
85
+ return;
86
+ }
87
+
88
+ /**
89
+ * Update form maker sessions by group_id.
90
+ *
91
+ * @param int $group_id
92
+ * @param array $data
93
+ */
94
+ public function update_formmaker_sessions_by_group_id( $group_id = 0, $data = array() ) {
95
+ global $wpdb;
96
+ $wpdb->update($wpdb->prefix . "formmaker_sessions", $data, array( 'group_id' => $group_id ));
97
+
98
+ return;
99
+ }
100
+ }
admin/models/FMPaypalInfo.php CHANGED
@@ -1,19 +1,19 @@
1
- <?php
2
-
3
- /**
4
- * Class FMModelPaypal_info
5
- */
6
- class FMModelPaypal_info extends FMAdminModel {
7
- /**
8
- * Get form session.
9
- *
10
- * @param int $id
11
- * @return object $row
12
- */
13
- public function get_form_session( $id = 0 ) {
14
- global $wpdb;
15
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE group_id="%d"', $id));
16
-
17
- return $row;
18
- }
19
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMModelPaypal_info
5
+ */
6
+ class FMModelPaypal_info extends FMAdminModel {
7
+ /**
8
+ * Get form session.
9
+ *
10
+ * @param int $id
11
+ * @return object $row
12
+ */
13
+ public function get_form_session( $id = 0 ) {
14
+ global $wpdb;
15
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE group_id="%d"', $id));
16
+
17
+ return $row;
18
+ }
19
+ }
admin/models/FMSelectDataFromDb.php CHANGED
@@ -1,142 +1,142 @@
1
- <?php
2
-
3
- /**
4
- * Class FMModelSelect_data_from_db_fmc
5
- */
6
- class FMModelSelect_data_from_db_fmc extends CFMAdminModel {
7
-
8
- /**
9
- * Get labels by form id.
10
- *
11
- * @param int $id
12
- *
13
- * @return (string|null) $rows
14
- */
15
- function get_labels( $id = 0 ) {
16
- global $wpdb;
17
- $rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $id);
18
-
19
- return $rows;
20
- }
21
-
22
- /**
23
- * Get tables.
24
- *
25
- * @return object $tables
26
- */
27
- function get_tables() {
28
- global $wpdb;
29
- $con_type = $_POST['con_type'];
30
- if ( $con_type == 'local' ) {
31
- $query = "SHOW TABLES";
32
- $tables = $wpdb->get_col($query);
33
- }
34
- else {
35
- if ( $con_type == 'remote' ) {
36
- $username = WDW_FM_Library(self::PLUGIN)->get('username', '');
37
- $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
38
- $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
39
- $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
40
- $port = WDW_FM_Library(self::PLUGIN)->get('port', '');
41
- if ($port) {
42
- $host .= ':' . $port;
43
- }
44
- $wpdb_temp = new wpdb($username, $password, $database, $host);
45
- $query = "SHOW TABLES";
46
- $tables = $wpdb_temp->get_col($query);
47
- }
48
- }
49
-
50
- return $tables;
51
- }
52
-
53
- /**
54
- * Get tables saved.
55
- *
56
- * @param string $con_type
57
- * @param string $username
58
- * @param string $password
59
- * @param string $database
60
- * @param string $host
61
- *
62
- * @return object $tables
63
- */
64
- function get_tables_saved( $con_type = '', $username = '', $password = '', $database = '', $host = '' ) {
65
- global $wpdb;
66
- if ( $con_type == 'local' ) {
67
- $query = "SHOW TABLES";
68
- $tables = $wpdb->get_col($query);
69
- }
70
- else {
71
- if ( $con_type == 'remote' ) {
72
- $wpdb_temp = new wpdb($username, $password, $database, $host);
73
- $query = "SHOW TABLES";
74
- $tables = $wpdb_temp->get_col($query);
75
- }
76
- }
77
-
78
- return $tables;
79
- }
80
-
81
- /**
82
- * Get table struct.
83
- *
84
- * @return object $table_struct
85
- */
86
- function get_table_struct() {
87
- global $wpdb;
88
- $name = WDW_FM_Library(self::PLUGIN)->get('name', NULL);
89
- if ( !$name ) {
90
- return array();
91
- }
92
- $con_method = WDW_FM_Library(self::PLUGIN)->get('con_method', NULL);
93
- $con_type = WDW_FM_Library(self::PLUGIN)->get('con_type', NULL);
94
- $query = 'SHOW COLUMNS FROM `' . $name . '`';
95
- if ( $con_type == 'remote' ) {
96
- $username = WDW_FM_Library(self::PLUGIN)->get('username', '');
97
- $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
98
- $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
99
- $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
100
- $port = WDW_FM_Library(self::PLUGIN)->get('port', '');
101
- if ($port) {
102
- $host .= ':' . $port;
103
- }
104
- $wpdb_temp = new wpdb($username, $password, $database, $host);
105
- $table_struct = $wpdb_temp->get_results($query);
106
- }
107
- else {
108
- $table_struct = $wpdb->get_results($query);
109
- }
110
-
111
- return $table_struct;
112
- }
113
-
114
- /**
115
- * Get table struct.
116
- *
117
- * @param string $con_type
118
- * @param string $username
119
- * @param string $password
120
- * @param string $database
121
- * @param string $host
122
- * @param string $name
123
- * @param string $con_method
124
- * @return object $table_struct
125
- */
126
- function get_table_struct_saved( $con_type = '', $username = '', $password = '', $database = '', $host = '', $name = '', $con_method = '' ) {
127
- global $wpdb;
128
- if ( !$name ) {
129
- return array();
130
- }
131
- $query = 'SHOW COLUMNS FROM `' . $name . '`';
132
- if ( $con_type == 'remote' ) {
133
- $wpdb_temp = new wpdb($username, $password, $database, $host);
134
- $table_struct = $wpdb_temp->get_results($query);
135
- }
136
- else {
137
- $table_struct = $wpdb->get_results($query);
138
- }
139
-
140
- return $table_struct;
141
- }
142
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMModelSelect_data_from_db_fmc
5
+ */
6
+ class FMModelSelect_data_from_db_fmc extends CFMAdminModel {
7
+
8
+ /**
9
+ * Get labels by form id.
10
+ *
11
+ * @param int $id
12
+ *
13
+ * @return (string|null) $rows
14
+ */
15
+ function get_labels( $id = 0 ) {
16
+ global $wpdb;
17
+ $rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $id);
18
+
19
+ return $rows;
20
+ }
21
+
22
+ /**
23
+ * Get tables.
24
+ *
25
+ * @return object $tables
26
+ */
27
+ function get_tables() {
28
+ global $wpdb;
29
+ $con_type = $_POST['con_type'];
30
+ if ( $con_type == 'local' ) {
31
+ $query = "SHOW TABLES";
32
+ $tables = $wpdb->get_col($query);
33
+ }
34
+ else {
35
+ if ( $con_type == 'remote' ) {
36
+ $username = WDW_FM_Library(self::PLUGIN)->get('username', '');
37
+ $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
38
+ $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
39
+ $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
40
+ $port = WDW_FM_Library(self::PLUGIN)->get('port', '');
41
+ if ($port) {
42
+ $host .= ':' . $port;
43
+ }
44
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
45
+ $query = "SHOW TABLES";
46
+ $tables = $wpdb_temp->get_col($query);
47
+ }
48
+ }
49
+
50
+ return $tables;
51
+ }
52
+
53
+ /**
54
+ * Get tables saved.
55
+ *
56
+ * @param string $con_type
57
+ * @param string $username
58
+ * @param string $password
59
+ * @param string $database
60
+ * @param string $host
61
+ *
62
+ * @return object $tables
63
+ */
64
+ function get_tables_saved( $con_type = '', $username = '', $password = '', $database = '', $host = '' ) {
65
+ global $wpdb;
66
+ if ( $con_type == 'local' ) {
67
+ $query = "SHOW TABLES";
68
+ $tables = $wpdb->get_col($query);
69
+ }
70
+ else {
71
+ if ( $con_type == 'remote' ) {
72
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
73
+ $query = "SHOW TABLES";
74
+ $tables = $wpdb_temp->get_col($query);
75
+ }
76
+ }
77
+
78
+ return $tables;
79
+ }
80
+
81
+ /**
82
+ * Get table struct.
83
+ *
84
+ * @return object $table_struct
85
+ */
86
+ function get_table_struct() {
87
+ global $wpdb;
88
+ $name = WDW_FM_Library(self::PLUGIN)->get('name', NULL);
89
+ if ( !$name ) {
90
+ return array();
91
+ }
92
+ $con_method = WDW_FM_Library(self::PLUGIN)->get('con_method', NULL);
93
+ $con_type = WDW_FM_Library(self::PLUGIN)->get('con_type', NULL);
94
+ $query = 'SHOW COLUMNS FROM `' . $name . '`';
95
+ if ( $con_type == 'remote' ) {
96
+ $username = WDW_FM_Library(self::PLUGIN)->get('username', '');
97
+ $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
98
+ $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
99
+ $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
100
+ $port = WDW_FM_Library(self::PLUGIN)->get('port', '');
101
+ if ($port) {
102
+ $host .= ':' . $port;
103
+ }
104
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
105
+ $table_struct = $wpdb_temp->get_results($query);
106
+ }
107
+ else {
108
+ $table_struct = $wpdb->get_results($query);
109
+ }
110
+
111
+ return $table_struct;
112
+ }
113
+
114
+ /**
115
+ * Get table struct.
116
+ *
117
+ * @param string $con_type
118
+ * @param string $username
119
+ * @param string $password
120
+ * @param string $database
121
+ * @param string $host
122
+ * @param string $name
123
+ * @param string $con_method
124
+ * @return object $table_struct
125
+ */
126
+ function get_table_struct_saved( $con_type = '', $username = '', $password = '', $database = '', $host = '', $name = '', $con_method = '' ) {
127
+ global $wpdb;
128
+ if ( !$name ) {
129
+ return array();
130
+ }
131
+ $query = 'SHOW COLUMNS FROM `' . $name . '`';
132
+ if ( $con_type == 'remote' ) {
133
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
134
+ $table_struct = $wpdb_temp->get_results($query);
135
+ }
136
+ else {
137
+ $table_struct = $wpdb->get_results($query);
138
+ }
139
+
140
+ return $table_struct;
141
+ }
142
+ }
admin/models/FMShortocde.php CHANGED
@@ -1,19 +1,19 @@
1
- <?php
2
-
3
- /**
4
- * Class FMModelFMShortocde_fmc
5
- */
6
- class FMModelFMShortocde_fmc extends CFMAdminModel {
7
-
8
- /**
9
- * Get forms.
10
- *
11
- * @return array $rows
12
- */
13
- public function get_form_data() {
14
- global $wpdb;
15
- $rows = $wpdb->get_results("SELECT * FROM `" . $wpdb->prefix . "formmaker`" . (!WDFMInstance(self::PLUGIN)->is_free ? '' : ' WHERE id' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ') ORDER BY `title`'));
16
-
17
- return $rows;
18
- }
19
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMModelFMShortocde_fmc
5
+ */
6
+ class FMModelFMShortocde_fmc extends CFMAdminModel {
7
+
8
+ /**
9
+ * Get forms.
10
+ *
11
+ * @return array $rows
12
+ */
13
+ public function get_form_data() {
14
+ global $wpdb;
15
+ $rows = $wpdb->get_results("SELECT * FROM `" . $wpdb->prefix . "formmaker`" . (!WDFMInstance(self::PLUGIN)->is_free ? '' : ' WHERE id' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ') ORDER BY `title`'));
16
+
17
+ return $rows;
18
+ }
19
+ }
admin/models/FMSqlMapping.php CHANGED
@@ -1,126 +1,126 @@
1
- <?php
2
-
3
- /**
4
- * Class FMModelFormMakerSQLMapping_fmc
5
- */
6
- class FMModelFormMakerSQLMapping_fmc extends CFMAdminModel {
7
-
8
- /**
9
- * Get query by id.
10
- *
11
- * @param $id
12
- * @return array|null|object|void
13
- */
14
- function get_query( $id = 0 ) {
15
- global $wpdb;
16
- $rows = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_query where id=" . $id);
17
-
18
- return $rows;
19
- }
20
-
21
- /**
22
- * Get labels by id.
23
- *
24
- * @param int $id
25
- * @return (string|null) $rows
26
- */
27
- function get_labels( $id = 0 ) {
28
- global $wpdb;
29
- $rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $id);
30
-
31
- return $rows;
32
- }
33
-
34
- /**
35
- * Get tables.
36
- *
37
- * @return object $tables
38
- */
39
- function get_tables() {
40
- global $wpdb;
41
- $con_type = WDW_FM_Library(self::PLUGIN)->get('con_type', NULL);
42
- if ( $con_type == 'local' ) {
43
- $query = "SHOW TABLES";
44
- $tables = $wpdb->get_col($query);
45
- }
46
- else {
47
- if ( $con_type == 'remote' ) {
48
- $username = WDW_FM_Library(self::PLUGIN)->get('username', '');
49
- $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
50
- $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
51
- $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
52
- $port = WDW_FM_Library(self::PLUGIN)->get('port', '');
53
- if ($port) {
54
- $host .= ':' . $port;
55
- }
56
- $wpdb_temp = new wpdb($username, $password, $database, $host);
57
- $query = "SHOW TABLES";
58
- $tables = $wpdb_temp->get_col($query);
59
- }
60
- }
61
-
62
- return $tables;
63
- }
64
-
65
- function get_tables_saved( $con_type, $username, $password, $database, $host ) {
66
- global $wpdb;
67
- if ( $con_type == 'local' ) {
68
- $query = "SHOW TABLES";
69
- $tables = $wpdb->get_col($query);
70
- }
71
- else {
72
- if ( $con_type == 'remote' ) {
73
- $wpdb_temp = new wpdb($username, $password, $database, $host);
74
- $query = "SHOW TABLES";
75
- $tables = $wpdb_temp->get_col($query);
76
- }
77
- }
78
-
79
- return $tables;
80
- }
81
-
82
- function get_table_struct() {
83
- global $wpdb;
84
- $name = WDW_FM_Library(self::PLUGIN)->get('name', NULL);
85
- if ( !$name ) {
86
- return array();
87
- }
88
- $con_method = WDW_FM_Library(self::PLUGIN)->get('con_method', NULL);
89
- $con_type = WDW_FM_Library(self::PLUGIN)->get('con_type', NULL);
90
- $query = 'SHOW COLUMNS FROM `' . $name . '`';
91
- if ( $con_type == 'remote' ) {
92
- $username = WDW_FM_Library(self::PLUGIN)->get('username', '');
93
- $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
94
- $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
95
- $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
96
- $port = WDW_FM_Library(self::PLUGIN)->get('port', '');
97
- if ($port) {
98
- $host .= ':' . $port;
99
- }
100
- $wpdb_temp = new wpdb($username, $password, $database, $host);
101
- $table_struct = $wpdb_temp->get_results($query);
102
- }
103
- else {
104
- $table_struct = $wpdb->get_results($query);
105
- }
106
-
107
- return $table_struct;
108
- }
109
-
110
- function get_table_struct_saved( $con_type, $username, $password, $database, $host, $name, $con_method ) {
111
- global $wpdb;
112
- if ( !$name ) {
113
- return array();
114
- }
115
- $query = 'SHOW COLUMNS FROM `' . $name . '`';
116
- if ( $con_type == 'remote' ) {
117
- $wpdb_temp = new wpdb($username, $password, $database, $host);
118
- $table_struct = $wpdb_temp->get_results($query);
119
- }
120
- else {
121
- $table_struct = $wpdb->get_results($query);
122
- }
123
-
124
- return $table_struct;
125
- }
126
  }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMModelFormMakerSQLMapping_fmc
5
+ */
6
+ class FMModelFormMakerSQLMapping_fmc extends CFMAdminModel {
7
+
8
+ /**
9
+ * Get query by id.
10
+ *
11
+ * @param $id
12
+ * @return array|null|object|void
13
+ */
14
+ function get_query( $id = 0 ) {
15
+ global $wpdb;
16
+ $rows = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_query where id=" . $id);
17
+
18
+ return $rows;
19
+ }
20
+
21
+ /**
22
+ * Get labels by id.
23
+ *
24
+ * @param int $id
25
+ * @return (string|null) $rows
26
+ */
27
+ function get_labels( $id = 0 ) {
28
+ global $wpdb;
29
+ $rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $id);
30
+
31
+ return $rows;
32
+ }
33
+
34
+ /**
35
+ * Get tables.
36
+ *
37
+ * @return object $tables
38
+ */
39
+ function get_tables() {
40
+ global $wpdb;
41
+ $con_type = WDW_FM_Library(self::PLUGIN)->get('con_type', NULL);
42
+ if ( $con_type == 'local' ) {
43
+ $query = "SHOW TABLES";
44
+ $tables = $wpdb->get_col($query);
45
+ }
46
+ else {
47
+ if ( $con_type == 'remote' ) {
48
+ $username = WDW_FM_Library(self::PLUGIN)->get('username', '');
49
+ $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
50
+ $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
51
+ $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
52
+ $port = WDW_FM_Library(self::PLUGIN)->get('port', '');
53
+ if ($port) {
54
+ $host .= ':' . $port;
55
+ }
56
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
57
+ $query = "SHOW TABLES";
58
+ $tables = $wpdb_temp->get_col($query);
59
+ }
60
+ }
61
+
62
+ return $tables;
63
+ }
64
+
65
+ function get_tables_saved( $con_type, $username, $password, $database, $host ) {
66
+ global $wpdb;
67
+ if ( $con_type == 'local' ) {
68
+ $query = "SHOW TABLES";
69
+ $tables = $wpdb->get_col($query);
70
+ }
71
+ else {
72
+ if ( $con_type == 'remote' ) {
73
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
74
+ $query = "SHOW TABLES";
75
+ $tables = $wpdb_temp->get_col($query);
76
+ }
77
+ }
78
+
79
+ return $tables;
80
+ }
81
+
82
+ function get_table_struct() {
83
+ global $wpdb;
84
+ $name = WDW_FM_Library(self::PLUGIN)->get('name', NULL);
85
+ if ( !$name ) {
86
+ return array();
87
+ }
88
+ $con_method = WDW_FM_Library(self::PLUGIN)->get('con_method', NULL);
89
+ $con_type = WDW_FM_Library(self::PLUGIN)->get('con_type', NULL);
90
+ $query = 'SHOW COLUMNS FROM `' . $name . '`';
91
+ if ( $con_type == 'remote' ) {
92
+ $username = WDW_FM_Library(self::PLUGIN)->get('username', '');
93
+ $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
94
+ $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
95
+ $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
96
+ $port = WDW_FM_Library(self::PLUGIN)->get('port', '');
97
+ if ($port) {
98
+ $host .= ':' . $port;
99
+ }
100
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
101
+ $table_struct = $wpdb_temp->get_results($query);
102
+ }
103
+ else {
104
+ $table_struct = $wpdb->get_results($query);
105
+ }
106
+
107
+ return $table_struct;
108
+ }
109
+
110
+ function get_table_struct_saved( $con_type, $username, $password, $database, $host, $name, $con_method ) {
111
+ global $wpdb;
112
+ if ( !$name ) {
113
+ return array();
114
+ }
115
+ $query = 'SHOW COLUMNS FROM `' . $name . '`';
116
+ if ( $con_type == 'remote' ) {
117
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
118
+ $table_struct = $wpdb_temp->get_results($query);
119
+ }
120
+ else {
121
+ $table_struct = $wpdb->get_results($query);
122
+ }
123
+
124
+ return $table_struct;
125
+ }
126
  }
admin/models/FormMakerSubmits.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
-
3
- /**
4
- * Class FMModelFormMakerSubmits_fmc
5
- */
6
- class FMModelFormMakerSubmits_fmc extends CFMAdminModel {
7
-
8
- /**
9
- * Get from label order.
10
- *
11
- * @param int $form_id
12
- * @return mixed
13
- */
14
- public function get_from_label_order( $form_id = 0 ) {
15
- global $wpdb;
16
- $label_order = $wpdb->get_var($wpdb->prepare('SELECT `label_order` FROM `' . $wpdb->prefix . 'formmaker` WHERE id="%d"', $form_id));
17
-
18
- return $label_order;
19
- }
20
-
21
- /**
22
- * Get submissions.
23
- *
24
- * @param int $group_id
25
- * @return mixed
26
- */
27
- public function get_submissions( $group_id = 0 ) {
28
- global $wpdb;
29
- $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . $wpdb->prefix . 'formmaker_submits` WHERE group_id="%d"', $group_id));
30
-
31
- return $row;
32
- }
33
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMModelFormMakerSubmits_fmc
5
+ */
6
+ class FMModelFormMakerSubmits_fmc extends CFMAdminModel {
7
+
8
+ /**
9
+ * Get from label order.
10
+ *
11
+ * @param int $form_id
12
+ * @return mixed
13
+ */
14
+ public function get_from_label_order( $form_id = 0 ) {
15
+ global $wpdb;
16
+ $label_order = $wpdb->get_var($wpdb->prepare('SELECT `label_order` FROM `' . $wpdb->prefix . 'formmaker` WHERE id="%d"', $form_id));
17
+
18
+ return $label_order;
19
+ }
20
+
21
+ /**
22
+ * Get submissions.
23
+ *
24
+ * @param int $group_id
25
+ * @return mixed
26
+ */
27
+ public function get_submissions( $group_id = 0 ) {
28
+ global $wpdb;
29
+ $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . $wpdb->prefix . 'formmaker_submits` WHERE group_id="%d"', $group_id));
30
+
31
+ return $row;
32
+ }
33
+ }
admin/models/Manage_fm.php CHANGED
@@ -1,4000 +1,4000 @@
1
- <?php
2
-
3
- /**
4
- * Class FMModelManage_fmc
5
- */
6
- class FMModelManage_fmc extends CFMAdminModel {
7
-
8
- /**
9
- * Get forms.
10
- *
11
- * @param $params
12
- *
13
- * @return array|null|object
14
- */
15
- public function get_rows_data( $params = array() ) {
16
- $order = $params['order'];
17
- $orderby = $params['orderby'];
18
- $items_per_page = $params['items_per_page'];
19
- $search = WDW_FM_Library(self::PLUGIN)->get('s', '');
20
- $page = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
21
- $limit = $page ? ($page - 1) * $items_per_page : 0;
22
-
23
- global $wpdb;
24
- $query = "SELECT t1.* FROM " . $wpdb->prefix . "formmaker as t1 ";
25
- $query .= (!WDFMInstance(self::PLUGIN)->is_free ? '' : 'WHERE t1.id' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')');
26
- if ( $search ) {
27
- $query .= (!WDFMInstance(self::PLUGIN)->is_free ? 'WHERE' : ' AND') . ' t1.title LIKE "%' . $search . '%"';
28
- }
29
- $query .= ' ORDER BY t1.`' . $orderby . '` ' . $order;
30
- $query .= " LIMIT " . $limit . "," . $items_per_page;
31
- $rows = $wpdb->get_results($query);
32
- if ( !empty($rows) ) {
33
- foreach ( $rows as $row ) {
34
- if ( !isset($row->header_hide) ) {
35
- $row->header_hide = 1;
36
- }
37
- $query = "SELECT count(DISTINCT group_id) FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id=" . (int) $row->id . "";
38
- $row->submission_count = $wpdb->get_var($query);
39
- }
40
- }
41
-
42
- return $rows;
43
- }
44
-
45
- /**
46
- * Get row data.
47
- *
48
- * @param int $id
49
- * @return stdClass
50
- */
51
- public function get_row_data( $id = 0 ) {
52
- global $wpdb;
53
- if ( $id != 0 ) {
54
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
55
- if ( $row ) {
56
- $row->gdpr_checkbox = 0;
57
- $row->gdpr_checkbox_text = __('I consent collecting this data and processing it according to {{privacy_policy}} of this website.', WDFMInstance(self::PLUGIN)->prefix);
58
- $row->save_ip = 1;
59
- $row->save_user_id = 1;
60
- if ( isset($row->privacy) ) {
61
- if ( $row->privacy ) {
62
- $privacy = json_decode($row->privacy);
63
- $row->gdpr_checkbox = isset($privacy->gdpr_checkbox) ? $privacy->gdpr_checkbox : 0;
64
- $row->gdpr_checkbox_text = isset($privacy->gdpr_checkbox_text) ? $privacy->gdpr_checkbox_text : __('I consent collecting this data and processing it according to {{privacy_policy}} of this website.', WDFMInstance(self::PLUGIN)->prefix);
65
- $row->save_ip = isset($privacy->save_ip) ? $privacy->save_ip : 1;
66
- $row->save_user_id = isset($privacy->save_user_id) ? $privacy->save_user_id : 1;
67
- }
68
- }
69
- }
70
- }
71
- else {
72
- // Add "Submit" button to new forms.
73
- $row = new stdClass();
74
- $row->id = 0;
75
- $row->title = '';
76
- $row->mail = '';
77
- $row->form = '';
78
- $row->form_front = '<div class="wdform-page-and-images fm-form-builder"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="true" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row ui-sortable-handle">%1 - type_submit_reset_1%</div></div></div><div valign="top" class="wdform_footer wd-width-100"><div class="wd-width-100"><div class="wd-width-100 wd-table" style="padding-top:10px;"><div class="wd-table-group"><div id="form_id_temppage_nav1" class="wd-table-row"></div></div></div></div></div></div></div>';
79
- $row->theme = 0;
80
- $row->javascript = '';
81
- $row->submit_text = '';
82
- $row->url = '';
83
- $row->submit_text_type = 0;
84
- $row->script1 = '';
85
- $row->script2 = '';
86
- $row->script_user1 = '';
87
- $row->script_user2 = '';
88
- $row->counter = 2;
89
- $row->label_order = '1#**id**#type_submit_reset_1#**label**#type_submit_reset#****##**id**##**label**##****#';
90
- $row->article_id = '';
91
- $row->pagination = '';
92
- $row->show_title = '';
93
- $row->show_numbers = '';
94
- $row->public_key = '';
95
- $row->private_key = '';
96
- $row->recaptcha_theme = '';
97
- $row->from_name = '';
98
- $row->from_mail = '';
99
- $row->label_order_current = '1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#';
100
- $row->script_mail_user = '';
101
- $row->script_mail = '';
102
- $row->tax = 0;
103
- $row->payment_currency = '$';
104
- $row->paypal_email = '';
105
- $row->checkout_mode = 'testmode';
106
- $row->paypal_mode = 0;
107
- $row->published = 1;
108
- $row->form_fields = '1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*';
109
- $row->savedb = 1;
110
- $row->sendemail = 1;
111
- $row->requiredmark = '*';
112
- $row->reply_to = 0;
113
- $row->send_to = 0;
114
- $row->autogen_layout = 1;
115
- $row->custom_front = '';
116
- $row->mail_from_user = '';
117
- $row->mail_from_name_user = '';
118
- $row->reply_to_user = '';
119
- $row->save_uploads = 1;
120
- $row->header_title = '';
121
- $row->header_description = '';
122
- $row->header_image_url = '';
123
- $row->header_image_animation = '';
124
- $row->header_hide_image = '';
125
- $row->header_hide = 1;
126
- $row->gdpr_checkbox = 0;
127
- $row->gdpr_checkbox_text = __('I consent collecting this data and processing it according to {{privacy_policy}} of this website.', WDFMInstance(self::PLUGIN)->prefix);
128
- $row->save_ip = 1;
129
- $row->save_user_id = 1;
130
- }
131
-
132
- return $row;
133
- }
134
-
135
- /**
136
- * get row data new.
137
- *
138
- * @param int $id
139
- * @return stdClass
140
- */
141
- public function get_row_data_new( $id = 0 ) {
142
- $fm_nonce = wp_create_nonce('fm_ajax_nonce');
143
- global $wpdb;
144
- if ( $id != 0 ) {
145
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_backup WHERE backup_id="%d"', $id));
146
- if ( $row ) {
147
- $row->gdpr_checkbox = 0;
148
- $row->gdpr_checkbox_text = __('I consent collecting this data and processing it according to {{privacy_policy}} of this website.', WDFMInstance(self::PLUGIN)->prefix);
149
- $row->save_ip = 1;
150
- $row->save_user_id = 1;
151
- if ( isset($row->privacy) ) {
152
- if ( $row->privacy ) {
153
- $privacy = json_decode($row->privacy);
154
- $row->gdpr_checkbox = isset($privacy->gdpr_checkbox) ? $privacy->gdpr_checkbox : 0;
155
- $row->gdpr_checkbox_text = isset($privacy->gdpr_checkbox_text) ? $privacy->gdpr_checkbox_text : __('I consent collecting this data and processing it according to {{privacy_policy}} of this website.', WDFMInstance(self::PLUGIN)->prefix);
156
- $row->save_ip = isset($privacy->save_ip) ? $privacy->save_ip : 1;
157
- $row->save_user_id = isset($privacy->save_user_id) ? $privacy->save_user_id : 1;
158
- }
159
- }
160
- }
161
- }
162
- else {
163
- // Add "Submit" button to new forms.
164
- $row = new stdClass();
165
- $row->id = 0;
166
- $row->backup_id = '';
167
- $row->title = '';
168
- $row->mail = '';
169
- $row->form = '';
170
- $row->form_front = '<div class="wdform-page-and-images fm-form-builder"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="true" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row ui-sortable-handle">%1 - type_submit_reset_1%</div></div></div><div valign="top" class="wdform_footer wd-width-100"><div class="wd-width-100"><div class="wd-width-100 wd-table" style="padding-top:10px;"><div class="wd-table-group"><div id="form_id_temppage_nav1" class="wd-table-row"></div></div></div></div></div></div></div>';
171
- $row->theme = $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'");
172
- $row->javascript = '';
173
- $row->submit_text = '';
174
- $row->url = '';
175
- $row->submit_text_type = 1;
176
- $row->script1 = '{all}';
177
- $row->script2 = '{all}';
178
- $row->script_user1 = '';
179
- $row->script_user2 = '';
180
- $row->counter = 2;
181
- $row->label_order = '1#**id**#type_submit_reset_1#**label**#type_submit_reset#****##**id**##**label**##****#';
182
- $row->article_id = 0;
183
- $row->pagination = 'none';
184
- $row->show_title = false;
185
- $row->show_numbers = true;
186
- $row->public_key = '';
187
- $row->private_key = '';
188
- $row->recaptcha_theme = '';
189
- $row->from_name = '';
190
- $row->from_mail = '';
191
- $row->label_order_current = '1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#';
192
- $row->script_mail_user = '';
193
- $row->script_mail = '';
194
- $row->tax = 0;
195
- $row->payment_currency = '$';
196
- $row->paypal_email = '';
197
- $row->checkout_mode = 'testmode';
198
- $row->paypal_mode = 0;
199
- $row->published = 1;
200
- $row->form_fields = '1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*';
201
- $row->savedb = 1;
202
- $row->sendemail = 1;
203
- $row->requiredmark = '*';
204
- $row->reply_to = 0;
205
- $row->send_to = 0;
206
- $row->autogen_layout = 1;
207
- $row->custom_front = '';
208
- $row->mail_from_user = '';
209
- $row->mail_from_name_user = '';
210
- $row->reply_to_user = '';
211
- $row->save_uploads = 1;
212
- $row->header_title = '';
213
- $row->header_description = '';
214
- $row->header_image_url = '';
215
- $row->header_image_animation = 'none';
216
- $row->header_hide_image = 0;
217
- $row->header_hide = 1;
218
- $row->condition = '';
219
- $row->mail_cc = '';
220
- $row->mail_cc_user = '';
221
- $row->mail_bcc = '';
222
- $row->mail_bcc_user = '';
223
- $row->mail_subject = '';
224
- $row->mail_subject_user = '';
225
- $row->mail_mode = 1;
226
- $row->mail_mode_user = 1;
227
- $row->mail_attachment = 1;
228
- $row->mail_attachment_user = 1;
229
- $row->user_id_wd = '';
230
- $row->sortable = 1;
231
- $row->frontend_submit_fields = '';
232
- $row->frontend_submit_stat_fields = '';
233
- $row->mail_emptyfields = 0;
234
- $row->mail_verify = 0;
235
- $row->mail_verify_expiretime = 0;
236
- $row->mail_verification_post_id = 0;
237
- $row->gdpr_checkbox = 0;
238
- $row->gdpr_checkbox_text = __('I consent collecting this data and processing it according to {{privacy_policy}} of this website.', WDFMInstance(self::PLUGIN)->prefix);
239
- $row->save_ip = 1;
240
- $row->save_user_id = 1;
241
- }
242
-
243
- $labels2 = array();
244
- $label_id = array();
245
- $label_order_original = array();
246
- $label_type = array();
247
- $label_all = explode('#****#', $row->label_order);
248
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
249
- foreach ( $label_all as $key => $label_each ) {
250
- $label_id_each = explode('#**id**#', $label_each);
251
- array_push($label_id, $label_id_each[0]);
252
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
253
- array_push($label_order_original, addslashes($label_oder_each[0]));
254
- array_push($label_type, $label_oder_each[1]);
255
- }
256
- $labels2['id'] = '"' . implode('","', $label_id) . '"';
257
- $labels2['label'] = '"' . implode('","', $label_order_original) . '"';
258
- $labels2['type'] = '"' . implode('","', $label_type) . '"';
259
- $ids = array();
260
- $types = array();
261
- $labels = array();
262
- $paramss = array();
263
- $fields = explode('*:*new_field*:*', $row->form_fields);
264
- $fields = array_slice($fields, 0, count($fields) - 1);
265
- foreach ( $fields as $field ) {
266
- $temp = explode('*:*id*:*', $field);
267
- array_push($ids, $temp[0]);
268
- $temp = explode('*:*type*:*', $temp[1]);
269
- array_push($types, $temp[0]);
270
- $temp = explode('*:*w_field_label*:*', $temp[1]);
271
- array_push($labels, $temp[0]);
272
- array_push($paramss, $temp[1]);
273
- }
274
- $form = $row->form_front;
275
- foreach ( $ids as $ids_key => $id ) {
276
- $label = $labels[$ids_key];
277
- $type = $types[$ids_key];
278
- $params = $paramss[$ids_key];
279
- if ( strpos($form, '%' . $id . ' - ' . $label . '%') || strpos($form, '%' . $id . ' -' . $label . '%') ) {
280
- $rep = '';
281
- $arrows = '';
282
- $param = array();
283
- $param['attributes'] = '';
284
- switch ( $type ) {
285
- case 'type_section_break': {
286
- $arrows = '<div id="wdform_arrows' . $id . '" class="wdform_arrows" style="display: none;">
287
- <span class="wdform_arrows_basic wdform_arrows_container">
288
- <span id="edit_' . $id . '" valign="middle" class="element_toolbar">
289
- <span title="Edit the field" class="page_toolbar fm-ico-edit" ontouchend="edit(&quot;' . $id . '&quot;, event)" onclick="edit(&quot;' . $id . '&quot;, event)"></span>
290
- </span>
291
- <span id="duplicate_' . $id . '" valign="middle" class="element_toolbar">
292
- <span title="Duplicate the field" class="page_toolbar fm-ico-duplicate" ontouchend="duplicate(&quot;' . $id . '&quot;, event)" onclick="duplicate(&quot;' . $id . '&quot;, event)"></span>
293
- </span>
294
- <span id="X_' . $id . '" valign="middle" align="right" class="element_toolbar">
295
- <span title="Remove the field" class="page_toolbar fm-ico-delete" onclick="remove_section_break(&quot;' . $id . '&quot;)"></span>
296
- </span>
297
- </span>
298
- </div>';
299
- break;
300
- }
301
- case 'type_send_copy':
302
- case 'type_stripe':
303
- case 'type_captcha':
304
- case 'type_arithmetic_captcha':
305
- case 'type_recaptcha': {
306
- $arrows = '<div id="wdform_arrows' . $id . '" class="wdform_arrows" style="display: none;">
307
- <div class="wdform_arrows_basic wdform_arrows_container">
308
- <span id="edit_' . $id . '" valign="middle" class="element_toolbar">
309
- <span title="Edit the field" class="page_toolbar fm-ico-edit" ontouchend="edit(&quot;' . $id . '&quot;, event)" onclick="edit(&quot;' . $id . '&quot;, event)"></span>
310
- </span>
311
- <span id="duplicate_' . $id . '" valign="middle" class="element_toolbar"></span>
312
- <span id="X_' . $id . '" valign="middle" align="right" class="element_toolbar">
313
- <span title="Remove the field" class="page_toolbar fm-ico-delete" ontouchend="remove_field(&quot;' . $id . '&quot;, event)" onclick="remove_field(&quot;' . $id . '&quot;, event)"></span>
314
- </span>
315
- </div>
316
- <div class="wdform_arrows_advanced wdform_arrows_container" style="display: none;">
317
- <span id="left_' . $id . '" valign="middle" class="element_toolbar">
318
- <span title="Move the field to the left" class="page_toolbar dashicons dashicons-arrow-left-alt" onclick="left_row(&quot;' . $id . '&quot;)"></span>
319
- </span>
320
- <span id="up_' . $id . '" valign="middle" class="element_toolbar">
321
- <span title="Move the field up" class="page_toolbar dashicons dashicons-arrow-up-alt" onclick="up_row(&quot;' . $id . '&quot;)"></span>
322
- </span>
323
- <span id="down_' . $id . '" valign="middle" class="element_toolbar">
324
- <span title="Move the field down" class="page_toolbar dashicons dashicons-arrow-down-alt" onclick="down_row(&quot;' . $id . '&quot;)"></span>
325
- </span>
326
- <span id="right_' . $id . '" valign="middle" class="element_toolbar">
327
- <span title="Move the field to the right" class="page_toolbar dashicons dashicons-arrow-right-alt" onclick="right_row(&quot;' . $id . '&quot;)"></span>
328
- </span>
329
- <span id="page_up_' . $id . '" valign="middle" class="element_toolbar">
330
- <span title="Move the field to the upper page" class="page_toolbar dashicons dashicons-upload" onclick="page_up(&quot;' . $id . '&quot;)"></span>
331
- </span>
332
- <span id="page_down_' . $id . '" valign="middle" class="element_toolbar">
333
- <span title="Move the field to the lower page" class="page_toolbar dashicons dashicons-download" onclick="page_down(&quot;' . $id . '&quot;)"></span>
334
- </span>
335
- </div>
336
- </div>';
337
- break;
338
- }
339
- default : {
340
- $arrows = '<div id="wdform_arrows' . $id . '" class="wdform_arrows" style="display: none;">
341
- <div class="wdform_arrows_basic wdform_arrows_container"> <span id="edit_' . $id . '" valign="middle" class="element_toolbar">
342
- <span title="Edit the field" class="page_toolbar fm-ico-edit" ontouchend="edit(&quot;' . $id . '&quot;, event)" onclick="edit(&quot;' . $id . '&quot;, event)"></span>
343
- </span>
344
- <span id="duplicate_' . $id . '" valign="middle" class="element_toolbar">
345
- <span title="Duplicate the field" class="page_toolbar fm-ico-duplicate" ontouchend="duplicate(&quot;' . $id . '&quot;, event)" onclick="duplicate(&quot;' . $id . '&quot;, event)"></span>
346
- </span>
347
- <span id="X_' . $id . '" valign="middle" align="right" class="element_toolbar">
348
- <span title="Remove the field" class="page_toolbar fm-ico-delete" ontouchend="remove_field(&quot;' . $id . '&quot;, event)" onclick="remove_field(&quot;' . $id . '&quot;, event)"></span>
349
- </span>
350
- </div>
351
- <div class="wdform_arrows_advanced wdform_arrows_container" style="display: none;">
352
- <span id="left_' . $id . '" valign="middle" class="element_toolbar">
353
- <span title="Move the field to the left" class="page_toolbar dashicons dashicons-arrow-left-alt" onclick="left_row(&quot;' . $id . '&quot;)"></span>
354
- </span>
355
- <span id="up_' . $id . '" valign="middle" class="element_toolbar">
356
- <span title="Move the field up" class="page_toolbar dashicons dashicons-arrow-up-alt" onclick="up_row(&quot;' . $id . '&quot;)"></span>
357
- </span>
358
- <span id="down_' . $id . '" valign="middle" class="element_toolbar">
359
- <span title="Move the field down" class="page_toolbar dashicons dashicons-arrow-down-alt" onclick="down_row(&quot;' . $id . '&quot;)"></span>
360
- </span>
361
- <span id="right_' . $id . '" valign="middle" class="element_toolbar">
362
- <span title="Move the field to the right" class="page_toolbar dashicons dashicons-arrow-right-alt" onclick="right_row(&quot;' . $id . '&quot;)"></span>
363
- </span>
364
- <span id="page_up_' . $id . '" valign="middle" class="element_toolbar">
365
- <span title="Move the field to the upper page" class="page_toolbar dashicons dashicons-upload" onclick="page_up(&quot;' . $id . '&quot;)"></span>
366
- </span>
367
- <span id="page_down_' . $id . '" valign="middle" class="element_toolbar">
368
- <span title="Move the field to the lower page" class="page_toolbar dashicons dashicons-download" onclick="page_down(&quot;' . $id . '&quot;)"></span>
369
- </span>
370
- </div>
371
- </div>';
372
- break;
373
- }
374
- }
375
- switch ( $type ) {
376
- case 'type_section_break': {
377
- $params_names = array( 'w_editor' );
378
- $temp = $params;
379
- foreach ( $params_names as $params_name ) {
380
- $temp = explode('*:*' . $params_name . '*:*', $temp);
381
- $param[$params_name] = $temp[0];
382
- $temp = $temp[1];
383
- }
384
- $rep = '<div id="wdform_field' . $id . '" type="type_section_break" class="wdform_field_section_break">' . $arrows . '<span id="' . $id . '_element_labelform_id_temp" style="display: none;">' . __('Section Break', WDFMInstance(self::PLUGIN)->prefix) . '</span><div id="' . $id . '_element_sectionform_id_temp" align="left" class="wdform_section_break">' . $param['w_editor'] . '</div></div><div id="' . $id . '_element_labelform_id_temp" style="color:red;">' . __('Section Break', WDFMInstance(self::PLUGIN)->prefix) . '</div>';
385
- break;
386
- }
387
- case 'type_editor': {
388
- $params_names = array( 'w_editor' );
389
- $temp = $params;
390
- foreach ( $params_names as $params_name ) {
391
- $temp = explode('*:*' . $params_name . '*:*', $temp);
392
- $param[$params_name] = $temp[0];
393
- $temp = $temp[1];
394
- }
395
- $rep = '<div id="wdform_field' . $id . '" type="type_editor" class="wdform_field" >' . $param['w_editor'] . '</div>' . $arrows . '<div id="' . $id . '_element_labelform_id_temp" style="color: red;">' . __('Custom HTML', WDFMInstance(self::PLUGIN)->prefix) . $id . '</div>';
396
- break;
397
- }
398
- case 'type_send_copy': {
399
- $params_names = array( 'w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_required' );
400
- $temp = $params;
401
- if ( strpos($temp, 'w_hide_label') > -1 ) {
402
- $params_names = array(
403
- 'w_field_label_size',
404
- 'w_field_label_pos',
405
- 'w_hide_label',
406
- 'w_first_val',
407
- 'w_required',
408
- );
409
- }
410
- foreach ( $params_names as $params_name ) {
411
- $temp = explode('*:*' . $params_name . '*:*', $temp);
412
- $param[$params_name] = $temp[0];
413
- $temp = $temp[1];
414
- }
415
- if ( $temp ) {
416
- $temp = explode('*:*w_attr_name*:*', $temp);
417
- $attrs = array_slice($temp, 0, count($temp) - 1);
418
- foreach ( $attrs as $attr ) {
419
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
420
- }
421
- }
422
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
423
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
424
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
425
- $input_active = ($param['w_first_val'] == 'true' ? "checked='checked'" : "");
426
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
427
- $rep = '<div id="wdform_field' . $id . '" type="type_send_copy" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_send_copy" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp" /><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp" /><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="checkbox" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" onclick="set_checked(&quot;' . $id . '&quot;,&quot;&quot;,&quot;form_id_temp&quot;)" ' . $input_active . ' ' . $param['attributes'] . ' disabled /></div></div>';
428
- break;
429
- }
430
- case 'type_text': {
431
- $params_names = array(
432
- 'w_field_label_size',
433
- 'w_field_label_pos',
434
- 'w_size',
435
- 'w_first_val',
436
- 'w_title',
437
- 'w_required',
438
- 'w_unique',
439
- );
440
- $temp = $params;
441
- if ( strpos($temp, 'w_regExp_status') > -1 ) {
442
- $params_names = array(
443
- 'w_field_label_size',
444
- 'w_field_label_pos',
445
- 'w_size',
446
- 'w_first_val',
447
- 'w_title',
448
- 'w_required',
449
- 'w_regExp_status',
450
- 'w_regExp_value',
451
- 'w_regExp_common',
452
- 'w_regExp_arg',
453
- 'w_regExp_alert',
454
- 'w_unique',
455
- );
456
- }
457
- if ( strpos($temp, 'w_readonly') > -1 ) {
458
- $params_names = array(
459
- 'w_field_label_size',
460
- 'w_field_label_pos',
461
- 'w_size',
462
- 'w_first_val',
463
- 'w_title',
464
- 'w_required',
465
- 'w_regExp_status',
466
- 'w_regExp_value',
467
- 'w_regExp_common',
468
- 'w_regExp_arg',
469
- 'w_regExp_alert',
470
- 'w_unique',
471
- 'w_readonly',
472
- );
473
- }
474
- if ( strpos($temp, 'w_hide_label') > -1 ) {
475
- $params_names = array(
476
- 'w_field_label_size',
477
- 'w_field_label_pos',
478
- 'w_hide_label',
479
- 'w_size',
480
- 'w_first_val',
481
- 'w_title',
482
- 'w_required',
483
- 'w_regExp_status',
484
- 'w_regExp_value',
485
- 'w_regExp_common',
486
- 'w_regExp_arg',
487
- 'w_regExp_alert',
488
- 'w_unique',
489
- 'w_readonly',
490
- );
491
- }
492
- if ( strpos($temp, 'w_class') > -1 ) {
493
- $params_names = array(
494
- 'w_field_label_size',
495
- 'w_field_label_pos',
496
- 'w_hide_label',
497
- 'w_size',
498
- 'w_first_val',
499
- 'w_title',
500
- 'w_required',
501
- 'w_regExp_status',
502
- 'w_regExp_value',
503
- 'w_regExp_common',
504
- 'w_regExp_arg',
505
- 'w_regExp_alert',
506
- 'w_unique',
507
- 'w_readonly',
508
- 'w_class',
509
- );
510
- }
511
- foreach ( $params_names as $params_name ) {
512
- $temp = explode('*:*' . $params_name . '*:*', $temp);
513
- $param[$params_name] = $temp[0];
514
- $temp = $temp[1];
515
- }
516
- if ( $temp ) {
517
- $temp = explode('*:*w_attr_name*:*', $temp);
518
- $attrs = array_slice($temp, 0, count($temp) - 1);
519
- foreach ( $attrs as $attr ) {
520
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
521
- }
522
- }
523
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
524
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
525
- $param['w_regExp_status'] = (isset($param['w_regExp_status']) ? $param['w_regExp_status'] : "no");
526
- $param['w_regExp_value'] = (isset($param['w_regExp_value']) ? $param['w_regExp_value'] : "");
527
- $param['w_regExp_common'] = (isset($param['w_regExp_common']) ? $param['w_regExp_common'] : "");
528
- $param['w_regExp_arg'] = (isset($param['w_regExp_arg']) ? $param['w_regExp_arg'] : "");
529
- $param['w_regExp_alert'] = (isset($param['w_regExp_alert']) ? $param['w_regExp_alert'] : "Incorrect Value");
530
- $param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
531
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
532
- $param['w_class'] = (isset($param['w_class']) ? $param['w_class'] : "");
533
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
534
- $rep = '<div id="wdform_field' . $id . '" type="type_text" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_text" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp" /><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp" /><input type="hidden" value="' . $param['w_readonly'] . '" name="' . $id . '_readonlyform_id_temp" id="' . $id . '_readonlyform_id_temp"/><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_regExp_status'] . '" name="' . $id . '_regExpStatusform_id_temp" id="' . $id . '_regExpStatusform_id_temp"><input type="hidden" value="' . $param['w_regExp_value'] . '" name="' . $id . '_regExp_valueform_id_temp" id="' . $id . '_regExp_valueform_id_temp"><input type="hidden" value="' . $param['w_regExp_common'] . '" name="' . $id . '_regExp_commonform_id_temp" id="' . $id . '_regExp_commonform_id_temp"><input type="hidden" value="' . $param['w_regExp_alert'] . '" name="' . $id . '_regExp_alertform_id_temp" id="' . $id . '_regExp_alertform_id_temp"><input type="hidden" value="' . $param['w_regExp_arg'] . '" name="' . $id . '_regArgumentform_id_temp" id="' . $id . '_regArgumentform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp" /><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" placeholder="' . htmlentities($param['w_title'], ENT_COMPAT) . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div>';
535
- break;
536
- }
537
- case 'type_number': {
538
- $params_names = array(
539
- 'w_field_label_size',
540
- 'w_field_label_pos',
541
- 'w_size',
542
- 'w_first_val',
543
- 'w_title',
544
- 'w_required',
545
- 'w_unique',
546
- 'w_class',
547
- );
548
- $temp = $params;
549
- foreach ( $params_names as $params_name ) {
550
- $temp = explode('*:*' . $params_name . '*:*', $temp);
551
- $param[$params_name] = $temp[0];
552
- $temp = $temp[1];
553
- }
554
- if ( $temp ) {
555
- $temp = explode('*:*w_attr_name*:*', $temp);
556
- $attrs = array_slice($temp, 0, count($temp) - 1);
557
- foreach ( $attrs as $attr ) {
558
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
559
- }
560
- }
561
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
562
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
563
- $rep = '<div id="wdform_field' . $id . '" type="type_number" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_number" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div>';
564
- break;
565
- }
566
- case 'type_password': {
567
- $params_names = array(
568
- 'w_field_label_size',
569
- 'w_field_label_pos',
570
- 'w_size',
571
- 'w_required',
572
- 'w_unique',
573
- 'w_class',
574
- );
575
- $temp = $params;
576
- if ( strpos($temp, 'w_hide_label') > -1 ) {
577
- $params_names = array(
578
- 'w_field_label_size',
579
- 'w_field_label_pos',
580
- 'w_hide_label',
581
- 'w_size',
582
- 'w_required',
583
- 'w_unique',
584
- 'w_class',
585
- );
586
- }
587
- if ( strpos($temp, 'w_verification') > -1 ) {
588
- $params_names = array(
589
- 'w_field_label_size',
590
- 'w_field_label_pos',
591
- 'w_hide_label',
592
- 'w_size',
593
- 'w_required',
594
- 'w_unique',
595
- 'w_class',
596
- 'w_verification',
597
- 'w_verification_label',
598
- );
599
- }
600
- if ( strpos($temp, 'w_placeholder') > -1 ) {
601
- $params_names = array(
602
- 'w_field_label_size',
603
- 'w_field_label_pos',
604
- 'w_hide_label',
605
- 'w_size',
606
- 'w_required',
607
- 'w_unique',
608
- 'w_class',
609
- 'w_verification',
610
- 'w_verification_label',
611
- 'w_placeholder',
612
- );
613
- }
614
- foreach ( $params_names as $params_name ) {
615
- $temp = explode('*:*' . $params_name . '*:*', $temp);
616
- $param[$params_name] = $temp[0];
617
- $temp = $temp[1];
618
- }
619
- if ( $temp ) {
620
- $temp = explode('*:*w_attr_name*:*', $temp);
621
- $attrs = array_slice($temp, 0, count($temp) - 1);
622
- foreach ( $attrs as $attr ) {
623
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
624
- }
625
- }
626
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
627
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
628
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
629
- if ( isset($param['w_verification']) && $param['w_verification'] == "yes" ) {
630
- $display_label_confirm = $display_label;
631
- $display_element_confirm = $param['w_field_label_pos'];
632
- }
633
- else {
634
- $display_label_confirm = "none";
635
- $display_element_confirm = "none";
636
- }
637
- $param['w_verification'] = isset($param['w_verification']) ? $param['w_verification'] : "no";
638
- $param['w_verification_label'] = isset($param['w_verification_label']) ? $param['w_verification_label'] : "Password confirmation:";
639
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
640
- $confirm_password = '<br><div align="left" id="' . $id . '_1_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label_confirm . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_1_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $param['w_verification_label'] . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_1_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_element_confirm . ';"><input type="hidden" value="' . $param['w_verification'] . '" name="' . $id . '_verification_id_temp" id="' . $id . '_verification_id_temp"><input type="text" id="' . $id . '_1_elementform_id_temp" name="' . $id . '_1_elementform_id_temp" placeholder="' . $param['w_placeholder'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>';
641
- $rep = '<div id="wdform_field' . $id . '" type="type_password" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_password" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="password" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" placeholder="' . $param['w_placeholder'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>' . $confirm_password . '</div>';
642
- break;
643
- }
644
- case 'type_textarea': {
645
- $params_names = array(
646
- 'w_field_label_size',
647
- 'w_field_label_pos',
648
- 'w_size_w',
649
- 'w_size_h',
650
- 'w_first_val',
651
- 'w_title',
652
- 'w_required',
653
- 'w_unique',
654
- 'w_class',
655
- );
656
- $temp = $params;
657
- if ( strpos($temp, 'w_hide_label') > -1 ) {
658
- $params_names = array(
659
- 'w_field_label_size',
660
- 'w_field_label_pos',
661
- 'w_hide_label',
662
- 'w_size_w',
663
- 'w_size_h',
664
- 'w_first_val',
665
- 'w_title',
666
- 'w_required',
667
- 'w_unique',
668
- 'w_class',
669
- );
670
- }
671
- foreach ( $params_names as $params_name ) {
672
- $temp = explode('*:*' . $params_name . '*:*', $temp);
673
- $param[$params_name] = $temp[0];
674
- $temp = $temp[1];
675
- }
676
- if ( $temp ) {
677
- $temp = explode('*:*w_attr_name*:*', $temp);
678
- $attrs = array_slice($temp, 0, count($temp) - 1);
679
- foreach ( $attrs as $attr ) {
680
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
681
- }
682
- }
683
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
684
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
685
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
686
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
687
- $rep = '<div id="wdform_field' . $id . '" type="type_textarea" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_textarea" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><textarea id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" placeholder="' . htmlentities($param['w_title'], ENT_COMPAT) . '" style="width: ' . $param['w_size_w'] . 'px; height: ' . $param['w_size_h'] . 'px;" ' . $param['attributes'] . ' disabled>' . htmlentities($param['w_first_val'], ENT_COMPAT) . '</textarea></div></div>';
688
- break;
689
- }
690
- case 'type_phone': {
691
- $params_names = array(
692
- 'w_field_label_size',
693
- 'w_field_label_pos',
694
- 'w_size',
695
- 'w_first_val',
696
- 'w_title',
697
- 'w_mini_labels',
698
- 'w_required',
699
- 'w_unique',
700
- 'w_class',
701
- );
702
- $temp = $params;
703
- if ( strpos($temp, 'w_hide_label') > -1 ) {
704
- $params_names = array(
705
- 'w_field_label_size',
706
- 'w_field_label_pos',
707
- 'w_hide_label',
708
- 'w_size',
709
- 'w_first_val',
710
- 'w_title',
711
- 'w_mini_labels',
712
- 'w_required',
713
- 'w_unique',
714
- 'w_class',
715
- );
716
- }
717
- foreach ( $params_names as $params_name ) {
718
- $temp = explode('*:*' . $params_name . '*:*', $temp);
719
- $param[$params_name] = $temp[0];
720
- $temp = $temp[1];
721
- }
722
- if ( $temp ) {
723
- $temp = explode('*:*w_attr_name*:*', $temp);
724
- $attrs = array_slice($temp, 0, count($temp) - 1);
725
- foreach ( $attrs as $attr ) {
726
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
727
- }
728
- }
729
- $w_first_val = explode('***', $param['w_first_val']);
730
- $w_title = explode('***', $param['w_title']);
731
- $w_mini_labels = explode('***', $param['w_mini_labels']);
732
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
733
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
734
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
735
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
736
- $rep = '<div id="wdform_field' . $id . '" type="type_phone" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_phone" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><div id="' . $id . '_table_name" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;"><div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_element_firstform_id_temp" name="' . $id . '_element_firstform_id_temp" value="' . htmlentities($w_first_val[0], ENT_COMPAT) . '" title="' . htmlentities($w_title[0], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[0], ENT_COMPAT) . '" onkeypress="return check_isnum(event)"style="width: 50px;" ' . $param['attributes'] . ' disabled /><span class="wdform_line" style="margin: 0px 4px; padding: 0px;">-</span></div><div id="' . $id . '_td_name_input_last" style="display: table-cell;"><input type="text" id="' . $id . '_element_lastform_id_temp" name="' . $id . '_element_lastform_id_temp" value="' . htmlentities($w_first_val[1], ENT_COMPAT) . '" title="' . htmlentities($w_title[1], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[1], ENT_COMPAT) . '" onkeypress="return check_isnum(event)"style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div><div id="' . $id . '_tr_name2" style="display: table-row;"><div id="' . $id . '_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_area_code">' . $w_mini_labels[0] . '</label></div><div id="' . $id . '_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_phone_number">' . $w_mini_labels[1] . '</label></div></div></div></div></div>';
737
- break;
738
- }
739
- case 'type_phone_new': {
740
- $temp = $params;
741
- $params_names = array(
742
- 'w_field_label_size',
743
- 'w_field_label_pos',
744
- 'w_hide_label',
745
- 'w_size',
746
- 'w_first_val',
747
- 'w_top_country',
748
- 'w_required',
749
- 'w_unique',
750
- 'w_class',
751
- );
752
- foreach ( $params_names as $params_name ) {
753
- $temp = explode('*:*' . $params_name . '*:*', $temp);
754
- $param[$params_name] = $temp[0];
755
- $temp = $temp[1];
756
- }
757
- if ( $temp ) {
758
- $temp = explode('*:*w_attr_name*:*', $temp);
759
- $attrs = array_slice($temp, 0, count($temp) - 1);
760
- foreach ( $attrs as $attr ) {
761
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
762
- }
763
- }
764
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
765
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
766
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
767
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
768
- $rep = '<div id="wdform_field' . $id . '" type="type_phone_new" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_phone_new" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><div id="' . $id . '_table_name" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;"><div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" top-country = "' . $param['w_top_country'] . '" onkeypress="return check_isnum(&quot;' . $id . '_elementform_id_temp&quot;)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled></div></div></div></div></div>';
769
- break;
770
- }
771
- case 'type_name': {
772
- $params_names = array(
773
- 'w_field_label_size',
774
- 'w_field_label_pos',
775
- 'w_first_val',
776
- 'w_title',
777
- 'w_mini_labels',
778
- 'w_size',
779
- 'w_name_format',
780
- 'w_required',
781
- 'w_unique',
782
- 'w_class',
783
- );
784
- $temp = $params;
785
- if ( strpos($temp, 'w_name_fields') > -1 ) {
786
- $params_names = array(
787
- 'w_field_label_size',
788
- 'w_field_label_pos',
789
- 'w_first_val',
790
- 'w_title',
791
- 'w_mini_labels',
792
- 'w_size',
793
- 'w_name_format',
794
- 'w_required',
795
- 'w_unique',
796
- 'w_class',
797
- 'w_name_fields',
798
- );
799
- }
800
- if ( strpos($temp, 'w_autofill') > -1 ) {
801
- $params_names = array(
802
- 'w_field_label_size',
803
- 'w_field_label_pos',
804
- 'w_first_val',
805
- 'w_title',
806
- 'w_mini_labels',
807
- 'w_size',
808
- 'w_name_format',
809
- 'w_required',
810
- 'w_unique',
811
- 'w_class',
812
- 'w_name_fields',
813
- 'w_autofill',
814
- );
815
- }
816
- if ( strpos($temp, 'w_hide_label') > -1 ) {
817
- $params_names = array(
818
- 'w_field_label_size',
819
- 'w_field_label_pos',
820
- 'w_hide_label',
821
- 'w_first_val',
822
- 'w_title',
823
- 'w_mini_labels',
824
- 'w_size',
825
- 'w_name_format',
826
- 'w_required',
827
- 'w_unique',
828
- 'w_class',
829
- 'w_name_fields',
830
- 'w_autofill',
831
- );
832
- }
833
- foreach ( $params_names as $params_name ) {
834
- $temp = explode('*:*' . $params_name . '*:*', $temp);
835
- $param[$params_name] = $temp[0];
836
- $temp = $temp[1];
837
- }
838
- if ( $temp ) {
839
- $temp = explode('*:*w_attr_name*:*', $temp);
840
- $attrs = array_slice($temp, 0, count($temp) - 1);
841
- foreach ( $attrs as $attr ) {
842
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
843
- }
844
- }
845
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
846
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
847
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
848
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
849
- $w_first_val = explode('***', $param['w_first_val']);
850
- $w_title = explode('***', $param['w_title']);
851
- $w_mini_labels = explode('***', $param['w_mini_labels']);
852
- $param['w_name_fields'] = isset($param['w_name_fields']) ? $param['w_name_fields'] : ($param['w_name_format'] == 'normal' ? 'no***no' : 'yes***yes');
853
- $w_name_fields = explode('***', $param['w_name_fields']);
854
- $param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
855
- $w_name_format = '<div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_element_firstform_id_temp" name="' . $id . '_element_firstform_id_temp" value="' . htmlentities($w_first_val[0], ENT_COMPAT) . '" title="' . htmlentities($w_title[0], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[0], ENT_COMPAT) . '" style="margin-right: 10px; width: ' . $param['w_size'] . 'px;"' . $param['attributes'] . ' disabled /></div><div id="' . $id . '_td_name_input_last" style="display: table-cell;"><input type="text" id="' . $id . '_element_lastform_id_temp" name="' . $id . '_element_lastform_id_temp" value="' . htmlentities($w_first_val[1], ENT_COMPAT) . '" title="' . htmlentities($w_title[1], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[1], ENT_COMPAT) . '" style="margin-right: 10px; width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>';
856
- $w_name_format_mini_labels = '<div id="' . $id . '_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_first">' . $w_mini_labels[1] . '</label></div><div id="' . $id . '_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_last">' . $w_mini_labels[2] . '</label></div>';
857
- if ( $w_name_fields[0] == 'yes' ) {
858
- $w_name_format = '<div id="' . $id . '_td_name_input_title" style="display: table-cell;"><input type="text" id="' . $id . '_element_titleform_id_temp" name="' . $id . '_element_titleform_id_temp" value="' . htmlentities($w_first_val[2], ENT_COMPAT) . '" title="' . htmlentities($w_title[2], ENT_COMPAT) . '" style="margin: 0px 10px 0px 0px; width: 40px;" disabled /></div>' . $w_name_format;
859
- $w_name_format_mini_labels = '<div id="' . $id . '_td_name_label_title" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_title">' . $w_mini_labels[0] . '</label></div>' . $w_name_format_mini_labels;
860
- }
861
- if ( $w_name_fields[1] == 'yes' ) {
862
- $w_name_format = $w_name_format . '<div id="' . $id . '_td_name_input_middle" style="display: table-cell;"><input type="text" id="' . $id . '_element_middleform_id_temp" name="' . $id . '_element_middleform_id_temp" value="' . htmlentities($w_first_val[3], ENT_COMPAT) . '" title="' . htmlentities($w_title[3], ENT_COMPAT) . '" style="width: ' . $param['w_size'] . 'px;" disabled /></div>';
863
- $w_name_format_mini_labels = $w_name_format_mini_labels . '<div id="' . $id . '_td_name_label_middle" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_middle">' . $w_mini_labels[3] . '</label></div>';
864
- }
865
- $rep = '<div id="wdform_field' . $id . '" type="type_name" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_name" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="hidden" value="' . $param['w_autofill'] . '" name="' . $id . '_autofillform_id_temp" id="' . $id . '_autofillform_id_temp"><input type="hidden" name="' . $id . '_enable_fieldsform_id_temp" id="' . $id . '_enable_fieldsform_id_temp" title="' . $w_name_fields[0] . '" first="yes" last="yes" middle="' . $w_name_fields[1] . '"><div id="' . $id . '_table_name" cellpadding="0" cellspacing="0" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;">' . $w_name_format . '</div><div id="' . $id . '_tr_name2" style="display: table-row;">' . $w_name_format_mini_labels . '</div></div></div></div>';
866
- break;
867
- }
868
- case 'type_address': {
869
- $params_names = array(
870
- 'w_field_label_size',
871
- 'w_field_label_pos',
872
- 'w_size',
873
- 'w_mini_labels',
874
- 'w_disabled_fields',
875
- 'w_required',
876
- 'w_class',
877
- );
878
- $temp = $params;
879
- if ( strpos($temp, 'w_hide_label') > -1 ) {
880
- $params_names = array(
881
- 'w_field_label_size',
882
- 'w_field_label_pos',
883
- 'w_hide_label',
884
- 'w_size',
885
- 'w_mini_labels',
886
- 'w_disabled_fields',
887
- 'w_required',
888
- 'w_class',
889
- );
890
- }
891
- foreach ( $params_names as $params_name ) {
892
- $temp = explode('*:*' . $params_name . '*:*', $temp);
893
- $param[$params_name] = $temp[0];
894
- $temp = $temp[1];
895
- }
896
- if ( $temp ) {
897
- $temp = explode('*:*w_attr_name*:*', $temp);
898
- $attrs = array_slice($temp, 0, count($temp) - 1);
899
- foreach ( $attrs as $attr ) {
900
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
901
- }
902
- }
903
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
904
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
905
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
906
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
907
- $w_mini_labels = explode('***', $param['w_mini_labels']);
908
- $w_disabled_fields = explode('***', $param['w_disabled_fields']);
909
- $hidden_inputs = '';
910
- $labels_for_id = array( 'street1', 'street2', 'city', 'state', 'postal', 'country' );
911
- foreach ( $w_disabled_fields as $key => $w_disabled_field ) {
912
- if ( $key != 6 ) {
913
- if ( $w_disabled_field == 'yes' ) {
914
- $hidden_inputs .= '<input type="hidden" id="' . $id . '_' . $labels_for_id[$key] . 'form_id_temp" value="' . $w_mini_labels[$key] . '" id_for_label="' . ($id + $key) . '">';
915
- }
916
- }
917
- }
918
- $address_fields = '';
919
- $g = 0;
920
- if ( $w_disabled_fields[0] == 'no' ) {
921
- $g += 2;
922
- $address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="' . $id . '_street1form_id_temp" name="' . $id . '_street1form_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled /><label class="mini_label" id="' . $id . '_mini_label_street1" style="display: block;">' . $w_mini_labels[0] . '</label></span>';
923
- }
924
- if ( $w_disabled_fields[1] == 'no' ) {
925
- $g += 2;
926
- $address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="' . $id . '_street2form_id_temp" name="' . ($id + 1) . '_street2form_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled /><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_street2">' . $w_mini_labels[1] . '</label></span>';
927
- }
928
- if ( $w_disabled_fields[2] == 'no' ) {
929
- $g++;
930
- $address_fields .= '<span style="float: left; width: 48%; padding-bottom: 8px;"><input type="text" id="' . $id . '_cityform_id_temp" name="' . ($id + 2) . '_cityform_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled /><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_city">' . $w_mini_labels[2] . '</label></span>';
931
- }
932
- if ( $w_disabled_fields[3] == 'no' ) {
933
- $g++;
934
- if ( $w_disabled_fields[5] == 'yes' && $w_disabled_fields[6] == 'yes' ) {
935
- $address_fields .= '<span style="float: ' . (($g % 2 == 0) ? 'right' : 'left') . '; width: 48%; padding-bottom: 8px;"><select type="text" id="' . $id . '_stateform_id_temp" name="' . ($id + 3) . '_stateform_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled >';
936
- $states = WDW_FM_Library(self::PLUGIN)->get_states();
937
- foreach ($states as $st => $state) {
938
- $address_fields .= '<option value="' . $st . '">' . $state . '</option>';
939
- }
940
- $address_fields .= '</select><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_state">' . $w_mini_labels[3] . '</label></span>';
941
- }
942
- else {
943
- $address_fields .= '<span style="float: ' . (($g % 2 == 0) ? 'right' : 'left') . '; width: 48%; padding-bottom: 8px;"><input type="text" id="' . $id . '_stateform_id_temp" name="' . ($id + 3) . '_stateform_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_state">' . $w_mini_labels[3] . '</label></span>';
944
- }
945
- }
946
- if ( $w_disabled_fields[4] == 'no' ) {
947
- $g++;
948
- $address_fields .= '<span style="float: ' . (($g % 2 == 0) ? 'right' : 'left') . '; width: 48%; padding-bottom: 8px;"><input type="text" id="' . $id . '_postalform_id_temp" name="' . ($id + 4) . '_postalform_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_postal">' . $w_mini_labels[4] . '</label></span>';
949
- }
950
- if ( $w_disabled_fields[5] == 'no' ) {
951
- $g++;
952
- $countries_list = WDW_FM_Library(self::PLUGIN)->get_countries();
953
- $address_fields .= '<span style="float: ' . (($g % 2 == 0) ? 'right' : 'left') . '; width: 48%; padding-bottom: 8px;">
954
- <select type="text" id="' . $id . '_countryform_id_temp" name="' . ($id + 5) . '_countryform_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled>';
955
- foreach ($countries_list as $value => $item) {
956
- $address_fields .= '<option value="' . $value . '">' . $item . '</option>';
957
- }
958
- $address_fields .= '</select><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_country">' . $w_mini_labels[5] . '</span>';
959
- }
960
- $rep = '<div id="wdform_field' . $id . '" type="type_address" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px; vertical-align:top;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_address" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" name="' . $id . '_disable_fieldsform_id_temp" id="' . $id . '_disable_fieldsform_id_temp" street1="' . $w_disabled_fields[0] . '" street2="' . $w_disabled_fields[1] . '" city="' . $w_disabled_fields[2] . '" state="' . $w_disabled_fields[3] . '" postal="' . $w_disabled_fields[4] . '" country="' . $w_disabled_fields[5] . '" us_states="' . $w_disabled_fields[6] . '"><div id="' . $id . '_div_address" style="width: ' . $param['w_size'] . 'px;">' . $address_fields . $hidden_inputs . '</div></div></div>';
961
- break;
962
- }
963
- case 'type_submitter_mail': {
964
- $params_names = array(
965
- 'w_field_label_size',
966
- 'w_field_label_pos',
967
- 'w_size',
968
- 'w_first_val',
969
- 'w_title',
970
- 'w_required',
971
- 'w_unique',
972
- 'w_class',
973
- );
974
- $temp = $params;
975
- if ( strpos($temp, 'w_autofill') > -1 ) {
976
- $params_names = array(
977
- 'w_field_label_size',
978
- 'w_field_label_pos',
979
- 'w_size',
980
- 'w_first_val',
981
- 'w_title',
982
- 'w_required',
983
- 'w_unique',
984
- 'w_class',
985
- 'w_autofill',
986
- );
987
- }
988
- if ( strpos($temp, 'w_hide_label') > -1 ) {
989
- $params_names = array(
990
- 'w_field_label_size',
991
- 'w_field_label_pos',
992
- 'w_hide_label',
993
- 'w_size',
994
- 'w_first_val',
995
- 'w_title',
996
- 'w_required',
997
- 'w_unique',
998
- 'w_class',
999
- 'w_autofill',
1000
- );
1001
- }
1002
- if ( strpos($temp, 'w_verification') > -1 ) {
1003
- $params_names = array(
1004
- 'w_field_label_size',
1005
- 'w_field_label_pos',
1006
- 'w_hide_label',
1007
- 'w_size',
1008
- 'w_first_val',
1009
- 'w_title',
1010
- 'w_required',
1011
- 'w_unique',
1012
- 'w_class',
1013
- 'w_verification',
1014
- 'w_verification_label',
1015
- 'w_verification_placeholder',
1016
- 'w_autofill',
1017
- );
1018
- }
1019
- foreach ( $params_names as $params_name ) {
1020
- $temp = explode('*:*' . $params_name . '*:*', $temp);
1021
- $param[$params_name] = $temp[0];
1022
- $temp = $temp[1];
1023
- }
1024
- if ( $temp ) {
1025
- $temp = explode('*:*w_attr_name*:*', $temp);
1026
- $attrs = array_slice($temp, 0, count($temp) - 1);
1027
- foreach ( $attrs as $attr ) {
1028
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1029
- }
1030
- }
1031
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1032
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1033
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1034
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1035
- $param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
1036
- if ( isset($param['w_verification']) && $param['w_verification'] == "yes" ) {
1037
- $display_label_confirm = $display_label;
1038
- $display_element_confirm = $param['w_field_label_pos'];
1039
- }
1040
- else {
1041
- $display_label_confirm = "none";
1042
- $display_element_confirm = "none";
1043
- }
1044
- $param['w_verification'] = isset($param['w_verification']) ? $param['w_verification'] : "no";
1045
- $param['w_verification_label'] = isset($param['w_verification_label']) ? $param['w_verification_label'] : "E-mail confirmation:";
1046
- $param['w_verification_placeholder'] = isset($param['w_verification_placeholder']) ? $param['w_verification_placeholder'] : "";
1047
- $confirm_emeil = '<br><div align="left" id="' . $id . '_1_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label_confirm . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_1_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $param['w_verification_label'] . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_1_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_element_confirm . ';"><input type="text" id="' . $id . '_1_elementform_id_temp" name="' . $id . '_1_elementform_id_temp" value="' . $param['w_verification_placeholder'] . '" title="' . $param['w_verification_placeholder'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>';
1048
- $rep = '<div id="wdform_field' . $id . '" type="type_submitter_mail" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_submitter_mail" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="hidden" value="' . $param['w_autofill'] . '" name="' . $id . '_autofillform_id_temp" id="' . $id . '_autofillform_id_temp"><input type="hidden" value="' . $param['w_verification'] . '" name="' . $id . '_verification_id_temp" id="' . $id . '_verification_id_temp"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" placeholder="' . htmlentities($param['w_title'], ENT_COMPAT) . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>' . $confirm_emeil . '</div>';
1049
- break;
1050
- }
1051
- case 'type_checkbox': {
1052
- $params_names = array(
1053
- 'w_field_label_size',
1054
- 'w_field_label_pos',
1055
- 'w_flow',
1056
- 'w_choices',
1057
- 'w_choices_checked',
1058
- 'w_rowcol',
1059
- 'w_required',
1060
- 'w_randomize',
1061
- 'w_allow_other',
1062
- 'w_allow_other_num',
1063
- 'w_class',
1064
- );
1065
- $temp = $params;
1066
- if ( strpos($temp, 'w_field_option_pos') > -1 ) {
1067
- $params_names = array(
1068
- 'w_field_label_size',
1069
- 'w_field_label_pos',
1070
- 'w_field_option_pos',
1071
- 'w_flow',
1072
- 'w_choices',
1073
- 'w_choices_checked',
1074
- 'w_rowcol',
1075
- 'w_required',
1076
- 'w_randomize',
1077
- 'w_allow_other',
1078
- 'w_allow_other_num',
1079
- 'w_value_disabled',
1080
- 'w_choices_value',
1081
- 'w_choices_params',
1082
- 'w_class',
1083
- );
1084
- }
1085
- if ( strpos($temp, 'w_hide_label') > -1 ) {
1086
- $params_names = array(
1087
- 'w_field_label_size',
1088
- 'w_field_label_pos',
1089
- 'w_field_option_pos',
1090
- 'w_hide_label',
1091
- 'w_flow',
1092
- 'w_choices',
1093
- 'w_choices_checked',
1094
- 'w_rowcol',
1095
- 'w_required',
1096
- 'w_randomize',
1097
- 'w_allow_other',
1098
- 'w_allow_other_num',
1099
- 'w_value_disabled',
1100
- 'w_choices_value',
1101
- 'w_choices_params',
1102
- 'w_class',
1103
- );
1104
- }
1105
- foreach ( $params_names as $params_name ) {
1106
- $temp = explode('*:*' . $params_name . '*:*', $temp);
1107
- $param[$params_name] = $temp[0];
1108
- $temp = $temp[1];
1109
- }
1110
- if ( $temp ) {
1111
- $temp = explode('*:*w_attr_name*:*', $temp);
1112
- $attrs = array_slice($temp, 0, count($temp) - 1);
1113
- foreach ( $attrs as $attr ) {
1114
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1115
- }
1116
- }
1117
- if ( !isset($param['w_value_disabled']) ) {
1118
- $param['w_value_disabled'] = 'no';
1119
- }
1120
- if ( !isset($param['w_field_option_pos']) ) {
1121
- $param['w_field_option_pos'] = 'left';
1122
- }
1123
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1124
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1125
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1126
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1127
- $param['w_choices'] = explode('***', $param['w_choices']);
1128
- $param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
1129
- if ( isset($param['w_choices_value']) ) {
1130
- $param['w_choices_value'] = explode('***', $param['w_choices_value']);
1131
- $param['w_choices_params'] = explode('***', $param['w_choices_params']);
1132
- }
1133
- foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
1134
- if ( $choices_checked == 'true' ) {
1135
- $param['w_choices_checked'][$key] = 'checked="checked"';
1136
- }
1137
- else {
1138
- $param['w_choices_checked'][$key] = '';
1139
- }
1140
- }
1141
- $rep = '<div id="wdform_field' . $id . '" type="type_checkbox" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_checkbox" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_randomize'] . '" name="' . $id . '_randomizeform_id_temp" id="' . $id . '_randomizeform_id_temp"><input type="hidden" value="' . $param['w_allow_other'] . '" name="' . $id . '_allow_otherform_id_temp" id="' . $id . '_allow_otherform_id_temp"><input type="hidden" value="' . $param['w_allow_other_num'] . '" name="' . $id . '_allow_other_numform_id_temp" id="' . $id . '_allow_other_numform_id_temp"><input type="hidden" value="' . $param['w_rowcol'] . '" name="' . $id . '_rowcol_numform_id_temp" id="' . $id . '_rowcol_numform_id_temp"><input type="hidden" value="' . $param['w_field_option_pos'] . '" id="' . $id . '_option_left_right"><input type="hidden" value="' . $param['w_value_disabled'] . '" name="' . $id . '_value_disabledform_id_temp" id="' . $id . '_value_disabledform_id_temp"><div style="display: table;"><div id="' . $id . '_table_little" style="display: table-row-group;" ' . ($param['w_flow'] == 'hor' ? 'for_hor="' . $id . '_hor"' : '') . '>';
1142
- if ( $param['w_flow'] == 'hor' ) {
1143
- $j = 0;
1144
- for ( $i = 0; $i < (int) $param['w_rowcol']; $i++ ) {
1145
- $rep .= '<div id="' . $id . '_element_tr' . $i . '" style="display: table-row;">';
1146
- for ( $l = 0; $l <= (int) (count($param['w_choices']) / $param['w_rowcol']); $l++ ) {
1147
- if ( $j >= count($param['w_choices']) % $param['w_rowcol'] && $l == (int) (count($param['w_choices']) / $param['w_rowcol']) ) {
1148
- continue;
1149
- }
1150
- if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
1151
- $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $l + $i) . '" idi="' . ((int) $param['w_rowcol'] * $l + $i) . '" style="display: table-cell;"><input type="checkbox" value="" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" other="1" onclick="if(set_checked(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $l + $i) . '&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $l + $i] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled /><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $l + $i) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $l + $i] . '</label></div>';
1152
- }
1153
- else {
1154
- $where = '';
1155
- $order_by = '';
1156
- $db_info = '';
1157
- if ( isset($param['w_choices_value']) ) {
1158
- $choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $l + $i];
1159
- }
1160
- else {
1161
- $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $l + $i];
1162
- }
1163
- $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1164
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i] ) {
1165
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i]);
1166
- $where = 'where="' . $w_choices_params[0] . '"';
1167
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1168
- $order_by = "order_by='" . $w_choices_params[0] . "'";
1169
- $db_info = "db_info='" . $w_choices_params[1] . "'";
1170
- }
1171
- $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $l + $i) . '" idi="' . ((int) $param['w_rowcol'] * $l + $i) . '" style="display: table-cell;"><input type="checkbox" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" onclick="set_checked(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $l + $i) . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $l + $i] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $l + $i) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $l + $i] . '</label></div>';
1172
- }
1173
- }
1174
- $j++;
1175
- $rep .= '</div>';
1176
- }
1177
- }
1178
- else {
1179
- for ( $i = 0; $i < (int) (count($param['w_choices']) / $param['w_rowcol']); $i++ ) {
1180
- $rep .= '<div id="' . $id . '_element_tr' . $i . '" style="display: table-row;">';
1181
- if ( count($param['w_choices']) > (int) $param['w_rowcol'] ) {
1182
- for ( $l = 0; $l < $param['w_rowcol']; $l++ ) {
1183
- if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
1184
- $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="checkbox" value="" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" other="1" onclick="if(set_checked(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled /><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1185
- }
1186
- else {
1187
- $where = '';
1188
- $order_by = '';
1189
- $db_info = '';
1190
- if ( isset($param['w_choices_value']) ) {
1191
- $choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $i + $l];
1192
- }
1193
- else {
1194
- $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1195
- }
1196
- $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1197
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1198
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1199
- $where = 'where="' . $w_choices_params[0] . '"';
1200
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1201
- $order_by = "order_by='" . $w_choices_params[0] . "'";
1202
- $db_info = "db_info='" . $w_choices_params[1] . "'";
1203
- }
1204
- $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="checkbox" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" onclick="set_checked(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '"
1205
- ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1206
- }
1207
- }
1208
- }
1209
- else {
1210
- for ( $l = 0; $l < count($param['w_choices']); $l++ ) {
1211
- if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
1212
- $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="checkbox" value="" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" other="1" onclick="if(set_checked(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1213
- }
1214
- else {
1215
- $where = '';
1216
- $order_by = '';
1217
- $db_info = '';
1218
- if ( isset($param['w_choices_value']) ) {
1219
- $choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $i + $l];
1220
- }
1221
- else {
1222
- $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1223
- }
1224
- $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1225
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1226
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1227
- $where = 'where="' . $w_choices_params[0] . '"';
1228
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1229
- $order_by = "order_by='" . $w_choices_params[0] . "'";
1230
- $db_info = "db_info='" . $w_choices_params[1] . "'";
1231
- }
1232
- $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="checkbox" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" onclick="set_checked(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1233
- }
1234
- }
1235
- }
1236
- $rep .= '</div>';
1237
- }
1238
- if ( count($param['w_choices']) % $param['w_rowcol'] != 0 ) {
1239
- $rep .= '<div id="' . $id . '_element_tr' . ((int) (count($param['w_choices']) / (int) $param['w_rowcol'])) . '" style="display: table-row;">';
1240
- for ( $k = 0; $k < count($param['w_choices']) % $param['w_rowcol']; $k++ ) {
1241
- $l = count($param['w_choices']) - count($param['w_choices']) % $param['w_rowcol'] + $k;
1242
- if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == $l ) {
1243
- $rep .= '<div valign="top" id="' . $id . '_td_little' . $l . '" idi="' . $l . '" style="display: table-cell;"><input type="checkbox" value="" id="' . $id . '_elementform_id_temp' . $l . '" name="' . $id . '_elementform_id_temp' . $l . '" other="1" onclick="if(set_checked(&quot;' . $id . '&quot;,&quot;' . $l . '&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][$l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $l . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $l . '">' . $param['w_choices'][$l] . '</label></div>';
1244
- }
1245
- else {
1246
- $where = '';
1247
- $order_by = '';
1248
- $db_info = '';
1249
- if ( isset($param['w_choices_value']) ) {
1250
- $choise_value = $param['w_choices_value'][$l];
1251
- }
1252
- else {
1253
- $choise_value = $param['w_choices'][$l];
1254
- }
1255
- $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1256
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][$l] ) {
1257
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$l]);
1258
- $where = 'where="' . $w_choices_params[0] . '"';
1259
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1260
- $order_by = "order_by='" . $w_choices_params[0] . "'";
1261
- $db_info = "db_info='" . $w_choices_params[1] . "'";
1262
- }
1263
- $rep .= '<div valign="top" id="' . $id . '_td_little' . $l . '" idi="' . $l . '" style="display: table-cell;"><input type="checkbox" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . $l . '" name="' . $id . '_elementform_id_temp' . $l . '" onclick="set_checked(&quot;' . $id . '&quot;,&quot;' . $l . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][$l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $l . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $l . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][$l] . '</label></div>';
1264
- }
1265
- }
1266
- $rep .= '</div>';
1267
- }
1268
- }
1269
- $rep .= '</div></div></div></div>';
1270
- break;
1271
- }
1272
- case 'type_radio': {
1273
- $params_names = array(
1274
- 'w_field_label_size',
1275
- 'w_field_label_pos',
1276
- 'w_flow',
1277
- 'w_choices',
1278
- 'w_choices_checked',
1279
- 'w_rowcol',
1280
- 'w_required',
1281
- 'w_randomize',
1282
- 'w_allow_other',
1283
- 'w_allow_other_num',
1284
- 'w_class',
1285
- );
1286
- $temp = $params;
1287
- if ( strpos($temp, 'w_field_option_pos') > -1 ) {
1288
- $params_names = array(
1289
- 'w_field_label_size',
1290
- 'w_field_label_pos',
1291
- 'w_field_option_pos',
1292
- 'w_flow',
1293
- 'w_choices',
1294
- 'w_choices_checked',
1295
- 'w_rowcol',
1296
- 'w_required',
1297
- 'w_randomize',
1298
- 'w_allow_other',
1299
- 'w_allow_other_num',
1300
- 'w_value_disabled',
1301
- 'w_choices_value',
1302
- 'w_choices_params',
1303
- 'w_class',
1304
- );
1305
- }
1306
- if ( strpos($temp, 'w_hide_label') > -1 ) {
1307
- $params_names = array(
1308
- 'w_field_label_size',
1309
- 'w_field_label_pos',
1310
- 'w_field_option_pos',
1311
- 'w_hide_label',
1312
- 'w_flow',
1313
- 'w_choices',
1314
- 'w_choices_checked',
1315
- 'w_rowcol',
1316
- 'w_required',
1317
- 'w_randomize',
1318
- 'w_allow_other',
1319
- 'w_allow_other_num',
1320
- 'w_value_disabled',
1321
- 'w_choices_value',
1322
- 'w_choices_params',
1323
- 'w_class',
1324
- );
1325
- }
1326
- foreach ( $params_names as $params_name ) {
1327
- $temp = explode('*:*' . $params_name . '*:*', $temp);
1328
- $param[$params_name] = $temp[0];
1329
- $temp = $temp[1];
1330
- }
1331
- if ( $temp ) {
1332
- $temp = explode('*:*w_attr_name*:*', $temp);
1333
- $attrs = array_slice($temp, 0, count($temp) - 1);
1334
- foreach ( $attrs as $attr ) {
1335
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1336
- }
1337
- }
1338
- if ( !isset($param['w_value_disabled']) ) {
1339
- $param['w_value_disabled'] = 'no';
1340
- }
1341
- if ( !isset($param['w_field_option_pos']) ) {
1342
- $param['w_field_option_pos'] = 'left';
1343
- }
1344
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1345
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1346
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1347
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1348
- $param['w_choices'] = explode('***', $param['w_choices']);
1349
- $param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
1350
- if ( isset($param['w_choices_value']) ) {
1351
- $param['w_choices_value'] = explode('***', $param['w_choices_value']);
1352
- $param['w_choices_params'] = explode('***', $param['w_choices_params']);
1353
- }
1354
- foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
1355
- if ( $choices_checked == 'true' ) {
1356
- $param['w_choices_checked'][$key] = 'checked="checked"';
1357
- }
1358
- else {
1359
- $param['w_choices_checked'][$key] = '';
1360
- }
1361
- }
1362
- $rep = '<div id="wdform_field' . $id . '" type="type_radio" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_radio" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_randomize'] . '" name="' . $id . '_randomizeform_id_temp" id="' . $id . '_randomizeform_id_temp"><input type="hidden" value="' . $param['w_allow_other'] . '" name="' . $id . '_allow_otherform_id_temp" id="' . $id . '_allow_otherform_id_temp"><input type="hidden" value="' . $param['w_allow_other_num'] . '" name="' . $id . '_allow_other_numform_id_temp" id="' . $id . '_allow_other_numform_id_temp"><input type="hidden" value="' . $param['w_rowcol'] . '" name="' . $id . '_rowcol_numform_id_temp" id="' . $id . '_rowcol_numform_id_temp"><input type="hidden" value="' . $param['w_field_option_pos'] . '" id="' . $id . '_option_left_right"><input type="hidden" value="' . $param['w_value_disabled'] . '" name="' . $id . '_value_disabledform_id_temp" id="' . $id . '_value_disabledform_id_temp"><div style="display: table;"><div id="' . $id . '_table_little" style="display: table-row-group;" ' . ($param['w_flow'] == 'hor' ? 'for_hor="' . $id . '_hor"' : '') . '>';
1363
- if ( $param['w_flow'] == 'hor' ) {
1364
- $j = 0;
1365
- for ( $i = 0; $i < (int) $param['w_rowcol']; $i++ ) {
1366
- $rep .= '<div id="' . $id . '_element_tr' . $i . '" style="display: table-row;">';
1367
- for ( $l = 0; $l <= (int) (count($param['w_choices']) / $param['w_rowcol']); $l++ ) {
1368
- if ( $j >= count($param['w_choices']) % $param['w_rowcol'] && $l == (int) (count($param['w_choices']) / $param['w_rowcol']) ) {
1369
- continue;
1370
- }
1371
- if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $l + $i ) {
1372
- $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $l + $i) . '" idi="' . ((int) $param['w_rowcol'] * $l + $i) . '" style="display: table-cell;"><input type="radio" value="' . $param['w_choices'][(int) $param['w_rowcol'] * $l + $i] . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" name="' . $id . '_elementform_id_temp" other="1" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $l + $i) . '&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $l + $i] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $l + $i) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $l + $i] . '</label></div>';
1373
- }
1374
- else {
1375
- $where = '';
1376
- $order_by = '';
1377
- $db_info = '';
1378
- if ( isset($param['w_choices_value']) ) {
1379
- $choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $l + $i];
1380
- }
1381
- else {
1382
- $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $l + $i];
1383
- }
1384
- $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1385
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i] ) {
1386
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i]);
1387
- $where = 'where="' . $w_choices_params[0] . '"';
1388
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1389
- $order_by = "order_by='" . $w_choices_params[0] . "'";
1390
- $db_info = "db_info='" . $w_choices_params[1] . "'";
1391
- }
1392
- $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $l + $i) . '" idi="' . ((int) $param['w_rowcol'] * $l + $i) . '" style="display: table-cell;"><input type="radio" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" name="' . $id . '_elementform_id_temp" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $l + $i) . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $l + $i] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $l + $i) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $l + $i] . '</label></div>';
1393
- }
1394
- }
1395
- $j++;
1396
- $rep .= '</div>';
1397
- }
1398
- }
1399
- else {
1400
- for ( $i = 0; $i < (int) (count($param['w_choices']) / $param['w_rowcol']); $i++ ) {
1401
- $rep .= '<div id="' . $id . '_element_tr' . $i . '" style="display: table-row;">';
1402
- if ( count($param['w_choices']) > (int) $param['w_rowcol'] ) {
1403
- for ( $l = 0; $l < $param['w_rowcol']; $l++ ) {
1404
- if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
1405
- $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="radio" value="' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp" other="1" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1406
- }
1407
- else {
1408
- $where = '';
1409
- $order_by = '';
1410
- $db_info = '';
1411
- if ( isset($param['w_choices_value']) ) {
1412
- $choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $i + $l];
1413
- }
1414
- else {
1415
- $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1416
- }
1417
- $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1418
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1419
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1420
- $where = 'where="' . $w_choices_params[0] . '"';
1421
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1422
- $order_by = "order_by='" . $w_choices_params[0] . "'";
1423
- $db_info = "db_info='" . $w_choices_params[1] . "'";
1424
- }
1425
- $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="radio" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1426
- }
1427
- }
1428
- }
1429
- else {
1430
- for ( $l = 0; $l < count($param['w_choices']); $l++ ) {
1431
- if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
1432
- $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="radio" value="' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp" other="1" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1433
- }
1434
- else {
1435
- $where = '';
1436
- $order_by = '';
1437
- $db_info = '';
1438
- if ( isset($param['w_choices_value']) ) {
1439
- $choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $i + $l];
1440
- }
1441
- else {
1442
- $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1443
- }
1444
- $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1445
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1446
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1447
- $where = 'where="' . $w_choices_params[0] . '"';
1448
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1449
- $order_by = "order_by='" . $w_choices_params[0] . "'";
1450
- $db_info = "db_info='" . $w_choices_params[1] . "'";
1451
- }
1452
- $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="radio" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1453
- }
1454
- }
1455
- }
1456
- $rep .= '</div>';
1457
- }
1458
- if ( count($param['w_choices']) % $param['w_rowcol'] != 0 ) {
1459
- $rep .= '<div id="' . $id . '_element_tr' . ((int) (count($param['w_choices']) / (int) $param['w_rowcol'])) . '" style="display: table-row;">';
1460
- for ( $k = 0; $k < count($param['w_choices']) % $param['w_rowcol']; $k++ ) {
1461
- $l = count($param['w_choices']) - count($param['w_choices']) % $param['w_rowcol'] + $k;
1462
- if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == $l ) {
1463
- $rep .= '<div valign="top" id="' . $id . '_td_little' . $l . '" idi="' . $l . '" style="display: table-cell;"><input type="radio" value="' . $param['w_choices'][$l] . '" id="' . $id . '_elementform_id_temp' . $l . '" name="' . $id . '_elementform_id_temp" other="1" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . $l . '&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][$l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $l . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $l . '">' . $param['w_choices'][$l] . '</label></div>';
1464
- }
1465
- else {
1466
- $where = '';
1467
- $order_by = '';
1468
- $db_info = '';
1469
- if ( isset($param['w_choices_value']) ) {
1470
- $choise_value = $param['w_choices_value'][$l];
1471
- }
1472
- else {
1473
- $choise_value = $param['w_choices'][$l];
1474
- }
1475
- $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1476
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][$l] ) {
1477
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$l]);
1478
- $where = 'where="' . $w_choices_params[0] . '"';
1479
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1480
- $order_by = "order_by='" . $w_choices_params[0] . "'";
1481
- $db_info = "db_info='" . $w_choices_params[1] . "'";
1482
- }
1483
- $rep .= '<div valign="top" id="' . $id . '_td_little' . $l . '" idi="' . $l . '" style="display: table-cell;"><input type="radio" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . $l . '" name="' . $id . '_elementform_id_temp" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . $l . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][$l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $l . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $l . '"
1484
- ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][$l] . '</label></div>';
1485
- }
1486
- }
1487
- $rep .= '</div>';
1488
- }
1489
- }
1490
- $rep .= '</div></div></div></div>';
1491
- break;
1492
- }
1493
- case 'type_own_select': {
1494
- $params_names = array(
1495
- 'w_field_label_size',
1496
- 'w_field_label_pos',
1497
- 'w_size',
1498
- 'w_choices',
1499
- 'w_choices_checked',
1500
- 'w_choices_disabled',
1501
- 'w_required',
1502
- 'w_class',
1503
- );
1504
- $temp = $params;
1505
- if ( strpos($temp, 'w_choices_value') > -1 ) {
1506
- $params_names = array(
1507
- 'w_field_label_size',
1508
- 'w_field_label_pos',
1509
- 'w_size',
1510
- 'w_choices',
1511
- 'w_choices_checked',
1512
- 'w_choices_disabled',
1513
- 'w_required',
1514
- 'w_value_disabled',
1515
- 'w_choices_value',
1516
- 'w_choices_params',
1517
- 'w_class',
1518
- );
1519
- }
1520
- if ( strpos($temp, 'w_hide_label') > -1 ) {
1521
- $params_names = array(
1522
- 'w_field_label_size',
1523
- 'w_field_label_pos',
1524
- 'w_hide_label',
1525
- 'w_size',
1526
- 'w_choices',
1527
- 'w_choices_checked',
1528
- 'w_choices_disabled',
1529
- 'w_required',
1530
- 'w_value_disabled',
1531
- 'w_choices_value',
1532
- 'w_choices_params',
1533
- 'w_class',
1534
- );
1535
- }
1536
- foreach ( $params_names as $params_name ) {
1537
- $temp = explode('*:*' . $params_name . '*:*', $temp);
1538
- $param[$params_name] = $temp[0];
1539
- $temp = $temp[1];
1540
- }
1541
- if ( $temp ) {
1542
- $temp = explode('*:*w_attr_name*:*', $temp);
1543
- $attrs = array_slice($temp, 0, count($temp) - 1);
1544
- foreach ( $attrs as $attr ) {
1545
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1546
- }
1547
- }
1548
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1549
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1550
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1551
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1552
- $param['w_choices'] = explode('***', $param['w_choices']);
1553
- $param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
1554
- $param['w_choices_disabled'] = explode('***', $param['w_choices_disabled']);
1555
- if ( isset($param['w_choices_value']) ) {
1556
- $param['w_choices_value'] = explode('***', $param['w_choices_value']);
1557
- $param['w_choices_params'] = explode('***', $param['w_choices_params']);
1558
- }
1559
- if ( !isset($param['w_value_disabled']) ) {
1560
- $param['w_value_disabled'] = 'no';
1561
- }
1562
- foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
1563
- if ( $choices_checked == 'true' ) {
1564
- $param['w_choices_checked'][$key] = 'selected="selected"';
1565
- }
1566
- else {
1567
- $param['w_choices_checked'][$key] = '';
1568
- }
1569
- }
1570
- $rep = '<div id="wdform_field' . $id . '" type="type_own_select" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; "><input type="hidden" value="type_own_select" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_value_disabled'] . '" name="' . $id . '_value_disabledform_id_temp" id="' . $id . '_value_disabledform_id_temp"><select id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" onchange="set_select(this)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled>';
1571
- foreach ( $param['w_choices'] as $key => $choice ) {
1572
- $where = '';
1573
- $order_by = '';
1574
- $db_info = '';
1575
- $choice_value = $param['w_choices_disabled'][$key] == 'true' ? '' : (isset($param['w_choices_value']) ? $param['w_choices_value'][$key] : $choice);
1576
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
1577
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
1578
- $where = 'where="' . $w_choices_params[0] . '"';
1579
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1580
- $order_by = "order_by='" . $w_choices_params[0] . "'";
1581
- $db_info = "db_info='" . $w_choices_params[1] . "'";
1582
- }
1583
- $rep .= '<option id="' . $id . '_option' . $key . '" value="' . $choice_value . '" onselect="set_select(&quot;' . $id . '_option' . $key . '&quot;)" ' . $param['w_choices_checked'][$key] . ' ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</option>';
1584
- }
1585
- $rep .= '</select></div></div>';
1586
- break;
1587
- }
1588
- case 'type_country': {
1589
- $params_names = array(
1590
- 'w_field_label_size',
1591
- 'w_field_label_pos',
1592
- 'w_size',
1593
- 'w_countries',
1594
- 'w_required',
1595
- 'w_class',
1596
- );
1597
- $temp = $params;
1598
- if ( strpos($temp, 'w_hide_label') > -1 ) {
1599
- $params_names = array(
1600
- 'w_field_label_size',
1601
- 'w_field_label_pos',
1602
- 'w_hide_label',
1603
- 'w_size',
1604
- 'w_countries',
1605
- 'w_required',
1606
- 'w_class',
1607
- );
1608
- }
1609
- foreach ( $params_names as $params_name ) {
1610
- $temp = explode('*:*' . $params_name . '*:*', $temp);
1611
- $param[$params_name] = $temp[0];
1612
- $temp = $temp[1];
1613
- }
1614
- if ( $temp ) {
1615
- $temp = explode('*:*w_attr_name*:*', $temp);
1616
- $attrs = array_slice($temp, 0, count($temp) - 1);
1617
- foreach ( $attrs as $attr ) {
1618
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1619
- }
1620
- }
1621
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1622
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1623
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1624
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1625
- $param['w_countries'] = explode('***', $param['w_countries']);
1626
- $rep = '<div id="wdform_field' . $id . '" type="type_country" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; "><input type="hidden" value="type_country" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><select id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled>';
1627
- foreach ( $param['w_countries'] as $key => $choice ) {
1628
- $choice_value = $choice;
1629
- $rep .= '<option value="' . $choice_value . '">' . $choice . '</option>';
1630
- }
1631
- $rep .= '</select></div></div>';
1632
- break;
1633
- }
1634
- case 'type_time': {
1635
- $params_names = array(
1636
- 'w_field_label_size',
1637
- 'w_field_label_pos',
1638
- 'w_time_type',
1639
- 'w_am_pm',
1640
- 'w_sec',
1641
- 'w_hh',
1642
- 'w_mm',
1643
- 'w_ss',
1644
- 'w_mini_labels',
1645
- 'w_required',
1646
- 'w_class',
1647
- );
1648
- $temp = $params;
1649
- if ( strpos($temp, 'w_hide_label') > -1 ) {
1650
- $params_names = array(
1651
- 'w_field_label_size',
1652
- 'w_field_label_pos',
1653
- 'w_hide_label',
1654
- 'w_time_type',
1655
- 'w_am_pm',
1656
- 'w_sec',
1657
- 'w_hh',
1658
- 'w_mm',
1659
- 'w_ss',
1660
- 'w_mini_labels',
1661
- 'w_required',
1662
- 'w_class',
1663
- );
1664
- }
1665
- foreach ( $params_names as $params_name ) {
1666
- $temp = explode('*:*' . $params_name . '*:*', $temp);
1667
- $param[$params_name] = $temp[0];
1668
- $temp = $temp[1];
1669
- }
1670
- if ( $temp ) {
1671
- $temp = explode('*:*w_attr_name*:*', $temp);
1672
- $attrs = array_slice($temp, 0, count($temp) - 1);
1673
- foreach ( $attrs as $attr ) {
1674
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1675
- }
1676
- }
1677
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1678
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1679
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1680
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1681
- $w_mini_labels = explode('***', $param['w_mini_labels']);
1682
- if ( $param['w_sec'] == '1' ) {
1683
- $w_sec = '<div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;:&nbsp;</span></div><div id="' . $id . '_td_time_input3" style="width: 32px; display: table-cell;"><input type="text" value="' . $param['w_ss'] . '" class="time_box" id="' . $id . '_ssform_id_temp" name="' . $id . '_ssform_id_temp" onblur="add_0(&quot;' . $id . '_ssform_id_temp&quot;)" ' . $param['attributes'] . ' disabled /></div>';
1684
- $w_sec_label = '<div style="display: table-cell;"></div><div id="' . $id . '_td_time_label3" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_ss">' . $w_mini_labels[2] . '</label></div>';
1685
- }
1686
- else {
1687
- $w_sec = '';
1688
- $w_sec_label = '';
1689
- }
1690
- if ( $param['w_time_type'] == '12' ) {
1691
- if ( $param['w_am_pm'] == 'am' ) {
1692
- $am_ = "selected=\"selected\"";
1693
- $pm_ = "";
1694
- }
1695
- else {
1696
- $am_ = "";
1697
- $pm_ = "selected=\"selected\"";
1698
- }
1699
- $w_time_type = '<div id="' . $id . '_am_pm_select" class="td_am_pm_select" style="display: table-cell;"><select class="am_pm_select" name="' . $id . '_am_pmform_id_temp" id="' . $id . '_am_pmform_id_temp" onchange="set_sel_am_pm(this)" ' . $param['attributes'] . '><option value="am" ' . $am_ . '>AM</option><option value="pm" ' . $pm_ . '>PM</option></select></div>';
1700
- $w_time_type_label = '<div id="' . $id . '_am_pm_label" class="td_am_pm_select" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_am_pm">' . $w_mini_labels[3] . '</label></div>';
1701
- }
1702
- else {
1703
- $w_time_type = '';
1704
- $w_time_type_label = '';
1705
- }
1706
- $rep = '<div id="wdform_field' . $id . '" type="type_time" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_time" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><div id="' . $id . '_table_time" style="display: table;"><div id="' . $id . '_tr_time1" style="display: table-row;"><div id="' . $id . '_td_time_input1" style="width: 32px; display: table-cell;"><input type="text" value="' . $param['w_hh'] . '" class="time_box" id="' . $id . '_hhform_id_temp" name="' . $id . '_hhform_id_temp" onblur="add_0(&quot;' . $id . '_hhform_id_temp&quot;)" ' . $param['attributes'] . ' disabled/></div><div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;:&nbsp;</span></div><div id="' . $id . '_td_time_input2" style="width: 32px; display: table-cell;"><input type="text" value="' . $param['w_mm'] . '" class="time_box" id="' . $id . '_mmform_id_temp" name="' . $id . '_mmform_id_temp" onblur="add_0(&quot;' . $id . '_mmform_id_temp&quot;)" ' . $param['attributes'] . ' disabled/></div>' . $w_sec . $w_time_type . '</div><div id="' . $id . '_tr_time2" style="display: table-row;"><div id="' . $id . '_td_time_label1" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_hh">' . $w_mini_labels[0] . '</label></div><div style="display: table-cell;"></div><div id="' . $id . '_td_time_label2" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_mm">' . $w_mini_labels[1] . '</label></div>' . $w_sec_label . $w_time_type_label . '</div></div></div></div>';
1707
- break;
1708
- }
1709
- case 'type_date': {
1710
- $params_names = array(
1711
- 'w_field_label_size',
1712
- 'w_field_label_pos',
1713
- 'w_date',
1714
- 'w_required',
1715
- 'w_class',
1716
- 'w_format',
1717
- 'w_but_val',
1718
- );
1719
- $temp = $params;
1720
- if ( strpos($temp, 'w_disable_past_days') > -1 ) {
1721
- $params_names = array(
1722
- 'w_field_label_size',
1723
- 'w_field_label_pos',
1724
- 'w_date',
1725
- 'w_required',
1726
- 'w_class',
1727
- 'w_format',
1728
- 'w_but_val',
1729
- 'w_disable_past_days',
1730
- );
1731
- }
1732
- foreach ( $params_names as $params_name ) {
1733
- $temp = explode('*:*' . $params_name . '*:*', $temp);
1734
- $param[$params_name] = $temp[0];
1735
- $temp = $temp[1];
1736
- }
1737
- if ( $temp ) {
1738
- $temp = explode('*:*w_attr_name*:*', $temp);
1739
- $attrs = array_slice($temp, 0, count($temp) - 1);
1740
- foreach ( $attrs as $attr ) {
1741
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1742
- }
1743
- }
1744
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1745
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1746
- $param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
1747
- $disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
1748
- $rep = '<div id="wdform_field' . $id . '" type="type_date" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_date" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_disable_past_days'] . '" name="' . $id . '_dis_past_daysform_id_temp" id="' . $id . '_dis_past_daysform_id_temp"><input type="text" value="' . $param['w_date'] . '" class="wdform-date wd-datepicker" data-format="' . $param['w_format'] . '" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" maxlength="10" size="10" ' . $param['attributes'] . ' disabled/></div></div>';
1749
- break;
1750
- }
1751
- ///////////////////////// type_date_new ////////////////////////////
1752
- case 'type_date_new': {
1753
- $params_names = array(
1754
- 'w_field_label_size',
1755
- 'w_field_label_pos',
1756
- 'w_size',
1757
- 'w_date',
1758
- 'w_required',
1759
- 'w_show_image',
1760
- 'w_class',
1761
- 'w_format',
1762
- 'w_start_day',
1763
- 'w_default_date',
1764
- 'w_min_date',
1765
- 'w_max_date',
1766
- 'w_invalid_dates',
1767
- 'w_show_days',
1768
- 'w_hide_time',
1769
- 'w_but_val',
1770
- 'w_disable_past_days',
1771
- );
1772
- $temp = $params;
1773
- if ( strpos($temp, 'w_hide_label') > -1 ) {
1774
- $params_names = array(
1775
- 'w_field_label_size',
1776
- 'w_field_label_pos',
1777
- 'w_hide_label',
1778
- 'w_size',
1779
- 'w_date',
1780
- 'w_required',
1781
- 'w_show_image',
1782
- 'w_class',
1783
- 'w_format',
1784
- 'w_start_day',
1785
- 'w_default_date',
1786
- 'w_min_date',
1787
- 'w_max_date',
1788
- 'w_invalid_dates',
1789
- 'w_show_days',
1790
- 'w_hide_time',
1791
- 'w_but_val',
1792
- 'w_disable_past_days',
1793
- );
1794
- }
1795
- foreach ( $params_names as $params_name ) {
1796
- $temp = explode('*:*' . $params_name . '*:*', $temp);
1797
- $param[$params_name] = $temp[0];
1798
- $temp = $temp[1];
1799
- }
1800
- if ( $temp ) {
1801
- $temp = explode('*:*w_attr_name*:*', $temp);
1802
- $attrs = array_slice($temp, 0, count($temp) - 1);
1803
- foreach ( $attrs as $attr ) {
1804
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1805
- }
1806
- }
1807
- $w_show_week_days = explode('***', $param['w_show_days']);
1808
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1809
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1810
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1811
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1812
- $param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
1813
- $disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
1814
- $display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
1815
- $rep = '<div id="wdform_field' . $id . '" type="type_date_new" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_date_new" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp">
1816
- <input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp">
1817
-
1818
- <input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/>
1819
-
1820
- <input type="hidden" value="' . $param['w_show_image'] . '" name="' . $id . '_show_imageform_id_temp" id="' . $id . '_show_imageform_id_temp">
1821
-
1822
- <input type="hidden" value="' . $param['w_disable_past_days'] . '" name="' . $id . '_dis_past_daysform_id_temp" id="' . $id . '_dis_past_daysform_id_temp">
1823
-
1824
- <input type="hidden" value="' . $param['w_default_date'] . '" name="' . $id . '_default_date_id_temp" id="' . $id . '_default_date_id_temp">
1825
- <input type="hidden" value="' . $param['w_min_date'] . '" name="' . $id . '_min_date_id_temp" id="' . $id . '_min_date_id_temp">
1826
- <input type="hidden" value="' . $param['w_max_date'] . '" name="' . $id . '_max_date_id_temp" id="' . $id . '_max_date_id_temp">
1827
- <input type="hidden" value="' . $param['w_invalid_dates'] . '" name="' . $id . '_invalid_dates_id_temp" id="' . $id . '_invalid_dates_id_temp">
1828
-
1829
- <input type="hidden" value="' . $param['w_start_day'] . '" name="' . $id . '_start_dayform_id_temp" id="' . $id . '_start_dayform_id_temp">
1830
-
1831
- <input type="hidden" value="' . $param['w_hide_time'] . '" name="' . $id . '_hide_timeform_id_temp" id="' . $id . '_hide_timeform_id_temp">
1832
-
1833
- <input type="hidden" name="' . $id . '_show_week_days" id="' . $id . '_show_week_days" sunday="' . $w_show_week_days[0] . '" monday="' . $w_show_week_days[1] . '" tuesday="' . $w_show_week_days[2] . '" wednesday="' . $w_show_week_days[3] . '" thursday="' . $w_show_week_days[4] . '" friday="' . $w_show_week_days[5] . '" saturday="' . $w_show_week_days[6] . '" />
1834
- <input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled />
1835
- <span id="' . $id . '_show_imagedateform_id_temp" class="dashicons dashicons-calendar-alt wd-calendar-button ' . ($param['w_show_image'] == "yes" ? "wd-inline-block" : "wd-hidden") . '"></span>
1836
- <input id="' . $id . '_buttonform_id_temp" type="hidden" value="' . $param['w_but_val'] . '" format="' . $param['w_format'] . '" ></div></div>';
1837
- break;
1838
- }
1839
- case 'type_date_range': {
1840
- $params_names = array(
1841
- 'w_field_label_size',
1842
- 'w_field_label_pos',
1843
- 'w_size',
1844
- 'w_date',
1845
- 'w_required',
1846
- 'w_show_image',
1847
- 'w_class',
1848
- 'w_format',
1849
- 'w_start_day',
1850
- 'w_default_date_start',
1851
- 'w_default_date_end',
1852
- 'w_min_date',
1853
- 'w_max_date',
1854
- 'w_invalid_dates',
1855
- 'w_show_days',
1856
- 'w_hide_time',
1857
- 'w_but_val',
1858
- 'w_disable_past_days',
1859
- );
1860
- $temp = $params;
1861
- if ( strpos($temp, 'w_hide_label') > -1 ) {
1862
- $params_names = array(
1863
- 'w_field_label_size',
1864
- 'w_field_label_pos',
1865
- 'w_hide_label',
1866
- 'w_size',
1867
- 'w_date',
1868
- 'w_required',
1869
- 'w_show_image',
1870
- 'w_class',
1871
- 'w_format',
1872
- 'w_start_day',
1873
- 'w_default_date_start',
1874
- 'w_default_date_end',
1875
- 'w_min_date',
1876
- 'w_max_date',
1877
- 'w_invalid_dates',
1878
- 'w_show_days',
1879
- 'w_hide_time',
1880
- 'w_but_val',
1881
- 'w_disable_past_days',
1882
- );
1883
- }
1884
- foreach ( $params_names as $params_name ) {
1885
- $temp = explode('*:*' . $params_name . '*:*', $temp);
1886
- $param[$params_name] = $temp[0];
1887
- $temp = $temp[1];
1888
- }
1889
- if ( $temp ) {
1890
- $temp = explode('*:*w_attr_name*:*', $temp);
1891
- $attrs = array_slice($temp, 0, count($temp) - 1);
1892
- foreach ( $attrs as $attr ) {
1893
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1894
- }
1895
- }
1896
- $w_show_week_days = explode('***', $param['w_show_days']);
1897
- $defaul_day_array = explode(',', $param['w_date']);
1898
- $defaul_day_start = $defaul_day_array[0];
1899
- $defaul_day_end = $defaul_day_array[1];
1900
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1901
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1902
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1903
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1904
- $param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
1905
- $disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
1906
- $display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
1907
- $rep = '<div id="wdform_field' . $id . '" type="type_date_range" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';">
1908
-
1909
- <input type="hidden" value="type_date_range" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp">
1910
-
1911
- <input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp">
1912
-
1913
- <input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/>
1914
-
1915
- <input type="hidden" value="' . $param['w_show_image'] . '" name="' . $id . '_show_imageform_id_temp" id="' . $id . '_show_imageform_id_temp">
1916
-
1917
- <input type="hidden" value="' . $param['w_disable_past_days'] . '" name="' . $id . '_dis_past_daysform_id_temp" id="' . $id . '_dis_past_daysform_id_temp">
1918
-
1919
- <input type="hidden" value="' . $param['w_default_date_start'] . '" name="' . $id . '_default_date_id_temp_start" id="' . $id . '_default_date_id_temp_start">
1920
-
1921
- <input type="hidden" value="' . $param['w_default_date_end'] . '" name="' . $id . '_default_date_id_temp_end" id="' . $id . '_default_date_id_temp_end">
1922
-
1923
- <input type="hidden" value="' . $param['w_min_date'] . '" name="' . $id . '_min_date_id_temp" id="' . $id . '_min_date_id_temp">
1924
-
1925
- <input type="hidden" value="' . $param['w_max_date'] . '" name="' . $id . '_max_date_id_temp" id="' . $id . '_max_date_id_temp">
1926
-
1927
- <input type="hidden" value="' . $param['w_invalid_dates'] . '" name="' . $id . '_invalid_dates_id_temp" id="' . $id . '_invalid_dates_id_temp">
1928
-
1929
- <input type="hidden" value="' . $param['w_start_day'] . '" name="' . $id . '_start_dayform_id_temp" id="' . $id . '_start_dayform_id_temp">
1930
-
1931
- <input type="hidden" value="' . $param['w_hide_time'] . '" name="' . $id . '_hide_timeform_id_temp" id="' . $id . '_hide_timeform_id_temp">
1932
-
1933
- <input type="hidden" name="' . $id . '_show_week_days" id="' . $id . '_show_week_days" sunday="' . $w_show_week_days[0] . '" monday="' . $w_show_week_days[1] . '" tuesday="' . $w_show_week_days[2] . '" wednesday="' . $w_show_week_days[3] . '" thursday="' . $w_show_week_days[4] . '" friday="' . $w_show_week_days[5] . '" saturday="' . $w_show_week_days[6] . '">
1934
-
1935
-
1936
-
1937
-
1938
-
1939
- <input type="text" id="' . $id . '_elementform_id_temp0" name="' . $id . '_elementform_id_temp0" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled />
1940
- <span id="' . $id . '_show_imagedateform_id_temp0" class="dashicons dashicons-calendar-alt wd-calendar-button ' . ($param['w_show_image'] == "yes" ? "wd-inline-block" : "wd-hidden") . '"></span>
1941
- <span>-</span>
1942
- <input type="text" id="' . $id . '_elementform_id_temp1" name="' . $id . '_elementform_id_temp1" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled />
1943
- <span id="' . $id . '_show_imagedateform_id_temp1" class="dashicons dashicons-calendar-alt wd-calendar-button ' . ($param['w_show_image'] == "yes" ? "wd-inline-block" : "wd-hidden") . '"></span>
1944
- <input id="' . $id . '_buttonform_id_temp" type="hidden" value="' . $param['w_but_val'] . '" format="' . $param['w_format'] . '" />
1945
- </div></div>';
1946
- break;
1947
- }
1948
- case 'type_date_fields': {
1949
- $params_names = array(
1950
- 'w_field_label_size',
1951
- 'w_field_label_pos',
1952
- 'w_day',
1953
- 'w_month',
1954
- 'w_year',
1955
- 'w_day_type',
1956
- 'w_month_type',
1957
- 'w_year_type',
1958
- 'w_day_label',
1959
- 'w_month_label',
1960
- 'w_year_label',
1961
- 'w_day_size',
1962
- 'w_month_size',
1963
- 'w_year_size',
1964
- 'w_required',
1965
- 'w_class',
1966
- 'w_from',
1967
- 'w_to',
1968
- 'w_divider',
1969
- );
1970
- $temp = $params;
1971
- if ( strpos($temp, 'w_hide_label') > -1 ) {
1972
- $params_names = array(
1973
- 'w_field_label_size',
1974
- 'w_field_label_pos',
1975
- 'w_hide_label',
1976
- 'w_day',
1977
- 'w_month',
1978
- 'w_year',
1979
- 'w_day_type',
1980
- 'w_month_type',
1981
- 'w_year_type',
1982
- 'w_day_label',
1983
- 'w_month_label',
1984
- 'w_year_label',
1985
- 'w_day_size',
1986
- 'w_month_size',
1987
- 'w_year_size',
1988
- 'w_required',
1989
- 'w_class',
1990
- 'w_from',
1991
- 'w_to',
1992
- 'w_divider',
1993
- );
1994
- }
1995
- foreach ( $params_names as $params_name ) {
1996
- $temp = explode('*:*' . $params_name . '*:*', $temp);
1997
- $param[$params_name] = $temp[0];
1998
- $temp = $temp[1];
1999
- }
2000
- if ( $temp ) {
2001
- $temp = explode('*:*w_attr_name*:*', $temp);
2002
- $attrs = array_slice($temp, 0, count($temp) - 1);
2003
- foreach ( $attrs as $attr ) {
2004
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2005
- }
2006
- }
2007
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2008
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2009
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2010
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
2011
- if ( $param['w_day_type'] == "SELECT" ) {
2012
- $w_day_type = '<select id="' . $id . '_dayform_id_temp" name="' . $id . '_dayform_id_temp" onchange="set_select(this)" style="width: ' . $param['w_day_size'] . 'px;" ' . $param['attributes'] . ' disabled><option value=""></option>';
2013
- for ( $k = 0; $k <= 31; $k++ ) {
2014
- if ( $k < 10 ) {
2015
- if ( $param['w_day'] == '0' . $k ) {
2016
- $selected = "selected=\"selected\"";
2017
- }
2018
- else {
2019
- $selected = "";
2020
- }
2021
- $w_day_type .= '<option value="0' . $k . '" ' . $selected . '>0' . $k . '</option>';
2022
- }
2023
- else {
2024
- if ( $param['w_day'] == '' . $k ) {
2025
- $selected = "selected=\"selected\"";
2026
- }
2027
- else {
2028
- $selected = "";
2029
- }
2030
- $w_day_type .= '<option value="' . $k . '" ' . $selected . '>' . $k . '</option>';
2031
- }
2032
- }
2033
- $w_day_type .= '</select>';
2034
- }
2035
- else {
2036
- $w_day_type = '<input type="text" value="' . $param['w_day'] . '" id="' . $id . '_dayform_id_temp" name="' . $id . '_dayform_id_temp" onblur="if (this.value==&quot;0&quot;) this.value=&quot;&quot;; else add_0(&quot;' . $id . '_dayform_id_temp&quot;)" style="width: ' . $param['w_day_size'] . 'px;" ' . $param['attributes'] . ' disabled/>';
2037
- }
2038
- if ( $param['w_month_type'] == "SELECT" ) {
2039
- $w_month_type = '<select id="' . $id . '_monthform_id_temp" name="' . $id . '_monthform_id_temp" onchange="set_select(this)" style="width: ' . $param['w_month_size'] . 'px;" ' . $param['attributes'] . ' disabled><option value=""></option><option value="01" ' . ($param['w_month'] == "01" ? "selected=\"selected\"" : "") . ' ><!--repstart-->January<!--repend--></option><option value="02" ' . ($param['w_month'] == "02" ? "selected=\"selected\"" : "") . '><!--repstart-->February<!--repend--></option><option value="03" ' . ($param['w_month'] == "03" ? "selected=\"selected\"" : "") . '><!--repstart-->March<!--repend--></option><option value="04" ' . ($param['w_month'] == "04" ? "selected=\"selected\"" : "") . ' ><!--repstart-->April<!--repend--></option><option value="05" ' . ($param['w_month'] == "05" ? "selected=\"selected\"" : "") . ' ><!--repstart-->May<!--repend--></option><option value="06" ' . ($param['w_month'] == "06" ? "selected=\"selected\"" : "") . ' ><!--repstart-->June<!--repend--></option><option value="07" ' . ($param['w_month'] == "07" ? "selected=\"selected\"" : "") . ' ><!--repstart-->July<!--repend--></option><option value="08" ' . ($param['w_month'] == "08" ? "selected=\"selected\"" : "") . ' ><!--repstart-->August<!--repend--></option><option value="09" ' . ($param['w_month'] == "09" ? "selected=\"selected\"" : "") . ' ><!--repstart-->September<!--repend--></option><option value="10" ' . ($param['w_month'] == "10" ? "selected=\"selected\"" : "") . ' ><!--repstart-->October<!--repend--></option><option value="11" ' . ($param['w_month'] == "11" ? "selected=\"selected\"" : "") . '><!--repstart-->November<!--repend--></option><option value="12" ' . ($param['w_month'] == "12" ? "selected=\"selected\"" : "") . ' ><!--repstart-->December<!--repend--></option></select>';
2040
- }
2041
- else {
2042
- $w_month_type = '<input type="text" value="' . $param['w_month'] . '" id="' . $id . '_monthform_id_temp" name="' . $id . '_monthform_id_temp" onblur="if (this.value==&quot;0&quot;) this.value=&quot;&quot;; else add_0(&quot;' . $id . '_monthform_id_temp&quot;)" style="width: ' . $param['w_month_size'] . 'px;" ' . $param['attributes'] . ' disabled/>';
2043
- }
2044
- $param['w_to'] = isset($param['w_to']) && $param['w_to'] != "NaN" ? $param['w_to'] : date("Y");
2045
- if ( $param['w_year_type'] == "SELECT" ) {
2046
- $w_year_type = '<select id="' . $id . '_yearform_id_temp" name="' . $id . '_yearform_id_temp" onchange="set_select(this)" from="' . $param['w_from'] . '" to="' . $param['w_to'] . '" style="width: ' . $param['w_year_size'] . 'px;" ' . $param['attributes'] . ' disabled><option value=""></option>';
2047
- for ( $k = $param['w_to']; $k >= $param['w_from']; $k-- ) {
2048
- if ( $param['w_year'] == $k ) {
2049
- $selected = "selected=\"selected\"";
2050
- }
2051
- else {
2052
- $selected = "";
2053
- }
2054
- $w_year_type .= '<option value="' . $k . '" ' . $selected . '>' . $k . '</option>';
2055
- }
2056
- $w_year_type .= '</select>';
2057
- }
2058
- else {
2059
- $w_year_type = '<input type="text" value="' . $param['w_year'] . '" id="' . $id . '_yearform_id_temp" name="' . $id . '_yearform_id_temp" from="' . $param['w_from'] . '" to="' . $param['w_to'] . '" style="width: ' . $param['w_year_size'] . 'px;" ' . $param['attributes'] . ' disabled/>';
2060
- }
2061
- $rep = '<div id="wdform_field' . $id . '" type="type_date_fields" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_date_fields" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><div id="' . $id . '_table_date" style="display: table;"><div id="' . $id . '_tr_date1" style="display: table-row;"><div id="' . $id . '_td_date_input1" style="display: table-cell;">
2062
- ' . $w_day_type . '
2063
-
2064
- </div><div id="' . $id . '_td_date_separator1" style="display: table-cell;"><span id="' . $id . '_separator1" class="wdform_separator">' . $param['w_divider'] . '</span></div><div id="' . $id . '_td_date_input2" style="display: table-cell;">' . $w_month_type . '</div><div id="' . $id . '_td_date_separator2" style="display: table-cell;"><span id="' . $id . '_separator2" class="wdform_separator">' . $param['w_divider'] . '</span></div><div id="' . $id . '_td_date_input3" style="display: table-cell;">' . $w_year_type . '</div></div><div id="' . $id . '_tr_date2" style="display: table-row;"><div id="' . $id . '_td_date_label1" style="display: table-cell;"><label class="mini_label" id="' . $id . '_day_label">' . $param['w_day_label'] . '</label></div><div style="display: table-cell;"></div><div id="' . $id . '_td_date_label2" style="display: table-cell;"><label class="mini_label" id="' . $id . '_month_label">' . $param['w_month_label'] . '</label></div><div style="display: table-cell;"></div><div id="' . $id . '_td_date_label3" style="display: table-cell;"><label class="mini_label" id="' . $id . '_year_label">' . $param['w_year_label'] . '</label></div></div></div></div></div>';
2065
- break;
2066
- }
2067
- case 'type_file_upload': {
2068
- $params_names = array(
2069
- 'w_field_label_size',
2070
- 'w_field_label_pos',
2071
- 'w_destination',
2072
- 'w_extension',
2073
- 'w_max_size',
2074
- 'w_required',
2075
- 'w_multiple',
2076
- 'w_class',
2077
- );
2078
- $temp = $params;
2079
- if ( strpos($temp, 'w_hide_label') > -1 ) {
2080
- $params_names = array(
2081
- 'w_field_label_size',
2082
- 'w_field_label_pos',
2083
- 'w_hide_label',
2084
- 'w_destination',
2085
- 'w_extension',
2086
- 'w_max_size',
2087
- 'w_required',
2088
- 'w_multiple',
2089
- 'w_class',
2090
- );
2091
- }
2092
- foreach ( $params_names as $params_name ) {
2093
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2094
- $param[$params_name] = $temp[0];
2095
- if ( isset($temp[1]) ) {
2096
- $temp = $temp[1];
2097
- }
2098
- else {
2099
- $temp = '';
2100
- }
2101
- }
2102
- if ( $temp ) {
2103
- $temp = explode('*:*w_attr_name*:*', $temp);
2104
- $attrs = array_slice($temp, 0, count($temp) - 1);
2105
- foreach ( $attrs as $attr ) {
2106
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2107
- }
2108
- }
2109
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2110
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2111
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2112
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
2113
- $multiple = ($param['w_multiple'] == "yes" ? "multiple='multiple'" : "");
2114
- $rep = '<div id="wdform_field' . $id . '" type="type_file_upload" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_file_upload" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="***max_sizeskizb' . $id . '***' . $param['w_max_size'] . '***max_sizeverj' . $id . '***" id="' . $id . '_max_size" name="' . $id . '_max_size"><input type="hidden" value="***destinationskizb' . $id . '***' . $param['w_destination'] . '***destinationverj' . $id . '***" id="' . $id . '_destination" name="' . $id . '_destination"><input type="hidden" value="***extensionskizb' . $id . '***' . $param['w_extension'] . '***extensionverj' . $id . '***" id="' . $id . '_extension" name="' . $id . '_extension"><input type="file" class="file_upload" id="' . $id . '_elementform_id_temp" name="' . $id . '_fileform_id_temp" ' . $multiple . ' ' . $param['attributes'] . ' disabled/></div></div>';
2115
- break;
2116
- }
2117
- case 'type_captcha': {
2118
- $params_names = array( 'w_field_label_size', 'w_field_label_pos', 'w_digit', 'w_class' );
2119
- $temp = $params;
2120
- if ( strpos($temp, 'w_hide_label') > -1 ) {
2121
- $params_names = array(
2122
- 'w_field_label_size',
2123
- 'w_field_label_pos',
2124
- 'w_hide_label',
2125
- 'w_digit',
2126
- 'w_class',
2127
- );
2128
- }
2129
- foreach ( $params_names as $params_name ) {
2130
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2131
- $param[$params_name] = $temp[0];
2132
- $temp = $temp[1];
2133
- }
2134
- if ( $temp ) {
2135
- $temp = explode('*:*w_attr_name*:*', $temp);
2136
- $attrs = array_slice($temp, 0, count($temp) - 1);
2137
- foreach ( $attrs as $attr ) {
2138
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2139
- }
2140
- }
2141
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2142
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2143
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2144
- $rep = '<div id="wdform_field' . $id . '" type="type_captcha" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display:' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_captcha" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div valign="middle" style="display: table-cell;"><img type="captcha" digit="' . $param['w_digit'] . '" src="' . add_query_arg(array(
2145
- 'action' => 'formmakerwdcaptcha' . WDFMInstance(self::PLUGIN)->plugin_postfix,
2146
- 'digit' => $param['w_digit'],
2147
- 'nonce' => $fm_nonce,
2148
- 'i' => 'form_id_temp',
2149
- ), admin_url('admin-ajax.php')) . '" id="_wd_captchaform_id_temp" class="captcha_img" onclick="captcha_refresh(&quot;_wd_captcha&quot;,&quot;form_id_temp&quot;)" ' . $param['attributes'] . '></div><div valign="middle" style="display: table-cell;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh(&quot;_wd_captcha&quot;,&quot;form_id_temp&quot;)" ' . $param['attributes'] . '></div></div></div><div style="display: table-row;"><div style="display: table-cell;"><input type="text" class="captcha_input" id="_wd_captcha_inputform_id_temp" name="captcha_input" style="width: ' . ($param['w_digit'] * 10 + 15) . 'px;" ' . $param['attributes'] . ' disabled/><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/></div></div></div></div></div>';
2150
- break;
2151
- }
2152
- case 'type_arithmetic_captcha': {
2153
- $params_names = array(
2154
- 'w_field_label_size',
2155
- 'w_field_label_pos',
2156
- 'w_count',
2157
- 'w_operations',
2158
- 'w_class',
2159
- 'w_input_size',
2160
- );
2161
- $temp = $params;
2162
- if ( strpos($temp, 'w_hide_label') > -1 ) {
2163
- $params_names = array(
2164
- 'w_field_label_size',
2165
- 'w_field_label_pos',
2166
- 'w_hide_label',
2167
- 'w_count',
2168
- 'w_operations',
2169
- 'w_class',
2170
- 'w_input_size',
2171
- );
2172
- }
2173
- foreach ( $params_names as $params_name ) {
2174
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2175
- $param[$params_name] = $temp[0];
2176
- $temp = $temp[1];
2177
- }
2178
- if ( $temp ) {
2179
- $temp = explode('*:*w_attr_name*:*', $temp);
2180
- $attrs = array_slice($temp, 0, count($temp) - 1);
2181
- foreach ( $attrs as $attr ) {
2182
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2183
- }
2184
- }
2185
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2186
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2187
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2188
- $param['w_count'] = $param['w_count'] ? $param['w_count'] : 1;
2189
- $param['w_operations'] = $param['w_operations'] ? $param['w_operations'] : '+, -, *, /';
2190
- $param['w_input_size'] = $param['w_input_size'] ? $param['w_input_size'] : 60;
2191
- $rep = '<div id="wdform_field' . $id . '" type="type_arithmetic_captcha" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display:' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_captcha" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell;"><img type="captcha" operations_count="' . $param['w_count'] . '" operations="' . $param['w_operations'] . '" input_size="' . $param['w_input_size'] . '" src="' . add_query_arg(array(
2192
- 'action' => 'formmakerwdmathcaptcha' . WDFMInstance(self::PLUGIN)->plugin_postfix,
2193
- 'operations_count' => $param['w_count'],
2194
- 'operations' => urlencode($param['w_operations']),
2195
- 'nonce' => $fm_nonce,
2196
- 'i' => 'form_id_temp',
2197
- ), admin_url('admin-ajax.php')) . '" id="_wd_arithmetic_captchaform_id_temp" class="arithmetic_captcha_img" onclick="captcha_refresh(&quot;_wd_arithmetic_captcha&quot;,&quot;form_id_temp&quot;)" ' . $param['attributes'] . '></div><div style="display: table-cell;"><input type="text" class="arithmetic_captcha_input" id="_wd_arithmetic_captcha_inputform_id_temp" name="arithmetic_captcha_input" onkeypress="return check_isnum(event)" style="width: ' . $param['w_input_size'] . 'px;" ' . $param['attributes'] . ' disabled/><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/></div><div style="display: table-cell; vertical-align: middle;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh(&quot;_wd_arithmetic_captcha&quot;,&quot;form_id_temp&quot;)" ' . $param['attributes'] . '></div></div></div></div></div></div>';
2198
- break;
2199
- }
2200
- case 'type_recaptcha': {
2201
- $params_names = array(
2202
- 'w_field_label_size',
2203
- 'w_field_label_pos',
2204
- 'w_public',
2205
- 'w_private',
2206
- 'w_theme',
2207
- 'w_class',
2208
- );
2209
- $temp = $params;
2210
- if ( strpos($temp, 'w_hide_label') > -1 ) {
2211
- $params_names = array(
2212
- 'w_field_label_size',
2213
- 'w_field_label_pos',
2214
- 'w_hide_label',
2215
- 'w_public',
2216
- 'w_private',
2217
- 'w_theme',
2218
- 'w_class',
2219
- );
2220
- }
2221
- if ( strpos($temp, 'w_type') > -1 ) {
2222
- $params_names = array(
2223
- 'w_field_label_size',
2224
- 'w_field_label_pos',
2225
- 'w_hide_label',
2226
- 'w_type',
2227
- 'w_position',
2228
- );
2229
- }
2230
- $param['w_type'] = 'v2';
2231
- $param['w_position'] = 'hidden';
2232
- foreach ( $params_names as $params_name ) {
2233
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2234
- $param[$params_name] = $temp[0];
2235
- $temp = $temp[1];
2236
- }
2237
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2238
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2239
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2240
- $rep = '<div id="wdform_field' . $id . '" type="type_recaptcha" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_recaptcha" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><div id="wd_recaptchaform_id_temp" w_type="' . $param['w_type'] . '" position="' . $param['w_position'] . '"><span style="color: red; font-style: italic;">' . __('No preview available for reCAPTCHA.', WDFMInstance(self::PLUGIN)->prefix) . '</span></div></div></div>';
2241
- break;
2242
- }
2243
- case 'type_hidden': {
2244
- $params_names = array( 'w_name', 'w_value' );
2245
- $temp = $params;
2246
- foreach ( $params_names as $params_name ) {
2247
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2248
- $param[$params_name] = $temp[0];
2249
- $temp = $temp[1];
2250
- }
2251
- if ( $temp ) {
2252
- $temp = explode('*:*w_attr_name*:*', $temp);
2253
- $attrs = array_slice($temp, 0, count($temp) - 1);
2254
- foreach ( $attrs as $attr ) {
2255
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2256
- }
2257
- }
2258
- $param['w_name'] = str_replace('&nbsp;', '', $param['w_name']);
2259
- $rep = '<div id="wdform_field' . $id . '" type="type_hidden" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" style="display: table-cell;"><span id="' . $id . '_element_labelform_id_temp" style="display: none;">' . $param['w_name'] . '</span><span style="color: red; font-size: 13px;">Hidden field</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" style="display: table-cell; padding-left:7px;"><input type="hidden" value="' . $param['w_value'] . '" id="' . $id . '_elementform_id_temp" name="' . $param['w_name'] . '" ' . $param['attributes'] . '><input type="hidden" value="type_hidden" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><div><span align="left">Name: </span><span align="left" id="' . $id . '_hidden_nameform_id_temp">' . $param['w_name'] . '</span></div><div><span align="left">Value: </span><span align="left" id="' . $id . '_hidden_valueform_id_temp">' . $param['w_value'] . '</span></div></div></div>';
2260
- break;
2261
- }
2262
- case 'type_mark_map': {
2263
- $params_names = array(
2264
- 'w_field_label_size',
2265
- 'w_field_label_pos',
2266
- 'w_center_x',
2267
- 'w_center_y',
2268
- 'w_long',
2269
- 'w_lat',
2270
- 'w_zoom',
2271
- 'w_width',
2272
- 'w_height',
2273
- 'w_info',
2274
- 'w_class',
2275
- );
2276
- $temp = $params;
2277
- if ( strpos($temp, 'w_hide_label') > -1 ) {
2278
- $params_names = array(
2279
- 'w_field_label_size',
2280
- 'w_field_label_pos',
2281
- 'w_hide_label',
2282
- 'w_center_x',
2283
- 'w_center_y',
2284
- 'w_long',
2285
- 'w_lat',
2286
- 'w_zoom',
2287
- 'w_width',
2288
- 'w_height',
2289
- 'w_info',
2290
- 'w_class',
2291
- );
2292
- }
2293
- foreach ( $params_names as $params_name ) {
2294
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2295
- $param[$params_name] = $temp[0];
2296
- $temp = $temp[1];
2297
- }
2298
- if ( $temp ) {
2299
- $temp = explode('*:*w_attr_name*:*', $temp);
2300
- $attrs = array_slice($temp, 0, count($temp) - 1);
2301
- foreach ( $attrs as $attr ) {
2302
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2303
- }
2304
- }
2305
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2306
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2307
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2308
- $rep = '<div id="wdform_field' . $id . '" type="type_mark_map" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="type_mark_map" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><div id="' . $id . '_elementform_id_temp" long0="' . $param['w_long'] . '" lat0="' . $param['w_lat'] . '" zoom="' . $param['w_zoom'] . '" info0="' . $param['w_info'] . '" center_x="' . $param['w_center_x'] . '" center_y="' . $param['w_center_y'] . '" style="width: ' . $param['w_width'] . 'px; height: ' . $param['w_height'] . 'px;" ' . $param['attributes'] . '></div></div></div> ';
2309
- break;
2310
- }
2311
- case 'type_map': {
2312
- $params_names = array(
2313
- 'w_center_x',
2314
- 'w_center_y',
2315
- 'w_long',
2316
- 'w_lat',
2317
- 'w_zoom',
2318
- 'w_width',
2319
- 'w_height',
2320
- 'w_info',
2321
- 'w_class',
2322
- );
2323
- $temp = $params;
2324
- foreach ( $params_names as $params_name ) {
2325
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2326
- $param[$params_name] = $temp[0];
2327
- $temp = $temp[1];
2328
- }
2329
- if ( $temp ) {
2330
- $temp = explode('*:*w_attr_name*:*', $temp);
2331
- $attrs = array_slice($temp, 0, count($temp) - 1);
2332
- foreach ( $attrs as $attr ) {
2333
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2334
- }
2335
- }
2336
- $marker = '';
2337
- $param['w_long'] = explode('***', $param['w_long']);
2338
- $param['w_lat'] = explode('***', $param['w_lat']);
2339
- $param['w_info'] = explode('***', $param['w_info']);
2340
- foreach ( $param['w_long'] as $key => $w_long ) {
2341
- $marker .= 'long' . $key . '="' . $w_long . '" lat' . $key . '="' . $param['w_lat'][$key] . '" info' . $key . '="' . $param['w_info'][$key] . '"';
2342
- }
2343
- $rep = '<div id="wdform_field' . $id . '" type="type_map" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><span id="' . $id . '_element_labelform_id_temp" style="display: none;">' . $label . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><input type="hidden" value="type_map" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><div id="' . $id . '_elementform_id_temp" zoom="' . $param['w_zoom'] . '" center_x="' . $param['w_center_x'] . '" center_y="' . $param['w_center_y'] . '" style="width: ' . $param['w_width'] . 'px; height: ' . $param['w_height'] . 'px;" ' . $marker . ' ' . $param['attributes'] . '></div></div></div>';
2344
- break;
2345
- }
2346
- case 'type_paypal_price': {
2347
- $params_names = array(
2348
- 'w_field_label_size',
2349
- 'w_field_label_pos',
2350
- 'w_first_val',
2351
- 'w_title',
2352
- 'w_mini_labels',
2353
- 'w_size',
2354
- 'w_required',
2355
- 'w_hide_cents',
2356
- 'w_class',
2357
- 'w_range_min',
2358
- 'w_range_max',
2359
- );
2360
- $temp = $params;
2361
- foreach ( $params_names as $params_name ) {
2362
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2363
- $param[$params_name] = $temp[0];
2364
- $temp = $temp[1];
2365
- }
2366
- if ( $temp ) {
2367
- $temp = explode('*:*w_attr_name*:*', $temp);
2368
- $attrs = array_slice($temp, 0, count($temp) - 1);
2369
- foreach ( $attrs as $attr ) {
2370
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2371
- }
2372
- }
2373
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2374
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
2375
- $hide_cents = ($param['w_hide_cents'] == "yes" ? "none;" : "table-cell;");
2376
- $w_first_val = explode('***', $param['w_first_val']);
2377
- $w_title = explode('***', $param['w_title']);
2378
- $w_mini_labels = explode('***', $param['w_mini_labels']);
2379
- $rep = '<div id="wdform_field' . $id . '" type="type_paypal_price" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required"style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_paypal_price" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_range_min'] . '" name="' . $id . '_range_minform_id_temp" id="' . $id . '_range_minform_id_temp"><input type="hidden" value="' . $param['w_range_max'] . '" name="' . $id . '_range_maxform_id_temp" id="' . $id . '_range_maxform_id_temp"><div id="' . $id . '_table_price" style="display: table;"><div id="' . $id . '_tr_price1" style="display: table-row;"><div id="' . $id . '_td_name_currency" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart-->&nbsp;$&nbsp;<!--repend--></span></div><div id="' . $id . '_td_name_dollars" style="display: table-cell;"><input type="text" id="' . $id . '_element_dollarsform_id_temp" name="' . $id . '_element_dollarsform_id_temp" value="' . htmlentities($w_first_val[0], ENT_COMPAT) . '" title="' . htmlentities($w_title[0], ENT_COMPAT) . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled/></div><div id="' . $id . '_td_name_divider" style="display: ' . $hide_cents . ';"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;.&nbsp;</span></div><div id="' . $id . '_td_name_cents" style="display: ' . $hide_cents . '"><input type="text" id="' . $id . '_element_centsform_id_temp" name="' . $id . '_element_centsform_id_temp" value="' . htmlentities($w_first_val[1], ENT_COMPAT) . '" title="' . htmlentities($w_title[1], ENT_COMPAT) . '" onblur="add_0(&quot;' . $id . '_element_centsform_id_temp&quot;)" onkeypress="return check_isnum_interval(event,&quot;' . $id . '_element_centsform_id_temp&quot;,0,99)"style="width: 30px;" ' . $param['attributes'] . ' disabled/></div></div><div id="' . $id . '_tr_price2" style="display: table-row;"><div style="display: table-cell;"><label class="mini_label"></label></div><div align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_dollars">' . $w_mini_labels[0] . '</label></div><div id="' . $id . '_td_name_label_divider" style="display: ' . $hide_cents . '"><label class="mini_label"></label></div><div align="left" id="' . $id . '_td_name_label_cents" style="display: ' . $hide_cents . '"><label class="mini_label" id="' . $id . '_mini_label_cents">' . $w_mini_labels[1] . '</label></div></div></div></div></div>';
2380
- break;
2381
- }
2382
- case 'type_paypal_price_new': {
2383
- $params_names = array(
2384
- 'w_field_label_size',
2385
- 'w_field_label_pos',
2386
- 'w_first_val',
2387
- 'w_title',
2388
- 'w_size',
2389
- 'w_required',
2390
- 'w_class',
2391
- 'w_range_min',
2392
- 'w_range_max',
2393
- 'w_readonly',
2394
- 'w_currency',
2395
- );
2396
- $temp = $params;
2397
- if ( strpos($temp, 'w_hide_label') > -1 ) {
2398
- $params_names = array(
2399
- 'w_field_label_size',
2400
- 'w_field_label_pos',
2401
- 'w_hide_label',
2402
- 'w_first_val',
2403
- 'w_title',
2404
- 'w_size',
2405
- 'w_required',
2406
- 'w_class',
2407
- 'w_range_min',
2408
- 'w_range_max',
2409
- 'w_readonly',
2410
- 'w_currency',
2411
- );
2412
- }
2413
- foreach ( $params_names as $params_name ) {
2414
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2415
- $param[$params_name] = $temp[0];
2416
- $temp = $temp[1];
2417
- }
2418
- if ( $temp ) {
2419
- $temp = explode('*:*w_attr_name*:*', $temp);
2420
- $attrs = array_slice($temp, 0, count($temp) - 1);
2421
- foreach ( $attrs as $attr ) {
2422
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2423
- }
2424
- }
2425
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2426
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2427
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2428
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
2429
- $currency_sumbol = ($param['w_currency'] == "yes" ? "display:none;" : "display: table-cell;");
2430
- $param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
2431
- $rep = '<div id="wdform_field' . $id . '" type="type_paypal_price_new" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required"style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_paypal_price_new" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_readonly'] . '" name="' . $id . '_readonlyform_id_temp" id="' . $id . '_readonlyform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_range_min'] . '" name="' . $id . '_range_minform_id_temp" id="' . $id . '_range_minform_id_temp"><input type="hidden" value="' . $param['w_range_max'] . '" name="' . $id . '_range_maxform_id_temp" id="' . $id . '_range_maxform_id_temp"><div id="' . $id . '_table_price" style="display: table;"><div id="' . $id . '_tr_price1" style="display: table-row;"><div id="' . $id . '_td_name_currency" style="' . $currency_sumbol . '"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart-->&nbsp;$&nbsp;<!--repend--></span></div><div id="' . $id . '_td_name_dollars" style="display: table-cell;"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" placeholder="' . htmlentities($param['w_title'], ENT_COMPAT) . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled/></div></div></div></div></div>';
2432
- break;
2433
- }
2434
- case 'type_paypal_select': {
2435
- $params_names = array(
2436
- 'w_field_label_size',
2437
- 'w_field_label_pos',
2438
- 'w_size',
2439
- 'w_choices',
2440
- 'w_choices_price',
2441
- 'w_choices_checked',
2442
- 'w_choices_disabled',
2443
- 'w_required',
2444
- 'w_quantity',
2445
- 'w_quantity_value',
2446
- 'w_class',
2447
- 'w_property',
2448
- 'w_property_values',
2449
- );
2450
- $temp = $params;
2451
- if ( strpos($temp, 'w_choices_params') > -1 ) {
2452
- $params_names = array(
2453
- 'w_field_label_size',
2454
- 'w_field_label_pos',
2455
- 'w_size',
2456
- 'w_choices',
2457
- 'w_choices_price',
2458
- 'w_choices_checked',
2459
- 'w_choices_disabled',
2460
- 'w_required',
2461
- 'w_quantity',
2462
- 'w_quantity_value',
2463
- 'w_choices_params',
2464
- 'w_class',
2465
- 'w_property',
2466
- 'w_property_values',
2467
- );
2468
- }
2469
- if ( strpos($temp, 'w_hide_label') > -1 ) {
2470
- $params_names = array(
2471
- 'w_field_label_size',
2472
- 'w_field_label_pos',
2473
- 'w_hide_label',
2474
- 'w_size',
2475
- 'w_choices',
2476
- 'w_choices_price',
2477
- 'w_choices_checked',
2478
- 'w_choices_disabled',
2479
- 'w_required',
2480
- 'w_quantity',
2481
- 'w_quantity_value',
2482
- 'w_choices_params',
2483
- 'w_class',
2484
- 'w_property',
2485
- 'w_property_values',
2486
- );
2487
- }
2488
- foreach ( $params_names as $params_name ) {
2489
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2490
- $param[$params_name] = $temp[0];
2491
- $temp = $temp[1];
2492
- }
2493
- if ( $temp ) {
2494
- $temp = explode('*:*w_attr_name*:*', $temp);
2495
- $attrs = array_slice($temp, 0, count($temp) - 1);
2496
- foreach ( $attrs as $attr ) {
2497
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2498
- }
2499
- }
2500
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2501
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2502
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2503
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
2504
- $param['w_choices'] = explode('***', $param['w_choices']);
2505
- $param['w_choices_price'] = explode('***', $param['w_choices_price']);
2506
- $param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
2507
- $param['w_choices_disabled'] = explode('***', $param['w_choices_disabled']);
2508
- $param['w_property'] = explode('***', $param['w_property']);
2509
- $param['w_property_values'] = explode('***', $param['w_property_values']);
2510
- if ( isset($param['w_choices_params']) ) {
2511
- $param['w_choices_params'] = explode('***', $param['w_choices_params']);
2512
- }
2513
- foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
2514
- if ( $choices_checked == 'true' ) {
2515
- $param['w_choices_checked'][$key] = 'selected="selected"';
2516
- }
2517
- else {
2518
- $param['w_choices_checked'][$key] = '';
2519
- }
2520
- }
2521
- $rep = '<div id="wdform_field' . $id . '" type="type_paypal_select" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; "><input type="hidden" value="type_paypal_select" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><select id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" onchange="set_select(this)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled>';
2522
- foreach ( $param['w_choices'] as $key => $choice ) {
2523
- $where = '';
2524
- $order_by = '';
2525
- $db_info = '';
2526
- $choice_value = $param['w_choices_disabled'][$key] == "true" ? '' : $param['w_choices_price'][$key];
2527
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2528
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2529
- $where = 'where="' . $w_choices_params[0] . '"';
2530
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2531
- $order_by = "order_by='" . $w_choices_params[0] . "'";
2532
- $db_info = "db_info='" . $w_choices_params[1] . "'";
2533
- }
2534
- $rep .= '<option id="' . $id . '_option' . $key . '" value="' . $choice_value . '" onselect="set_select(&quot;' . $id . '_option' . $key . '&quot;)" ' . $param['w_choices_checked'][$key] . ' ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</option>';
2535
- }
2536
- $rep .= '</select><div id="' . $id . '_divform_id_temp">';
2537
- if ( $param['w_quantity'] == "yes" ) {
2538
- $rep .= '<span id="' . $id . '_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="' . $id . '_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="' . $param['w_quantity_value'] . '" id="' . $id . '_element_quantityform_id_temp" name="' . $id . '_element_quantityform_id_temp" onkeypress="return check_isnum(event)" style="width: 30px; margin: 2px 0px;" disabled /></span>';
2539
- }
2540
- if ( $param['w_property'][0] ) {
2541
- foreach ( $param['w_property'] as $key => $property ) {
2542
- $rep .= '
2543
- <span id="' . $id . '_property_' . $key . '" style="margin-right: 15px;">
2544
-
2545
- <label class="mini_label" id="' . $id . '_property_label_form_id_temp' . $key . '" style="margin-right: 5px;">' . $property . '</label>
2546
- <select id="' . $id . '_propertyform_id_temp' . $key . '" name="' . $id . '_propertyform_id_temp' . $key . '" style="width: auto; margin: 2px 0px;" disabled>';
2547
- $param['w_property_values'][$key] = explode('###', $param['w_property_values'][$key]);
2548
- $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key], 1, count($param['w_property_values'][$key]));
2549
- foreach ( $param['w_property_values'][$key] as $subkey => $property_value ) {
2550
- $rep .= '<option id="' . $id . '_' . $key . '_option' . $subkey . '" value="' . $property_value . '">' . $property_value . '</option>';
2551
- }
2552
- $rep .= '</select></span>';
2553
- }
2554
- }
2555
- $rep .= '</div></div></div>';
2556
- break;
2557
- }
2558
- case 'type_paypal_checkbox': {
2559
- $params_names = array(
2560
- 'w_field_label_size',
2561
- 'w_field_label_pos',
2562
- 'w_flow',
2563
- 'w_choices',
2564
- 'w_choices_price',
2565
- 'w_choices_checked',
2566
- 'w_required',
2567
- 'w_randomize',
2568
- 'w_allow_other',
2569
- 'w_allow_other_num',
2570
- 'w_class',
2571
- 'w_property',
2572
- 'w_property_values',
2573
- 'w_quantity',
2574
- 'w_quantity_value',
2575
- );
2576
- $temp = $params;
2577
- if ( strpos($temp, 'w_field_option_pos') > -1 ) {
2578
- $params_names = array(
2579
- 'w_field_label_size',
2580
- 'w_field_label_pos',
2581
- 'w_field_option_pos',
2582
- 'w_flow',
2583
- 'w_choices',
2584
- 'w_choices_price',
2585
- 'w_choices_checked',
2586
- 'w_required',
2587
- 'w_randomize',
2588
- 'w_allow_other',
2589
- 'w_allow_other_num',
2590
- 'w_choices_params',
2591
- 'w_class',
2592
- 'w_property',
2593
- 'w_property_values',
2594
- 'w_quantity',
2595
- 'w_quantity_value',
2596
- );
2597
- }
2598
- if ( strpos($temp, 'w_hide_label') > -1 ) {
2599
- $params_names = array(
2600
- 'w_field_label_size',
2601
- 'w_field_label_pos',
2602
- 'w_field_option_pos',
2603
- 'w_hide_label',
2604
- 'w_flow',
2605
- 'w_choices',
2606
- 'w_choices_price',
2607
- 'w_choices_checked',
2608
- 'w_required',
2609
- 'w_randomize',
2610
- 'w_allow_other',
2611
- 'w_allow_other_num',
2612
- 'w_choices_params',
2613
- 'w_class',
2614
- 'w_property',
2615
- 'w_property_values',
2616
- 'w_quantity',
2617
- 'w_quantity_value',
2618
- );
2619
- }
2620
- foreach ( $params_names as $params_name ) {
2621
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2622
- $param[$params_name] = $temp[0];
2623
- $temp = $temp[1];
2624
- }
2625
- if ( $temp ) {
2626
- $temp = explode('*:*w_attr_name*:*', $temp);
2627
- $attrs = array_slice($temp, 0, count($temp) - 1);
2628
- foreach ( $attrs as $attr ) {
2629
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2630
- }
2631
- }
2632
- if ( !isset($param['w_field_option_pos']) ) {
2633
- $param['w_field_option_pos'] = 'left';
2634
- }
2635
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2636
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2637
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2638
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
2639
- $param['w_choices'] = explode('***', $param['w_choices']);
2640
- $param['w_choices_price'] = explode('***', $param['w_choices_price']);
2641
- $param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
2642
- $param['w_property'] = explode('***', $param['w_property']);
2643
- $param['w_property_values'] = explode('***', $param['w_property_values']);
2644
- if ( isset($param['w_choices_params']) ) {
2645
- $param['w_choices_params'] = explode('***', $param['w_choices_params']);
2646
- }
2647
- foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
2648
- if ( $choices_checked == 'true' ) {
2649
- $param['w_choices_checked'][$key] = 'checked="checked"';
2650
- }
2651
- else {
2652
- $param['w_choices_checked'][$key] = '';
2653
- }
2654
- }
2655
- $rep = '<div id="wdform_field' . $id . '" type="type_paypal_checkbox" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_paypal_checkbox" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_randomize'] . '" name="' . $id . '_randomizeform_id_temp" id="' . $id . '_randomizeform_id_temp"><input type="hidden" value="' . $param['w_allow_other'] . '" name="' . $id . '_allow_otherform_id_temp" id="' . $id . '_allow_otherform_id_temp"><input type="hidden" value="' . $param['w_allow_other_num'] . '" name="' . $id . '_allow_other_numform_id_temp" id="' . $id . '_allow_other_numform_id_temp"><input type="hidden" value="' . $param['w_field_option_pos'] . '" id="' . $id . '_option_left_right"><div style="display: table;"><div id="' . $id . '_table_little" style="display: table-row-group;">';
2656
- if ( $param['w_flow'] == 'hor' ) {
2657
- $rep .= '<div id="' . $id . '_hor" style="display: table-row;">';
2658
- foreach ( $param['w_choices'] as $key => $choice ) {
2659
- $where = '';
2660
- $order_by = '';
2661
- $db_info = '';
2662
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2663
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2664
- $where = 'where="' . $w_choices_params[0] . '"';
2665
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2666
- $order_by = "order_by='" . $w_choices_params[0] . "'";
2667
- $db_info = "db_info='" . $w_choices_params[1] . "'";
2668
- }
2669
- $rep .= '<div valign="top" id="' . $id . '_td_little' . $key . '" idi="' . $key . '" style="display: table-cell;"><input type="checkbox" id="' . $id . '_elementform_id_temp' . $key . '" name="' . $id . '_elementform_id_temp' . $key . '" value="' . $param['w_choices_price'][$key] . '" onclick="set_checked(&quot;' . $id . '&quot;,&quot;' . $key . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][$key] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $key . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $key . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</label></div>';
2670
- }
2671
- $rep .= '</div>';
2672
- }
2673
- else {
2674
- foreach ( $param['w_choices'] as $key => $choice ) {
2675
- $where = '';
2676
- $order_by = '';
2677
- $db_info = '';
2678
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2679
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2680
- $where = 'where="' . $w_choices_params[0] . '"';
2681
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2682
- $order_by = "order_by='" . $w_choices_params[0] . "'";
2683
- $db_info = "db_info='" . $w_choices_params[1] . "'";
2684
- }
2685
- $rep .= '<div id="' . $id . '_element_tr' . $key . '" style="display: table-row;"><div valign="top" id="' . $id . '_td_little' . $key . '" idi="' . $key . '" style="display: table-cell;"><input type="checkbox" id="' . $id . '_elementform_id_temp' . $key . '" name="' . $id . '_elementform_id_temp' . $key . '" value="' . $param['w_choices_price'][$key] . '" onclick="set_checked(&quot;' . $id . '&quot;,&quot;' . $key . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][$key] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $key . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $key . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</label></div></div>';
2686
- }
2687
- }
2688
- $rep .= '</div></div>';
2689
- $rep .= '<div id="' . $id . '_divform_id_temp">';
2690
- if ( $param['w_quantity'] == "yes" ) {
2691
- $rep .= '<span id="' . $id . '_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="' . $id . '_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="' . $param['w_quantity_value'] . '" id="' . $id . '_element_quantityform_id_temp" name="' . $id . '_element_quantityform_id_temp" onkeypress="return check_isnum(event)" style="width: 30px; margin: 2px 0px;" disabled/></span>';
2692
- }
2693
- if ( $param['w_property'][0] ) {
2694
- foreach ( $param['w_property'] as $key => $property ) {
2695
- $rep .= '
2696
- <span id="' . $id . '_property_' . $key . '" style="margin-right: 15px;">
2697
-
2698
- <label class="mini_label" id="' . $id . '_property_label_form_id_temp' . $key . '" style="margin-right: 5px;">' . $property . '</label>
2699
- <select id="' . $id . '_propertyform_id_temp' . $key . '" name="' . $id . '_propertyform_id_temp' . $key . '" style="width: auto; margin: 2px 0px;" disabled>';
2700
- $param['w_property_values'][$key] = explode('###', $param['w_property_values'][$key]);
2701
- $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key], 1, count($param['w_property_values'][$key]));
2702
- foreach ( $param['w_property_values'][$key] as $subkey => $property_value ) {
2703
- $rep .= '<option id="' . $id . '_' . $key . '_option' . $subkey . '" value="' . $property_value . '">' . $property_value . '</option>';
2704
- }
2705
- $rep .= '</select></span>';
2706
- }
2707
- }
2708
- $rep .= '</div></div></div>';
2709
- break;
2710
- }
2711
- case 'type_paypal_radio': {
2712
- $params_names = array(
2713
- 'w_field_label_size',
2714
- 'w_field_label_pos',
2715
- 'w_flow',
2716
- 'w_choices',
2717
- 'w_choices_price',
2718
- 'w_choices_checked',
2719
- 'w_required',
2720
- 'w_randomize',
2721
- 'w_allow_other',
2722
- 'w_allow_other_num',
2723
- 'w_class',
2724
- 'w_property',
2725
- 'w_property_values',
2726
- 'w_quantity',
2727
- 'w_quantity_value',
2728
- );
2729
- $temp = $params;
2730
- if ( strpos($temp, 'w_field_option_pos') > -1 ) {
2731
- $params_names = array(
2732
- 'w_field_label_size',
2733
- 'w_field_label_pos',
2734
- 'w_field_option_pos',
2735
- 'w_flow',
2736
- 'w_choices',
2737
- 'w_choices_price',
2738
- 'w_choices_checked',
2739
- 'w_required',
2740
- 'w_randomize',
2741
- 'w_allow_other',
2742
- 'w_allow_other_num',
2743
- 'w_choices_params',
2744
- 'w_class',
2745
- 'w_property',
2746
- 'w_property_values',
2747
- 'w_quantity',
2748
- 'w_quantity_value',
2749
- );
2750
- }
2751
- if ( strpos($temp, 'w_hide_label') > -1 ) {
2752
- $params_names = array(
2753
- 'w_field_label_size',
2754
- 'w_field_label_pos',
2755
- 'w_field_option_pos',
2756
- 'w_hide_label',
2757
- 'w_flow',
2758
- 'w_choices',
2759
- 'w_choices_price',
2760
- 'w_choices_checked',
2761
- 'w_required',
2762
- 'w_randomize',
2763
- 'w_allow_other',
2764
- 'w_allow_other_num',
2765
- 'w_choices_params',
2766
- 'w_class',
2767
- 'w_property',
2768
- 'w_property_values',
2769
- 'w_quantity',
2770
- 'w_quantity_value',
2771
- );
2772
- }
2773
- foreach ( $params_names as $params_name ) {
2774
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2775
- $param[$params_name] = $temp[0];
2776
- $temp = $temp[1];
2777
- }
2778
- if ( $temp ) {
2779
- $temp = explode('*:*w_attr_name*:*', $temp);
2780
- $attrs = array_slice($temp, 0, count($temp) - 1);
2781
- foreach ( $attrs as $attr ) {
2782
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2783
- }
2784
- }
2785
- if ( !isset($param['w_field_option_pos']) ) {
2786
- $param['w_field_option_pos'] = 'left';
2787
- }
2788
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2789
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2790
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2791
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
2792
- $param['w_choices'] = explode('***', $param['w_choices']);
2793
- $param['w_choices_price'] = explode('***', $param['w_choices_price']);
2794
- $param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
2795
- $param['w_property'] = explode('***', $param['w_property']);
2796
- $param['w_property_values'] = explode('***', $param['w_property_values']);
2797
- if ( isset($param['w_choices_params']) ) {
2798
- $param['w_choices_params'] = explode('***', $param['w_choices_params']);
2799
- }
2800
- foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
2801
- if ( $choices_checked == 'true' ) {
2802
- $param['w_choices_checked'][$key] = 'checked="checked"';
2803
- }
2804
- else {
2805
- $param['w_choices_checked'][$key] = '';
2806
- }
2807
- }
2808
- $rep = '<div id="wdform_field' . $id . '" type="type_paypal_radio" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_paypal_radio" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_randomize'] . '" name="' . $id . '_randomizeform_id_temp" id="' . $id . '_randomizeform_id_temp"><input type="hidden" value="' . $param['w_allow_other'] . '" name="' . $id . '_allow_otherform_id_temp" id="' . $id . '_allow_otherform_id_temp"><input type="hidden" value="' . $param['w_allow_other_num'] . '" name="' . $id . '_allow_other_numform_id_temp" id="' . $id . '_allow_other_numform_id_temp"><input type="hidden" value="' . $param['w_field_option_pos'] . '" id="' . $id . '_option_left_right"><div style="display: table;"><div id="' . $id . '_table_little" style="display: table-row-group;">';
2809
- if ( $param['w_flow'] == 'hor' ) {
2810
- $rep .= '<div id="' . $id . '_hor" style="display: table-row;">';
2811
- foreach ( $param['w_choices'] as $key => $choice ) {
2812
- $where = '';
2813
- $order_by = '';
2814
- $db_info = '';
2815
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2816
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2817
- $where = 'where="' . $w_choices_params[0] . '"';
2818
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2819
- $order_by = "order_by='" . $w_choices_params[0] . "'";
2820
- $db_info = "db_info='" . $w_choices_params[1] . "'";
2821
- }
2822
- $rep .= '<div valign="top" id="' . $id . '_td_little' . $key . '" idi="' . $key . '" style="display: table-cell;"><input type="radio" id="' . $id . '_elementform_id_temp' . $key . '" name="' . $id . '_elementform_id_temp" value="' . $param['w_choices_price'][$key] . '" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . $key . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][$key] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $key . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $key . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</label></div>';
2823
- }
2824
- $rep .= '</div>';
2825
- }
2826
- else {
2827
- foreach ( $param['w_choices'] as $key => $choice ) {
2828
- $where = '';
2829
- $order_by = '';
2830
- $db_info = '';
2831
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2832
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2833
- $where = 'where="' . $w_choices_params[0] . '"';
2834
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2835
- $order_by = "order_by='" . $w_choices_params[0] . "'";
2836
- $db_info = "db_info='" . $w_choices_params[1] . "'";
2837
- }
2838
- $rep .= '<div id="' . $id . '_element_tr' . $key . '" style="display: table-row;"><div valign="top" id="' . $id . '_td_little' . $key . '" idi="' . $key . '" style="display: table-cell;"><input type="radio" id="' . $id . '_elementform_id_temp' . $key . '" name="' . $id . '_elementform_id_temp" value="' . $param['w_choices_price'][$key] . '" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . $key . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][$key] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $key . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $key . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</label></div></div>';
2839
- }
2840
- }
2841
- $rep .= '</div></div>';
2842
- $rep .= '<div id="' . $id . '_divform_id_temp">';
2843
- if ( $param['w_quantity'] == "yes" ) {
2844
- $rep .= '<span id="' . $id . '_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="' . $id . '_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="' . $param['w_quantity_value'] . '" id="' . $id . '_element_quantityform_id_temp" name="' . $id . '_element_quantityform_id_temp" onkeypress="return check_isnum(event)" style="width: 30px; margin: 2px 0px;" disabled/></span>';
2845
- }
2846
- if ( $param['w_property'][0] ) {
2847
- foreach ( $param['w_property'] as $key => $property ) {
2848
- $rep .= '
2849
- <span id="' . $id . '_property_' . $key . '" style="margin-right: 15px;">
2850
-
2851
- <label class="mini_label" id="' . $id . '_property_label_form_id_temp' . $key . '" style="margin-right: 5px;">' . $property . '</label>
2852
- <select id="' . $id . '_propertyform_id_temp' . $key . '" name="' . $id . '_propertyform_id_temp' . $key . '" style="width: auto; margin: 2px 0px;" disabled>';
2853
- $param['w_property_values'][$key] = explode('###', $param['w_property_values'][$key]);
2854
- $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key], 1, count($param['w_property_values'][$key]));
2855
- foreach ( $param['w_property_values'][$key] as $subkey => $property_value ) {
2856
- $rep .= '<option id="' . $id . '_' . $key . '_option' . $subkey . '" value="' . $property_value . '">' . $property_value . '</option>';
2857
- }
2858
- $rep .= '</select></span>';
2859
- }
2860
- }
2861
- $rep .= '</div></div></div>';
2862
- break;
2863
- }
2864
- case 'type_paypal_shipping': {
2865
- $params_names = array(
2866
- 'w_field_label_size',
2867
- 'w_field_label_pos',
2868
- 'w_flow',
2869
- 'w_choices',
2870
- 'w_choices_price',
2871
- 'w_choices_checked',
2872
- 'w_required',
2873
- 'w_randomize',
2874
- 'w_allow_other',
2875
- 'w_allow_other_num',
2876
- 'w_class',
2877
- );
2878
- $temp = $params;
2879
- if ( strpos($temp, 'w_field_option_pos') > -1 ) {
2880
- $params_names = array(
2881
- 'w_field_label_size',
2882
- 'w_field_label_pos',
2883
- 'w_field_option_pos',
2884
- 'w_flow',
2885
- 'w_choices',
2886
- 'w_choices_price',
2887
- 'w_choices_checked',
2888
- 'w_required',
2889
- 'w_randomize',
2890
- 'w_allow_other',
2891
- 'w_allow_other_num',
2892
- 'w_choices_params',
2893
- 'w_class',
2894
- );
2895
- }
2896
- if ( strpos($temp, 'w_hide_label') > -1 ) {
2897
- $params_names = array(
2898
- 'w_field_label_size',
2899
- 'w_field_label_pos',
2900
- 'w_field_option_pos',
2901
- 'w_hide_label',
2902
- 'w_flow',
2903
- 'w_choices',
2904
- 'w_choices_price',
2905
- 'w_choices_checked',
2906
- 'w_required',
2907
- 'w_randomize',
2908
- 'w_allow_other',
2909
- 'w_allow_other_num',
2910
- 'w_choices_params',
2911
- 'w_class',
2912
- );
2913
- }
2914
- foreach ( $params_names as $params_name ) {
2915
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2916
- $param[$params_name] = $temp[0];
2917
- $temp = $temp[1];
2918
- }
2919
- if ( $temp ) {
2920
- $temp = explode('*:*w_attr_name*:*', $temp);
2921
- $attrs = array_slice($temp, 0, count($temp) - 1);
2922
- foreach ( $attrs as $attr ) {
2923
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2924
- }
2925
- }
2926
- if ( !isset($param['w_field_option_pos']) ) {
2927
- $param['w_field_option_pos'] = 'left';
2928
- }
2929
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2930
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2931
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2932
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
2933
- $param['w_choices'] = explode('***', $param['w_choices']);
2934
- $param['w_choices_price'] = explode('***', $param['w_choices_price']);
2935
- $param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
2936
- if ( isset($param['w_choices_params']) ) {
2937
- $param['w_choices_params'] = explode('***', $param['w_choices_params']);
2938
- }
2939
- foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
2940
- if ( $choices_checked == 'true' ) {
2941
- $param['w_choices_checked'][$key] = 'checked="checked"';
2942
- }
2943
- else {
2944
- $param['w_choices_checked'][$key] = '';
2945
- }
2946
- }
2947
- $rep = '<div id="wdform_field' . $id . '" type="type_paypal_shipping" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; vertical-align:top;"><input type="hidden" value="type_paypal_shipping" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_randomize'] . '" name="' . $id . '_randomizeform_id_temp" id="' . $id . '_randomizeform_id_temp"><input type="hidden" value="' . $param['w_allow_other'] . '" name="' . $id . '_allow_otherform_id_temp" id="' . $id . '_allow_otherform_id_temp"><input type="hidden" value="' . $param['w_allow_other_num'] . '" name="' . $id . '_allow_other_numform_id_temp" id="' . $id . '_allow_other_numform_id_temp"><input type="hidden" value="' . $param['w_field_option_pos'] . '" id="' . $id . '_option_left_right"><div style="display: table;"><div id="' . $id . '_table_little" style="display: table-row-group;">';
2948
- if ( $param['w_flow'] == 'hor' ) {
2949
- $rep .= '<div id="' . $id . '_hor" style="display: table-row;">';
2950
- foreach ( $param['w_choices'] as $key => $choice ) {
2951
- $where = '';
2952
- $order_by = '';
2953
- $db_info = '';
2954
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2955
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2956
- $where = 'where="' . $w_choices_params[0] . '"';
2957
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2958
- $order_by = "order_by='" . $w_choices_params[0] . "'";
2959
- $db_info = "db_info='" . $w_choices_params[1] . "'";
2960
- }
2961
- $rep .= '<div valign="top" id="' . $id . '_td_little' . $key . '" idi="' . $key . '" style="display: table-cell;"><input type="radio" id="' . $id . '_elementform_id_temp' . $key . '" name="' . $id . '_elementform_id_temp" value="' . $param['w_choices_price'][$key] . '" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . $key . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][$key] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $key . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $key . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</label></div>';
2962
- }
2963
- $rep .= '</div>';
2964
- }
2965
- else {
2966
- foreach ( $param['w_choices'] as $key => $choice ) {
2967
- $where = '';
2968
- $order_by = '';
2969
- $db_info = '';
2970
- if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2971
- $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2972
- $where = 'where="' . $w_choices_params[0] . '"';
2973
- $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2974
- $order_by = "order_by='" . $w_choices_params[0] . "'";
2975
- $db_info = "db_info='" . $w_choices_params[1] . "'";
2976
- }
2977
- $rep .= '<div id="' . $id . '_element_tr' . $key . '" style="display: table-row;"><div valign="top" id="' . $id . '_td_little' . $key . '" idi="' . $key . '" style="display: table-cell;"><input type="radio" id="' . $id . '_elementform_id_temp' . $key . '" name="' . $id . '_elementform_id_temp" value="' . $param['w_choices_price'][$key] . '" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . $key . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][$key] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $key . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $key . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</label></div></div>';
2978
- }
2979
- }
2980
- $rep .= '</div></div>';
2981
- $rep .= '</div></div>';
2982
- break;
2983
- }
2984
- case 'type_paypal_total': {
2985
- $params_names = array( 'w_field_label_size', 'w_field_label_pos', 'w_class' );
2986
- $temp = $params;
2987
- if ( strpos($temp, 'w_size') > -1 ) {
2988
- $params_names = array( 'w_field_label_size', 'w_field_label_pos', 'w_class', 'w_size' );
2989
- }
2990
- if ( strpos($temp, 'w_hide_label') > -1 ) {
2991
- $params_names = array( 'w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_class', 'w_size' );
2992
- }
2993
- foreach ( $params_names as $params_name ) {
2994
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2995
- $param[$params_name] = $temp[0];
2996
- $temp = $temp[1];
2997
- }
2998
- if ( $temp ) {
2999
- $temp = explode('*:*w_attr_name*:*', $temp);
3000
- $attrs = array_slice($temp, 0, count($temp) - 1);
3001
- foreach ( $attrs as $attr ) {
3002
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
3003
- }
3004
- }
3005
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
3006
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
3007
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
3008
- $param['w_size'] = isset($param['w_size']) ? $param['w_size'] : '300';
3009
- $rep = '<div id="wdform_field' . $id . '" type="type_paypal_total" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label">' . $label . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_paypal_total" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><div id="' . $id . 'paypal_totalform_id_temp" class="wdform_paypal_total paypal_totalform_id_temp" style="width:' . $param['w_size'] . 'px;"><input type="hidden" value="" name="' . $id . '_paypal_totalform_id_temp" class="input_paypal_totalform_id_temp"><div id="' . $id . 'div_totalform_id_temp" class="div_totalform_id_temp" style="margin-bottom: 10px;"><!--repstart-->$300<!--repend--></div><div id="' . $id . 'paypal_productsform_id_temp" class="paypal_productsform_id_temp" style="border-spacing: 2px;"><div style="border-spacing: 2px;"><!--repstart-->product 1 $100<!--repend--></div><div style="border-spacing: 2px;"><!--repstart-->product 2 $200<!--repend--></div></div><div id="' . $id . 'paypal_taxform_id_temp" class="paypal_taxform_id_temp" style="border-spacing: 2px; margin-top: 7px;"></div></div></div></div>';
3010
- break;
3011
- }
3012
- case 'type_stripe': {
3013
- $params_names = array( 'w_field_size', 'w_field_label_size', 'w_field_label_pos', 'w_class' );
3014
- $temp = $params;
3015
- foreach ( $params_names as $params_name ) {
3016
- $temp = explode('*:*' . $params_name . '*:*', $temp);
3017
- $param[$params_name] = $temp[0];
3018
- $temp = $temp[1];
3019
- }
3020
- if ( $temp ) {
3021
- $temp = explode('*:*w_attr_name*:*', $temp);
3022
- $attrs = array_slice($temp, 0, count($temp) - 1);
3023
- foreach ( $attrs as $attr ) {
3024
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
3025
- }
3026
- }
3027
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
3028
- $rep = '<div id="wdform_field' . $id . '" type="type_stripe" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="display: none;">stripe</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><div id="' . $id . '_elementform_id_temp" style="width:' . $param['w_field_size'] . 'px; margin:10px; border: 1px solid #000; min-width:80px;text-align:center;"> Stripe Section</div><input type="hidden" id="is_stripe" /><input type="hidden" value="type_stripe" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"></div></div>';
3029
- break;
3030
- }
3031
- case 'type_star_rating': {
3032
- $params_names = array(
3033
- 'w_field_label_size',
3034
- 'w_field_label_pos',
3035
- 'w_field_label_col',
3036
- 'w_star_amount',
3037
- 'w_required',
3038
- 'w_class',
3039
- );
3040
- $temp = $params;
3041
- if ( strpos($temp, 'w_hide_label') > -1 ) {
3042
- $params_names = array(
3043
- 'w_field_label_size',
3044
- 'w_field_label_pos',
3045
- 'w_hide_label',
3046
- 'w_field_label_col',
3047
- 'w_star_amount',
3048
- 'w_required',
3049
- 'w_class',
3050
- );
3051
- }
3052
- foreach ( $params_names as $params_name ) {
3053
- $temp = explode('*:*' . $params_name . '*:*', $temp);
3054
- $param[$params_name] = $temp[0];
3055
- $temp = $temp[1];
3056
- }
3057
- if ( $temp ) {
3058
- $temp = explode('*:*w_attr_name*:*', $temp);
3059
- $attrs = array_slice($temp, 0, count($temp) - 1);
3060
- foreach ( $attrs as $attr ) {
3061
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
3062
- }
3063
- }
3064
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
3065
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
3066
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
3067
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
3068
- $images = '';
3069
- for ( $i = 0; $i < $param['w_star_amount']; $i++ ) {
3070
- $images .= '<img id="' . $id . '_star_' . $i . '" src="' . WDFMInstance(self::PLUGIN)->plugin_url . '/images/star.png?ver=' . WDFMInstance(self::PLUGIN)->plugin_version . '" onmouseover="change_src(' . $i . ',' . $id . ',&quot;form_id_temp&quot;)" onmouseout="reset_src(' . $i . ',' . $id . ')" onclick="select_star_rating(' . $i . ',' . $id . ', &quot;form_id_temp&quot;)">';
3071
- }
3072
- $rep = '<div id="wdform_field' . $id . '" type="type_star_rating" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_star_rating" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_star_amount'] . '" id="' . $id . '_star_amountform_id_temp" name="' . $id . '_star_amountform_id_temp"><input type="hidden" value="' . $param['w_field_label_col'] . '" name="' . $id . '_star_colorform_id_temp" id="' . $id . '_star_colorform_id_temp"><div id="' . $id . '_elementform_id_temp" class="wdform_stars" ' . $param['attributes'] . '>' . $images . '</div></div></div>';
3073
- break;
3074
- }
3075
- case 'type_scale_rating': {
3076
- $params_names = array(
3077
- 'w_field_label_size',
3078
- 'w_field_label_pos',
3079
- 'w_mini_labels',
3080
- 'w_scale_amount',
3081
- 'w_required',
3082
- 'w_class',
3083
- );
3084
- $temp = $params;
3085
- if ( strpos($temp, 'w_hide_label') > -1 ) {
3086
- $params_names = array(
3087
- 'w_field_label_size',
3088
- 'w_field_label_pos',
3089
- 'w_hide_label',
3090
- 'w_mini_labels',
3091
- 'w_scale_amount',
3092
- 'w_required',
3093
- 'w_class',
3094
- );
3095
- }
3096
- foreach ( $params_names as $params_name ) {
3097
- $temp = explode('*:*' . $params_name . '*:*', $temp);
3098
- $param[$params_name] = $temp[0];
3099
- $temp = $temp[1];
3100
- }
3101
- if ( $temp ) {
3102
- $temp = explode('*:*w_attr_name*:*', $temp);
3103
- $attrs = array_slice($temp, 0, count($temp) - 1);
3104
- foreach ( $attrs as $attr ) {
3105
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
3106
- }
3107
- }
3108
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
3109
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
3110
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
3111
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
3112
- $w_mini_labels = explode('***', $param['w_mini_labels']);
3113
- $numbers = '';
3114
- for ( $i = 1; $i <= $param['w_scale_amount']; $i++ ) {
3115
- $numbers .= '<div id="' . $id . '_scale_td1_' . $i . 'form_id_temp" style="text-align: center; display: table-cell;"><span>' . $i . '</span></div>';
3116
- }
3117
- $radio_buttons = '';
3118
- for ( $k = 1; $k <= $param['w_scale_amount']; $k++ ) {
3119
- $radio_buttons .= '<div id="' . $id . '_scale_td2_' . $k . 'form_id_temp" style="display: table-cell;"><input id="' . $id . '_scale_radioform_id_temp_' . $k . '" name="' . $id . '_scale_radioform_id_temp" value="' . $k . '" type="radio"></div>';
3120
- }
3121
- $rep = '<div id="wdform_field' . $id . '" type="type_scale_rating" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; vertical-align: top; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_scale_rating" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_scale_amount'] . '" id="' . $id . '_scale_amountform_id_temp" name="' . $id . '_scale_amountform_id_temp"><div id="' . $id . '_elementform_id_temp" style="float: left;" ' . $param['attributes'] . '><label class="mini_label" id="' . $id . '_mini_label_worst" style="position: relative; top: 6px; font-size: 11px; display: inline-table;">' . $w_mini_labels[0] . '</label><div id="' . $id . '_scale_tableform_id_temp" style="display: inline-table;"><div id="' . $id . '_scale_tr1form_id_temp" style="display: table-row;">' . $numbers . '</div><div id="' . $id . '_scale_tr2form_id_temp" style="display: table-row;">' . $radio_buttons . '</div></div><label class="mini_label" id="' . $id . '_mini_label_best" style="position: relative; top: 6px; font-size: 11px; display: inline-table;">' . $w_mini_labels[1] . '</label></div></div></div>';
3122
- break;
3123
- }
3124
- case 'type_spinner': {
3125
- $params_names = array(
3126
- 'w_field_label_size',
3127
- 'w_field_label_pos',
3128
- 'w_field_width',
3129
- 'w_field_min_value',
3130
- 'w_field_max_value',
3131
- 'w_field_step',
3132
- 'w_field_value',
3133
- 'w_required',
3134
- 'w_class',
3135
- );
3136
- $temp = $params;
3137
- if ( strpos($temp, 'w_hide_label') > -1 ) {
3138
- $params_names = array(
3139
- 'w_field_label_size',
3140
- 'w_field_label_pos',
3141
- 'w_hide_label',
3142
- 'w_field_width',
3143
- 'w_field_min_value',
3144
- 'w_field_max_value',
3145
- 'w_field_step',
3146
- 'w_field_value',
3147
- 'w_required',
3148
- 'w_class',
3149
- );
3150
- }
3151
- foreach ( $params_names as $params_name ) {
3152
- $temp = explode('*:*' . $params_name . '*:*', $temp);
3153
- $param[$params_name] = $temp[0];
3154
- $temp = $temp[1];
3155
- }
3156
- if ( $temp ) {
3157
- $temp = explode('*:*w_attr_name*:*', $temp);
3158
- $attrs = array_slice($temp, 0, count($temp) - 1);
3159
- foreach ( $attrs as $attr ) {
3160
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
3161
- }
3162
- }
3163
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
3164
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
3165
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
3166
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
3167
- $rep = '<div id="wdform_field' . $id . '" type="type_spinner" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_spinner" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_field_width'] . '" name="' . $id . '_spinner_widthform_id_temp" id="' . $id . '_spinner_widthform_id_temp"><input type="hidden" value="' . $param['w_field_min_value'] . '" id="' . $id . '_min_valueform_id_temp" name="' . $id . '_min_valueform_id_temp"><input type="hidden" value="' . $param['w_field_max_value'] . '" name="' . $id . '_max_valueform_id_temp" id="' . $id . '_max_valueform_id_temp"><input type="hidden" value="' . $param['w_field_step'] . '" name="' . $id . '_stepform_id_temp" id="' . $id . '_stepform_id_temp"><input type="" value="' . ($param['w_field_value'] != 'null' ? $param['w_field_value'] : '') . '" name="' . $id . '_elementform_id_temp" id="' . $id . '_elementform_id_temp" onkeypress="return check_isnum_or_minus(event)" style="width: ' . $param['w_field_width'] . 'px;" ' . $param['attributes'] . ' disabled/></div></div>';
3168
- break;
3169
- }
3170
- case 'type_slider': {
3171
- $params_names = array(
3172
- 'w_field_label_size',
3173
- 'w_field_label_pos',
3174
- 'w_field_width',
3175
- 'w_field_min_value',
3176
- 'w_field_max_value',
3177
- 'w_field_value',
3178
- 'w_required',
3179
- 'w_class',
3180
- );
3181
- $temp = $params;
3182
- if ( strpos($temp, 'w_hide_label') > -1 ) {
3183
- $params_names = array(
3184
- 'w_field_label_size',
3185
- 'w_field_label_pos',
3186
- 'w_hide_label',
3187
- 'w_field_width',
3188
- 'w_field_min_value',
3189
- 'w_field_max_value',
3190
- 'w_field_value',
3191
- 'w_required',
3192
- 'w_class',
3193
- );
3194
- }
3195
- if ( strpos($temp, 'w_field_step') > -1 ) {
3196
- $params_names = array(
3197
- 'w_field_label_size',
3198
- 'w_field_label_pos',
3199
- 'w_hide_label',
3200
- 'w_field_width',
3201
- 'w_field_min_value',
3202
- 'w_field_max_value',
3203
- 'w_field_step',
3204
- 'w_field_value',
3205
- 'w_required',
3206
- 'w_class',
3207
- );
3208
- }
3209
- foreach ( $params_names as $params_name ) {
3210
- $temp = explode('*:*' . $params_name . '*:*', $temp);
3211
- $param[$params_name] = $temp[0];
3212
- $temp = $temp[1];
3213
- }
3214
- if ( $temp ) {
3215
- $temp = explode('*:*w_attr_name*:*', $temp);
3216
- $attrs = array_slice($temp, 0, count($temp) - 1);
3217
- foreach ( $attrs as $attr ) {
3218
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
3219
- }
3220
- }
3221
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
3222
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
3223
- $param['w_field_step'] = (isset($param['w_field_step']) ? $param['w_field_step'] : 1);
3224
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
3225
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
3226
- $rep = '<div id="wdform_field' . $id . '" type="type_slider" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; vertical-align: top; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_slider" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_field_width'] . '" name="' . $id . '_slider_widthform_id_temp" id="' . $id . '_slider_widthform_id_temp"><input type="hidden" value="' . $param['w_field_min_value'] . '" id="' . $id . '_slider_min_valueform_id_temp" name="' . $id . '_slider_min_valueform_id_temp"><input type="hidden" value="' . $param['w_field_max_value'] . '" id="' . $id . '_slider_max_valueform_id_temp" name="' . $id . '_slider_max_valueform_id_temp"><input type="hidden" value="' . $param['w_field_step'] . '" id="' . $id . '_slider_stepform_id_temp" name="' . $id . '_slider_stepform_id_temp" /><input type="hidden" value="' . $param['w_field_value'] . '" id="' . $id . '_slider_valueform_id_temp" name="' . $id . '_slider_valueform_id_temp"><div id="' . $id . '_slider_tableform_id_temp"><div><div id="' . $id . '_slider_td1form_id_temp"><div name="' . $id . '_elementform_id_temp" id="' . $id . '_elementform_id_temp" style="width: ' . $param['w_field_width'] . 'px;" ' . $param['attributes'] . '"></div></div></div><div><div align="left" id="' . $id . '_slider_td2form_id_temp" style="display: inline-table; width: 33.3%; text-align: left;"><span id="' . $id . '_element_minform_id_temp" class="label">' . $param['w_field_min_value'] . '</span></div><div align="right" id="' . $id . '_slider_td3form_id_temp" style="display: inline-table; width: 33.3%; text-align: center;"><span id="' . $id . '_element_valueform_id_temp" class="label">' . $param['w_field_value'] . '</span></div><div align="right" id="' . $id . '_slider_td4form_id_temp" style="display: inline-table; width: 33.3%; text-align: right;"><span id="' . $id . '_element_maxform_id_temp" class="label">' . $param['w_field_max_value'] . '</span></div></div></div></div></div>';
3227
- break;
3228
- }
3229
- case 'type_range': {
3230
- $params_names = array(
3231
- 'w_field_label_size',
3232
- 'w_field_label_pos',
3233
- 'w_field_range_width',
3234
- 'w_field_range_step',
3235
- 'w_field_value1',
3236
- 'w_field_value2',
3237
- 'w_mini_labels',
3238
- 'w_required',
3239
- 'w_class',
3240
- );
3241
- $temp = $params;
3242
- if ( strpos($temp, 'w_hide_label') > -1 ) {
3243
- $params_names = array(
3244
- 'w_field_label_size',
3245
- 'w_field_label_pos',
3246
- 'w_hide_label',
3247
- 'w_field_range_width',
3248
- 'w_field_range_step',
3249
- 'w_field_value1',
3250
- 'w_field_value2',
3251
- 'w_mini_labels',
3252
- 'w_required',
3253
- 'w_class',
3254
- );
3255
- }
3256
- foreach ( $params_names as $params_name ) {
3257
- $temp = explode('*:*' . $params_name . '*:*', $temp);
3258
- $param[$params_name] = $temp[0];
3259
- $temp = $temp[1];
3260
- }
3261
- if ( $temp ) {
3262
- $temp = explode('*:*w_attr_name*:*', $temp);
3263
- $attrs = array_slice($temp, 0, count($temp) - 1);
3264
- foreach ( $attrs as $attr ) {
3265
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
3266
- }
3267
- }
3268
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
3269
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
3270
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
3271
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
3272
- $w_mini_labels = explode('***', $param['w_mini_labels']);
3273
- $rep = '<div id="wdform_field' . $id . '" type="type_range" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_range" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_field_range_width'] . '" name="' . $id . '_range_widthform_id_temp" id="' . $id . '_range_widthform_id_temp"><input type="hidden" value="' . $param['w_field_range_step'] . '" name="' . $id . '_range_stepform_id_temp" id="' . $id . '_range_stepform_id_temp"><div id="' . $id . '_elemet_table_littleform_id_temp" style="display: table;"><div style="display: table-row;"><div valign="middle" align="left" style="display: table-cell;"><input type="" value="' . ($param['w_field_value1'] != 'null' ? $param['w_field_value1'] : '') . '" name="' . $id . '_elementform_id_temp0" id="' . $id . '_elementform_id_temp0" onkeypress="return check_isnum_or_minus(event)" style="width: ' . $param['w_field_range_width'] . 'px;" ' . $param['attributes'] . ' disabled/></div><div valign="middle" align="left" style="display: table-cell; padding-left: 4px;"><input type="" value="' . ($param['w_field_value2'] != 'null' ? $param['w_field_value2'] : '') . '" name="' . $id . '_elementform_id_temp1" id="' . $id . '_elementform_id_temp1" onkeypress="return check_isnum_or_minus(event)" style="width: ' . $param['w_field_range_width'] . 'px;" ' . $param['attributes'] . ' disabled/></div></div><div style="display: table-row;"><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_from">' . $w_mini_labels[0] . '</label></div><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_to">' . $w_mini_labels[1] . '</label></div></div></div></div></div>';
3274
- break;
3275
- }
3276
- case 'type_grading': {
3277
- $params_names = array(
3278
- 'w_field_label_size',
3279
- 'w_field_label_pos',
3280
- 'w_items',
3281
- 'w_total',
3282
- 'w_required',
3283
- 'w_class',
3284
- );
3285
- $temp = $params;
3286
- if ( strpos($temp, 'w_hide_label') > -1 ) {
3287
- $params_names = array(
3288
- 'w_field_label_size',
3289
- 'w_field_label_pos',
3290
- 'w_hide_label',
3291
- 'w_items',
3292
- 'w_total',
3293
- 'w_required',
3294
- 'w_class',
3295
- );
3296
- }
3297
- foreach ( $params_names as $params_name ) {
3298
- $temp = explode('*:*' . $params_name . '*:*', $temp);
3299
- $param[$params_name] = $temp[0];
3300
- $temp = $temp[1];
3301
- }
3302
- if ( $temp ) {
3303
- $temp = explode('*:*w_attr_name*:*', $temp);
3304
- $attrs = array_slice($temp, 0, count($temp) - 1);
3305
- foreach ( $attrs as $attr ) {
3306
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
3307
- }
3308
- }
3309
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
3310
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
3311
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
3312
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
3313
- $w_items = explode('***', $param['w_items']);
3314
- $grading_items = '';
3315
- for ( $i = 0; $i < count($w_items); $i++ ) {
3316
- $grading_items .= '<div id="' . $id . '_element_div' . $i . '" class="grading"><input id="' . $id . '_elementform_id_temp_' . $i . '" name="' . $id . '_elementform_id_temp_' . $i . '" onkeypress="return check_isnum_or_minus(event)" value="" type="text" size="5" onkeyup="sum_grading_values(' . $id . ',&quot;form_id_temp&quot;)" onchange="sum_grading_values(' . $id . ',&quot;form_id_temp&quot;)" ' . $param['attributes'] . ' disabled/><label id="' . $id . '_label_elementform_id_temp' . $i . '" class="ch-rad-label">' . $w_items[$i] . '</label></div>';
3317
- }
3318
- $rep = '<div id="wdform_field' . $id . '" type="type_grading" class="wdform_field" style="display: table-cell;">'
3319
- . $arrows . '
3320
- <div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; vertical-align: top; width: ' . $param['w_field_label_size'] . 'px;">
3321
- <span id="' . $id . '_element_labelform_id_temp" class="label">' . $label . '</span>
3322
- <span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span>
3323
- </div>
3324
- <div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';">
3325
- <input type="hidden" value="type_grading" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp">
3326
- <input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp">
3327
- <input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/>
3328
- <input type="hidden" value="' . $param['w_total'] . '" name="' . $id . '_grading_totalform_id_temp" id="' . $id . '_grading_totalform_id_temp">
3329
- <div id="' . $id . '_elementform_id_temp">' . $grading_items . '
3330
- <div id="' . $id . '_element_total_divform_id_temp" class="grading_div" style="display: ' . (!$param['w_total'] ? 'none' : 'block') . ';">Total:<span id="' . $id . '_sum_elementform_id_temp" name="' . $id . '_sum_elementform_id_temp">0</span>/<span id="' . $id . '_total_elementform_id_temp" name="' . $id . '_total_elementform_id_temp">' . $param['w_total'] . '</span>
3331
- <span id="' . $id . '_text_elementform_id_temp" name="' . $id . '_text_elementform_id_temp"></span>
3332
- </div>
3333
- </div>
3334
- </div>
3335
- </div>';
3336
- break;
3337
- }
3338
- case 'type_matrix': {
3339
- $params_names = array(
3340
- 'w_field_label_size',
3341
- 'w_field_label_pos',
3342
- 'w_field_input_type',
3343
- 'w_rows',
3344
- 'w_columns',
3345
- 'w_required',
3346
- 'w_class',
3347
- 'w_textbox_size',
3348
- );
3349
- $temp = $params;
3350
- if ( strpos($temp, 'w_hide_label') > -1 ) {
3351
- $params_names = array(
3352
- 'w_field_label_size',
3353
- 'w_field_label_pos',
3354
- 'w_hide_label',
3355
- 'w_field_input_type',
3356
- 'w_rows',
3357
- 'w_columns',
3358
- 'w_required',
3359
- 'w_class',
3360
- 'w_textbox_size',
3361
- );
3362
- }
3363
- foreach ( $params_names as $params_name ) {
3364
- $temp = explode('*:*' . $params_name . '*:*', $temp);
3365
- $param[$params_name] = $temp[0];
3366
- $temp = $temp[1];
3367
- }
3368
- if ( $temp ) {
3369
- $temp = explode('*:*w_attr_name*:*', $temp);
3370
- $attrs = array_slice($temp, 0, count($temp) - 1);
3371
- foreach ( $attrs as $attr ) {
3372
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
3373
- }
3374
- }
3375
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
3376
- $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
3377
- $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
3378
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
3379
- $param['w_textbox_size'] = isset($param['w_textbox_size']) ? $param['w_textbox_size'] : '100';
3380
- $w_rows = explode('***', $param['w_rows']);
3381
- $w_columns = explode('***', $param['w_columns']);
3382
- $column_labels = '';
3383
- for ( $i = 1; $i < count($w_columns); $i++ ) {
3384
- $column_labels .= '<div id="' . $id . '_element_td0_' . $i . '" class="matrix_" style="display: table-cell;"><label id="' . $id . '_label_elementform_id_temp0_' . $i . '" name="' . $id . '_label_elementform_id_temp0_' . $i . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $i . '" value="' . $w_columns[$i] . '">' . $w_columns[$i] . '</label></div>';
3385
- }
3386
- $rows_columns = '';
3387
- for ( $i = 1; $i < count($w_rows); $i++ ) {
3388
- $rows_columns .= '<div id="' . $id . '_element_tr' . $i . '" style="display: table-row;"><div id="' . $id . '_element_td' . $i . '_0" class="matrix_" style="display: table-cell;"><label id="' . $id . '_label_elementform_id_temp' . $i . '_0" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $i . '" value="' . $w_rows[$i] . '">' . $w_rows[$i] . '</label></div>';
3389
- for ( $k = 1; $k < count($w_columns); $k++ ) {
3390
- if ( $param['w_field_input_type'] == 'radio' ) {
3391
- $rows_columns .= '<div id="' . $id . '_element_td' . $i . '_' . $k . '" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="' . $id . '_input_elementform_id_temp' . $i . '_' . $k . '" align="center" size="14" type="radio" name="' . $id . '_input_elementform_id_temp' . $i . '" value="' . $i . '_' . $k . '" disabled/></div>';
3392
- }
3393
- else {
3394
- if ( $param['w_field_input_type'] == 'checkbox' ) {
3395
- $rows_columns .= '<div id="' . $id . '_element_td' . $i . '_' . $k . '" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="' . $id . '_input_elementform_id_temp' . $i . '_' . $k . '" align="center" size="14" type="checkbox" name="' . $id . '_input_elementform_id_temp' . $i . '_' . $k . '" value="1" disabled/></div>';
3396
- }
3397
- else {
3398
- if ( $param['w_field_input_type'] == 'text' ) {
3399
- $rows_columns .= '<div id="' . $id . '_element_td' . $i . '_' . $k . '" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="' . $id . '_input_elementform_id_temp' . $i . '_' . $k . '" align="center" type="text" name="' . $id . '_input_elementform_id_temp' . $i . '_' . $k . '" value="" style="width:' . $param['w_textbox_size'] . 'px" disabled/></div>';
3400
- }
3401
- else {
3402
- if ( $param['w_field_input_type'] == 'select' ) {
3403
- $rows_columns .= '<div id="' . $id . '_element_td' . $i . '_' . $k . '" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><select id="' . $id . '_select_yes_noform_id_temp' . $i . '_' . $k . '" name="' . $id . '_select_yes_noform_id_temp' . $i . '_' . $k . '" disabled><option value=""> </option><option value="yes">Yes</option><option value="no">No</option></select></div>';
3404
- }
3405
- }
3406
- }
3407
- }
3408
- }
3409
- $rows_columns .= '</div>';
3410
- }
3411
- $rep = '<div id="wdform_field' . $id . '" type="type_matrix" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_matrix" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_field_input_type'] . '" name="' . $id . '_input_typeform_id_temp" id="' . $id . '_input_typeform_id_temp"><input type="hidden" value="' . $param['w_textbox_size'] . '" name="' . $id . '_textbox_sizeform_id_temp" id="' . $id . '_textbox_sizeform_id_temp"><div id="' . $id . '_elementform_id_temp" style="display: table;" ' . $param['attributes'] . '><div id="' . $id . '_table_little" style="display: table-row-group;"><div id="' . $id . '_element_tr0" style="display: table-row;"><div id="' . $id . '_element_td0_0" style="display: table-cell;"></div>' . $column_labels . '</div>' . $rows_columns . '</div></div></div></div>';
3412
- break;
3413
- }
3414
- case 'type_submit_reset': {
3415
- $params_names = array( 'w_submit_title', 'w_reset_title', 'w_class', 'w_act' );
3416
- $temp = $params;
3417
- foreach ( $params_names as $params_name ) {
3418
- $temp = explode('*:*' . $params_name . '*:*', $temp);
3419
- $param[$params_name] = $temp[0];
3420
- $temp = $temp[1];
3421
- }
3422
- if ( $temp ) {
3423
- $temp = explode('*:*w_attr_name*:*', $temp);
3424
- $attrs = array_slice($temp, 0, count($temp) - 1);
3425
- foreach ( $attrs as $attr ) {
3426
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
3427
- }
3428
- }
3429
- $param['w_act'] = ($param['w_act'] == "false" ? 'style="display: none;"' : "");
3430
- $rep = '<div id="wdform_field' . $id . '" type="type_submit_reset" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><span id="' . $id . '_element_labelform_id_temp" style="display: none;">type_submit_reset_' . $id . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><input type="hidden" value="type_submit_reset" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><button type="button" class="button button-hero button-submit" id="' . $id . '_element_submitform_id_temp" value="' . $param['w_submit_title'] . '" disabled ' . $param['attributes'] . '>' . $param['w_submit_title'] . '</button><button type="button" class="button button-secondary button-hero button-reset" id="' . $id . '_element_resetform_id_temp" value="' . $param['w_reset_title'] . '" disabled ' . $param['w_act'] . ' ' . $param['attributes'] . '>' . $param['w_reset_title'] . '</button></div></div>';
3431
- break;
3432
- }
3433
- case 'type_button': {
3434
- $params_names = array( 'w_title', 'w_func', 'w_class' );
3435
- $temp = $params;
3436
- foreach ( $params_names as $params_name ) {
3437
- $temp = explode('*:*' . $params_name . '*:*', $temp);
3438
- $param[$params_name] = $temp[0];
3439
- $temp = $temp[1];
3440
- }
3441
- if ( $temp ) {
3442
- $temp = explode('*:*w_attr_name*:*', $temp);
3443
- $attrs = array_slice($temp, 0, count($temp) - 1);
3444
- foreach ( $attrs as $attr ) {
3445
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
3446
- }
3447
- }
3448
- $param['w_title'] = explode('***', $param['w_title']);
3449
- $param['w_func'] = explode('***', $param['w_func']);
3450
- $rep .= '<div id="wdform_field' . $id . '" type="type_button" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><span id="' . $id . '_element_labelform_id_temp" style="display: none;">button_' . $id . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><input type="hidden" value="type_button" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp">';
3451
- foreach ( $param['w_title'] as $key => $title ) {
3452
- $rep .= '<button type="button" class="button button-secondary button-large" id="' . $id . '_elementform_id_temp' . $key . '" name="' . $id . '_elementform_id_temp' . $key . '" value="' . htmlentities($title, ENT_COMPAT) . '" onclick="' . $param['w_func'][$key] . '" ' . $param['attributes'] . '>' . $title . '</button>';
3453
- }
3454
- $rep .= '</div></div>';
3455
- break;
3456
- }
3457
- }
3458
- $form = str_replace('%' . $id . ' - ' . $labels[$ids_key] . '%', $rep, $form);
3459
- $form = str_replace('%' . $id . ' -' . $labels[$ids_key] . '%', $rep, $form);
3460
- $row->form_front = $form;
3461
- }
3462
- }
3463
-
3464
- return $row;
3465
- }
3466
-
3467
- /**
3468
- * Get theme rows data.
3469
- *
3470
- * @param string $old
3471
- * @return mixed
3472
- */
3473
- public function get_theme_rows_data( $old = '' ) {
3474
- global $wpdb;
3475
- $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes ORDER BY `default` DESC, `version` DESC, `id` ASC");
3476
-
3477
- return $rows;
3478
- }
3479
-
3480
- /**
3481
- * Get queries rows data.
3482
- *
3483
- * @param int $id
3484
- * @return mixed
3485
- */
3486
- public function get_queries_rows_data( $id = 0 ) {
3487
- global $wpdb;
3488
- $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_query WHERE form_id=" . $id . " ORDER BY id ASC");
3489
-
3490
- return $rows;
3491
- }
3492
-
3493
- /**
3494
- * Get labels.
3495
- *
3496
- * @param $id
3497
- * @return mixed
3498
- */
3499
- public function get_labels( $id = 0 ) {
3500
- global $wpdb;
3501
- $rows = $wpdb->get_col("SELECT DISTINCT `element_label` FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id=" . $id);
3502
-
3503
- return $rows;
3504
- }
3505
-
3506
- /**
3507
- * Is paypal.
3508
- *
3509
- * @param int $id
3510
- * @return mixed
3511
- */
3512
- public function is_paypal( $id = 0 ) {
3513
- global $wpdb;
3514
- $rows = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_sessions WHERE form_id=" . $id);
3515
-
3516
- return $rows;
3517
- }
3518
-
3519
- /**
3520
- * Return total count of forms.
3521
- *
3522
- * @return null|string
3523
- */
3524
- public function total() {
3525
- global $wpdb;
3526
- $query = "SELECT COUNT(*) FROM `" . $wpdb->prefix . "formmaker`";
3527
-
3528
- $search = WDW_FM_Library(self::PLUGIN)->get('s', '');
3529
-
3530
- $query .= (!WDFMInstance(self::PLUGIN)->is_free ? '' : 'WHERE id' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')');
3531
- if ( $search ) {
3532
- $query .= (!WDFMInstance(self::PLUGIN)->is_free ? 'WHERE' : ' AND') . ' `title` LIKE "%' . $search . '%"';
3533
- }
3534
-
3535
- $total = $wpdb->get_var($query);
3536
-
3537
- return $total;
3538
- }
3539
-
3540
- /**
3541
- * Get display options.
3542
- *
3543
- * @param int $id
3544
- *
3545
- * @return string
3546
- */
3547
- public function get_display_options( $id = 0 ) {
3548
- global $wpdb;
3549
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_display_options WHERE form_id="%d"', $id));
3550
- if ( !$row ) {
3551
- $row = new stdClass();
3552
- $row->form_id = $id;
3553
- $row->type = 'embedded';
3554
- $row->scrollbox_loading_delay = 0;
3555
- $row->popover_animate_effect = '';
3556
- $row->popover_loading_delay = 0;
3557
- $row->popover_frequency = 0;
3558
- $row->topbar_position = 1;
3559
- $row->topbar_remain_top = 1;
3560
- $row->topbar_closing = 1;
3561
- $row->topbar_hide_duration = 0;
3562
- $row->scrollbox_position = 1;
3563
- $row->scrollbox_trigger_point = 20;
3564
- $row->scrollbox_hide_duration = 0;
3565
- $row->scrollbox_auto_hide = 1;
3566
- $row->hide_mobile = 0;
3567
- $row->scrollbox_closing = 1;
3568
- $row->scrollbox_minimize = 1;
3569
- $row->scrollbox_minimize_text = '';
3570
- $row->display_on = 'home,post,page';
3571
- $row->posts_include = '';
3572
- $row->pages_include = '';
3573
- $row->display_on_categories = 'select_all_categories';
3574
- $row->current_categories = 'select_all_categories';
3575
- $row->show_for_admin = 0;
3576
- }
3577
-
3578
- return $row;
3579
- }
3580
-
3581
- public function fm_posts_query() {
3582
- $default_post_types = array( 'post', 'page' );
3583
- $query = array(
3584
- 'post_type' => $default_post_types,
3585
- 'suppress_filters' => TRUE,
3586
- 'update_post_term_cache' => FALSE,
3587
- 'update_post_meta_cache' => FALSE,
3588
- 'post_status' => 'publish',
3589
- 'posts_per_page' => -1,
3590
- );
3591
- $get_posts = new WP_Query;
3592
- $posts = $get_posts->query($query);
3593
- if ( !$get_posts->post_count ) {
3594
- return FALSE;
3595
- }
3596
- $results = array();
3597
- foreach ( $posts as $post ) {
3598
- $post_id = (int) $post->ID;
3599
- $post_type = $post->post_type;
3600
- $post_title = trim(esc_html(strip_tags(get_the_title($post))));
3601
- $results[$post_id] = array(
3602
- 'title' => $post_title,
3603
- 'post_type' => $post->post_type,
3604
- );
3605
- }
3606
-
3607
- wp_reset_postdata();
3608
- return $results;
3609
- }
3610
-
3611
- public function fm_categories_query() {
3612
- $categories = get_categories(array(
3613
- 'hide_empty' => 0,
3614
- ));
3615
- $final_categories = array();
3616
- foreach ( $categories as $key => $value ) {
3617
- $final_categories[$value->term_id] = $value->name;
3618
- }
3619
-
3620
- return $final_categories;
3621
- }
3622
-
3623
- /**
3624
- * Get all revisions from formmaker_backup.
3625
- *
3626
- * @param int $id
3627
- *
3628
- * @return array
3629
- */
3630
- public function get_revisions( $id ) {
3631
- global $wpdb;
3632
- $result = array();
3633
- $result['total'] = 0;
3634
- $query = "SELECT backup_id, cur, date FROM " . $wpdb->prefix . "formmaker_backup WHERE id = $id ORDER BY backup_id DESC";
3635
- $result['data'] = $wpdb->get_results($query);
3636
- if($result['data']) {
3637
- $result['total'] = $wpdb->num_rows;
3638
- }
3639
- return $result;
3640
- }
3641
-
3642
- /**
3643
- * Get current form data from backup.
3644
- *
3645
- * @return array
3646
- */
3647
- public function get_current_revision( $id ) {
3648
- global $wpdb;
3649
- $query = "SELECT backup_id, cur, date FROM " . $wpdb->prefix . "formmaker_backup WHERE cur = 1 && id =" . $id;
3650
- $result = $wpdb->get_row($query);
3651
- return $result;
3652
- }
3653
-
3654
- /**
3655
- * Get revision date.
3656
- *
3657
- * @param int $backup_id
3658
- *
3659
- * @return int
3660
- */
3661
- public function get_revision_date( $backup_id = 0 ) {
3662
- global $wpdb;
3663
- $query = "SELECT date FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id = $backup_id";
3664
- return $wpdb->get_var($query);
3665
- }
3666
-
3667
- /**
3668
- * Get max row.
3669
- *
3670
- * @param string $table
3671
- * @param string $column
3672
- *
3673
- * @return int
3674
- */
3675
- public function get_max_row( $table = '', $column = '' ) {
3676
- global $wpdb;
3677
- $query = "SELECT max(" . $column . ") FROM " . $wpdb->prefix . $table;
3678
-
3679
- return $wpdb->get_var($query);
3680
- }
3681
-
3682
- /**
3683
- * Delete row.
3684
- *
3685
- * @param int $id
3686
- *
3687
- * @return bool
3688
- */
3689
- public function delete_formmaker_query( $id = 0 ) {
3690
- global $wpdb;
3691
- $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id =' . $id;
3692
- return $wpdb->query($query);
3693
- }
3694
-
3695
- public function get_mail_verification_post_id() {
3696
- global $wpdb;
3697
- $query = 'SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE mail_verification_post_id!=0';
3698
-
3699
- return $wpdb->get_var($query);
3700
- }
3701
-
3702
- /**
3703
- * Update row(s) in db.
3704
- *
3705
- * @param string $table
3706
- * @param array $data_params
3707
- * @param array $where_data_params
3708
- * params = [where]
3709
- *
3710
- * @return bool
3711
- */
3712
- public function update_data( $table = '', $data_params = array(), $where_data_params = array() ) {
3713
- global $wpdb;
3714
- return $wpdb->update($wpdb->prefix . $table, $data_params, $where_data_params);
3715
- }
3716
-
3717
- /**
3718
- * Get request value.
3719
- *
3720
- * @param string $table
3721
- * @param array $data
3722
- *
3723
- * @return false|int
3724
- */
3725
- public function insert_data_to_db( $table = '', $data = array() ) {
3726
- global $wpdb;
3727
- $query = $wpdb->insert($wpdb->prefix . $table, $data);
3728
- $wpdb->show_errors();
3729
-
3730
- return $query;
3731
- }
3732
-
3733
- /**
3734
- * Get id of default theme.
3735
- *
3736
- * @return int (id)
3737
- */
3738
- public function get_default_theme_id() {
3739
- global $wpdb;
3740
-
3741
- return $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'");
3742
- }
3743
-
3744
- /**
3745
- * Replace data.
3746
- *
3747
- * @param array $data
3748
- *
3749
- * @return bool
3750
- */
3751
- public function replace_display_options( $data = array() ) {
3752
- global $wpdb;
3753
-
3754
- return $wpdb->replace($wpdb->prefix . 'formmaker_display_options', $data);
3755
- }
3756
-
3757
- /**
3758
- * Get previous backup_id.
3759
- *
3760
- * @param int $backup_id
3761
- * @param int $id
3762
- *
3763
- * @return int
3764
- */
3765
- public function get_prev_backup_id( $backup_id = 0, $id = 0 ) {
3766
- global $wpdb;
3767
- $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id < " . $backup_id . " AND id = " . $id . " ORDER BY backup_id DESC LIMIT 0 , 1 ";
3768
-
3769
- return $wpdb->get_var($query);
3770
- }
3771
-
3772
- /**
3773
- * Get next backup_id.
3774
- *
3775
- * @param int $backup_id
3776
- * @param int $id
3777
- *
3778
- * @return int
3779
- */
3780
- public function get_backup_id( $backup_id = 0, $id = 0 ) {
3781
- global $wpdb;
3782
- $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id > " . $backup_id . " AND id = " . $id . " ORDER BY backup_id ASC LIMIT 0 , 1 ";
3783
-
3784
- return $wpdb->get_var($query);
3785
- }
3786
-
3787
- public function get_autogen_layout( $id = 0 ) {
3788
- global $wpdb;
3789
- $autogen_layout = $wpdb->get_var($wpdb->prepare('SELECT autogen_layout FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
3790
- return $autogen_layout == '1';
3791
- }
3792
-
3793
- /**
3794
- * Get count of rows from table.
3795
- *
3796
- * @param array $params
3797
- * params = [selection, table, where]
3798
- *
3799
- * @return int
3800
- */
3801
- public function get_count( $params = array() ) {
3802
- global $wpdb;
3803
- $query = "SELECT count(" . $params['selection'] . ") FROM " . $wpdb->prefix . $params['table'];
3804
- if ( isset($params['where']) ) {
3805
- $query .= " WHERE " . $params['where'];
3806
- }
3807
-
3808
- return $wpdb->get_var($query);
3809
- }
3810
-
3811
- /**
3812
- * Delete row(s) from db.
3813
- *
3814
- * @param array $params
3815
- * params = [selection, table, where, order_by, limit]
3816
- *
3817
- * @return array
3818
- */
3819
- public function delete_rows( $params = array() ) {
3820
- global $wpdb;
3821
- $query = "DELETE FROM " . $wpdb->prefix . $params['table'];
3822
- if ( isset($params['where']) ) {
3823
- $query .= " WHERE " . $params['where'];
3824
- }
3825
- if ( isset($params['order_by']) ) {
3826
- $query .= " " . $params['order_by'];
3827
- }
3828
- if ( isset($params['limit']) ) {
3829
- $query .= " " . $params['limit'];
3830
- }
3831
-
3832
- return $wpdb->query($query);
3833
- }
3834
-
3835
- /**
3836
- * Get row(s) from db.
3837
- *
3838
- * @param string $get_type
3839
- * @param array $params
3840
- * params = [selection, table, where, order_by, limit]
3841
- *
3842
- * @return array
3843
- */
3844
- public function select_rows( $get_type = '', $params = array() ) {
3845
- global $wpdb;
3846
- $query = "SELECT " . $params['selection'] . " FROM " . $wpdb->prefix . $params['table'];
3847
- if ( isset($params['where']) ) {
3848
- $query .= " WHERE " . $params['where'];
3849
- }
3850
- if ( isset($params['order_by']) ) {
3851
- $query .= " " . $params['order_by'];
3852
- }
3853
- if ( isset($params['limit']) ) {
3854
- $query .= " " . $params['limit'];
3855
- }
3856
- if ( $get_type == "get_col" ) {
3857
- return $wpdb->get_col($query);
3858
- }
3859
- elseif ( $get_type == "get_var" ) {
3860
- return $wpdb->get_var($query);
3861
- }
3862
- elseif ( $get_type == "get_results" ) {
3863
- return $wpdb->get_results($query);
3864
- }
3865
-
3866
- return $wpdb->get_row($query);
3867
- }
3868
-
3869
- /**
3870
- * @param int $form_id
3871
- */
3872
- public function create_js( $form_id = 0) {
3873
- WDW_FM_Library(self::PLUGIN)->create_js($form_id, true);
3874
- $jsversion = rand();
3875
- global $wpdb;
3876
- $wpdb->update($wpdb->prefix . 'formmaker', array(
3877
- 'jsversion' => $jsversion,
3878
- ), array( 'id' => $form_id ));
3879
- }
3880
-
3881
- /**
3882
- * Insert to DB.
3883
- *
3884
- * @param int $backup_id
3885
- * @param int $id
3886
- *
3887
- * @return bool
3888
- */
3889
- public function insert_formmaker_backup( $backup_id = 0, $id = 0 ) {
3890
- global $wpdb;
3891
- $query = "INSERT INTO " . $wpdb->prefix . "formmaker_backup (backup_id, cur, id, title, `type`, mail, form_front, theme, javascript, submit_text, url, submit_text_type, script_mail, script_mail_user, counter, published, label_order, label_order_current, article_id, pagination, show_title, show_numbers, public_key, private_key, recaptcha_theme, paypal_mode, checkout_mode, paypal_email, payment_currency, tax, form_fields, savedb, sendemail, requiredmark, from_mail, from_name, reply_to, send_to, autogen_layout, custom_front, mail_from_user, mail_from_name_user, reply_to_user, `condition`, mail_cc, mail_cc_user, mail_bcc, mail_bcc_user, mail_subject, mail_subject_user, mail_mode, mail_mode_user, mail_attachment, mail_attachment_user, user_id_wd, sortable, frontend_submit_fields, frontend_submit_stat_fields, mail_emptyfields, mail_verify, mail_verify_expiretime, mail_verification_post_id, save_uploads, header_title, header_description, header_image_url, header_image_animation, header_hide_image, header_hide, privacy, date) SELECT " . $backup_id . ", 1, formmakerbkup.id, formmakerbkup.title, formmakerbkup.type, formmakerbkup.mail, formmakerbkup.form_front, formmakerbkup.theme, formmakerbkup.javascript, formmakerbkup.submit_text, formmakerbkup.url, formmakerbkup.submit_text_type, formmakerbkup.script_mail, formmakerbkup.script_mail_user, formmakerbkup.counter, formmakerbkup.published, formmakerbkup.label_order, formmakerbkup.label_order_current, formmakerbkup.article_id, formmakerbkup.pagination, formmakerbkup.show_title, formmakerbkup.show_numbers, formmakerbkup.public_key, formmakerbkup.private_key, formmakerbkup.recaptcha_theme, formmakerbkup.paypal_mode, formmakerbkup.checkout_mode, formmakerbkup.paypal_email, formmakerbkup.payment_currency, formmakerbkup.tax, formmakerbkup.form_fields, formmakerbkup.savedb, formmakerbkup.sendemail, formmakerbkup.requiredmark, formmakerbkup.from_mail, formmakerbkup.from_name, formmakerbkup.reply_to, formmakerbkup.send_to, formmakerbkup.autogen_layout, formmakerbkup.custom_front, formmakerbkup.mail_from_user, formmakerbkup.mail_from_name_user, formmakerbkup.reply_to_user, formmakerbkup.condition, formmakerbkup.mail_cc, formmakerbkup.mail_cc_user, formmakerbkup.mail_bcc, formmakerbkup.mail_bcc_user, formmakerbkup.mail_subject, formmakerbkup.mail_subject_user, formmakerbkup.mail_mode, formmakerbkup.mail_mode_user, formmakerbkup.mail_attachment, formmakerbkup.mail_attachment_user, formmakerbkup.user_id_wd, formmakerbkup.sortable, formmakerbkup.frontend_submit_fields, formmakerbkup.frontend_submit_stat_fields, formmakerbkup.mail_emptyfields, formmakerbkup.mail_verify, formmakerbkup.mail_verify_expiretime, formmakerbkup.mail_verification_post_id, formmakerbkup.save_uploads, formmakerbkup.header_title, formmakerbkup.header_description, formmakerbkup.header_image_url, formmakerbkup.header_image_animation, formmakerbkup.header_hide_image, formmakerbkup.header_hide, formmakerbkup.privacy, '".current_time('timestamp')."' FROM " . $wpdb->prefix . "formmaker as formmakerbkup WHERE id=" . $id;
3892
- return $wpdb->query($query);
3893
- }
3894
-
3895
- /**
3896
- * Update mail_verification_post_id in formmaker table
3897
- *
3898
- * @param int $id
3899
- *
3900
- * @return bool
3901
- */
3902
- public function update_emailverification_id( $id = 0 ) {
3903
- global $wpdb;
3904
- $sql = "UPDATE " . $wpdb->prefix . "formmaker SET mail_verification_post_id = " . $id . " WHERE mail_verification_post_id != 0";
3905
-
3906
- return $wpdb->query($sql);
3907
- }
3908
-
3909
- /**
3910
- * Check if mail_verification_post_id the same in table posts and formmaker
3911
- *
3912
- * @param int $id
3913
- *
3914
- * @return bool
3915
- */
3916
- public function check_mailverification_id_posts_vs_fm( $id = 0 ) {
3917
- global $wpdb;
3918
- $rows = $wpdb->get_results('SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE mail_verification_post_id = ' . $id);
3919
- if ( $rows ) {
3920
- return TRUE;
3921
- }
3922
-
3923
- return FALSE;
3924
- }
3925
-
3926
- /**
3927
- * Get email verification post id
3928
- *
3929
- * @return int
3930
- */
3931
- public function get_emailverification_post_id() {
3932
- global $wpdb;
3933
- $post_type = 'fmemailverification';
3934
- $row = get_posts(array('post_type' => $post_type));
3935
- if (!empty($row[0])) {
3936
- $id = $row[0]->ID;
3937
- if (!$this->check_mailverification_id_posts_vs_fm($id)) {
3938
- $this->update_emailverification_id($id);
3939
- }
3940
- return $id;
3941
- }
3942
- else {
3943
- $post_params = array(
3944
- 'post_author' => 1,
3945
- 'post_content' => '[email_verification]',
3946
- 'post_title' => 'Email Verification',
3947
- 'post_status' => 'publish',
3948
- 'post_type' => $post_type,
3949
- 'comment_status' => 'closed',
3950
- 'ping_status' => 'closed',
3951
- 'post_parent' => 0,
3952
- 'menu_order' => 0,
3953
- 'import_id' => 0,
3954
- );
3955
- $insert_id = wp_insert_post($post_params);
3956
- if (!is_wp_error($insert_id)) { // create new post by fmemailverification type
3957
- $this->update_emailverification_id($insert_id);
3958
-
3959
- return $insert_id;
3960
- }
3961
- }
3962
- }
3963
-
3964
- /**
3965
- * Create Preview Form post.
3966
- *
3967
- * @return string $guid
3968
- */
3969
- public function get_form_preview_post() {
3970
- $post_type = 'form-maker' . WDFMInstance(self::PLUGIN)->plugin_postfix;
3971
- $row = get_posts(array( 'post_type' => $post_type ));
3972
- if ( !empty($row[0]) ) {
3973
- return get_post_permalink($row[0]->ID);
3974
- }
3975
- else {
3976
- $post_params = array(
3977
- 'post_author' => 1,
3978
- 'post_status' => 'publish',
3979
- 'post_content' => '[FormPreview' . WDFMInstance(self::PLUGIN)->plugin_postfix . ']',
3980
- 'post_title' => 'Preview',
3981
- 'post_type' => 'form-maker' . WDFMInstance(self::PLUGIN)->plugin_postfix,
3982
- 'comment_status' => 'closed',
3983
- 'ping_status' => 'closed',
3984
- 'post_parent' => 0,
3985
- 'menu_order' => 0,
3986
- 'import_id' => 0,
3987
- );
3988
- // Create new post by fmformpreview type.
3989
- $insert_id = wp_insert_post($post_params);
3990
- if ( !is_wp_error($insert_id) ) {
3991
- flush_rewrite_rules();
3992
-
3993
- return get_post_permalink($insert_id);
3994
- }
3995
- else {
3996
- return "";
3997
- }
3998
- }
3999
- }
4000
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class FMModelManage_fmc
5
+ */
6
+ class FMModelManage_fmc extends CFMAdminModel {
7
+
8
+ /**
9
+ * Get forms.
10
+ *
11
+ * @param $params
12
+ *
13
+ * @return array|null|object
14
+ */
15
+ public function get_rows_data( $params = array() ) {
16
+ $order = $params['order'];
17
+ $orderby = $params['orderby'];
18
+ $items_per_page = $params['items_per_page'];
19
+ $search = WDW_FM_Library(self::PLUGIN)->get('s', '');
20
+ $page = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
21
+ $limit = $page ? ($page - 1) * $items_per_page : 0;
22
+
23
+ global $wpdb;
24
+ $query = "SELECT t1.* FROM " . $wpdb->prefix . "formmaker as t1 ";
25
+ $query .= (!WDFMInstance(self::PLUGIN)->is_free ? '' : 'WHERE t1.id' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')');
26
+ if ( $search ) {
27
+ $query .= (!WDFMInstance(self::PLUGIN)->is_free ? 'WHERE' : ' AND') . ' t1.title LIKE "%' . $search . '%"';
28
+ }
29
+ $query .= ' ORDER BY t1.`' . $orderby . '` ' . $order;
30
+ $query .= " LIMIT " . $limit . "," . $items_per_page;
31
+ $rows = $wpdb->get_results($query);
32
+ if ( !empty($rows) ) {
33
+ foreach ( $rows as $row ) {
34
+ if ( !isset($row->header_hide) ) {
35
+ $row->header_hide = 1;
36
+ }
37
+ $query = "SELECT count(DISTINCT group_id) FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id=" . (int) $row->id . "";
38
+ $row->submission_count = $wpdb->get_var($query);
39
+ }
40
+ }
41
+
42
+ return $rows;
43
+ }
44
+
45
+ /**
46
+ * Get row data.
47
+ *
48
+ * @param int $id
49
+ * @return stdClass
50
+ */
51
+ public function get_row_data( $id = 0 ) {
52
+ global $wpdb;
53
+ if ( $id != 0 ) {
54
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
55
+ if ( $row ) {
56
+ $row->gdpr_checkbox = 0;
57
+ $row->gdpr_checkbox_text = __('I consent collecting this data and processing it according to {{privacy_policy}} of this website.', WDFMInstance(self::PLUGIN)->prefix);
58
+ $row->save_ip = 1;
59
+ $row->save_user_id = 1;
60
+ if ( isset($row->privacy) ) {
61
+ if ( $row->privacy ) {
62
+ $privacy = json_decode($row->privacy);
63
+ $row->gdpr_checkbox = isset($privacy->gdpr_checkbox) ? $privacy->gdpr_checkbox : 0;
64
+ $row->gdpr_checkbox_text = isset($privacy->gdpr_checkbox_text) ? $privacy->gdpr_checkbox_text : __('I consent collecting this data and processing it according to {{privacy_policy}} of this website.', WDFMInstance(self::PLUGIN)->prefix);
65
+ $row->save_ip = isset($privacy->save_ip) ? $privacy->save_ip : 1;
66
+ $row->save_user_id = isset($privacy->save_user_id) ? $privacy->save_user_id : 1;
67
+ }
68
+ }
69
+ }
70
+ }
71
+ else {
72
+ // Add "Submit" button to new forms.
73
+ $row = new stdClass();
74
+ $row->id = 0;
75
+ $row->title = '';
76
+ $row->mail = '';
77
+ $row->form = '';
78
+ $row->form_front = '<div class="wdform-page-and-images fm-form-builder"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="true" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row ui-sortable-handle">%1 - type_submit_reset_1%</div></div></div><div valign="top" class="wdform_footer wd-width-100"><div class="wd-width-100"><div class="wd-width-100 wd-table" style="padding-top:10px;"><div class="wd-table-group"><div id="form_id_temppage_nav1" class="wd-table-row"></div></div></div></div></div></div></div>';
79
+ $row->theme = 0;
80
+ $row->javascript = '';
81
+ $row->submit_text = '';
82
+ $row->url = '';
83
+ $row->submit_text_type = 0;
84
+ $row->script1 = '';
85
+ $row->script2 = '';
86
+ $row->script_user1 = '';
87
+ $row->script_user2 = '';
88
+ $row->counter = 2;
89
+ $row->label_order = '1#**id**#type_submit_reset_1#**label**#type_submit_reset#****##**id**##**label**##****#';
90
+ $row->article_id = '';
91
+ $row->pagination = '';
92
+ $row->show_title = '';
93
+ $row->show_numbers = '';
94
+ $row->public_key = '';
95
+ $row->private_key = '';
96
+ $row->recaptcha_theme = '';
97
+ $row->from_name = '';
98
+ $row->from_mail = '';
99
+ $row->label_order_current = '1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#';
100
+ $row->script_mail_user = '';
101
+ $row->script_mail = '';
102
+ $row->tax = 0;
103
+ $row->payment_currency = '$';
104
+ $row->paypal_email = '';
105
+ $row->checkout_mode = 'testmode';
106
+ $row->paypal_mode = 0;
107
+ $row->published = 1;
108
+ $row->form_fields = '1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*';
109
+ $row->savedb = 1;
110
+ $row->sendemail = 1;
111
+ $row->requiredmark = '*';
112
+ $row->reply_to = 0;
113
+ $row->send_to = 0;
114
+ $row->autogen_layout = 1;
115
+ $row->custom_front = '';
116
+ $row->mail_from_user = '';
117
+ $row->mail_from_name_user = '';
118
+ $row->reply_to_user = '';
119
+ $row->save_uploads = 1;
120
+ $row->header_title = '';
121
+ $row->header_description = '';
122
+ $row->header_image_url = '';
123
+ $row->header_image_animation = '';
124
+ $row->header_hide_image = '';
125
+ $row->header_hide = 1;
126
+ $row->gdpr_checkbox = 0;
127
+ $row->gdpr_checkbox_text = __('I consent collecting this data and processing it according to {{privacy_policy}} of this website.', WDFMInstance(self::PLUGIN)->prefix);
128
+ $row->save_ip = 1;
129
+ $row->save_user_id = 1;
130
+ }
131
+
132
+ return $row;
133
+ }
134
+
135
+ /**
136
+ * get row data new.
137
+ *
138
+ * @param int $id
139
+ * @return stdClass
140
+ */
141
+ public function get_row_data_new( $id = 0 ) {
142
+ $fm_nonce = wp_create_nonce('fm_ajax_nonce');
143
+ global $wpdb;
144
+ if ( $id != 0 ) {
145
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_backup WHERE backup_id="%d"', $id));
146
+ if ( $row ) {
147
+ $row->gdpr_checkbox = 0;
148
+ $row->gdpr_checkbox_text = __('I consent collecting this data and processing it according to {{privacy_policy}} of this website.', WDFMInstance(self::PLUGIN)->prefix);
149
+ $row->save_ip = 1;
150
+ $row->save_user_id = 1;
151
+ if ( isset($row->privacy) ) {
152
+ if ( $row->privacy ) {
153
+ $privacy = json_decode($row->privacy);
154
+ $row->gdpr_checkbox = isset($privacy->gdpr_checkbox) ? $privacy->gdpr_checkbox : 0;
155
+ $row->gdpr_checkbox_text = isset($privacy->gdpr_checkbox_text) ? $privacy->gdpr_checkbox_text : __('I consent collecting this data and processing it according to {{privacy_policy}} of this website.', WDFMInstance(self::PLUGIN)->prefix);
156
+ $row->save_ip = isset($privacy->save_ip) ? $privacy->save_ip : 1;
157
+ $row->save_user_id = isset($privacy->save_user_id) ? $privacy->save_user_id : 1;
158
+ }
159
+ }
160
+ }
161
+ }
162
+ else {
163
+ // Add "Submit" button to new forms.
164
+ $row = new stdClass();
165
+ $row->id = 0;
166
+ $row->backup_id = '';
167
+ $row->title = '';
168
+ $row->mail = '';
169
+ $row->form = '';
170
+ $row->form_front = '<div class="wdform-page-and-images fm-form-builder"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="true" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row ui-sortable-handle">%1 - type_submit_reset_1%</div></div></div><div valign="top" class="wdform_footer wd-width-100"><div class="wd-width-100"><div class="wd-width-100 wd-table" style="padding-top:10px;"><div class="wd-table-group"><div id="form_id_temppage_nav1" class="wd-table-row"></div></div></div></div></div></div></div>';
171
+ $row->theme = $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'");
172
+ $row->javascript = '';
173
+ $row->submit_text = '';
174
+ $row->url = '';
175
+ $row->submit_text_type = 1;
176
+ $row->script1 = '{all}';
177
+ $row->script2 = '{all}';
178
+ $row->script_user1 = '';
179
+ $row->script_user2 = '';
180
+ $row->counter = 2;
181
+ $row->label_order = '1#**id**#type_submit_reset_1#**label**#type_submit_reset#****##**id**##**label**##****#';
182
+ $row->article_id = 0;
183
+ $row->pagination = 'none';
184
+ $row->show_title = false;
185
+ $row->show_numbers = true;
186
+ $row->public_key = '';
187
+ $row->private_key = '';
188
+ $row->recaptcha_theme = '';
189
+ $row->from_name = '';
190
+ $row->from_mail = '';
191
+ $row->label_order_current = '1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#';
192
+ $row->script_mail_user = '';
193
+ $row->script_mail = '';
194
+ $row->tax = 0;
195
+ $row->payment_currency = '$';
196
+ $row->paypal_email = '';
197
+ $row->checkout_mode = 'testmode';
198
+ $row->paypal_mode = 0;
199
+ $row->published = 1;
200
+ $row->form_fields = '1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*';
201
+ $row->savedb = 1;
202
+ $row->sendemail = 1;
203
+ $row->requiredmark = '*';
204
+ $row->reply_to = 0;
205
+ $row->send_to = 0;
206
+ $row->autogen_layout = 1;
207
+ $row->custom_front = '';
208
+ $row->mail_from_user = '';
209
+ $row->mail_from_name_user = '';
210
+ $row->reply_to_user = '';
211
+ $row->save_uploads = 1;
212
+ $row->header_title = '';
213
+ $row->header_description = '';
214
+ $row->header_image_url = '';
215
+ $row->header_image_animation = 'none';
216
+ $row->header_hide_image = 0;
217
+ $row->header_hide = 1;
218
+ $row->condition = '';
219
+ $row->mail_cc = '';
220
+ $row->mail_cc_user = '';
221
+ $row->mail_bcc = '';
222
+ $row->mail_bcc_user = '';
223
+ $row->mail_subject = '';
224
+ $row->mail_subject_user = '';
225
+ $row->mail_mode = 1;
226
+ $row->mail_mode_user = 1;
227
+ $row->mail_attachment = 1;
228
+ $row->mail_attachment_user = 1;
229
+ $row->user_id_wd = '';
230
+ $row->sortable = 1;
231
+ $row->frontend_submit_fields = '';
232
+ $row->frontend_submit_stat_fields = '';
233
+ $row->mail_emptyfields = 0;
234
+ $row->mail_verify = 0;
235
+ $row->mail_verify_expiretime = 0;
236
+ $row->mail_verification_post_id = 0;
237
+ $row->gdpr_checkbox = 0;
238
+ $row->gdpr_checkbox_text = __('I consent collecting this data and processing it according to {{privacy_policy}} of this website.', WDFMInstance(self::PLUGIN)->prefix);
239
+ $row->save_ip = 1;
240
+ $row->save_user_id = 1;
241
+ }
242
+
243
+ $labels2 = array();
244
+ $label_id = array();
245
+ $label_order_original = array();
246
+ $label_type = array();
247
+ $label_all = explode('#****#', $row->label_order);
248
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
249
+ foreach ( $label_all as $key => $label_each ) {
250
+ $label_id_each = explode('#**id**#', $label_each);
251
+ array_push($label_id, $label_id_each[0]);
252
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
253
+ array_push($label_order_original, addslashes($label_oder_each[0]));
254
+ array_push($label_type, $label_oder_each[1]);
255
+ }
256
+ $labels2['id'] = '"' . implode('","', $label_id) . '"';
257
+ $labels2['label'] = '"' . implode('","', $label_order_original) . '"';
258
+ $labels2['type'] = '"' . implode('","', $label_type) . '"';
259
+ $ids = array();
260
+ $types = array();
261
+ $labels = array();
262
+ $paramss = array();
263
+ $fields = explode('*:*new_field*:*', $row->form_fields);
264
+ $fields = array_slice($fields, 0, count($fields) - 1);
265
+ foreach ( $fields as $field ) {
266
+ $temp = explode('*:*id*:*', $field);
267
+ array_push($ids, $temp[0]);
268
+ $temp = explode('*:*type*:*', $temp[1]);
269
+ array_push($types, $temp[0]);
270
+ $temp = explode('*:*w_field_label*:*', $temp[1]);
271
+ array_push($labels, $temp[0]);
272
+ array_push($paramss, $temp[1]);
273
+ }
274
+ $form = $row->form_front;
275
+ foreach ( $ids as $ids_key => $id ) {
276
+ $label = $labels[$ids_key];
277
+ $type = $types[$ids_key];
278
+ $params = $paramss[$ids_key];
279
+ if ( strpos($form, '%' . $id . ' - ' . $label . '%') || strpos($form, '%' . $id . ' -' . $label . '%') ) {
280
+ $rep = '';
281
+ $arrows = '';
282
+ $param = array();
283
+ $param['attributes'] = '';
284
+ switch ( $type ) {
285
+ case 'type_section_break': {
286
+ $arrows = '<div id="wdform_arrows' . $id . '" class="wdform_arrows" style="display: none;">
287
+ <span class="wdform_arrows_basic wdform_arrows_container">
288
+ <span id="edit_' . $id . '" valign="middle" class="element_toolbar">
289
+ <span title="Edit the field" class="page_toolbar fm-ico-edit" ontouchend="edit(&quot;' . $id . '&quot;, event)" onclick="edit(&quot;' . $id . '&quot;, event)"></span>
290
+ </span>
291
+ <span id="duplicate_' . $id . '" valign="middle" class="element_toolbar">
292
+ <span title="Duplicate the field" class="page_toolbar fm-ico-duplicate" ontouchend="duplicate(&quot;' . $id . '&quot;, event)" onclick="duplicate(&quot;' . $id . '&quot;, event)"></span>
293
+ </span>
294
+ <span id="X_' . $id . '" valign="middle" align="right" class="element_toolbar">
295
+ <span title="Remove the field" class="page_toolbar fm-ico-delete" onclick="remove_section_break(&quot;' . $id . '&quot;)"></span>
296
+ </span>
297
+ </span>
298
+ </div>';
299
+ break;
300
+ }
301
+ case 'type_send_copy':
302
+ case 'type_stripe':
303
+ case 'type_captcha':
304
+ case 'type_arithmetic_captcha':
305
+ case 'type_recaptcha': {
306
+ $arrows = '<div id="wdform_arrows' . $id . '" class="wdform_arrows" style="display: none;">
307
+ <div class="wdform_arrows_basic wdform_arrows_container">
308
+ <span id="edit_' . $id . '" valign="middle" class="element_toolbar">
309
+ <span title="Edit the field" class="page_toolbar fm-ico-edit" ontouchend="edit(&quot;' . $id . '&quot;, event)" onclick="edit(&quot;' . $id . '&quot;, event)"></span>
310
+ </span>
311
+ <span id="duplicate_' . $id . '" valign="middle" class="element_toolbar"></span>
312
+ <span id="X_' . $id . '" valign="middle" align="right" class="element_toolbar">
313
+ <span title="Remove the field" class="page_toolbar fm-ico-delete" ontouchend="remove_field(&quot;' . $id . '&quot;, event)" onclick="remove_field(&quot;' . $id . '&quot;, event)"></span>
314
+ </span>
315
+ </div>
316
+ <div class="wdform_arrows_advanced wdform_arrows_container" style="display: none;">
317
+ <span id="left_' . $id . '" valign="middle" class="element_toolbar">
318
+ <span title="Move the field to the left" class="page_toolbar dashicons dashicons-arrow-left-alt" onclick="left_row(&quot;' . $id . '&quot;)"></span>
319
+ </span>
320
+ <span id="up_' . $id . '" valign="middle" class="element_toolbar">
321
+ <span title="Move the field up" class="page_toolbar dashicons dashicons-arrow-up-alt" onclick="up_row(&quot;' . $id . '&quot;)"></span>
322
+ </span>
323
+ <span id="down_' . $id . '" valign="middle" class="element_toolbar">
324
+ <span title="Move the field down" class="page_toolbar dashicons dashicons-arrow-down-alt" onclick="down_row(&quot;' . $id . '&quot;)"></span>
325
+ </span>
326
+ <span id="right_' . $id . '" valign="middle" class="element_toolbar">
327
+ <span title="Move the field to the right" class="page_toolbar dashicons dashicons-arrow-right-alt" onclick="right_row(&quot;' . $id . '&quot;)"></span>
328
+ </span>
329
+ <span id="page_up_' . $id . '" valign="middle" class="element_toolbar">
330
+ <span title="Move the field to the upper page" class="page_toolbar dashicons dashicons-upload" onclick="page_up(&quot;' . $id . '&quot;)"></span>
331
+ </span>
332
+ <span id="page_down_' . $id . '" valign="middle" class="element_toolbar">
333
+ <span title="Move the field to the lower page" class="page_toolbar dashicons dashicons-download" onclick="page_down(&quot;' . $id . '&quot;)"></span>
334
+ </span>
335
+ </div>
336
+ </div>';
337
+ break;
338
+ }
339
+ default : {
340
+ $arrows = '<div id="wdform_arrows' . $id . '" class="wdform_arrows" style="display: none;">
341
+ <div class="wdform_arrows_basic wdform_arrows_container"> <span id="edit_' . $id . '" valign="middle" class="element_toolbar">
342
+ <span title="Edit the field" class="page_toolbar fm-ico-edit" ontouchend="edit(&quot;' . $id . '&quot;, event)" onclick="edit(&quot;' . $id . '&quot;, event)"></span>
343
+ </span>
344
+ <span id="duplicate_' . $id . '" valign="middle" class="element_toolbar">
345
+ <span title="Duplicate the field" class="page_toolbar fm-ico-duplicate" ontouchend="duplicate(&quot;' . $id . '&quot;, event)" onclick="duplicate(&quot;' . $id . '&quot;, event)"></span>
346
+ </span>
347
+ <span id="X_' . $id . '" valign="middle" align="right" class="element_toolbar">
348
+ <span title="Remove the field" class="page_toolbar fm-ico-delete" ontouchend="remove_field(&quot;' . $id . '&quot;, event)" onclick="remove_field(&quot;' . $id . '&quot;, event)"></span>
349
+ </span>
350
+ </div>
351
+ <div class="wdform_arrows_advanced wdform_arrows_container" style="display: none;">
352
+ <span id="left_' . $id . '" valign="middle" class="element_toolbar">
353
+ <span title="Move the field to the left" class="page_toolbar dashicons dashicons-arrow-left-alt" onclick="left_row(&quot;' . $id . '&quot;)"></span>
354
+ </span>
355
+ <span id="up_' . $id . '" valign="middle" class="element_toolbar">
356
+ <span title="Move the field up" class="page_toolbar dashicons dashicons-arrow-up-alt" onclick="up_row(&quot;' . $id . '&quot;)"></span>
357
+ </span>
358
+ <span id="down_' . $id . '" valign="middle" class="element_toolbar">
359
+ <span title="Move the field down" class="page_toolbar dashicons dashicons-arrow-down-alt" onclick="down_row(&quot;' . $id . '&quot;)"></span>
360
+ </span>
361
+ <span id="right_' . $id . '" valign="middle" class="element_toolbar">
362
+ <span title="Move the field to the right" class="page_toolbar dashicons dashicons-arrow-right-alt" onclick="right_row(&quot;' . $id . '&quot;)"></span>
363
+ </span>
364
+ <span id="page_up_' . $id . '" valign="middle" class="element_toolbar">
365
+ <span title="Move the field to the upper page" class="page_toolbar dashicons dashicons-upload" onclick="page_up(&quot;' . $id . '&quot;)"></span>
366
+ </span>
367
+ <span id="page_down_' . $id . '" valign="middle" class="element_toolbar">
368
+ <span title="Move the field to the lower page" class="page_toolbar dashicons dashicons-download" onclick="page_down(&quot;' . $id . '&quot;)"></span>
369
+ </span>
370
+ </div>
371
+ </div>';
372
+ break;
373
+ }
374
+ }
375
+ switch ( $type ) {
376
+ case 'type_section_break': {
377
+ $params_names = array( 'w_editor' );
378
+ $temp = $params;
379
+ foreach ( $params_names as $params_name ) {
380
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
381
+ $param[$params_name] = $temp[0];
382
+ $temp = $temp[1];
383
+ }
384
+ $rep = '<div id="wdform_field' . $id . '" type="type_section_break" class="wdform_field_section_break">' . $arrows . '<span id="' . $id . '_element_labelform_id_temp" style="display: none;">' . __('Section Break', WDFMInstance(self::PLUGIN)->prefix) . '</span><div id="' . $id . '_element_sectionform_id_temp" align="left" class="wdform_section_break">' . $param['w_editor'] . '</div></div><div id="' . $id . '_element_labelform_id_temp" style="color:red;">' . __('Section Break', WDFMInstance(self::PLUGIN)->prefix) . '</div>';
385
+ break;
386
+ }
387
+ case 'type_editor': {
388
+ $params_names = array( 'w_editor' );
389
+ $temp = $params;
390
+ foreach ( $params_names as $params_name ) {
391
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
392
+ $param[$params_name] = $temp[0];
393
+ $temp = $temp[1];
394
+ }
395
+ $rep = '<div id="wdform_field' . $id . '" type="type_editor" class="wdform_field" >' . $param['w_editor'] . '</div>' . $arrows . '<div id="' . $id . '_element_labelform_id_temp" style="color: red;">' . __('Custom HTML', WDFMInstance(self::PLUGIN)->prefix) . $id . '</div>';
396
+ break;
397
+ }
398
+ case 'type_send_copy': {
399
+ $params_names = array( 'w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_required' );
400
+ $temp = $params;
401
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
402
+ $params_names = array(
403
+ 'w_field_label_size',
404
+ 'w_field_label_pos',
405
+ 'w_hide_label',
406
+ 'w_first_val',
407
+ 'w_required',
408
+ );
409
+ }
410
+ foreach ( $params_names as $params_name ) {
411
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
412
+ $param[$params_name] = $temp[0];
413
+ $temp = $temp[1];
414
+ }
415
+ if ( $temp ) {
416
+ $temp = explode('*:*w_attr_name*:*', $temp);
417
+ $attrs = array_slice($temp, 0, count($temp) - 1);
418
+ foreach ( $attrs as $attr ) {
419
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
420
+ }
421
+ }
422
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
423
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
424
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
425
+ $input_active = ($param['w_first_val'] == 'true' ? "checked='checked'" : "");
426
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
427
+ $rep = '<div id="wdform_field' . $id . '" type="type_send_copy" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_send_copy" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp" /><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp" /><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="checkbox" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" onclick="set_checked(&quot;' . $id . '&quot;,&quot;&quot;,&quot;form_id_temp&quot;)" ' . $input_active . ' ' . $param['attributes'] . ' disabled /></div></div>';
428
+ break;
429
+ }
430
+ case 'type_text': {
431
+ $params_names = array(
432
+ 'w_field_label_size',
433
+ 'w_field_label_pos',
434
+ 'w_size',
435
+ 'w_first_val',
436
+ 'w_title',
437
+ 'w_required',
438
+ 'w_unique',
439
+ );
440
+ $temp = $params;
441
+ if ( strpos($temp, 'w_regExp_status') > -1 ) {
442
+ $params_names = array(
443
+ 'w_field_label_size',
444
+ 'w_field_label_pos',
445
+ 'w_size',
446
+ 'w_first_val',
447
+ 'w_title',
448
+ 'w_required',
449
+ 'w_regExp_status',
450
+ 'w_regExp_value',
451
+ 'w_regExp_common',
452
+ 'w_regExp_arg',
453
+ 'w_regExp_alert',
454
+ 'w_unique',
455
+ );
456
+ }
457
+ if ( strpos($temp, 'w_readonly') > -1 ) {
458
+ $params_names = array(
459
+ 'w_field_label_size',
460
+ 'w_field_label_pos',
461
+ 'w_size',
462
+ 'w_first_val',
463
+ 'w_title',
464
+ 'w_required',
465
+ 'w_regExp_status',
466
+ 'w_regExp_value',
467
+ 'w_regExp_common',
468
+ 'w_regExp_arg',
469
+ 'w_regExp_alert',
470
+ 'w_unique',
471
+ 'w_readonly',
472
+ );
473
+ }
474
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
475
+ $params_names = array(
476
+ 'w_field_label_size',
477
+ 'w_field_label_pos',
478
+ 'w_hide_label',
479
+ 'w_size',
480
+ 'w_first_val',
481
+ 'w_title',
482
+ 'w_required',
483
+ 'w_regExp_status',
484
+ 'w_regExp_value',
485
+ 'w_regExp_common',
486
+ 'w_regExp_arg',
487
+ 'w_regExp_alert',
488
+ 'w_unique',
489
+ 'w_readonly',
490
+ );
491
+ }
492
+ if ( strpos($temp, 'w_class') > -1 ) {
493
+ $params_names = array(
494
+ 'w_field_label_size',
495
+ 'w_field_label_pos',
496
+ 'w_hide_label',
497
+ 'w_size',
498
+ 'w_first_val',
499
+ 'w_title',
500
+ 'w_required',
501
+ 'w_regExp_status',
502
+ 'w_regExp_value',
503
+ 'w_regExp_common',
504
+ 'w_regExp_arg',
505
+ 'w_regExp_alert',
506
+ 'w_unique',
507
+ 'w_readonly',
508
+ 'w_class',
509
+ );
510
+ }
511
+ foreach ( $params_names as $params_name ) {
512
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
513
+ $param[$params_name] = $temp[0];
514
+ $temp = $temp[1];
515
+ }
516
+ if ( $temp ) {
517
+ $temp = explode('*:*w_attr_name*:*', $temp);
518
+ $attrs = array_slice($temp, 0, count($temp) - 1);
519
+ foreach ( $attrs as $attr ) {
520
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
521
+ }
522
+ }
523
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
524
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
525
+ $param['w_regExp_status'] = (isset($param['w_regExp_status']) ? $param['w_regExp_status'] : "no");
526
+ $param['w_regExp_value'] = (isset($param['w_regExp_value']) ? $param['w_regExp_value'] : "");
527
+ $param['w_regExp_common'] = (isset($param['w_regExp_common']) ? $param['w_regExp_common'] : "");
528
+ $param['w_regExp_arg'] = (isset($param['w_regExp_arg']) ? $param['w_regExp_arg'] : "");
529
+ $param['w_regExp_alert'] = (isset($param['w_regExp_alert']) ? $param['w_regExp_alert'] : "Incorrect Value");
530
+ $param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
531
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
532
+ $param['w_class'] = (isset($param['w_class']) ? $param['w_class'] : "");
533
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
534
+ $rep = '<div id="wdform_field' . $id . '" type="type_text" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_text" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp" /><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp" /><input type="hidden" value="' . $param['w_readonly'] . '" name="' . $id . '_readonlyform_id_temp" id="' . $id . '_readonlyform_id_temp"/><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_regExp_status'] . '" name="' . $id . '_regExpStatusform_id_temp" id="' . $id . '_regExpStatusform_id_temp"><input type="hidden" value="' . $param['w_regExp_value'] . '" name="' . $id . '_regExp_valueform_id_temp" id="' . $id . '_regExp_valueform_id_temp"><input type="hidden" value="' . $param['w_regExp_common'] . '" name="' . $id . '_regExp_commonform_id_temp" id="' . $id . '_regExp_commonform_id_temp"><input type="hidden" value="' . $param['w_regExp_alert'] . '" name="' . $id . '_regExp_alertform_id_temp" id="' . $id . '_regExp_alertform_id_temp"><input type="hidden" value="' . $param['w_regExp_arg'] . '" name="' . $id . '_regArgumentform_id_temp" id="' . $id . '_regArgumentform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp" /><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" placeholder="' . htmlentities($param['w_title'], ENT_COMPAT) . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div>';
535
+ break;
536
+ }
537
+ case 'type_number': {
538
+ $params_names = array(
539
+ 'w_field_label_size',
540
+ 'w_field_label_pos',
541
+ 'w_size',
542
+ 'w_first_val',
543
+ 'w_title',
544
+ 'w_required',
545
+ 'w_unique',
546
+ 'w_class',
547
+ );
548
+ $temp = $params;
549
+ foreach ( $params_names as $params_name ) {
550
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
551
+ $param[$params_name] = $temp[0];
552
+ $temp = $temp[1];
553
+ }
554
+ if ( $temp ) {
555
+ $temp = explode('*:*w_attr_name*:*', $temp);
556
+ $attrs = array_slice($temp, 0, count($temp) - 1);
557
+ foreach ( $attrs as $attr ) {
558
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
559
+ }
560
+ }
561
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
562
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
563
+ $rep = '<div id="wdform_field' . $id . '" type="type_number" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_number" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div>';
564
+ break;
565
+ }
566
+ case 'type_password': {
567
+ $params_names = array(
568
+ 'w_field_label_size',
569
+ 'w_field_label_pos',
570
+ 'w_size',
571
+ 'w_required',
572
+ 'w_unique',
573
+ 'w_class',
574
+ );
575
+ $temp = $params;
576
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
577
+ $params_names = array(
578
+ 'w_field_label_size',
579
+ 'w_field_label_pos',
580
+ 'w_hide_label',
581
+ 'w_size',
582
+ 'w_required',
583
+ 'w_unique',
584
+ 'w_class',
585
+ );
586
+ }
587
+ if ( strpos($temp, 'w_verification') > -1 ) {
588
+ $params_names = array(
589
+ 'w_field_label_size',
590
+ 'w_field_label_pos',
591
+ 'w_hide_label',
592
+ 'w_size',
593
+ 'w_required',
594
+ 'w_unique',
595
+ 'w_class',
596
+ 'w_verification',
597
+ 'w_verification_label',
598
+ );
599
+ }
600
+ if ( strpos($temp, 'w_placeholder') > -1 ) {
601
+ $params_names = array(
602
+ 'w_field_label_size',
603
+ 'w_field_label_pos',
604
+ 'w_hide_label',
605
+ 'w_size',
606
+ 'w_required',
607
+ 'w_unique',
608
+ 'w_class',
609
+ 'w_verification',
610
+ 'w_verification_label',
611
+ 'w_placeholder',
612
+ );
613
+ }
614
+ foreach ( $params_names as $params_name ) {
615
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
616
+ $param[$params_name] = $temp[0];
617
+ $temp = $temp[1];
618
+ }
619
+ if ( $temp ) {
620
+ $temp = explode('*:*w_attr_name*:*', $temp);
621
+ $attrs = array_slice($temp, 0, count($temp) - 1);
622
+ foreach ( $attrs as $attr ) {
623
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
624
+ }
625
+ }
626
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
627
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
628
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
629
+ if ( isset($param['w_verification']) && $param['w_verification'] == "yes" ) {
630
+ $display_label_confirm = $display_label;
631
+ $display_element_confirm = $param['w_field_label_pos'];
632
+ }
633
+ else {
634
+ $display_label_confirm = "none";
635
+ $display_element_confirm = "none";
636
+ }
637
+ $param['w_verification'] = isset($param['w_verification']) ? $param['w_verification'] : "no";
638
+ $param['w_verification_label'] = isset($param['w_verification_label']) ? $param['w_verification_label'] : "Password confirmation:";
639
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
640
+ $confirm_password = '<br><div align="left" id="' . $id . '_1_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label_confirm . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_1_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $param['w_verification_label'] . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_1_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_element_confirm . ';"><input type="hidden" value="' . $param['w_verification'] . '" name="' . $id . '_verification_id_temp" id="' . $id . '_verification_id_temp"><input type="text" id="' . $id . '_1_elementform_id_temp" name="' . $id . '_1_elementform_id_temp" placeholder="' . $param['w_placeholder'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>';
641
+ $rep = '<div id="wdform_field' . $id . '" type="type_password" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_password" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="password" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" placeholder="' . $param['w_placeholder'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>' . $confirm_password . '</div>';
642
+ break;
643
+ }
644
+ case 'type_textarea': {
645
+ $params_names = array(
646
+ 'w_field_label_size',
647
+ 'w_field_label_pos',
648
+ 'w_size_w',
649
+ 'w_size_h',
650
+ 'w_first_val',
651
+ 'w_title',
652
+ 'w_required',
653
+ 'w_unique',
654
+ 'w_class',
655
+ );
656
+ $temp = $params;
657
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
658
+ $params_names = array(
659
+ 'w_field_label_size',
660
+ 'w_field_label_pos',
661
+ 'w_hide_label',
662
+ 'w_size_w',
663
+ 'w_size_h',
664
+ 'w_first_val',
665
+ 'w_title',
666
+ 'w_required',
667
+ 'w_unique',
668
+ 'w_class',
669
+ );
670
+ }
671
+ foreach ( $params_names as $params_name ) {
672
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
673
+ $param[$params_name] = $temp[0];
674
+ $temp = $temp[1];
675
+ }
676
+ if ( $temp ) {
677
+ $temp = explode('*:*w_attr_name*:*', $temp);
678
+ $attrs = array_slice($temp, 0, count($temp) - 1);
679
+ foreach ( $attrs as $attr ) {
680
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
681
+ }
682
+ }
683
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
684
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
685
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
686
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
687
+ $rep = '<div id="wdform_field' . $id . '" type="type_textarea" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_textarea" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><textarea id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" placeholder="' . htmlentities($param['w_title'], ENT_COMPAT) . '" style="width: ' . $param['w_size_w'] . 'px; height: ' . $param['w_size_h'] . 'px;" ' . $param['attributes'] . ' disabled>' . htmlentities($param['w_first_val'], ENT_COMPAT) . '</textarea></div></div>';
688
+ break;
689
+ }
690
+ case 'type_phone': {
691
+ $params_names = array(
692
+ 'w_field_label_size',
693
+ 'w_field_label_pos',
694
+ 'w_size',
695
+ 'w_first_val',
696
+ 'w_title',
697
+ 'w_mini_labels',
698
+ 'w_required',
699
+ 'w_unique',
700
+ 'w_class',
701
+ );
702
+ $temp = $params;
703
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
704
+ $params_names = array(
705
+ 'w_field_label_size',
706
+ 'w_field_label_pos',
707
+ 'w_hide_label',
708
+ 'w_size',
709
+ 'w_first_val',
710
+ 'w_title',
711
+ 'w_mini_labels',
712
+ 'w_required',
713
+ 'w_unique',
714
+ 'w_class',
715
+ );
716
+ }
717
+ foreach ( $params_names as $params_name ) {
718
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
719
+ $param[$params_name] = $temp[0];
720
+ $temp = $temp[1];
721
+ }
722
+ if ( $temp ) {
723
+ $temp = explode('*:*w_attr_name*:*', $temp);
724
+ $attrs = array_slice($temp, 0, count($temp) - 1);
725
+ foreach ( $attrs as $attr ) {
726
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
727
+ }
728
+ }
729
+ $w_first_val = explode('***', $param['w_first_val']);
730
+ $w_title = explode('***', $param['w_title']);
731
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
732
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
733
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
734
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
735
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
736
+ $rep = '<div id="wdform_field' . $id . '" type="type_phone" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_phone" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><div id="' . $id . '_table_name" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;"><div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_element_firstform_id_temp" name="' . $id . '_element_firstform_id_temp" value="' . htmlentities($w_first_val[0], ENT_COMPAT) . '" title="' . htmlentities($w_title[0], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[0], ENT_COMPAT) . '" onkeypress="return check_isnum(event)"style="width: 50px;" ' . $param['attributes'] . ' disabled /><span class="wdform_line" style="margin: 0px 4px; padding: 0px;">-</span></div><div id="' . $id . '_td_name_input_last" style="display: table-cell;"><input type="text" id="' . $id . '_element_lastform_id_temp" name="' . $id . '_element_lastform_id_temp" value="' . htmlentities($w_first_val[1], ENT_COMPAT) . '" title="' . htmlentities($w_title[1], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[1], ENT_COMPAT) . '" onkeypress="return check_isnum(event)"style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div><div id="' . $id . '_tr_name2" style="display: table-row;"><div id="' . $id . '_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_area_code">' . $w_mini_labels[0] . '</label></div><div id="' . $id . '_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_phone_number">' . $w_mini_labels[1] . '</label></div></div></div></div></div>';
737
+ break;
738
+ }
739
+ case 'type_phone_new': {
740
+ $temp = $params;
741
+ $params_names = array(
742
+ 'w_field_label_size',
743
+ 'w_field_label_pos',
744
+ 'w_hide_label',
745
+ 'w_size',
746
+ 'w_first_val',
747
+ 'w_top_country',
748
+ 'w_required',
749
+ 'w_unique',
750
+ 'w_class',
751
+ );
752
+ foreach ( $params_names as $params_name ) {
753
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
754
+ $param[$params_name] = $temp[0];
755
+ $temp = $temp[1];
756
+ }
757
+ if ( $temp ) {
758
+ $temp = explode('*:*w_attr_name*:*', $temp);
759
+ $attrs = array_slice($temp, 0, count($temp) - 1);
760
+ foreach ( $attrs as $attr ) {
761
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
762
+ }
763
+ }
764
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
765
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
766
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
767
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
768
+ $rep = '<div id="wdform_field' . $id . '" type="type_phone_new" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_phone_new" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><div id="' . $id . '_table_name" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;"><div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" top-country = "' . $param['w_top_country'] . '" onkeypress="return check_isnum(&quot;' . $id . '_elementform_id_temp&quot;)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled></div></div></div></div></div>';
769
+ break;
770
+ }
771
+ case 'type_name': {
772
+ $params_names = array(
773
+ 'w_field_label_size',
774
+ 'w_field_label_pos',
775
+ 'w_first_val',
776
+ 'w_title',
777
+ 'w_mini_labels',
778
+ 'w_size',
779
+ 'w_name_format',
780
+ 'w_required',
781
+ 'w_unique',
782
+ 'w_class',
783
+ );
784
+ $temp = $params;
785
+ if ( strpos($temp, 'w_name_fields') > -1 ) {
786
+ $params_names = array(
787
+ 'w_field_label_size',
788
+ 'w_field_label_pos',
789
+ 'w_first_val',
790
+ 'w_title',
791
+ 'w_mini_labels',
792
+ 'w_size',
793
+ 'w_name_format',
794
+ 'w_required',
795
+ 'w_unique',
796
+ 'w_class',
797
+ 'w_name_fields',
798
+ );
799
+ }
800
+ if ( strpos($temp, 'w_autofill') > -1 ) {
801
+ $params_names = array(
802
+ 'w_field_label_size',
803
+ 'w_field_label_pos',
804
+ 'w_first_val',
805
+ 'w_title',
806
+ 'w_mini_labels',
807
+ 'w_size',
808
+ 'w_name_format',
809
+ 'w_required',
810
+ 'w_unique',
811
+ 'w_class',
812
+ 'w_name_fields',
813
+ 'w_autofill',
814
+ );
815
+ }
816
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
817
+ $params_names = array(
818
+ 'w_field_label_size',
819
+ 'w_field_label_pos',
820
+ 'w_hide_label',
821
+ 'w_first_val',
822
+ 'w_title',
823
+ 'w_mini_labels',
824
+ 'w_size',
825
+ 'w_name_format',
826
+ 'w_required',
827
+ 'w_unique',
828
+ 'w_class',
829
+ 'w_name_fields',
830
+ 'w_autofill',
831
+ );
832
+ }
833
+ foreach ( $params_names as $params_name ) {
834
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
835
+ $param[$params_name] = $temp[0];
836
+ $temp = $temp[1];
837
+ }
838
+ if ( $temp ) {
839
+ $temp = explode('*:*w_attr_name*:*', $temp);
840
+ $attrs = array_slice($temp, 0, count($temp) - 1);
841
+ foreach ( $attrs as $attr ) {
842
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
843
+ }
844
+ }
845
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
846
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
847
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
848
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
849
+ $w_first_val = explode('***', $param['w_first_val']);
850
+ $w_title = explode('***', $param['w_title']);
851
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
852
+ $param['w_name_fields'] = isset($param['w_name_fields']) ? $param['w_name_fields'] : ($param['w_name_format'] == 'normal' ? 'no***no' : 'yes***yes');
853
+ $w_name_fields = explode('***', $param['w_name_fields']);
854
+ $param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
855
+ $w_name_format = '<div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_element_firstform_id_temp" name="' . $id . '_element_firstform_id_temp" value="' . htmlentities($w_first_val[0], ENT_COMPAT) . '" title="' . htmlentities($w_title[0], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[0], ENT_COMPAT) . '" style="margin-right: 10px; width: ' . $param['w_size'] . 'px;"' . $param['attributes'] . ' disabled /></div><div id="' . $id . '_td_name_input_last" style="display: table-cell;"><input type="text" id="' . $id . '_element_lastform_id_temp" name="' . $id . '_element_lastform_id_temp" value="' . htmlentities($w_first_val[1], ENT_COMPAT) . '" title="' . htmlentities($w_title[1], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[1], ENT_COMPAT) . '" style="margin-right: 10px; width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>';
856
+ $w_name_format_mini_labels = '<div id="' . $id . '_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_first">' . $w_mini_labels[1] . '</label></div><div id="' . $id . '_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_last">' . $w_mini_labels[2] . '</label></div>';
857
+ if ( $w_name_fields[0] == 'yes' ) {
858
+ $w_name_format = '<div id="' . $id . '_td_name_input_title" style="display: table-cell;"><input type="text" id="' . $id . '_element_titleform_id_temp" name="' . $id . '_element_titleform_id_temp" value="' . htmlentities($w_first_val[2], ENT_COMPAT) . '" title="' . htmlentities($w_title[2], ENT_COMPAT) . '" style="margin: 0px 10px 0px 0px; width: 40px;" disabled /></div>' . $w_name_format;
859
+ $w_name_format_mini_labels = '<div id="' . $id . '_td_name_label_title" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_title">' . $w_mini_labels[0] . '</label></div>' . $w_name_format_mini_labels;
860
+ }
861
+ if ( $w_name_fields[1] == 'yes' ) {
862
+ $w_name_format = $w_name_format . '<div id="' . $id . '_td_name_input_middle" style="display: table-cell;"><input type="text" id="' . $id . '_element_middleform_id_temp" name="' . $id . '_element_middleform_id_temp" value="' . htmlentities($w_first_val[3], ENT_COMPAT) . '" title="' . htmlentities($w_title[3], ENT_COMPAT) . '" style="width: ' . $param['w_size'] . 'px;" disabled /></div>';
863
+ $w_name_format_mini_labels = $w_name_format_mini_labels . '<div id="' . $id . '_td_name_label_middle" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_middle">' . $w_mini_labels[3] . '</label></div>';
864
+ }
865
+ $rep = '<div id="wdform_field' . $id . '" type="type_name" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_name" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="hidden" value="' . $param['w_autofill'] . '" name="' . $id . '_autofillform_id_temp" id="' . $id . '_autofillform_id_temp"><input type="hidden" name="' . $id . '_enable_fieldsform_id_temp" id="' . $id . '_enable_fieldsform_id_temp" title="' . $w_name_fields[0] . '" first="yes" last="yes" middle="' . $w_name_fields[1] . '"><div id="' . $id . '_table_name" cellpadding="0" cellspacing="0" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;">' . $w_name_format . '</div><div id="' . $id . '_tr_name2" style="display: table-row;">' . $w_name_format_mini_labels . '</div></div></div></div>';
866
+ break;
867
+ }
868
+ case 'type_address': {
869
+ $params_names = array(
870
+ 'w_field_label_size',
871
+ 'w_field_label_pos',
872
+ 'w_size',
873
+ 'w_mini_labels',
874
+ 'w_disabled_fields',
875
+ 'w_required',
876
+ 'w_class',
877
+ );
878
+ $temp = $params;
879
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
880
+ $params_names = array(
881
+ 'w_field_label_size',
882
+ 'w_field_label_pos',
883
+ 'w_hide_label',
884
+ 'w_size',
885
+ 'w_mini_labels',
886
+ 'w_disabled_fields',
887
+ 'w_required',
888
+ 'w_class',
889
+ );
890
+ }
891
+ foreach ( $params_names as $params_name ) {
892
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
893
+ $param[$params_name] = $temp[0];
894
+ $temp = $temp[1];
895
+ }
896
+ if ( $temp ) {
897
+ $temp = explode('*:*w_attr_name*:*', $temp);
898
+ $attrs = array_slice($temp, 0, count($temp) - 1);
899
+ foreach ( $attrs as $attr ) {
900
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
901
+ }
902
+ }
903
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
904
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
905
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
906
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
907
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
908
+ $w_disabled_fields = explode('***', $param['w_disabled_fields']);
909
+ $hidden_inputs = '';
910
+ $labels_for_id = array( 'street1', 'street2', 'city', 'state', 'postal', 'country' );
911
+ foreach ( $w_disabled_fields as $key => $w_disabled_field ) {
912
+ if ( $key != 6 ) {
913
+ if ( $w_disabled_field == 'yes' ) {
914
+ $hidden_inputs .= '<input type="hidden" id="' . $id . '_' . $labels_for_id[$key] . 'form_id_temp" value="' . $w_mini_labels[$key] . '" id_for_label="' . ($id + $key) . '">';
915
+ }
916
+ }
917
+ }
918
+ $address_fields = '';
919
+ $g = 0;
920
+ if ( $w_disabled_fields[0] == 'no' ) {
921
+ $g += 2;
922
+ $address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="' . $id . '_street1form_id_temp" name="' . $id . '_street1form_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled /><label class="mini_label" id="' . $id . '_mini_label_street1" style="display: block;">' . $w_mini_labels[0] . '</label></span>';
923
+ }
924
+ if ( $w_disabled_fields[1] == 'no' ) {
925
+ $g += 2;
926
+ $address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="' . $id . '_street2form_id_temp" name="' . ($id + 1) . '_street2form_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled /><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_street2">' . $w_mini_labels[1] . '</label></span>';
927
+ }
928
+ if ( $w_disabled_fields[2] == 'no' ) {
929
+ $g++;
930
+ $address_fields .= '<span style="float: left; width: 48%; padding-bottom: 8px;"><input type="text" id="' . $id . '_cityform_id_temp" name="' . ($id + 2) . '_cityform_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled /><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_city">' . $w_mini_labels[2] . '</label></span>';
931
+ }
932
+ if ( $w_disabled_fields[3] == 'no' ) {
933
+ $g++;
934
+ if ( $w_disabled_fields[5] == 'yes' && $w_disabled_fields[6] == 'yes' ) {
935
+ $address_fields .= '<span style="float: ' . (($g % 2 == 0) ? 'right' : 'left') . '; width: 48%; padding-bottom: 8px;"><select type="text" id="' . $id . '_stateform_id_temp" name="' . ($id + 3) . '_stateform_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled >';
936
+ $states = WDW_FM_Library(self::PLUGIN)->get_states();
937
+ foreach ($states as $st => $state) {
938
+ $address_fields .= '<option value="' . $st . '">' . $state . '</option>';
939
+ }
940
+ $address_fields .= '</select><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_state">' . $w_mini_labels[3] . '</label></span>';
941
+ }
942
+ else {
943
+ $address_fields .= '<span style="float: ' . (($g % 2 == 0) ? 'right' : 'left') . '; width: 48%; padding-bottom: 8px;"><input type="text" id="' . $id . '_stateform_id_temp" name="' . ($id + 3) . '_stateform_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_state">' . $w_mini_labels[3] . '</label></span>';
944
+ }
945
+ }
946
+ if ( $w_disabled_fields[4] == 'no' ) {
947
+ $g++;
948
+ $address_fields .= '<span style="float: ' . (($g % 2 == 0) ? 'right' : 'left') . '; width: 48%; padding-bottom: 8px;"><input type="text" id="' . $id . '_postalform_id_temp" name="' . ($id + 4) . '_postalform_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_postal">' . $w_mini_labels[4] . '</label></span>';
949
+ }
950
+ if ( $w_disabled_fields[5] == 'no' ) {
951
+ $g++;
952
+ $countries_list = WDW_FM_Library(self::PLUGIN)->get_countries();
953
+ $address_fields .= '<span style="float: ' . (($g % 2 == 0) ? 'right' : 'left') . '; width: 48%; padding-bottom: 8px;">
954
+ <select type="text" id="' . $id . '_countryform_id_temp" name="' . ($id + 5) . '_countryform_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled>';
955
+ foreach ($countries_list as $value => $item) {
956
+ $address_fields .= '<option value="' . $value . '">' . $item . '</option>';
957
+ }
958
+ $address_fields .= '</select><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_country">' . $w_mini_labels[5] . '</span>';
959
+ }
960
+ $rep = '<div id="wdform_field' . $id . '" type="type_address" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px; vertical-align:top;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_address" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" name="' . $id . '_disable_fieldsform_id_temp" id="' . $id . '_disable_fieldsform_id_temp" street1="' . $w_disabled_fields[0] . '" street2="' . $w_disabled_fields[1] . '" city="' . $w_disabled_fields[2] . '" state="' . $w_disabled_fields[3] . '" postal="' . $w_disabled_fields[4] . '" country="' . $w_disabled_fields[5] . '" us_states="' . $w_disabled_fields[6] . '"><div id="' . $id . '_div_address" style="width: ' . $param['w_size'] . 'px;">' . $address_fields . $hidden_inputs . '</div></div></div>';
961
+ break;
962
+ }
963
+ case 'type_submitter_mail': {
964
+ $params_names = array(
965
+ 'w_field_label_size',
966
+ 'w_field_label_pos',
967
+ 'w_size',
968
+ 'w_first_val',
969
+ 'w_title',
970
+ 'w_required',
971
+ 'w_unique',
972
+ 'w_class',
973
+ );
974
+ $temp = $params;
975
+ if ( strpos($temp, 'w_autofill') > -1 ) {
976
+ $params_names = array(
977
+ 'w_field_label_size',
978
+ 'w_field_label_pos',
979
+ 'w_size',
980
+ 'w_first_val',
981
+ 'w_title',
982
+ 'w_required',
983
+ 'w_unique',
984
+ 'w_class',
985
+ 'w_autofill',
986
+ );
987
+ }
988
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
989
+ $params_names = array(
990
+ 'w_field_label_size',
991
+ 'w_field_label_pos',
992
+ 'w_hide_label',
993
+ 'w_size',
994
+ 'w_first_val',
995
+ 'w_title',
996
+ 'w_required',
997
+ 'w_unique',
998
+ 'w_class',
999
+ 'w_autofill',
1000
+ );
1001
+ }
1002
+ if ( strpos($temp, 'w_verification') > -1 ) {
1003
+ $params_names = array(
1004
+ 'w_field_label_size',
1005
+ 'w_field_label_pos',
1006
+ 'w_hide_label',
1007
+ 'w_size',
1008
+ 'w_first_val',
1009
+ 'w_title',
1010
+ 'w_required',
1011
+ 'w_unique',
1012
+ 'w_class',
1013
+ 'w_verification',
1014
+ 'w_verification_label',
1015
+ 'w_verification_placeholder',
1016
+ 'w_autofill',
1017
+ );
1018
+ }
1019
+ foreach ( $params_names as $params_name ) {
1020
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1021
+ $param[$params_name] = $temp[0];
1022
+ $temp = $temp[1];
1023
+ }
1024
+ if ( $temp ) {
1025
+ $temp = explode('*:*w_attr_name*:*', $temp);
1026
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1027
+ foreach ( $attrs as $attr ) {
1028
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1029
+ }
1030
+ }
1031
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1032
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1033
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1034
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1035
+ $param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
1036
+ if ( isset($param['w_verification']) && $param['w_verification'] == "yes" ) {
1037
+ $display_label_confirm = $display_label;
1038
+ $display_element_confirm = $param['w_field_label_pos'];
1039
+ }
1040
+ else {
1041
+ $display_label_confirm = "none";
1042
+ $display_element_confirm = "none";
1043
+ }
1044
+ $param['w_verification'] = isset($param['w_verification']) ? $param['w_verification'] : "no";
1045
+ $param['w_verification_label'] = isset($param['w_verification_label']) ? $param['w_verification_label'] : "E-mail confirmation:";
1046
+ $param['w_verification_placeholder'] = isset($param['w_verification_placeholder']) ? $param['w_verification_placeholder'] : "";
1047
+ $confirm_emeil = '<br><div align="left" id="' . $id . '_1_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label_confirm . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_1_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $param['w_verification_label'] . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_1_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_element_confirm . ';"><input type="text" id="' . $id . '_1_elementform_id_temp" name="' . $id . '_1_elementform_id_temp" value="' . $param['w_verification_placeholder'] . '" title="' . $param['w_verification_placeholder'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>';
1048
+ $rep = '<div id="wdform_field' . $id . '" type="type_submitter_mail" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_submitter_mail" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="hidden" value="' . $param['w_autofill'] . '" name="' . $id . '_autofillform_id_temp" id="' . $id . '_autofillform_id_temp"><input type="hidden" value="' . $param['w_verification'] . '" name="' . $id . '_verification_id_temp" id="' . $id . '_verification_id_temp"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" placeholder="' . htmlentities($param['w_title'], ENT_COMPAT) . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>' . $confirm_emeil . '</div>';
1049
+ break;
1050
+ }
1051
+ case 'type_checkbox': {
1052
+ $params_names = array(
1053
+ 'w_field_label_size',
1054
+ 'w_field_label_pos',
1055
+ 'w_flow',
1056
+ 'w_choices',
1057
+ 'w_choices_checked',
1058
+ 'w_rowcol',
1059
+ 'w_required',
1060
+ 'w_randomize',
1061
+ 'w_allow_other',
1062
+ 'w_allow_other_num',
1063
+ 'w_class',
1064
+ );
1065
+ $temp = $params;
1066
+ if ( strpos($temp, 'w_field_option_pos') > -1 ) {
1067
+ $params_names = array(
1068
+ 'w_field_label_size',
1069
+ 'w_field_label_pos',
1070
+ 'w_field_option_pos',
1071
+ 'w_flow',
1072
+ 'w_choices',
1073
+ 'w_choices_checked',
1074
+ 'w_rowcol',
1075
+ 'w_required',
1076
+ 'w_randomize',
1077
+ 'w_allow_other',
1078
+ 'w_allow_other_num',
1079
+ 'w_value_disabled',
1080
+ 'w_choices_value',
1081
+ 'w_choices_params',
1082
+ 'w_class',
1083
+ );
1084
+ }
1085
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
1086
+ $params_names = array(
1087
+ 'w_field_label_size',
1088
+ 'w_field_label_pos',
1089
+ 'w_field_option_pos',
1090
+ 'w_hide_label',
1091
+ 'w_flow',
1092
+ 'w_choices',
1093
+ 'w_choices_checked',
1094
+ 'w_rowcol',
1095
+ 'w_required',
1096
+ 'w_randomize',
1097
+ 'w_allow_other',
1098
+ 'w_allow_other_num',
1099
+ 'w_value_disabled',
1100
+ 'w_choices_value',
1101
+ 'w_choices_params',
1102
+ 'w_class',
1103
+ );
1104
+ }
1105
+ foreach ( $params_names as $params_name ) {
1106
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1107
+ $param[$params_name] = $temp[0];
1108
+ $temp = $temp[1];
1109
+ }
1110
+ if ( $temp ) {
1111
+ $temp = explode('*:*w_attr_name*:*', $temp);
1112
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1113
+ foreach ( $attrs as $attr ) {
1114
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1115
+ }
1116
+ }
1117
+ if ( !isset($param['w_value_disabled']) ) {
1118
+ $param['w_value_disabled'] = 'no';
1119
+ }
1120
+ if ( !isset($param['w_field_option_pos']) ) {
1121
+ $param['w_field_option_pos'] = 'left';
1122
+ }
1123
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1124
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1125
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1126
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1127
+ $param['w_choices'] = explode('***', $param['w_choices']);
1128
+ $param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
1129
+ if ( isset($param['w_choices_value']) ) {
1130
+ $param['w_choices_value'] = explode('***', $param['w_choices_value']);
1131
+ $param['w_choices_params'] = explode('***', $param['w_choices_params']);
1132
+ }
1133
+ foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
1134
+ if ( $choices_checked == 'true' ) {
1135
+ $param['w_choices_checked'][$key] = 'checked="checked"';
1136
+ }
1137
+ else {
1138
+ $param['w_choices_checked'][$key] = '';
1139
+ }
1140
+ }
1141
+ $rep = '<div id="wdform_field' . $id . '" type="type_checkbox" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_checkbox" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_randomize'] . '" name="' . $id . '_randomizeform_id_temp" id="' . $id . '_randomizeform_id_temp"><input type="hidden" value="' . $param['w_allow_other'] . '" name="' . $id . '_allow_otherform_id_temp" id="' . $id . '_allow_otherform_id_temp"><input type="hidden" value="' . $param['w_allow_other_num'] . '" name="' . $id . '_allow_other_numform_id_temp" id="' . $id . '_allow_other_numform_id_temp"><input type="hidden" value="' . $param['w_rowcol'] . '" name="' . $id . '_rowcol_numform_id_temp" id="' . $id . '_rowcol_numform_id_temp"><input type="hidden" value="' . $param['w_field_option_pos'] . '" id="' . $id . '_option_left_right"><input type="hidden" value="' . $param['w_value_disabled'] . '" name="' . $id . '_value_disabledform_id_temp" id="' . $id . '_value_disabledform_id_temp"><div style="display: table;"><div id="' . $id . '_table_little" style="display: table-row-group;" ' . ($param['w_flow'] == 'hor' ? 'for_hor="' . $id . '_hor"' : '') . '>';
1142
+ if ( $param['w_flow'] == 'hor' ) {
1143
+ $j = 0;
1144
+ for ( $i = 0; $i < (int) $param['w_rowcol']; $i++ ) {
1145
+ $rep .= '<div id="' . $id . '_element_tr' . $i . '" style="display: table-row;">';
1146
+ for ( $l = 0; $l <= (int) (count($param['w_choices']) / $param['w_rowcol']); $l++ ) {
1147
+ if ( $j >= count($param['w_choices']) % $param['w_rowcol'] && $l == (int) (count($param['w_choices']) / $param['w_rowcol']) ) {
1148
+ continue;
1149
+ }
1150
+ if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
1151
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $l + $i) . '" idi="' . ((int) $param['w_rowcol'] * $l + $i) . '" style="display: table-cell;"><input type="checkbox" value="" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" other="1" onclick="if(set_checked(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $l + $i) . '&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $l + $i] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled /><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $l + $i) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $l + $i] . '</label></div>';
1152
+ }
1153
+ else {
1154
+ $where = '';
1155
+ $order_by = '';
1156
+ $db_info = '';
1157
+ if ( isset($param['w_choices_value']) ) {
1158
+ $choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $l + $i];
1159
+ }
1160
+ else {
1161
+ $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $l + $i];
1162
+ }
1163
+ $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1164
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i] ) {
1165
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i]);
1166
+ $where = 'where="' . $w_choices_params[0] . '"';
1167
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1168
+ $order_by = "order_by='" . $w_choices_params[0] . "'";
1169
+ $db_info = "db_info='" . $w_choices_params[1] . "'";
1170
+ }
1171
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $l + $i) . '" idi="' . ((int) $param['w_rowcol'] * $l + $i) . '" style="display: table-cell;"><input type="checkbox" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" onclick="set_checked(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $l + $i) . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $l + $i] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $l + $i) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $l + $i] . '</label></div>';
1172
+ }
1173
+ }
1174
+ $j++;
1175
+ $rep .= '</div>';
1176
+ }
1177
+ }
1178
+ else {
1179
+ for ( $i = 0; $i < (int) (count($param['w_choices']) / $param['w_rowcol']); $i++ ) {
1180
+ $rep .= '<div id="' . $id . '_element_tr' . $i . '" style="display: table-row;">';
1181
+ if ( count($param['w_choices']) > (int) $param['w_rowcol'] ) {
1182
+ for ( $l = 0; $l < $param['w_rowcol']; $l++ ) {
1183
+ if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
1184
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="checkbox" value="" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" other="1" onclick="if(set_checked(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled /><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1185
+ }
1186
+ else {
1187
+ $where = '';
1188
+ $order_by = '';
1189
+ $db_info = '';
1190
+ if ( isset($param['w_choices_value']) ) {
1191
+ $choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $i + $l];
1192
+ }
1193
+ else {
1194
+ $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1195
+ }
1196
+ $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1197
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1198
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1199
+ $where = 'where="' . $w_choices_params[0] . '"';
1200
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1201
+ $order_by = "order_by='" . $w_choices_params[0] . "'";
1202
+ $db_info = "db_info='" . $w_choices_params[1] . "'";
1203
+ }
1204
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="checkbox" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" onclick="set_checked(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '"
1205
+ ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1206
+ }
1207
+ }
1208
+ }
1209
+ else {
1210
+ for ( $l = 0; $l < count($param['w_choices']); $l++ ) {
1211
+ if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
1212
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="checkbox" value="" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" other="1" onclick="if(set_checked(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1213
+ }
1214
+ else {
1215
+ $where = '';
1216
+ $order_by = '';
1217
+ $db_info = '';
1218
+ if ( isset($param['w_choices_value']) ) {
1219
+ $choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $i + $l];
1220
+ }
1221
+ else {
1222
+ $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1223
+ }
1224
+ $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1225
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1226
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1227
+ $where = 'where="' . $w_choices_params[0] . '"';
1228
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1229
+ $order_by = "order_by='" . $w_choices_params[0] . "'";
1230
+ $db_info = "db_info='" . $w_choices_params[1] . "'";
1231
+ }
1232
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="checkbox" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" onclick="set_checked(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1233
+ }
1234
+ }
1235
+ }
1236
+ $rep .= '</div>';
1237
+ }
1238
+ if ( count($param['w_choices']) % $param['w_rowcol'] != 0 ) {
1239
+ $rep .= '<div id="' . $id . '_element_tr' . ((int) (count($param['w_choices']) / (int) $param['w_rowcol'])) . '" style="display: table-row;">';
1240
+ for ( $k = 0; $k < count($param['w_choices']) % $param['w_rowcol']; $k++ ) {
1241
+ $l = count($param['w_choices']) - count($param['w_choices']) % $param['w_rowcol'] + $k;
1242
+ if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == $l ) {
1243
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . $l . '" idi="' . $l . '" style="display: table-cell;"><input type="checkbox" value="" id="' . $id . '_elementform_id_temp' . $l . '" name="' . $id . '_elementform_id_temp' . $l . '" other="1" onclick="if(set_checked(&quot;' . $id . '&quot;,&quot;' . $l . '&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][$l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $l . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $l . '">' . $param['w_choices'][$l] . '</label></div>';
1244
+ }
1245
+ else {
1246
+ $where = '';
1247
+ $order_by = '';
1248
+ $db_info = '';
1249
+ if ( isset($param['w_choices_value']) ) {
1250
+ $choise_value = $param['w_choices_value'][$l];
1251
+ }
1252
+ else {
1253
+ $choise_value = $param['w_choices'][$l];
1254
+ }
1255
+ $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1256
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][$l] ) {
1257
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$l]);
1258
+ $where = 'where="' . $w_choices_params[0] . '"';
1259
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1260
+ $order_by = "order_by='" . $w_choices_params[0] . "'";
1261
+ $db_info = "db_info='" . $w_choices_params[1] . "'";
1262
+ }
1263
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . $l . '" idi="' . $l . '" style="display: table-cell;"><input type="checkbox" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . $l . '" name="' . $id . '_elementform_id_temp' . $l . '" onclick="set_checked(&quot;' . $id . '&quot;,&quot;' . $l . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][$l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $l . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $l . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][$l] . '</label></div>';
1264
+ }
1265
+ }
1266
+ $rep .= '</div>';
1267
+ }
1268
+ }
1269
+ $rep .= '</div></div></div></div>';
1270
+ break;
1271
+ }
1272
+ case 'type_radio': {
1273
+ $params_names = array(
1274
+ 'w_field_label_size',
1275
+ 'w_field_label_pos',
1276
+ 'w_flow',
1277
+ 'w_choices',
1278
+ 'w_choices_checked',
1279
+ 'w_rowcol',
1280
+ 'w_required',
1281
+ 'w_randomize',
1282
+ 'w_allow_other',
1283
+ 'w_allow_other_num',
1284
+ 'w_class',
1285
+ );
1286
+ $temp = $params;
1287
+ if ( strpos($temp, 'w_field_option_pos') > -1 ) {
1288
+ $params_names = array(
1289
+ 'w_field_label_size',
1290
+ 'w_field_label_pos',
1291
+ 'w_field_option_pos',
1292
+ 'w_flow',
1293
+ 'w_choices',
1294
+ 'w_choices_checked',
1295
+ 'w_rowcol',
1296
+ 'w_required',
1297
+ 'w_randomize',
1298
+ 'w_allow_other',
1299
+ 'w_allow_other_num',
1300
+ 'w_value_disabled',
1301
+ 'w_choices_value',
1302
+ 'w_choices_params',
1303
+ 'w_class',
1304
+ );
1305
+ }
1306
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
1307
+ $params_names = array(
1308
+ 'w_field_label_size',
1309
+ 'w_field_label_pos',
1310
+ 'w_field_option_pos',
1311
+ 'w_hide_label',
1312
+ 'w_flow',
1313
+ 'w_choices',
1314
+ 'w_choices_checked',
1315
+ 'w_rowcol',
1316
+ 'w_required',
1317
+ 'w_randomize',
1318
+ 'w_allow_other',
1319
+ 'w_allow_other_num',
1320
+ 'w_value_disabled',
1321
+ 'w_choices_value',
1322
+ 'w_choices_params',
1323
+ 'w_class',
1324
+ );
1325
+ }
1326
+ foreach ( $params_names as $params_name ) {
1327
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1328
+ $param[$params_name] = $temp[0];
1329
+ $temp = $temp[1];
1330
+ }
1331
+ if ( $temp ) {
1332
+ $temp = explode('*:*w_attr_name*:*', $temp);
1333
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1334
+ foreach ( $attrs as $attr ) {
1335
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1336
+ }
1337
+ }
1338
+ if ( !isset($param['w_value_disabled']) ) {
1339
+ $param['w_value_disabled'] = 'no';
1340
+ }
1341
+ if ( !isset($param['w_field_option_pos']) ) {
1342
+ $param['w_field_option_pos'] = 'left';
1343
+ }
1344
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1345
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1346
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1347
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1348
+ $param['w_choices'] = explode('***', $param['w_choices']);
1349
+ $param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
1350
+ if ( isset($param['w_choices_value']) ) {
1351
+ $param['w_choices_value'] = explode('***', $param['w_choices_value']);
1352
+ $param['w_choices_params'] = explode('***', $param['w_choices_params']);
1353
+ }
1354
+ foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
1355
+ if ( $choices_checked == 'true' ) {
1356
+ $param['w_choices_checked'][$key] = 'checked="checked"';
1357
+ }
1358
+ else {
1359
+ $param['w_choices_checked'][$key] = '';
1360
+ }
1361
+ }
1362
+ $rep = '<div id="wdform_field' . $id . '" type="type_radio" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_radio" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_randomize'] . '" name="' . $id . '_randomizeform_id_temp" id="' . $id . '_randomizeform_id_temp"><input type="hidden" value="' . $param['w_allow_other'] . '" name="' . $id . '_allow_otherform_id_temp" id="' . $id . '_allow_otherform_id_temp"><input type="hidden" value="' . $param['w_allow_other_num'] . '" name="' . $id . '_allow_other_numform_id_temp" id="' . $id . '_allow_other_numform_id_temp"><input type="hidden" value="' . $param['w_rowcol'] . '" name="' . $id . '_rowcol_numform_id_temp" id="' . $id . '_rowcol_numform_id_temp"><input type="hidden" value="' . $param['w_field_option_pos'] . '" id="' . $id . '_option_left_right"><input type="hidden" value="' . $param['w_value_disabled'] . '" name="' . $id . '_value_disabledform_id_temp" id="' . $id . '_value_disabledform_id_temp"><div style="display: table;"><div id="' . $id . '_table_little" style="display: table-row-group;" ' . ($param['w_flow'] == 'hor' ? 'for_hor="' . $id . '_hor"' : '') . '>';
1363
+ if ( $param['w_flow'] == 'hor' ) {
1364
+ $j = 0;
1365
+ for ( $i = 0; $i < (int) $param['w_rowcol']; $i++ ) {
1366
+ $rep .= '<div id="' . $id . '_element_tr' . $i . '" style="display: table-row;">';
1367
+ for ( $l = 0; $l <= (int) (count($param['w_choices']) / $param['w_rowcol']); $l++ ) {
1368
+ if ( $j >= count($param['w_choices']) % $param['w_rowcol'] && $l == (int) (count($param['w_choices']) / $param['w_rowcol']) ) {
1369
+ continue;
1370
+ }
1371
+ if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $l + $i ) {
1372
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $l + $i) . '" idi="' . ((int) $param['w_rowcol'] * $l + $i) . '" style="display: table-cell;"><input type="radio" value="' . $param['w_choices'][(int) $param['w_rowcol'] * $l + $i] . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" name="' . $id . '_elementform_id_temp" other="1" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $l + $i) . '&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $l + $i] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $l + $i) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $l + $i] . '</label></div>';
1373
+ }
1374
+ else {
1375
+ $where = '';
1376
+ $order_by = '';
1377
+ $db_info = '';
1378
+ if ( isset($param['w_choices_value']) ) {
1379
+ $choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $l + $i];
1380
+ }
1381
+ else {
1382
+ $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $l + $i];
1383
+ }
1384
+ $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1385
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i] ) {
1386
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i]);
1387
+ $where = 'where="' . $w_choices_params[0] . '"';
1388
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1389
+ $order_by = "order_by='" . $w_choices_params[0] . "'";
1390
+ $db_info = "db_info='" . $w_choices_params[1] . "'";
1391
+ }
1392
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $l + $i) . '" idi="' . ((int) $param['w_rowcol'] * $l + $i) . '" style="display: table-cell;"><input type="radio" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" name="' . $id . '_elementform_id_temp" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $l + $i) . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $l + $i] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $l + $i) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $l + $i] . '</label></div>';
1393
+ }
1394
+ }
1395
+ $j++;
1396
+ $rep .= '</div>';
1397
+ }
1398
+ }
1399
+ else {
1400
+ for ( $i = 0; $i < (int) (count($param['w_choices']) / $param['w_rowcol']); $i++ ) {
1401
+ $rep .= '<div id="' . $id . '_element_tr' . $i . '" style="display: table-row;">';
1402
+ if ( count($param['w_choices']) > (int) $param['w_rowcol'] ) {
1403
+ for ( $l = 0; $l < $param['w_rowcol']; $l++ ) {
1404
+ if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
1405
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="radio" value="' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp" other="1" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1406
+ }
1407
+ else {
1408
+ $where = '';
1409
+ $order_by = '';
1410
+ $db_info = '';
1411
+ if ( isset($param['w_choices_value']) ) {
1412
+ $choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $i + $l];
1413
+ }
1414
+ else {
1415
+ $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1416
+ }
1417
+ $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1418
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1419
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1420
+ $where = 'where="' . $w_choices_params[0] . '"';
1421
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1422
+ $order_by = "order_by='" . $w_choices_params[0] . "'";
1423
+ $db_info = "db_info='" . $w_choices_params[1] . "'";
1424
+ }
1425
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="radio" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1426
+ }
1427
+ }
1428
+ }
1429
+ else {
1430
+ for ( $l = 0; $l < count($param['w_choices']); $l++ ) {
1431
+ if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
1432
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="radio" value="' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp" other="1" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1433
+ }
1434
+ else {
1435
+ $where = '';
1436
+ $order_by = '';
1437
+ $db_info = '';
1438
+ if ( isset($param['w_choices_value']) ) {
1439
+ $choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $i + $l];
1440
+ }
1441
+ else {
1442
+ $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1443
+ }
1444
+ $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1445
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1446
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1447
+ $where = 'where="' . $w_choices_params[0] . '"';
1448
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1449
+ $order_by = "order_by='" . $w_choices_params[0] . "'";
1450
+ $db_info = "db_info='" . $w_choices_params[1] . "'";
1451
+ }
1452
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="radio" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . ((int) $param['w_rowcol'] * $i + $l) . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
1453
+ }
1454
+ }
1455
+ }
1456
+ $rep .= '</div>';
1457
+ }
1458
+ if ( count($param['w_choices']) % $param['w_rowcol'] != 0 ) {
1459
+ $rep .= '<div id="' . $id . '_element_tr' . ((int) (count($param['w_choices']) / (int) $param['w_rowcol'])) . '" style="display: table-row;">';
1460
+ for ( $k = 0; $k < count($param['w_choices']) % $param['w_rowcol']; $k++ ) {
1461
+ $l = count($param['w_choices']) - count($param['w_choices']) % $param['w_rowcol'] + $k;
1462
+ if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == $l ) {
1463
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . $l . '" idi="' . $l . '" style="display: table-cell;"><input type="radio" value="' . $param['w_choices'][$l] . '" id="' . $id . '_elementform_id_temp' . $l . '" name="' . $id . '_elementform_id_temp" other="1" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . $l . '&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;' . $id . '&quot;,&quot;form_id_temp&quot;);" ' . $param['w_choices_checked'][$l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $l . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $l . '">' . $param['w_choices'][$l] . '</label></div>';
1464
+ }
1465
+ else {
1466
+ $where = '';
1467
+ $order_by = '';
1468
+ $db_info = '';
1469
+ if ( isset($param['w_choices_value']) ) {
1470
+ $choise_value = $param['w_choices_value'][$l];
1471
+ }
1472
+ else {
1473
+ $choise_value = $param['w_choices'][$l];
1474
+ }
1475
+ $choise_value = htmlentities($choise_value, ENT_COMPAT, "UTF-8");
1476
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][$l] ) {
1477
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$l]);
1478
+ $where = 'where="' . $w_choices_params[0] . '"';
1479
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1480
+ $order_by = "order_by='" . $w_choices_params[0] . "'";
1481
+ $db_info = "db_info='" . $w_choices_params[1] . "'";
1482
+ }
1483
+ $rep .= '<div valign="top" id="' . $id . '_td_little' . $l . '" idi="' . $l . '" style="display: table-cell;"><input type="radio" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . $l . '" name="' . $id . '_elementform_id_temp" onclick="set_default(&quot;' . $id . '&quot;,&quot;' . $l . '&quot;,&quot;form_id_temp&quot;)" ' . $param['w_choices_checked'][$l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $l . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $l . '"
1484
+ ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][$l] . '</label></div>';
1485
+ }
1486
+ }
1487
+ $rep .= '</div>';
1488
+ }
1489
+ }
1490
+ $rep .= '</div></div></div></div>';
1491
+ break;
1492
+ }
1493
+ case 'type_own_select': {
1494
+ $params_names = array(
1495
+ 'w_field_label_size',
1496
+ 'w_field_label_pos',
1497
+ 'w_size',
1498
+ 'w_choices',
1499
+ 'w_choices_checked',
1500
+ 'w_choices_disabled',
1501
+ 'w_required',
1502
+ 'w_class',
1503
+ );
1504
+ $temp = $params;
1505
+ if ( strpos($temp, 'w_choices_value') > -1 ) {
1506
+ $params_names = array(
1507
+ 'w_field_label_size',
1508
+ 'w_field_label_pos',
1509
+ 'w_size',
1510
+ 'w_choices',
1511
+ 'w_choices_checked',
1512
+ 'w_choices_disabled',
1513
+ 'w_required',
1514
+ 'w_value_disabled',
1515
+ 'w_choices_value',
1516
+ 'w_choices_params',
1517
+ 'w_class',
1518
+ );
1519
+ }
1520
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
1521
+ $params_names = array(
1522
+ 'w_field_label_size',
1523
+ 'w_field_label_pos',
1524
+ 'w_hide_label',
1525
+ 'w_size',
1526
+ 'w_choices',
1527
+ 'w_choices_checked',
1528
+ 'w_choices_disabled',
1529
+ 'w_required',
1530
+ 'w_value_disabled',
1531
+ 'w_choices_value',
1532
+ 'w_choices_params',
1533
+ 'w_class',
1534
+ );
1535
+ }
1536
+ foreach ( $params_names as $params_name ) {
1537
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1538
+ $param[$params_name] = $temp[0];
1539
+ $temp = $temp[1];
1540
+ }
1541
+ if ( $temp ) {
1542
+ $temp = explode('*:*w_attr_name*:*', $temp);
1543
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1544
+ foreach ( $attrs as $attr ) {
1545
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1546
+ }
1547
+ }
1548
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1549
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1550
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1551
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1552
+ $param['w_choices'] = explode('***', $param['w_choices']);
1553
+ $param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
1554
+ $param['w_choices_disabled'] = explode('***', $param['w_choices_disabled']);
1555
+ if ( isset($param['w_choices_value']) ) {
1556
+ $param['w_choices_value'] = explode('***', $param['w_choices_value']);
1557
+ $param['w_choices_params'] = explode('***', $param['w_choices_params']);
1558
+ }
1559
+ if ( !isset($param['w_value_disabled']) ) {
1560
+ $param['w_value_disabled'] = 'no';
1561
+ }
1562
+ foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
1563
+ if ( $choices_checked == 'true' ) {
1564
+ $param['w_choices_checked'][$key] = 'selected="selected"';
1565
+ }
1566
+ else {
1567
+ $param['w_choices_checked'][$key] = '';
1568
+ }
1569
+ }
1570
+ $rep = '<div id="wdform_field' . $id . '" type="type_own_select" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; "><input type="hidden" value="type_own_select" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_value_disabled'] . '" name="' . $id . '_value_disabledform_id_temp" id="' . $id . '_value_disabledform_id_temp"><select id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" onchange="set_select(this)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled>';
1571
+ foreach ( $param['w_choices'] as $key => $choice ) {
1572
+ $where = '';
1573
+ $order_by = '';
1574
+ $db_info = '';
1575
+ $choice_value = $param['w_choices_disabled'][$key] == 'true' ? '' : (isset($param['w_choices_value']) ? $param['w_choices_value'][$key] : $choice);
1576
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
1577
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
1578
+ $where = 'where="' . $w_choices_params[0] . '"';
1579
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
1580
+ $order_by = "order_by='" . $w_choices_params[0] . "'";
1581
+ $db_info = "db_info='" . $w_choices_params[1] . "'";
1582
+ }
1583
+ $rep .= '<option id="' . $id . '_option' . $key . '" value="' . $choice_value . '" onselect="set_select(&quot;' . $id . '_option' . $key . '&quot;)" ' . $param['w_choices_checked'][$key] . ' ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</option>';
1584
+ }
1585
+ $rep .= '</select></div></div>';
1586
+ break;
1587
+ }
1588
+ case 'type_country': {
1589
+ $params_names = array(
1590
+ 'w_field_label_size',
1591
+ 'w_field_label_pos',
1592
+ 'w_size',
1593
+ 'w_countries',
1594
+ 'w_required',
1595
+ 'w_class',
1596
+ );
1597
+ $temp = $params;
1598
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
1599
+ $params_names = array(
1600
+ 'w_field_label_size',
1601
+ 'w_field_label_pos',
1602
+ 'w_hide_label',
1603
+ 'w_size',
1604
+ 'w_countries',
1605
+ 'w_required',
1606
+ 'w_class',
1607
+ );
1608
+ }
1609
+ foreach ( $params_names as $params_name ) {
1610
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1611
+ $param[$params_name] = $temp[0];
1612
+ $temp = $temp[1];
1613
+ }
1614
+ if ( $temp ) {
1615
+ $temp = explode('*:*w_attr_name*:*', $temp);
1616
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1617
+ foreach ( $attrs as $attr ) {
1618
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1619
+ }
1620
+ }
1621
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1622
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1623
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1624
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1625
+ $param['w_countries'] = explode('***', $param['w_countries']);
1626
+ $rep = '<div id="wdform_field' . $id . '" type="type_country" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; "><input type="hidden" value="type_country" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><select id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled>';
1627
+ foreach ( $param['w_countries'] as $key => $choice ) {
1628
+ $choice_value = $choice;
1629
+ $rep .= '<option value="' . $choice_value . '">' . $choice . '</option>';
1630
+ }
1631
+ $rep .= '</select></div></div>';
1632
+ break;
1633
+ }
1634
+ case 'type_time': {
1635
+ $params_names = array(
1636
+ 'w_field_label_size',
1637
+ 'w_field_label_pos',
1638
+ 'w_time_type',
1639
+ 'w_am_pm',
1640
+ 'w_sec',
1641
+ 'w_hh',
1642
+ 'w_mm',
1643
+ 'w_ss',
1644
+ 'w_mini_labels',
1645
+ 'w_required',
1646
+ 'w_class',
1647
+ );
1648
+ $temp = $params;
1649
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
1650
+ $params_names = array(
1651
+ 'w_field_label_size',
1652
+ 'w_field_label_pos',
1653
+ 'w_hide_label',
1654
+ 'w_time_type',
1655
+ 'w_am_pm',
1656
+ 'w_sec',
1657
+ 'w_hh',
1658
+ 'w_mm',
1659
+ 'w_ss',
1660
+ 'w_mini_labels',
1661
+ 'w_required',
1662
+ 'w_class',
1663
+ );
1664
+ }
1665
+ foreach ( $params_names as $params_name ) {
1666
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1667
+ $param[$params_name] = $temp[0];
1668
+ $temp = $temp[1];
1669
+ }
1670
+ if ( $temp ) {
1671
+ $temp = explode('*:*w_attr_name*:*', $temp);
1672
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1673
+ foreach ( $attrs as $attr ) {
1674
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1675
+ }
1676
+ }
1677
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1678
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1679
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1680
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1681
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
1682
+ if ( $param['w_sec'] == '1' ) {
1683
+ $w_sec = '<div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;:&nbsp;</span></div><div id="' . $id . '_td_time_input3" style="width: 32px; display: table-cell;"><input type="text" value="' . $param['w_ss'] . '" class="time_box" id="' . $id . '_ssform_id_temp" name="' . $id . '_ssform_id_temp" onblur="add_0(&quot;' . $id . '_ssform_id_temp&quot;)" ' . $param['attributes'] . ' disabled /></div>';
1684
+ $w_sec_label = '<div style="display: table-cell;"></div><div id="' . $id . '_td_time_label3" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_ss">' . $w_mini_labels[2] . '</label></div>';
1685
+ }
1686
+ else {
1687
+ $w_sec = '';
1688
+ $w_sec_label = '';
1689
+ }
1690
+ if ( $param['w_time_type'] == '12' ) {
1691
+ if ( $param['w_am_pm'] == 'am' ) {
1692
+ $am_ = "selected=\"selected\"";
1693
+ $pm_ = "";
1694
+ }
1695
+ else {
1696
+ $am_ = "";
1697
+ $pm_ = "selected=\"selected\"";
1698
+ }
1699
+ $w_time_type = '<div id="' . $id . '_am_pm_select" class="td_am_pm_select" style="display: table-cell;"><select class="am_pm_select" name="' . $id . '_am_pmform_id_temp" id="' . $id . '_am_pmform_id_temp" onchange="set_sel_am_pm(this)" ' . $param['attributes'] . '><option value="am" ' . $am_ . '>AM</option><option value="pm" ' . $pm_ . '>PM</option></select></div>';
1700
+ $w_time_type_label = '<div id="' . $id . '_am_pm_label" class="td_am_pm_select" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_am_pm">' . $w_mini_labels[3] . '</label></div>';
1701
+ }
1702
+ else {
1703
+ $w_time_type = '';
1704
+ $w_time_type_label = '';
1705
+ }
1706
+ $rep = '<div id="wdform_field' . $id . '" type="type_time" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_time" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><div id="' . $id . '_table_time" style="display: table;"><div id="' . $id . '_tr_time1" style="display: table-row;"><div id="' . $id . '_td_time_input1" style="width: 32px; display: table-cell;"><input type="text" value="' . $param['w_hh'] . '" class="time_box" id="' . $id . '_hhform_id_temp" name="' . $id . '_hhform_id_temp" onblur="add_0(&quot;' . $id . '_hhform_id_temp&quot;)" ' . $param['attributes'] . ' disabled/></div><div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;:&nbsp;</span></div><div id="' . $id . '_td_time_input2" style="width: 32px; display: table-cell;"><input type="text" value="' . $param['w_mm'] . '" class="time_box" id="' . $id . '_mmform_id_temp" name="' . $id . '_mmform_id_temp" onblur="add_0(&quot;' . $id . '_mmform_id_temp&quot;)" ' . $param['attributes'] . ' disabled/></div>' . $w_sec . $w_time_type . '</div><div id="' . $id . '_tr_time2" style="display: table-row;"><div id="' . $id . '_td_time_label1" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_hh">' . $w_mini_labels[0] . '</label></div><div style="display: table-cell;"></div><div id="' . $id . '_td_time_label2" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_mm">' . $w_mini_labels[1] . '</label></div>' . $w_sec_label . $w_time_type_label . '</div></div></div></div>';
1707
+ break;
1708
+ }
1709
+ case 'type_date': {
1710
+ $params_names = array(
1711
+ 'w_field_label_size',
1712
+ 'w_field_label_pos',
1713
+ 'w_date',
1714
+ 'w_required',
1715
+ 'w_class',
1716
+ 'w_format',
1717
+ 'w_but_val',
1718
+ );
1719
+ $temp = $params;
1720
+ if ( strpos($temp, 'w_disable_past_days') > -1 ) {
1721
+ $params_names = array(
1722
+ 'w_field_label_size',
1723
+ 'w_field_label_pos',
1724
+ 'w_date',
1725
+ 'w_required',
1726
+ 'w_class',
1727
+ 'w_format',
1728
+ 'w_but_val',
1729
+ 'w_disable_past_days',
1730
+ );
1731
+ }
1732
+ foreach ( $params_names as $params_name ) {
1733
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1734
+ $param[$params_name] = $temp[0];
1735
+ $temp = $temp[1];
1736
+ }
1737
+ if ( $temp ) {
1738
+ $temp = explode('*:*w_attr_name*:*', $temp);
1739
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1740
+ foreach ( $attrs as $attr ) {
1741
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1742
+ }
1743
+ }
1744
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1745
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1746
+ $param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
1747
+ $disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
1748
+ $rep = '<div id="wdform_field' . $id . '" type="type_date" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_date" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_disable_past_days'] . '" name="' . $id . '_dis_past_daysform_id_temp" id="' . $id . '_dis_past_daysform_id_temp"><input type="text" value="' . $param['w_date'] . '" class="wdform-date wd-datepicker" data-format="' . $param['w_format'] . '" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" maxlength="10" size="10" ' . $param['attributes'] . ' disabled/></div></div>';
1749
+ break;
1750
+ }
1751
+ ///////////////////////// type_date_new ////////////////////////////
1752
+ case 'type_date_new': {
1753
+ $params_names = array(
1754
+ 'w_field_label_size',
1755
+ 'w_field_label_pos',
1756
+ 'w_size',
1757
+ 'w_date',
1758
+ 'w_required',
1759
+ 'w_show_image',
1760
+ 'w_class',
1761
+ 'w_format',
1762
+ 'w_start_day',
1763
+ 'w_default_date',
1764
+ 'w_min_date',
1765
+ 'w_max_date',
1766
+ 'w_invalid_dates',
1767
+ 'w_show_days',
1768
+ 'w_hide_time',
1769
+ 'w_but_val',
1770
+ 'w_disable_past_days',
1771
+ );
1772
+ $temp = $params;
1773
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
1774
+ $params_names = array(
1775
+ 'w_field_label_size',
1776
+ 'w_field_label_pos',
1777
+ 'w_hide_label',
1778
+ 'w_size',
1779
+ 'w_date',
1780
+ 'w_required',
1781
+ 'w_show_image',
1782
+ 'w_class',
1783
+ 'w_format',
1784
+ 'w_start_day',
1785
+ 'w_default_date',
1786
+ 'w_min_date',
1787
+ 'w_max_date',
1788
+ 'w_invalid_dates',
1789
+ 'w_show_days',
1790
+ 'w_hide_time',
1791
+ 'w_but_val',
1792
+ 'w_disable_past_days',
1793
+ );
1794
+ }
1795
+ foreach ( $params_names as $params_name ) {
1796
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1797
+ $param[$params_name] = $temp[0];
1798
+ $temp = $temp[1];
1799
+ }
1800
+ if ( $temp ) {
1801
+ $temp = explode('*:*w_attr_name*:*', $temp);
1802
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1803
+ foreach ( $attrs as $attr ) {
1804
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1805
+ }
1806
+ }
1807
+ $w_show_week_days = explode('***', $param['w_show_days']);
1808
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1809
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1810
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1811
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1812
+ $param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
1813
+ $disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
1814
+ $display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
1815
+ $rep = '<div id="wdform_field' . $id . '" type="type_date_new" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_date_new" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp">
1816
+ <input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp">
1817
+
1818
+ <input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/>
1819
+
1820
+ <input type="hidden" value="' . $param['w_show_image'] . '" name="' . $id . '_show_imageform_id_temp" id="' . $id . '_show_imageform_id_temp">
1821
+
1822
+ <input type="hidden" value="' . $param['w_disable_past_days'] . '" name="' . $id . '_dis_past_daysform_id_temp" id="' . $id . '_dis_past_daysform_id_temp">
1823
+
1824
+ <input type="hidden" value="' . $param['w_default_date'] . '" name="' . $id . '_default_date_id_temp" id="' . $id . '_default_date_id_temp">
1825
+ <input type="hidden" value="' . $param['w_min_date'] . '" name="' . $id . '_min_date_id_temp" id="' . $id . '_min_date_id_temp">
1826
+ <input type="hidden" value="' . $param['w_max_date'] . '" name="' . $id . '_max_date_id_temp" id="' . $id . '_max_date_id_temp">
1827
+ <input type="hidden" value="' . $param['w_invalid_dates'] . '" name="' . $id . '_invalid_dates_id_temp" id="' . $id . '_invalid_dates_id_temp">
1828
+
1829
+ <input type="hidden" value="' . $param['w_start_day'] . '" name="' . $id . '_start_dayform_id_temp" id="' . $id . '_start_dayform_id_temp">
1830
+
1831
+ <input type="hidden" value="' . $param['w_hide_time'] . '" name="' . $id . '_hide_timeform_id_temp" id="' . $id . '_hide_timeform_id_temp">
1832
+
1833
+ <input type="hidden" name="' . $id . '_show_week_days" id="' . $id . '_show_week_days" sunday="' . $w_show_week_days[0] . '" monday="' . $w_show_week_days[1] . '" tuesday="' . $w_show_week_days[2] . '" wednesday="' . $w_show_week_days[3] . '" thursday="' . $w_show_week_days[4] . '" friday="' . $w_show_week_days[5] . '" saturday="' . $w_show_week_days[6] . '" />
1834
+ <input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled />
1835
+ <span id="' . $id . '_show_imagedateform_id_temp" class="dashicons dashicons-calendar-alt wd-calendar-button ' . ($param['w_show_image'] == "yes" ? "wd-inline-block" : "wd-hidden") . '"></span>
1836
+ <input id="' . $id . '_buttonform_id_temp" type="hidden" value="' . $param['w_but_val'] . '" format="' . $param['w_format'] . '" ></div></div>';
1837
+ break;
1838
+ }
1839
+ case 'type_date_range': {
1840
+ $params_names = array(
1841
+ 'w_field_label_size',
1842
+ 'w_field_label_pos',
1843
+ 'w_size',
1844
+ 'w_date',
1845
+ 'w_required',
1846
+ 'w_show_image',
1847
+ 'w_class',
1848
+ 'w_format',
1849
+ 'w_start_day',
1850
+ 'w_default_date_start',
1851
+ 'w_default_date_end',
1852
+ 'w_min_date',
1853
+ 'w_max_date',
1854
+ 'w_invalid_dates',
1855
+ 'w_show_days',
1856
+ 'w_hide_time',
1857
+ 'w_but_val',
1858
+ 'w_disable_past_days',
1859
+ );
1860
+ $temp = $params;
1861
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
1862
+ $params_names = array(
1863
+ 'w_field_label_size',
1864
+ 'w_field_label_pos',
1865
+ 'w_hide_label',
1866
+ 'w_size',
1867
+ 'w_date',
1868
+ 'w_required',
1869
+ 'w_show_image',
1870
+ 'w_class',
1871
+ 'w_format',
1872
+ 'w_start_day',
1873
+ 'w_default_date_start',
1874
+ 'w_default_date_end',
1875
+ 'w_min_date',
1876
+ 'w_max_date',
1877
+ 'w_invalid_dates',
1878
+ 'w_show_days',
1879
+ 'w_hide_time',
1880
+ 'w_but_val',
1881
+ 'w_disable_past_days',
1882
+ );
1883
+ }
1884
+ foreach ( $params_names as $params_name ) {
1885
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1886
+ $param[$params_name] = $temp[0];
1887
+ $temp = $temp[1];
1888
+ }
1889
+ if ( $temp ) {
1890
+ $temp = explode('*:*w_attr_name*:*', $temp);
1891
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1892
+ foreach ( $attrs as $attr ) {
1893
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1894
+ }
1895
+ }
1896
+ $w_show_week_days = explode('***', $param['w_show_days']);
1897
+ $defaul_day_array = explode(',', $param['w_date']);
1898
+ $defaul_day_start = $defaul_day_array[0];
1899
+ $defaul_day_end = $defaul_day_array[1];
1900
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1901
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
1902
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
1903
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1904
+ $param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
1905
+ $disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
1906
+ $display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
1907
+ $rep = '<div id="wdform_field' . $id . '" type="type_date_range" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';">
1908
+
1909
+ <input type="hidden" value="type_date_range" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp">
1910
+
1911
+ <input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp">
1912
+
1913
+ <input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/>
1914
+
1915
+ <input type="hidden" value="' . $param['w_show_image'] . '" name="' . $id . '_show_imageform_id_temp" id="' . $id . '_show_imageform_id_temp">
1916
+
1917
+ <input type="hidden" value="' . $param['w_disable_past_days'] . '" name="' . $id . '_dis_past_daysform_id_temp" id="' . $id . '_dis_past_daysform_id_temp">
1918
+
1919
+ <input type="hidden" value="' . $param['w_default_date_start'] . '" name="' . $id . '_default_date_id_temp_start" id="' . $id . '_default_date_id_temp_start">
1920
+
1921
+ <input type="hidden" value="' . $param['w_default_date_end'] . '" name="' . $id . '_default_date_id_temp_end" id="' . $id . '_default_date_id_temp_end">
1922
+
1923
+ <input type="hidden" value="' . $param['w_min_date'] . '" name="' . $id . '_min_date_id_temp" id="' . $id . '_min_date_id_temp">
1924
+
1925
+ <input type="hidden" value="' . $param['w_max_date'] . '" name="' . $id . '_max_date_id_temp" id="' . $id . '_max_date_id_temp">
1926
+
1927
+ <input type="hidden" value="' . $param['w_invalid_dates'] . '" name="' . $id . '_invalid_dates_id_temp" id="' . $id . '_invalid_dates_id_temp">
1928
+
1929
+ <input type="hidden" value="' . $param['w_start_day'] . '" name="' . $id . '_start_dayform_id_temp" id="' . $id . '_start_dayform_id_temp">
1930
+
1931
+ <input type="hidden" value="' . $param['w_hide_time'] . '" name="' . $id . '_hide_timeform_id_temp" id="' . $id . '_hide_timeform_id_temp">
1932
+
1933
+ <input type="hidden" name="' . $id . '_show_week_days" id="' . $id . '_show_week_days" sunday="' . $w_show_week_days[0] . '" monday="' . $w_show_week_days[1] . '" tuesday="' . $w_show_week_days[2] . '" wednesday="' . $w_show_week_days[3] . '" thursday="' . $w_show_week_days[4] . '" friday="' . $w_show_week_days[5] . '" saturday="' . $w_show_week_days[6] . '">
1934
+
1935
+
1936
+
1937
+
1938
+
1939
+ <input type="text" id="' . $id . '_elementform_id_temp0" name="' . $id . '_elementform_id_temp0" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled />
1940
+ <span id="' . $id . '_show_imagedateform_id_temp0" class="dashicons dashicons-calendar-alt wd-calendar-button ' . ($param['w_show_image'] == "yes" ? "wd-inline-block" : "wd-hidden") . '"></span>
1941
+ <span>-</span>
1942
+ <input type="text" id="' . $id . '_elementform_id_temp1" name="' . $id . '_elementform_id_temp1" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled />
1943
+ <span id="' . $id . '_show_imagedateform_id_temp1" class="dashicons dashicons-calendar-alt wd-calendar-button ' . ($param['w_show_image'] == "yes" ? "wd-inline-block" : "wd-hidden") . '"></span>
1944
+ <input id="' . $id . '_buttonform_id_temp" type="hidden" value="' . $param['w_but_val'] . '" format="' . $param['w_format'] . '" />
1945
+ </div></div>';
1946
+ break;
1947
+ }
1948
+ case 'type_date_fields': {
1949
+ $params_names = array(
1950
+ 'w_field_label_size',
1951
+ 'w_field_label_pos',
1952
+ 'w_day',
1953
+ 'w_month',
1954
+ 'w_year',
1955
+ 'w_day_type',
1956
+ 'w_month_type',
1957
+ 'w_year_type',
1958
+ 'w_day_label',
1959
+ 'w_month_label',
1960
+ 'w_year_label',
1961
+ 'w_day_size',
1962
+ 'w_month_size',
1963
+ 'w_year_size',
1964
+ 'w_required',
1965
+ 'w_class',
1966
+ 'w_from',
1967
+ 'w_to',
1968
+ 'w_divider',
1969
+ );
1970
+ $temp = $params;
1971
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
1972
+ $params_names = array(
1973
+ 'w_field_label_size',
1974
+ 'w_field_label_pos',
1975
+ 'w_hide_label',
1976
+ 'w_day',
1977
+ 'w_month',
1978
+ 'w_year',
1979
+ 'w_day_type',
1980
+ 'w_month_type',
1981
+ 'w_year_type',
1982
+ 'w_day_label',
1983
+ 'w_month_label',
1984
+ 'w_year_label',
1985
+ 'w_day_size',
1986
+ 'w_month_size',
1987
+ 'w_year_size',
1988
+ 'w_required',
1989
+ 'w_class',
1990
+ 'w_from',
1991
+ 'w_to',
1992
+ 'w_divider',
1993
+ );
1994
+ }
1995
+ foreach ( $params_names as $params_name ) {
1996
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1997
+ $param[$params_name] = $temp[0];
1998
+ $temp = $temp[1];
1999
+ }
2000
+ if ( $temp ) {
2001
+ $temp = explode('*:*w_attr_name*:*', $temp);
2002
+ $attrs = array_slice($temp, 0, count($temp) - 1);
2003
+ foreach ( $attrs as $attr ) {
2004
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2005
+ }
2006
+ }
2007
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2008
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2009
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2010
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
2011
+ if ( $param['w_day_type'] == "SELECT" ) {
2012
+ $w_day_type = '<select id="' . $id . '_dayform_id_temp" name="' . $id . '_dayform_id_temp" onchange="set_select(this)" style="width: ' . $param['w_day_size'] . 'px;" ' . $param['attributes'] . ' disabled><option value=""></option>';
2013
+ for ( $k = 0; $k <= 31; $k++ ) {
2014
+ if ( $k < 10 ) {
2015
+ if ( $param['w_day'] == '0' . $k ) {
2016
+ $selected = "selected=\"selected\"";
2017
+ }
2018
+ else {
2019
+ $selected = "";
2020
+ }
2021
+ $w_day_type .= '<option value="0' . $k . '" ' . $selected . '>0' . $k . '</option>';
2022
+ }
2023
+ else {
2024
+ if ( $param['w_day'] == '' . $k ) {
2025
+ $selected = "selected=\"selected\"";
2026
+ }
2027
+ else {
2028
+ $selected = "";
2029
+ }
2030
+ $w_day_type .= '<option value="' . $k . '" ' . $selected . '>' . $k . '</option>';
2031
+ }
2032
+ }
2033
+ $w_day_type .= '</select>';
2034
+ }
2035
+ else {
2036
+ $w_day_type = '<input type="text" value="' . $param['w_day'] . '" id="' . $id . '_dayform_id_temp" name="' . $id . '_dayform_id_temp" onblur="if (this.value==&quot;0&quot;) this.value=&quot;&quot;; else add_0(&quot;' . $id . '_dayform_id_temp&quot;)" style="width: ' . $param['w_day_size'] . 'px;" ' . $param['attributes'] . ' disabled/>';
2037
+ }
2038
+ if ( $param['w_month_type'] == "SELECT" ) {
2039
+ $w_month_type = '<select id="' . $id . '_monthform_id_temp" name="' . $id . '_monthform_id_temp" onchange="set_select(this)" style="width: ' . $param['w_month_size'] . 'px;" ' . $param['attributes'] . ' disabled><option value=""></option><option value="01" ' . ($param['w_month'] == "01" ? "selected=\"selected\"" : "") . ' ><!--repstart-->January<!--repend--></option><option value="02" ' . ($param['w_month'] == "02" ? "selected=\"selected\"" : "") . '><!--repstart-->February<!--repend--></option><option value="03" ' . ($param['w_month'] == "03" ? "selected=\"selected\"" : "") . '><!--repstart-->March<!--repend--></option><option value="04" ' . ($param['w_month'] == "04" ? "selected=\"selected\"" : "") . ' ><!--repstart-->April<!--repend--></option><option value="05" ' . ($param['w_month'] == "05" ? "selected=\"selected\"" : "") . ' ><!--repstart-->May<!--repend--></option><option value="06" ' . ($param['w_month'] == "06" ? "selected=\"selected\"" : "") . ' ><!--repstart-->June<!--repend--></option><option value="07" ' . ($param['w_month'] == "07" ? "selected=\"selected\"" : "") . ' ><!--repstart-->July<!--repend--></option><option value="08" ' . ($param['w_month'] == "08" ? "selected=\"selected\"" : "") . ' ><!--repstart-->August<!--repend--></option><option value="09" ' . ($param['w_month'] == "09" ? "selected=\"selected\"" : "") . ' ><!--repstart-->September<!--repend--></option><option value="10" ' . ($param['w_month'] == "10" ? "selected=\"selected\"" : "") . ' ><!--repstart-->October<!--repend--></option><option value="11" ' . ($param['w_month'] == "11" ? "selected=\"selected\"" : "") . '><!--repstart-->November<!--repend--></option><option value="12" ' . ($param['w_month'] == "12" ? "selected=\"selected\"" : "") . ' ><!--repstart-->December<!--repend--></option></select>';
2040
+ }
2041
+ else {
2042
+ $w_month_type = '<input type="text" value="' . $param['w_month'] . '" id="' . $id . '_monthform_id_temp" name="' . $id . '_monthform_id_temp" onblur="if (this.value==&quot;0&quot;) this.value=&quot;&quot;; else add_0(&quot;' . $id . '_monthform_id_temp&quot;)" style="width: ' . $param['w_month_size'] . 'px;" ' . $param['attributes'] . ' disabled/>';
2043
+ }
2044
+ $param['w_to'] = isset($param['w_to']) && $param['w_to'] != "NaN" ? $param['w_to'] : date("Y");
2045
+ if ( $param['w_year_type'] == "SELECT" ) {
2046
+ $w_year_type = '<select id="' . $id . '_yearform_id_temp" name="' . $id . '_yearform_id_temp" onchange="set_select(this)" from="' . $param['w_from'] . '" to="' . $param['w_to'] . '" style="width: ' . $param['w_year_size'] . 'px;" ' . $param['attributes'] . ' disabled><option value=""></option>';
2047
+ for ( $k = $param['w_to']; $k >= $param['w_from']; $k-- ) {
2048
+ if ( $param['w_year'] == $k ) {
2049
+ $selected = "selected=\"selected\"";
2050
+ }
2051
+ else {
2052
+ $selected = "";
2053
+ }
2054
+ $w_year_type .= '<option value="' . $k . '" ' . $selected . '>' . $k . '</option>';
2055
+ }
2056
+ $w_year_type .= '</select>';
2057
+ }
2058
+ else {
2059
+ $w_year_type = '<input type="text" value="' . $param['w_year'] . '" id="' . $id . '_yearform_id_temp" name="' . $id . '_yearform_id_temp" from="' . $param['w_from'] . '" to="' . $param['w_to'] . '" style="width: ' . $param['w_year_size'] . 'px;" ' . $param['attributes'] . ' disabled/>';
2060
+ }
2061
+ $rep = '<div id="wdform_field' . $id . '" type="type_date_fields" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_date_fields" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><div id="' . $id . '_table_date" style="display: table;"><div id="' . $id . '_tr_date1" style="display: table-row;"><div id="' . $id . '_td_date_input1" style="display: table-cell;">
2062
+ ' . $w_day_type . '
2063
+
2064
+ </div><div id="' . $id . '_td_date_separator1" style="display: table-cell;"><span id="' . $id . '_separator1" class="wdform_separator">' . $param['w_divider'] . '</span></div><div id="' . $id . '_td_date_input2" style="display: table-cell;">' . $w_month_type . '</div><div id="' . $id . '_td_date_separator2" style="display: table-cell;"><span id="' . $id . '_separator2" class="wdform_separator">' . $param['w_divider'] . '</span></div><div id="' . $id . '_td_date_input3" style="display: table-cell;">' . $w_year_type . '</div></div><div id="' . $id . '_tr_date2" style="display: table-row;"><div id="' . $id . '_td_date_label1" style="display: table-cell;"><label class="mini_label" id="' . $id . '_day_label">' . $param['w_day_label'] . '</label></div><div style="display: table-cell;"></div><div id="' . $id . '_td_date_label2" style="display: table-cell;"><label class="mini_label" id="' . $id . '_month_label">' . $param['w_month_label'] . '</label></div><div style="display: table-cell;"></div><div id="' . $id . '_td_date_label3" style="display: table-cell;"><label class="mini_label" id="' . $id . '_year_label">' . $param['w_year_label'] . '</label></div></div></div></div></div>';
2065
+ break;
2066
+ }
2067
+ case 'type_file_upload': {
2068
+ $params_names = array(
2069
+ 'w_field_label_size',
2070
+ 'w_field_label_pos',
2071
+ 'w_destination',
2072
+ 'w_extension',
2073
+ 'w_max_size',
2074
+ 'w_required',
2075
+ 'w_multiple',
2076
+ 'w_class',
2077
+ );
2078
+ $temp = $params;
2079
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
2080
+ $params_names = array(
2081
+ 'w_field_label_size',
2082
+ 'w_field_label_pos',
2083
+ 'w_hide_label',
2084
+ 'w_destination',
2085
+ 'w_extension',
2086
+ 'w_max_size',
2087
+ 'w_required',
2088
+ 'w_multiple',
2089
+ 'w_class',
2090
+ );
2091
+ }
2092
+ foreach ( $params_names as $params_name ) {
2093
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
2094
+ $param[$params_name] = $temp[0];
2095
+ if ( isset($temp[1]) ) {
2096
+ $temp = $temp[1];
2097
+ }
2098
+ else {
2099
+ $temp = '';
2100
+ }
2101
+ }
2102
+ if ( $temp ) {
2103
+ $temp = explode('*:*w_attr_name*:*', $temp);
2104
+ $attrs = array_slice($temp, 0, count($temp) - 1);
2105
+ foreach ( $attrs as $attr ) {
2106
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2107
+ }
2108
+ }
2109
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2110
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2111
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2112
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
2113
+ $multiple = ($param['w_multiple'] == "yes" ? "multiple='multiple'" : "");
2114
+ $rep = '<div id="wdform_field' . $id . '" type="type_file_upload" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_file_upload" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="***max_sizeskizb' . $id . '***' . $param['w_max_size'] . '***max_sizeverj' . $id . '***" id="' . $id . '_max_size" name="' . $id . '_max_size"><input type="hidden" value="***destinationskizb' . $id . '***' . $param['w_destination'] . '***destinationverj' . $id . '***" id="' . $id . '_destination" name="' . $id . '_destination"><input type="hidden" value="***extensionskizb' . $id . '***' . $param['w_extension'] . '***extensionverj' . $id . '***" id="' . $id . '_extension" name="' . $id . '_extension"><input type="file" class="file_upload" id="' . $id . '_elementform_id_temp" name="' . $id . '_fileform_id_temp" ' . $multiple . ' ' . $param['attributes'] . ' disabled/></div></div>';
2115
+ break;
2116
+ }
2117
+ case 'type_captcha': {
2118
+ $params_names = array( 'w_field_label_size', 'w_field_label_pos', 'w_digit', 'w_class' );
2119
+ $temp = $params;
2120
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
2121
+ $params_names = array(
2122
+ 'w_field_label_size',
2123
+ 'w_field_label_pos',
2124
+ 'w_hide_label',
2125
+ 'w_digit',
2126
+ 'w_class',
2127
+ );
2128
+ }
2129
+ foreach ( $params_names as $params_name ) {
2130
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
2131
+ $param[$params_name] = $temp[0];
2132
+ $temp = $temp[1];
2133
+ }
2134
+ if ( $temp ) {
2135
+ $temp = explode('*:*w_attr_name*:*', $temp);
2136
+ $attrs = array_slice($temp, 0, count($temp) - 1);
2137
+ foreach ( $attrs as $attr ) {
2138
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2139
+ }
2140
+ }
2141
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2142
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2143
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2144
+ $rep = '<div id="wdform_field' . $id . '" type="type_captcha" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display:' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_captcha" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div valign="middle" style="display: table-cell;"><img type="captcha" digit="' . $param['w_digit'] . '" src="' . add_query_arg(array(
2145
+ 'action' => 'formmakerwdcaptcha' . WDFMInstance(self::PLUGIN)->plugin_postfix,
2146
+ 'digit' => $param['w_digit'],
2147
+ 'nonce' => $fm_nonce,
2148
+ 'i' => 'form_id_temp',
2149
+ ), admin_url('admin-ajax.php')) . '" id="_wd_captchaform_id_temp" class="captcha_img" onclick="captcha_refresh(&quot;_wd_captcha&quot;,&quot;form_id_temp&quot;)" ' . $param['attributes'] . '></div><div valign="middle" style="display: table-cell;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh(&quot;_wd_captcha&quot;,&quot;form_id_temp&quot;)" ' . $param['attributes'] . '></div></div></div><div style="display: table-row;"><div style="display: table-cell;"><input type="text" class="captcha_input" id="_wd_captcha_inputform_id_temp" name="captcha_input" style="width: ' . ($param['w_digit'] * 10 + 15) . 'px;" ' . $param['attributes'] . ' disabled/><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/></div></div></div></div></div>';
2150
+ break;
2151
+ }
2152
+ case 'type_arithmetic_captcha': {
2153
+ $params_names = array(
2154
+ 'w_field_label_size',
2155
+ 'w_field_label_pos',
2156
+ 'w_count',
2157
+ 'w_operations',
2158
+ 'w_class',
2159
+ 'w_input_size',
2160
+ );
2161
+ $temp = $params;
2162
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
2163
+ $params_names = array(
2164
+ 'w_field_label_size',
2165
+ 'w_field_label_pos',
2166
+ 'w_hide_label',
2167
+ 'w_count',
2168
+ 'w_operations',
2169
+ 'w_class',
2170
+ 'w_input_size',
2171
+ );
2172
+ }
2173
+ foreach ( $params_names as $params_name ) {
2174
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
2175
+ $param[$params_name] = $temp[0];
2176
+ $temp = $temp[1];
2177
+ }
2178
+ if ( $temp ) {
2179
+ $temp = explode('*:*w_attr_name*:*', $temp);
2180
+ $attrs = array_slice($temp, 0, count($temp) - 1);
2181
+ foreach ( $attrs as $attr ) {
2182
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2183
+ }
2184
+ }
2185
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2186
+ $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
2187
+ $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
2188
+ $param['w_count'] = $param['w_count'] ? $param['w_count'] : 1;
2189
+ $param['w_operations'] = $param['w_operations'] ? $param['w_operations'] : '+, -, *, /';
2190
+ $param['w_input_size'] = $param['w_input_size'] ? $param['w_input_size'] : 60;
2191
+ $rep = '<div id="wdform_field' . $id . '" type="type_arithmetic_captcha" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display:' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_captcha" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell;"><img type="captcha" operations_count="' . $param['w_count'] . '" operations="' . $param['w_operations'] . '" input_size="' . $param['w_input_size'] . '" src="' . add_query_arg(array(
2192
+ 'action' => 'formmakerwdmathcaptcha' . WDFMInstance(self::PLUGIN)->plugin_postfix,
2193
+ 'operations_count' => $param['w_count'],
2194
+