Contact Form Builder – a plugin for creating contact and feedback forms - Version 1.0.52

Version Description

  • Added: Autofill with user name
  • Added: Autofill with user email
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Contact Form Builder – a plugin for creating contact and feedback forms
Version 1.0.52
Comparing to
See all releases

Code changes from version 1.0.51 to 1.0.52

Files changed (35) hide show
  1. admin/controllers/CFMControllerBlocked_ips_cfm.php +143 -143
  2. admin/controllers/CFMControllerCFMShortcode.php +42 -42
  3. admin/controllers/CFMControllerContactFormMakerPreview.php +42 -42
  4. admin/controllers/CFMControllerContactFormmakerwdcaptcha.php +42 -42
  5. admin/controllers/CFMControllerGoptions_cfm.php +67 -67
  6. admin/controllers/CFMControllerUninstall_cfm.php +57 -57
  7. admin/controllers/CFMControllerWidget.php +60 -60
  8. admin/models/CFMModelBlocked_ips_cfm.php +73 -73
  9. admin/models/CFMModelCFMShortcode.php +35 -35
  10. admin/models/CFMModelContactFormMakerPreview.php +30 -30
  11. admin/models/CFMModelContactFormmakerwdcaptcha.php +30 -30
  12. admin/models/CFMModelGoptions_cfm.php +29 -29
  13. admin/models/CFMModelManage_cfm.php +10 -2
  14. admin/models/CFMModelUninstall_cfm.php +40 -40
  15. admin/models/CFMModelWidget.php +36 -36
  16. admin/views/CFMViewCFMShortcode.php +111 -111
  17. admin/views/CFMViewContactFormMakerPreview.php +56 -56
  18. admin/views/CFMViewContactFormmakerwdcaptcha.php +92 -92
  19. admin/views/CFMViewGoptions_cfm.php +111 -111
  20. admin/views/CFMViewUninstall_cfm.php +124 -124
  21. admin/views/CFMViewWidget.php +83 -83
  22. contact-form-builder-update.php +25 -25
  23. contact-form-builder.php +2 -2
  24. css/contact_form_maker_first.css +173 -173
  25. css/contact_form_maker_frontend.css +39 -39
  26. featured/featured.php +170 -170
  27. featured/style.css +201 -201
  28. framework/WDW_CFM_Library.php +431 -431
  29. frontend/controllers/CFMControllerForm_maker.php +45 -45
  30. frontend/models/CFMModelForm_maker.php +949 -949
  31. frontend/views/CFMViewForm_maker.php +41 -9
  32. js/contact_form_maker_admin.js +0 -1
  33. js/contact_form_maker_manage.js +0 -2
  34. js/contactformmaker.js +84 -14
  35. readme.txt +5 -1
admin/controllers/CFMControllerBlocked_ips_cfm.php CHANGED
@@ -1,144 +1,144 @@
1
- <?php
2
-
3
- class CFMControllerBlocked_ips_cfm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = WDW_CFM_Library::get('task');
23
- $id = WDW_CFM_Library::get('current_id', 0);
24
- $message = WDW_CFM_Library::get('message');
25
- echo WDW_CFM_Library::message_id($message);
26
- if (method_exists($this, $task)) {
27
- check_admin_referer('nonce_cfm', 'nonce_cfm');
28
- $this->$task($id);
29
- }
30
- else {
31
- $this->display();
32
- }
33
- }
34
-
35
- public function display() {
36
- require_once WD_CFM_DIR . "/admin/models/CFMModelBlocked_ips_cfm.php";
37
- $model = new CFMModelBlocked_ips_cfm();
38
-
39
- require_once WD_CFM_DIR . "/admin/views/CFMViewBlocked_ips_cfm.php";
40
- $view = new CFMViewBlocked_ips_cfm($model);
41
- $view->display();
42
- }
43
-
44
- public function save() {
45
- $message = $this->save_db();
46
- $page = WDW_CFM_Library::get('page');
47
- WDW_CFM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
48
- }
49
-
50
- public function save_db() {
51
- global $wpdb;
52
- $id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
53
- $ip = (isset($_POST['ip']) ? esc_html(stripslashes($_POST['ip'])) : '');
54
- if ($id != 0) {
55
- $save = $wpdb->update($wpdb->prefix . 'contactformmaker_blocked', array(
56
- 'ip' => $ip,
57
- ), array('id' => $id));
58
- }
59
- else {
60
- $save = $wpdb->insert($wpdb->prefix . 'contactformmaker_blocked', array(
61
- 'ip' => $ip,
62
- ), array(
63
- '%s',
64
- ));
65
- }
66
- if ($save !== FALSE) {
67
- $message = 1;
68
- }
69
- else {
70
- $message = 2;
71
- }
72
- }
73
-
74
- public function save_all() {
75
- global $wpdb;
76
- $flag = FALSE;
77
- $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'contactformmaker_blocked');
78
- foreach ($ips_id_col as $ip_id) {
79
- if (isset($_POST['ip' . $ip_id])) {
80
- $ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
81
- if ($ip == '') {
82
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'contactformmaker_blocked WHERE id="%d"', $ip_id));
83
- }
84
- else {
85
- $flag = TRUE;
86
- $wpdb->update($wpdb->prefix . 'contactformmaker_blocked', array(
87
- 'ip' => $ip,
88
- ), array('id' => $ip_id));
89
- }
90
- }
91
- }
92
- if ($flag) {
93
- $message = 1;
94
- }
95
- else {
96
- $message = 0;
97
- }
98
- $page = WDW_CFM_Library::get('page');
99
- WDW_CFM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
100
- }
101
-
102
- public function delete($id) {
103
- global $wpdb;
104
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'contactformmaker_blocked WHERE id="%d"', $id);
105
- if ($wpdb->query($query)) {
106
- $message = 3;
107
- }
108
- else {
109
- $message = 2;
110
- }
111
- $page = WDW_CFM_Library::get('page');
112
- WDW_CFM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
113
- }
114
-
115
- public function delete_all() {
116
- global $wpdb;
117
- $flag = FALSE;
118
- $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'contactformmaker_blocked');
119
- foreach ($ips_id_col as $ip_id) {
120
- if (isset($_POST['check_' . $ip_id])) {
121
- $flag = TRUE;
122
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'contactformmaker_blocked WHERE id="%d"', $ip_id));
123
- }
124
- }
125
- if ($flag) {
126
- $message = 5;
127
- }
128
- else {
129
- $message = 2;
130
- }
131
- $page = WDW_CFM_Library::get('page');
132
- WDW_CFM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
133
- }
134
-
135
- ////////////////////////////////////////////////////////////////////////////////////////
136
- // Getters & Setters //
137
- ////////////////////////////////////////////////////////////////////////////////////////
138
- ////////////////////////////////////////////////////////////////////////////////////////
139
- // Private Methods //
140
- ////////////////////////////////////////////////////////////////////////////////////////
141
- ////////////////////////////////////////////////////////////////////////////////////////
142
- // Listeners //
143
- ////////////////////////////////////////////////////////////////////////////////////////
144
  }
1
+ <?php
2
+
3
+ class CFMControllerBlocked_ips_cfm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = WDW_CFM_Library::get('task');
23
+ $id = WDW_CFM_Library::get('current_id', 0);
24
+ $message = WDW_CFM_Library::get('message');
25
+ echo WDW_CFM_Library::message_id($message);
26
+ if (method_exists($this, $task)) {
27
+ check_admin_referer('nonce_cfm', 'nonce_cfm');
28
+ $this->$task($id);
29
+ }
30
+ else {
31
+ $this->display();
32
+ }
33
+ }
34
+
35
+ public function display() {
36
+ require_once WD_CFM_DIR . "/admin/models/CFMModelBlocked_ips_cfm.php";
37
+ $model = new CFMModelBlocked_ips_cfm();
38
+
39
+ require_once WD_CFM_DIR . "/admin/views/CFMViewBlocked_ips_cfm.php";
40
+ $view = new CFMViewBlocked_ips_cfm($model);
41
+ $view->display();
42
+ }
43
+
44
+ public function save() {
45
+ $message = $this->save_db();
46
+ $page = WDW_CFM_Library::get('page');
47
+ WDW_CFM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
48
+ }
49
+
50
+ public function save_db() {
51
+ global $wpdb;
52
+ $id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
53
+ $ip = (isset($_POST['ip']) ? esc_html(stripslashes($_POST['ip'])) : '');
54
+ if ($id != 0) {
55
+ $save = $wpdb->update($wpdb->prefix . 'contactformmaker_blocked', array(
56
+ 'ip' => $ip,
57
+ ), array('id' => $id));
58
+ }
59
+ else {
60
+ $save = $wpdb->insert($wpdb->prefix . 'contactformmaker_blocked', array(
61
+ 'ip' => $ip,
62
+ ), array(
63
+ '%s',
64
+ ));
65
+ }
66
+ if ($save !== FALSE) {
67
+ $message = 1;
68
+ }
69
+ else {
70
+ $message = 2;
71
+ }
72
+ }
73
+
74
+ public function save_all() {
75
+ global $wpdb;
76
+ $flag = FALSE;
77
+ $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'contactformmaker_blocked');
78
+ foreach ($ips_id_col as $ip_id) {
79
+ if (isset($_POST['ip' . $ip_id])) {
80
+ $ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
81
+ if ($ip == '') {
82
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'contactformmaker_blocked WHERE id="%d"', $ip_id));
83
+ }
84
+ else {
85
+ $flag = TRUE;
86
+ $wpdb->update($wpdb->prefix . 'contactformmaker_blocked', array(
87
+ 'ip' => $ip,
88
+ ), array('id' => $ip_id));
89
+ }
90
+ }
91
+ }
92
+ if ($flag) {
93
+ $message = 1;
94
+ }
95
+ else {
96
+ $message = 0;
97
+ }
98
+ $page = WDW_CFM_Library::get('page');
99
+ WDW_CFM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
100
+ }
101
+
102
+ public function delete($id) {
103
+ global $wpdb;
104
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'contactformmaker_blocked WHERE id="%d"', $id);
105
+ if ($wpdb->query($query)) {
106
+ $message = 3;
107
+ }
108
+ else {
109
+ $message = 2;
110
+ }
111
+ $page = WDW_CFM_Library::get('page');
112
+ WDW_CFM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
113
+ }
114
+
115
+ public function delete_all() {
116
+ global $wpdb;
117
+ $flag = FALSE;
118
+ $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'contactformmaker_blocked');
119
+ foreach ($ips_id_col as $ip_id) {
120
+ if (isset($_POST['check_' . $ip_id])) {
121
+ $flag = TRUE;
122
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'contactformmaker_blocked WHERE id="%d"', $ip_id));
123
+ }
124
+ }
125
+ if ($flag) {
126
+ $message = 5;
127
+ }
128
+ else {
129
+ $message = 2;
130
+ }
131
+ $page = WDW_CFM_Library::get('page');
132
+ WDW_CFM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
133
+ }
134
+
135
+ ////////////////////////////////////////////////////////////////////////////////////////
136
+ // Getters & Setters //
137
+ ////////////////////////////////////////////////////////////////////////////////////////
138
+ ////////////////////////////////////////////////////////////////////////////////////////
139
+ // Private Methods //
140
+ ////////////////////////////////////////////////////////////////////////////////////////
141
+ ////////////////////////////////////////////////////////////////////////////////////////
142
+ // Listeners //
143
+ ////////////////////////////////////////////////////////////////////////////////////////
144
  }
admin/controllers/CFMControllerCFMShortcode.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class CFMControllerCFMShortcode {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_CFM_DIR . "/admin/models/CFMModelCFMShortcode.php";
27
- $model = new CFMModelCFMShortcode();
28
-
29
- require_once WD_CFM_DIR . "/admin/views/CFMViewCFMShortcode.php";
30
- $view = new CFMViewCFMShortcode($model);
31
- $view->display();
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class CFMControllerCFMShortcode {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_CFM_DIR . "/admin/models/CFMModelCFMShortcode.php";
27
+ $model = new CFMModelCFMShortcode();
28
+
29
+ require_once WD_CFM_DIR . "/admin/views/CFMViewCFMShortcode.php";
30
+ $view = new CFMViewCFMShortcode($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/CFMControllerContactFormMakerPreview.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class CFMControllerContactFormMakerPreview {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_CFM_DIR . "/admin/models/CFMModelContactFormMakerPreview.php";
27
- $model = new CFMModelContactFormMakerPreview();
28
-
29
- require_once WD_CFM_DIR . "/admin/views/CFMViewContactFormMakerPreview.php";
30
- $view = new CFMViewContactFormMakerPreview($model);
31
- $view->display();
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class CFMControllerContactFormMakerPreview {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_CFM_DIR . "/admin/models/CFMModelContactFormMakerPreview.php";
27
+ $model = new CFMModelContactFormMakerPreview();
28
+
29
+ require_once WD_CFM_DIR . "/admin/views/CFMViewContactFormMakerPreview.php";
30
+ $view = new CFMViewContactFormMakerPreview($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/CFMControllerContactFormmakerwdcaptcha.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class CFMControllerContactFormmakerwdcaptcha {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_CFM_DIR . "/admin/models/CFMModelContactFormmakerwdcaptcha.php";
27
- $model = new CFMModelContactFormmakerwdcaptcha();
28
-
29
- require_once WD_CFM_DIR . "/admin/views/CFMViewContactFormmakerwdcaptcha.php";
30
- $view = new CFMViewContactFormmakerwdcaptcha($model);
31
- $view->display();
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class CFMControllerContactFormmakerwdcaptcha {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_CFM_DIR . "/admin/models/CFMModelContactFormmakerwdcaptcha.php";
27
+ $model = new CFMModelContactFormmakerwdcaptcha();
28
+
29
+ require_once WD_CFM_DIR . "/admin/views/CFMViewContactFormmakerwdcaptcha.php";
30
+ $view = new CFMViewContactFormmakerwdcaptcha($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/CFMControllerGoptions_cfm.php CHANGED
@@ -1,68 +1,68 @@
1
- <?php
2
-
3
- class CFMControllerGoptions_cfm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = WDW_CFM_Library::get('task');
23
- $id = (int)WDW_CFM_Library::get('current_id', 0);
24
- $message = WDW_CFM_Library::get('message');
25
- echo WDW_CFM_Library::message_id($message);
26
- if (method_exists($this, $task)) {
27
- check_admin_referer('nonce_cfm', 'nonce_cfm');
28
- $this->$task($id);
29
- }
30
- else {
31
- $this->display();
32
- }
33
- }
34
-
35
- public function display() {
36
- require_once WD_CFM_DIR . "/admin/models/CFMModelGoptions_cfm.php";
37
- $model = new CFMModelGoptions_cfm();
38
-
39
- require_once WD_CFM_DIR . "/admin/views/CFMViewGoptions_cfm.php";
40
- $view = new CFMViewGoptions_cfm($model);
41
- $view->display();
42
- }
43
-
44
- public function save() {
45
- $message = $this->save_db();
46
- $page = WDW_CFM_Library::get('page');
47
- WDW_CFM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
48
- }
49
-
50
- public function save_db() {
51
- $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
52
- $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
53
- $map_key = (isset($_POST['map_key']) ? esc_html(stripslashes($_POST['map_key'])) : '');
54
- update_option('cfm_settings', array('public_key' => $public_key, 'private_key' => $private_key, 'map_key' => $map_key));
55
- }
56
-
57
-
58
-
59
- ////////////////////////////////////////////////////////////////////////////////////////
60
- // Getters & Setters //
61
- ////////////////////////////////////////////////////////////////////////////////////////
62
- ////////////////////////////////////////////////////////////////////////////////////////
63
- // Private Methods //
64
- ////////////////////////////////////////////////////////////////////////////////////////
65
- ////////////////////////////////////////////////////////////////////////////////////////
66
- // Listeners //
67
- ////////////////////////////////////////////////////////////////////////////////////////
68
  }
1
+ <?php
2
+
3
+ class CFMControllerGoptions_cfm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = WDW_CFM_Library::get('task');
23
+ $id = (int)WDW_CFM_Library::get('current_id', 0);
24
+ $message = WDW_CFM_Library::get('message');
25
+ echo WDW_CFM_Library::message_id($message);
26
+ if (method_exists($this, $task)) {
27
+ check_admin_referer('nonce_cfm', 'nonce_cfm');
28
+ $this->$task($id);
29
+ }
30
+ else {
31
+ $this->display();
32
+ }
33
+ }
34
+
35
+ public function display() {
36
+ require_once WD_CFM_DIR . "/admin/models/CFMModelGoptions_cfm.php";
37
+ $model = new CFMModelGoptions_cfm();
38
+
39
+ require_once WD_CFM_DIR . "/admin/views/CFMViewGoptions_cfm.php";
40
+ $view = new CFMViewGoptions_cfm($model);
41
+ $view->display();
42
+ }
43
+
44
+ public function save() {
45
+ $message = $this->save_db();
46
+ $page = WDW_CFM_Library::get('page');
47
+ WDW_CFM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
48
+ }
49
+
50
+ public function save_db() {
51
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
52
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
53
+ $map_key = (isset($_POST['map_key']) ? esc_html(stripslashes($_POST['map_key'])) : '');
54
+ update_option('cfm_settings', array('public_key' => $public_key, 'private_key' => $private_key, 'map_key' => $map_key));
55
+ }
56
+
57
+
58
+
59
+ ////////////////////////////////////////////////////////////////////////////////////////
60
+ // Getters & Setters //
61
+ ////////////////////////////////////////////////////////////////////////////////////////
62
+ ////////////////////////////////////////////////////////////////////////////////////////
63
+ // Private Methods //
64
+ ////////////////////////////////////////////////////////////////////////////////////////
65
+ ////////////////////////////////////////////////////////////////////////////////////////
66
+ // Listeners //
67
+ ////////////////////////////////////////////////////////////////////////////////////////
68
  }
admin/controllers/CFMControllerUninstall_cfm.php CHANGED
@@ -1,58 +1,58 @@
1
- <?php
2
-
3
- class CFMControllerUninstall_cfm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
- if (method_exists($this, $task)) {
24
- check_admin_referer('nonce_cfm', 'nonce_cfm');
25
- $this->$task();
26
- }
27
- else {
28
- $this->display();
29
- }
30
- }
31
-
32
- public function display() {
33
- require_once WD_CFM_DIR . "/admin/models/CFMModelUninstall_cfm.php";
34
- $model = new CFMModelUninstall_cfm();
35
-
36
- require_once WD_CFM_DIR . "/admin/views/CFMViewUninstall_cfm.php";
37
- $view = new CFMViewUninstall_cfm($model);
38
- $view->display();
39
- }
40
-
41
- public function uninstall() {
42
- require_once WD_CFM_DIR . "/admin/models/CFMModelUninstall_cfm.php";
43
- $model = new CFMModelUninstall_cfm();
44
-
45
- require_once WD_CFM_DIR . "/admin/views/CFMViewUninstall_cfm.php";
46
- $view = new CFMViewUninstall_cfm($model);
47
- $view->uninstall();
48
- }
49
- ////////////////////////////////////////////////////////////////////////////////////////
50
- // Getters & Setters //
51
- ////////////////////////////////////////////////////////////////////////////////////////
52
- ////////////////////////////////////////////////////////////////////////////////////////
53
- // Private Methods //
54
- ////////////////////////////////////////////////////////////////////////////////////////
55
- ////////////////////////////////////////////////////////////////////////////////////////
56
- // Listeners //
57
- ////////////////////////////////////////////////////////////////////////////////////////
58
  }
1
+ <?php
2
+
3
+ class CFMControllerUninstall_cfm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
+ if (method_exists($this, $task)) {
24
+ check_admin_referer('nonce_cfm', 'nonce_cfm');
25
+ $this->$task();
26
+ }
27
+ else {
28
+ $this->display();
29
+ }
30
+ }
31
+
32
+ public function display() {
33
+ require_once WD_CFM_DIR . "/admin/models/CFMModelUninstall_cfm.php";
34
+ $model = new CFMModelUninstall_cfm();
35
+
36
+ require_once WD_CFM_DIR . "/admin/views/CFMViewUninstall_cfm.php";
37
+ $view = new CFMViewUninstall_cfm($model);
38
+ $view->display();
39
+ }
40
+
41
+ public function uninstall() {
42
+ require_once WD_CFM_DIR . "/admin/models/CFMModelUninstall_cfm.php";
43
+ $model = new CFMModelUninstall_cfm();
44
+
45
+ require_once WD_CFM_DIR . "/admin/views/CFMViewUninstall_cfm.php";
46
+ $view = new CFMViewUninstall_cfm($model);
47
+ $view->uninstall();
48
+ }
49
+ ////////////////////////////////////////////////////////////////////////////////////////
50
+ // Getters & Setters //
51
+ ////////////////////////////////////////////////////////////////////////////////////////
52
+ ////////////////////////////////////////////////////////////////////////////////////////
53
+ // Private Methods //
54
+ ////////////////////////////////////////////////////////////////////////////////////////
55
+ ////////////////////////////////////////////////////////////////////////////////////////
56
+ // Listeners //
57
+ ////////////////////////////////////////////////////////////////////////////////////////
58
  }
admin/controllers/CFMControllerWidget.php CHANGED
@@ -1,61 +1,61 @@
1
- <?php
2
-
3
- class CFMControllerWidget extends WP_Widget {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $view;
14
- private $model;
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- // Constructor & Destructor //
17
- ////////////////////////////////////////////////////////////////////////////////////////
18
- public function __construct() {
19
- $widget_ops = array(
20
- 'classname' => 'contact_form_maker_widget',
21
- 'description' => __('Add Conatct Form Builder widget.', 'contact_form_maker')
22
- );
23
- // Widget Control Settings.
24
- $control_ops = array('id_base' => 'contact_form_maker_widget');
25
- // Create the widget.
26
- parent::__construct('contact_form_maker_widget', 'Contact Form Builder', $widget_ops, $control_ops);
27
- require_once WD_CFM_DIR . "/admin/models/CFMModelWidget.php";
28
- $this->model = new CFMModelWidget();
29
-
30
- require_once WD_CFM_DIR . "/admin/views/CFMViewWidget.php";
31
- $this->view = new CFMViewWidget($this->model);
32
- }
33
- ////////////////////////////////////////////////////////////////////////////////////////
34
- // Public Methods //
35
- ////////////////////////////////////////////////////////////////////////////////////////
36
-
37
- public function widget($args, $instance) {
38
- $this->view->widget($args, $instance);
39
- }
40
-
41
- public function form($instance) {
42
- $this->view->form($instance, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
43
- }
44
-
45
- // Update Settings.
46
- public function update($new_instance, $old_instance) {
47
- $instance['title'] = $new_instance['title'];
48
- $instance['form_id'] = $new_instance['form_id'];
49
- return $instance;
50
- }
51
-
52
- ////////////////////////////////////////////////////////////////////////////////////////
53
- // Getters & Setters //
54
- ////////////////////////////////////////////////////////////////////////////////////////
55
- ////////////////////////////////////////////////////////////////////////////////////////
56
- // Private Methods //
57
- ////////////////////////////////////////////////////////////////////////////////////////
58
- ////////////////////////////////////////////////////////////////////////////////////////
59
- // Listeners //
60
- ////////////////////////////////////////////////////////////////////////////////////////
61
  }
1
+ <?php
2
+
3
+ class CFMControllerWidget extends WP_Widget {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $view;
14
+ private $model;
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct() {
19
+ $widget_ops = array(
20
+ 'classname' => 'contact_form_maker_widget',
21
+ 'description' => __('Add Conatct Form Builder widget.', 'contact_form_maker')
22
+ );
23
+ // Widget Control Settings.
24
+ $control_ops = array('id_base' => 'contact_form_maker_widget');
25
+ // Create the widget.
26
+ parent::__construct('contact_form_maker_widget', 'Contact Form Builder', $widget_ops, $control_ops);
27
+ require_once WD_CFM_DIR . "/admin/models/CFMModelWidget.php";
28
+ $this->model = new CFMModelWidget();
29
+
30
+ require_once WD_CFM_DIR . "/admin/views/CFMViewWidget.php";
31
+ $this->view = new CFMViewWidget($this->model);
32
+ }
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Public Methods //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+
37
+ public function widget($args, $instance) {
38
+ $this->view->widget($args, $instance);
39
+ }
40
+
41
+ public function form($instance) {
42
+ $this->view->form($instance, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
43
+ }
44
+
45
+ // Update Settings.
46
+ public function update($new_instance, $old_instance) {
47
+ $instance['title'] = $new_instance['title'];
48
+ $instance['form_id'] = $new_instance['form_id'];
49
+ return $instance;
50
+ }
51
+
52
+ ////////////////////////////////////////////////////////////////////////////////////////
53
+ // Getters & Setters //
54
+ ////////////////////////////////////////////////////////////////////////////////////////
55
+ ////////////////////////////////////////////////////////////////////////////////////////
56
+ // Private Methods //
57
+ ////////////////////////////////////////////////////////////////////////////////////////
58
+ ////////////////////////////////////////////////////////////////////////////////////////
59
+ // Listeners //
60
+ ////////////////////////////////////////////////////////////////////////////////////////
61
  }
admin/models/CFMModelBlocked_ips_cfm.php CHANGED
@@ -1,74 +1,74 @@
1
- <?php
2
-
3
- class CFMModelBlocked_ips_cfm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function get_rows_data() {
22
- global $wpdb;
23
- $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
24
- $asc_or_desc = ((isset($_POST['asc_or_desc']) && esc_html($_POST['asc_or_desc']) == 'asc') ? 'asc' : 'desc');
25
- $order_by = ((isset($_POST['order_by']) && esc_html($_POST['order_by']) == 'ip') ? 'ip' : 'id');
26
- $order_by = ' ORDER BY ' . $order_by . ' ' . $asc_or_desc;
27
- if (isset($_POST['page_number']) && $_POST['page_number']) {
28
- $limit = ((int) $_POST['page_number'] - 1) * 20;
29
- }
30
- else {
31
- $limit = 0;
32
- }
33
- $query = "SELECT * FROM " . $wpdb->prefix . "contactformmaker_blocked " . $where . $order_by . " LIMIT " . $limit . ",20";
34
- $rows = $wpdb->get_results($query);
35
- return $rows;
36
- }
37
-
38
- public function get_row_data($id) {
39
- global $wpdb;
40
- if ($id != 0) {
41
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'contactformmaker_blocked WHERE id="%d"', $id));
42
- }
43
- else {
44
- $row->id = 0;
45
- $row->ip = '';
46
- }
47
- return $row;
48
- }
49
-
50
- public function page_nav() {
51
- global $wpdb;
52
- $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
53
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "contactformmaker_blocked " . $where;
54
- $total = $wpdb->get_var($query);
55
- $page_nav['total'] = $total;
56
- if (isset($_POST['page_number']) && $_POST['page_number']) {
57
- $limit = ((int) $_POST['page_number'] - 1) * 20;
58
- }
59
- else {
60
- $limit = 0;
61
- }
62
- $page_nav['limit'] = (int) ($limit / 20 + 1);
63
- return $page_nav;
64
- }
65
- ////////////////////////////////////////////////////////////////////////////////////////
66
- // Getters & Setters //
67
- ////////////////////////////////////////////////////////////////////////////////////////
68
- ////////////////////////////////////////////////////////////////////////////////////////
69
- // Private Methods //
70
- ////////////////////////////////////////////////////////////////////////////////////////
71
- ////////////////////////////////////////////////////////////////////////////////////////
72
- // Listeners //
73
- ////////////////////////////////////////////////////////////////////////////////////////
74
  }
1
+ <?php
2
+
3
+ class CFMModelBlocked_ips_cfm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function get_rows_data() {
22
+ global $wpdb;
23
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
24
+ $asc_or_desc = ((isset($_POST['asc_or_desc']) && esc_html($_POST['asc_or_desc']) == 'asc') ? 'asc' : 'desc');
25
+ $order_by = ((isset($_POST['order_by']) && esc_html($_POST['order_by']) == 'ip') ? 'ip' : 'id');
26
+ $order_by = ' ORDER BY ' . $order_by . ' ' . $asc_or_desc;
27
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
28
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
29
+ }
30
+ else {
31
+ $limit = 0;
32
+ }
33
+ $query = "SELECT * FROM " . $wpdb->prefix . "contactformmaker_blocked " . $where . $order_by . " LIMIT " . $limit . ",20";
34
+ $rows = $wpdb->get_results($query);
35
+ return $rows;
36
+ }
37
+
38
+ public function get_row_data($id) {
39
+ global $wpdb;
40
+ if ($id != 0) {
41
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'contactformmaker_blocked WHERE id="%d"', $id));
42
+ }
43
+ else {
44
+ $row->id = 0;
45
+ $row->ip = '';
46
+ }
47
+ return $row;
48
+ }
49
+
50
+ public function page_nav() {
51
+ global $wpdb;
52
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
53
+ $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "contactformmaker_blocked " . $where;
54
+ $total = $wpdb->get_var($query);
55
+ $page_nav['total'] = $total;
56
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
57
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
58
+ }
59
+ else {
60
+ $limit = 0;
61
+ }
62
+ $page_nav['limit'] = (int) ($limit / 20 + 1);
63
+ return $page_nav;
64
+ }
65
+ ////////////////////////////////////////////////////////////////////////////////////////
66
+ // Getters & Setters //
67
+ ////////////////////////////////////////////////////////////////////////////////////////
68
+ ////////////////////////////////////////////////////////////////////////////////////////
69
+ // Private Methods //
70
+ ////////////////////////////////////////////////////////////////////////////////////////
71
+ ////////////////////////////////////////////////////////////////////////////////////////
72
+ // Listeners //
73
+ ////////////////////////////////////////////////////////////////////////////////////////
74
  }
admin/models/CFMModelCFMShortcode.php CHANGED
@@ -1,36 +1,36 @@
1
- <?php
2
-
3
- class CFMModelCFMShortcode {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- public function get_form_data() {
23
- global $wpdb;
24
- $row = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "contactformmaker order by `title` ASC");
25
- return $row;
26
- }
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- // Getters & Setters //
29
- ////////////////////////////////////////////////////////////////////////////////////////
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
- // Private Methods //
32
- ////////////////////////////////////////////////////////////////////////////////////////
33
- ////////////////////////////////////////////////////////////////////////////////////////
34
- // Listeners //
35
- ////////////////////////////////////////////////////////////////////////////////////////
36
  }
1
+ <?php
2
+
3
+ class CFMModelCFMShortcode {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_form_data() {
23
+ global $wpdb;
24
+ $row = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "contactformmaker order by `title` ASC");
25
+ return $row;
26
+ }
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ // Getters & Setters //
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
+ // Private Methods //
32
+ ////////////////////////////////////////////////////////////////////////////////////////
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Listeners //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
  }
admin/models/CFMModelContactFormMakerPreview.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- class CFMModelContactFormMakerPreview {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Getters & Setters //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- ////////////////////////////////////////////////////////////////////////////////////////
26
- // Private Methods //
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- ////////////////////////////////////////////////////////////////////////////////////////
29
- // Listeners //
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
  }
1
+ <?php
2
+
3
+ class CFMModelContactFormMakerPreview {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
  }
admin/models/CFMModelContactFormmakerwdcaptcha.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- class CFMModelContactFormmakerwdcaptcha {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Getters & Setters //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- ////////////////////////////////////////////////////////////////////////////////////////
26
- // Private Methods //
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- ////////////////////////////////////////////////////////////////////////////////////////
29
- // Listeners //
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
  }
1
+ <?php
2
+
3
+ class CFMModelContactFormmakerwdcaptcha {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
  }
admin/models/CFMModelGoptions_cfm.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
-
3
- class CFMModelGoptions_cfm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- ////////////////////////////////////////////////////////////////////////////////////////
22
- // Getters & Setters //
23
- ////////////////////////////////////////////////////////////////////////////////////////
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- // Private Methods //
26
- ////////////////////////////////////////////////////////////////////////////////////////
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- // Listeners //
29
- ////////////////////////////////////////////////////////////////////////////////////////
30
  }
1
+ <?php
2
+
3
+ class CFMModelGoptions_cfm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // Getters & Setters //
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ // Private Methods //
26
+ ////////////////////////////////////////////////////////////////////////////////////////
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ // Listeners //
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
  }
admin/models/CFMModelManage_cfm.php CHANGED
@@ -245,6 +245,9 @@ class CFMModelManage_cfm {
245
  case 'type_name': {
246
  $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class');
247
  $temp = $params;
 
 
 
248
  foreach ($params_names as $params_name) {
249
  $temp = explode('*:*' . $params_name . '*:*', $temp);
250
  $param[$params_name] = $temp[0];
@@ -262,6 +265,7 @@ class CFMModelManage_cfm {
262
  $w_first_val = explode('***', $param['w_first_val']);
263
  $w_title = explode('***', $param['w_title']);
264
  $w_mini_labels = explode('***', $param['w_mini_labels']);
 
265
  if ($param['w_name_format'] == 'normal') {
266
  $w_name_format = '<div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.($w_first_val[0]==$w_title[0] ? "input_deactive" : "input_active").'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value(&quot;'.$id.'_element_firstform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" 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" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&quot;'.$id.'_element_lastform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled ></div>';
267
  $w_name_format_mini_labels = '<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_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></div>';
@@ -270,7 +274,7 @@ class CFMModelManage_cfm {
270
  $w_name_format = '<div id="'.$id.'_td_name_input_title" style="display: table-cell;"><input type="text" class="'.($w_first_val[0]==$w_title[0] ? "input_deactive" : "input_active").'" id="'.$id.'_element_titleform_id_temp" name="'.$id.'_element_titleform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" style="margin: 0px 10px 0px 0px; width: 40px;"></div><div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;"></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.($w_first_val[2]==$w_title[2] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[2].'" title="'.$w_title[2].'" onfocus="delete_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;"></div><div id="'.$id.'_td_name_input_middle" style="display: table-cell;"><input type="text" class="'.($w_first_val[3]==$w_title[3] ? "input_deactive" : "input_active").'" id="'.$id.'_element_middleform_id_temp" name="'.$id.'_element_middleform_id_temp" value="'.$w_first_val[3].'" title="'.$w_title[3].'" onfocus="delete_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" style="width: '.$param['w_size'].'px;"></div>';
271
  $w_name_format_mini_labels ='<div id="'.$id.'_tr_name2" style="display: table-row;"><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><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><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></div>';
272
  }
273
- $rep .= '<div id="wdform_field'.$id.'" type="type_name" class="wdform_field" style="display: table-cell;"><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; 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_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_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><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>'.$w_name_format_mini_labels.' </div></div></div>';
274
  break;
275
  }
276
  case 'type_address': {
@@ -338,6 +342,9 @@ class CFMModelManage_cfm {
338
  case 'type_submitter_mail': {
339
  $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
340
  $temp = $params;
 
 
 
341
  foreach ($params_names as $params_name) {
342
  $temp = explode('*:*' . $params_name . '*:*', $temp);
343
  $param[$params_name] = $temp[0];
@@ -353,7 +360,8 @@ class CFMModelManage_cfm {
353
  $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
354
  $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
355
  $required_sym = ($param['w_required'] == "yes" ? " *" : "");
356
- $rep .= '<div id="wdform_field'.$id.'" type="type_submitter_mail" class="wdform_field" style="display: table-cell;"><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; 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_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_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled ></div></div>';
 
357
  break;
358
  }
359
  case 'type_checkbox': {
245
  case 'type_name': {
246
  $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class');
247
  $temp = $params;
248
+ if (strpos($temp, 'w_autofill') > -1) {
249
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_autofill');
250
+ }
251
  foreach ($params_names as $params_name) {
252
  $temp = explode('*:*' . $params_name . '*:*', $temp);
253
  $param[$params_name] = $temp[0];
265
  $w_first_val = explode('***', $param['w_first_val']);
266
  $w_title = explode('***', $param['w_title']);
267
  $w_mini_labels = explode('***', $param['w_mini_labels']);
268
+ $param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
269
  if ($param['w_name_format'] == 'normal') {
270
  $w_name_format = '<div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.($w_first_val[0]==$w_title[0] ? "input_deactive" : "input_active").'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value(&quot;'.$id.'_element_firstform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" 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" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&quot;'.$id.'_element_lastform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled ></div>';
271
  $w_name_format_mini_labels = '<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_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></div>';
274
  $w_name_format = '<div id="'.$id.'_td_name_input_title" style="display: table-cell;"><input type="text" class="'.($w_first_val[0]==$w_title[0] ? "input_deactive" : "input_active").'" id="'.$id.'_element_titleform_id_temp" name="'.$id.'_element_titleform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" style="margin: 0px 10px 0px 0px; width: 40px;"></div><div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;"></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.($w_first_val[2]==$w_title[2] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[2].'" title="'.$w_title[2].'" onfocus="delete_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;"></div><div id="'.$id.'_td_name_input_middle" style="display: table-cell;"><input type="text" class="'.($w_first_val[3]==$w_title[3] ? "input_deactive" : "input_active").'" id="'.$id.'_element_middleform_id_temp" name="'.$id.'_element_middleform_id_temp" value="'.$w_first_val[3].'" title="'.$w_title[3].'" onfocus="delete_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" style="width: '.$param['w_size'].'px;"></div>';
275
  $w_name_format_mini_labels ='<div id="'.$id.'_tr_name2" style="display: table-row;"><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><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><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></div>';
276
  }
277
+ $rep .= '<div id="wdform_field'.$id.'" type="type_name" class="wdform_field" style="display: table-cell;"><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; 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_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_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"><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>'.$w_name_format_mini_labels.' </div></div></div>';
278
  break;
279
  }
280
  case 'type_address': {
342
  case 'type_submitter_mail': {
343
  $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
344
  $temp = $params;
345
+ if (strpos($temp, 'w_autofill') > -1) {
346
+ $params_names = array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class', 'w_autofill');
347
+ }
348
  foreach ($params_names as $params_name) {
349
  $temp = explode('*:*' . $params_name . '*:*', $temp);
350
  $param[$params_name] = $temp[0];
360
  $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
361
  $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
362
  $required_sym = ($param['w_required'] == "yes" ? " *" : "");
363
+ $param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
364
+ $rep .= '<div id="wdform_field'.$id.'" type="type_submitter_mail" class="wdform_field" style="display: table-cell;"><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; 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_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_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="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled ></div></div>';
365
  break;
366
  }
367
  case 'type_checkbox': {
admin/models/CFMModelUninstall_cfm.php CHANGED
@@ -1,41 +1,41 @@
1
- <?php
2
-
3
- class CFMModelUninstall_cfm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function delete_db_tables() {
22
- global $wpdb;
23
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "contactformmaker");
24
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "contactformmaker_submits");
25
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "contactformmaker_themes");
26
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "contactformmaker_views");
27
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "contactformmaker_blocked");
28
- delete_option("wd_contact_form_maker_version");
29
- delete_option("cfm_export_delimiter");
30
- delete_option("cfm_settings");
31
- }
32
- ////////////////////////////////////////////////////////////////////////////////////////
33
- // Getters & Setters //
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- ////////////////////////////////////////////////////////////////////////////////////////
36
- // Private Methods //
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- ////////////////////////////////////////////////////////////////////////////////////////
39
- // Listeners //
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
  }
1
+ <?php
2
+
3
+ class CFMModelUninstall_cfm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function delete_db_tables() {
22
+ global $wpdb;
23
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "contactformmaker");
24
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "contactformmaker_submits");
25
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "contactformmaker_themes");
26
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "contactformmaker_views");
27
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "contactformmaker_blocked");
28
+ delete_option("wd_contact_form_maker_version");
29
+ delete_option("cfm_export_delimiter");
30
+ delete_option("cfm_settings");
31
+ }
32
+ ////////////////////////////////////////////////////////////////////////////////////////
33
+ // Getters & Setters //
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+ // Private Methods //
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ ////////////////////////////////////////////////////////////////////////////////////////
39
+ // Listeners //
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
  }
admin/models/CFMModelWidget.php CHANGED
@@ -1,37 +1,37 @@
1
- <?php
2
-
3
- class CFMModelWidget {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- public function get_gallery_rows_data() {
23
- global $wpdb;
24
- $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "contactformmaker order by `title`");
25
- return $rows;
26
- }
27
-
28
- ////////////////////////////////////////////////////////////////////////////////////////
29
- // Getters & Setters //
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
- ////////////////////////////////////////////////////////////////////////////////////////
32
- // Private Methods //
33
- ////////////////////////////////////////////////////////////////////////////////////////
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Listeners //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
  }
1
+ <?php
2
+
3
+ class CFMModelWidget {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_gallery_rows_data() {
23
+ global $wpdb;
24
+ $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "contactformmaker order by `title`");
25
+ return $rows;
26
+ }
27
+
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Getters & Setters //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
+ ////////////////////////////////////////////////////////////////////////////////////////
32
+ // Private Methods //
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Listeners //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
  }
admin/views/CFMViewCFMShortcode.php CHANGED
@@ -1,112 +1,112 @@
1
- <?php
2
-
3
- class CFMViewCFMShortcode {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- // Constructor & Destructor //
17
- ////////////////////////////////////////////////////////////////////////////////////////
18
- public function __construct($model) {
19
- $this->model = $model;
20
- }
21
- ////////////////////////////////////////////////////////////////////////////////////////
22
- // Public Methods //
23
- ////////////////////////////////////////////////////////////////////////////////////////
24
- public function display() {
25
- $rows = $this->model->get_form_data();
26
- ?>
27
- <html xmlns="http://www.w3.org/1999/xhtml">
28
- <head>
29
- <title>Contact Form Builder</title>
30
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
31
- <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
32
- <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
33
- <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
34
-
35
- <?php
36
- wp_print_scripts('jquery');
37
- ?>
38
- <base target="_self">
39
- </head>
40
- <body id="link" onLoad="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';" dir="ltr" class="forceColors">
41
- <div class="tabs" role="tablist" tabindex="-1">
42
- <ul>
43
- <li id="display_tab" class="current" role="tab" tabindex="0">
44
- <span>
45
- <a href="javascript:mcTabs.displayTab('display_tab','display_panel');" onMouseDown="return false;" tabindex="-1">Contact Form Builder</a>
46
- </span>
47
- </li>
48
- </ul>
49
- </div>
50
- <style>
51
- .panel_wrapper {
52
- height: 170px !important;
53
- }
54
- </style>
55
- <div class="panel_wrapper">
56
- <div id="display_panel" class="panel current">
57
- <table>
58
- <tr>
59
- <td style="vertical-align: middle; text-align: left;"><?php echo __("Select a Form", "contact_form_maker"); ?></td>
60
- <td style="vertical-align: middle; text-align: left;">
61
- <select name="form_maker_id" id="form_maker_id" style="width: 230px; text-align: left;">
62
- <option value="- Select Form -" selected="selected">-<?php echo __("Select a Form", "contact_form_maker"); ?>-</option>
63
- <?php
64
- foreach ($rows as $row) {
65
- ?>
66
- <option value="<?php echo $row->id; ?>"><?php echo $row->title; ?></option>
67
- <?php
68
- }
69
- ?>
70
- </select>
71
- </td>
72
- </tr>
73
- </table>
74
- </div>
75
- </div>
76
- <div class="mceActionPanel">
77
- <div style="float: left;">
78
- <input type="button" id="cancel" name="cancel" value="<?php echo __('Cancel', 'contact_form_maker'); ?>" onClick="tinyMCEPopup.close();"/>
79
- </div>
80
- <div style="float: right;">
81
- <input type="submit" id="insert" name="insert" value="<?php echo __('Insert', 'contact_form_maker'); ?>" onClick="form_maker_insert_shortcode();"/>
82
- </div>
83
- </div>
84
- <script type="text/javascript">
85
- function form_maker_insert_shortcode() {
86
- if (document.getElementById('form_maker_id').value == '- Select Form -') {
87
- tinyMCEPopup.close();
88
- }
89
- else {
90
- var tagtext;
91
- tagtext = '[Contact_Form_Builder id="' + document.getElementById('form_maker_id').value + '"]';
92
- window.tinyMCE.execCommand('mceInsertContent', false, tagtext);
93
- tinyMCEPopup.close();
94
- }
95
- }
96
- </script>
97
- </body>
98
- </html>
99
- <?php
100
- die();
101
- }
102
-
103
- ////////////////////////////////////////////////////////////////////////////////////////
104
- // Getters & Setters //
105
- ////////////////////////////////////////////////////////////////////////////////////////
106
- ////////////////////////////////////////////////////////////////////////////////////////
107
- // Private Methods //
108
- ////////////////////////////////////////////////////////////////////////////////////////
109
- ////////////////////////////////////////////////////////////////////////////////////////
110
- // Listeners //
111
- ////////////////////////////////////////////////////////////////////////////////////////
112
  }
1
+ <?php
2
+
3
+ class CFMViewCFMShortcode {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // Public Methods //
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+ public function display() {
25
+ $rows = $this->model->get_form_data();
26
+ ?>
27
+ <html xmlns="http://www.w3.org/1999/xhtml">
28
+ <head>
29
+ <title>Contact Form Builder</title>
30
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
31
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
32
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
33
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
34
+
35
+ <?php
36
+ wp_print_scripts('jquery');
37
+ ?>
38
+ <base target="_self">
39
+ </head>
40
+ <body id="link" onLoad="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';" dir="ltr" class="forceColors">
41
+ <div class="tabs" role="tablist" tabindex="-1">
42
+ <ul>
43
+ <li id="display_tab" class="current" role="tab" tabindex="0">
44
+ <span>
45
+ <a href="javascript:mcTabs.displayTab('display_tab','display_panel');" onMouseDown="return false;" tabindex="-1">Contact Form Builder</a>
46
+ </span>
47
+ </li>
48
+ </ul>
49
+ </div>
50
+ <style>
51
+ .panel_wrapper {
52
+ height: 170px !important;
53
+ }
54
+ </style>
55
+ <div class="panel_wrapper">
56
+ <div id="display_panel" class="panel current">
57
+ <table>
58
+ <tr>
59
+ <td style="vertical-align: middle; text-align: left;"><?php echo __("Select a Form", "contact_form_maker"); ?></td>
60
+ <td style="vertical-align: middle; text-align: left;">
61
+ <select name="form_maker_id" id="form_maker_id" style="width: 230px; text-align: left;">
62
+ <option value="- Select Form -" selected="selected">-<?php echo __("Select a Form", "contact_form_maker"); ?>-</option>
63
+ <?php
64
+ foreach ($rows as $row) {
65
+ ?>
66
+ <option value="<?php echo $row->id; ?>"><?php echo $row->title; ?></option>
67
+ <?php
68
+ }
69
+ ?>
70
+ </select>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ </div>
76
+ <div class="mceActionPanel">
77
+ <div style="float: left;">
78
+ <input type="button" id="cancel" name="cancel" value="<?php echo __('Cancel', 'contact_form_maker'); ?>" onClick="tinyMCEPopup.close();"/>
79
+ </div>
80
+ <div style="float: right;">
81
+ <input type="submit" id="insert" name="insert" value="<?php echo __('Insert', 'contact_form_maker'); ?>" onClick="form_maker_insert_shortcode();"/>
82
+ </div>
83
+ </div>
84
+ <script type="text/javascript">
85
+ function form_maker_insert_shortcode() {
86
+ if (document.getElementById('form_maker_id').value == '- Select Form -') {
87
+ tinyMCEPopup.close();
88
+ }
89
+ else {
90
+ var tagtext;
91
+ tagtext = '[Contact_Form_Builder id="' + document.getElementById('form_maker_id').value + '"]';
92
+ window.tinyMCE.execCommand('mceInsertContent', false, tagtext);
93
+ tinyMCEPopup.close();
94
+ }
95
+ }
96
+ </script>
97
+ </body>
98
+ </html>
99
+ <?php
100
+ die();
101
+ }
102
+
103
+ ////////////////////////////////////////////////////////////////////////////////////////
104
+ // Getters & Setters //
105
+ ////////////////////////////////////////////////////////////////////////////////////////
106
+ ////////////////////////////////////////////////////////////////////////////////////////
107
+ // Private Methods //
108
+ ////////////////////////////////////////////////////////////////////////////////////////
109
+ ////////////////////////////////////////////////////////////////////////////////////////
110
+ // Listeners //
111
+ ////////////////////////////////////////////////////////////////////////////////////////
112
  }
admin/views/CFMViewContactFormMakerPreview.php CHANGED
@@ -1,57 +1,57 @@
1
- <?php
2
-
3
- class CFMViewContactFormMakerPreview {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
-
16
- ////////////////////////////////////////////////////////////////////////////////////////
17
- // Constructor & Destructor //
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- public function __construct($model) {
20
- $this->model = $model;
21
- }
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- if (isset($_GET['form_id']) && isset($_GET['test_theme'])) {
27
- wp_print_scripts('jquery');
28
- wp_print_scripts('jquery-ui-widget');
29
- wp_print_scripts('jquery-effects-shake');
30
- $cfm_settings = get_option('cfm_settings');
31
- $map_key = isset($cfm_settings['map_key']) ? $cfm_settings['map_key'] : '';
32
- ?>
33
- <script src="https://maps.google.com/maps/api/js?v=3.exp&key=<?php echo $map_key ?>" type="text/javascript"></script>
34
- <script src="<?php echo WD_CFM_URL . '/js/if_gmap_front_end.js'; ?>" type="text/javascript"></script>
35
- <script src="<?php echo WD_CFM_URL . '/js/cfm_main_front_end.js'; ?>" type="text/javascript"></script>
36
- <link media="all" type="text/css" href="<?php echo WD_CFM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>" rel="stylesheet">
37
- <link media="all" type="text/css" href="<?php echo WD_CFM_URL . '/css/contact_form_maker_frontend.css'; ?>" rel="stylesheet">
38
- <?php
39
- $form_id = esc_html(stripslashes($_GET['form_id']));
40
- $theme_id = esc_html(stripslashes($_GET['test_theme']));
41
- require_once (WD_CFM_DIR . '/frontend/controllers/CFMControllerForm_maker.php');
42
- $controller = new CFMControllerForm_maker();
43
- echo $controller->execute($form_id, $theme_id);
44
- }
45
- die();
46
- }
47
-
48
- ////////////////////////////////////////////////////////////////////////////////////////
49
- // Getters & Setters //
50
- ////////////////////////////////////////////////////////////////////////////////////////
51
- ////////////////////////////////////////////////////////////////////////////////////////
52
- // Private Methods //
53
- ////////////////////////////////////////////////////////////////////////////////////////
54
- ////////////////////////////////////////////////////////////////////////////////////////
55
- // Listeners //
56
- ////////////////////////////////////////////////////////////////////////////////////////
57
  }
1
+ <?php
2
+
3
+ class CFMViewContactFormMakerPreview {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ if (isset($_GET['form_id']) && isset($_GET['test_theme'])) {
27
+ wp_print_scripts('jquery');
28
+ wp_print_scripts('jquery-ui-widget');
29
+ wp_print_scripts('jquery-effects-shake');
30
+ $cfm_settings = get_option('cfm_settings');
31
+ $map_key = isset($cfm_settings['map_key']) ? $cfm_settings['map_key'] : '';
32
+ ?>
33
+ <script src="https://maps.google.com/maps/api/js?v=3.exp&key=<?php echo $map_key ?>" type="text/javascript"></script>
34
+ <script src="<?php echo WD_CFM_URL . '/js/if_gmap_front_end.js'; ?>" type="text/javascript"></script>
35
+ <script src="<?php echo WD_CFM_URL . '/js/cfm_main_front_end.js'; ?>" type="text/javascript"></script>
36
+ <link media="all" type="text/css" href="<?php echo WD_CFM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>" rel="stylesheet">
37
+ <link media="all" type="text/css" href="<?php echo WD_CFM_URL . '/css/contact_form_maker_frontend.css'; ?>" rel="stylesheet">
38
+ <?php
39
+ $form_id = esc_html(stripslashes($_GET['form_id']));
40
+ $theme_id = esc_html(stripslashes($_GET['test_theme']));
41
+ require_once (WD_CFM_DIR . '/frontend/controllers/CFMControllerForm_maker.php');
42
+ $controller = new CFMControllerForm_maker();
43
+ echo $controller->execute($form_id, $theme_id);
44
+ }
45
+ die();
46
+ }
47
+
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
+ // Getters & Setters //
50
+ ////////////////////////////////////////////////////////////////////////////////////////
51
+ ////////////////////////////////////////////////////////////////////////////////////////
52
+ // Private Methods //
53
+ ////////////////////////////////////////////////////////////////////////////////////////
54
+ ////////////////////////////////////////////////////////////////////////////////////////
55
+ // Listeners //
56
+ ////////////////////////////////////////////////////////////////////////////////////////
57
  }
admin/views/CFMViewContactFormmakerwdcaptcha.php CHANGED
@@ -1,93 +1,93 @@
1
- <?php
2
-
3
- class CFMViewContactFormmakerwdcaptcha {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
-
16
- ////////////////////////////////////////////////////////////////////////////////////////
17
- // Constructor & Destructor //
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- public function __construct($model) {
20
- $this->model = $model;
21
- }
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- if (isset($_GET['action']) && esc_html($_GET['action']) == 'ContactFormmakerwdcaptcha') {
27
- $i = (isset($_GET["i"]) ? esc_html($_GET["i"]) : '');
28
- $r2 = (isset($_GET["r2"]) ? (int) $_GET["r2"] : 0);
29
- $rrr = (isset($_GET["rrr"]) ? (int) $_GET["rrr"] : 0);
30
- $randNum = 0 + $r2 + $rrr;
31
- $digit = (isset($_GET["digit"]) ? (int) $_GET["digit"] : 6);
32
- $cap_width = $digit * 10 + 15;
33
- $cap_height = 26;
34
- $cap_quality = 100;
35
- $cap_length_min = $digit;
36
- $cap_length_max = $digit;
37
- $cap_digital = 1;
38
- $cap_latin_char = 1;
39
- function code_generic($_length, $_digital = 1, $_latin_char = 1) {
40
- $dig = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
41
- $lat = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
42
- $main = array();
43
- if ($_digital) {
44
- $main = array_merge($main, $dig);
45
- }
46
- if ($_latin_char) {
47
- $main = array_merge($main, $lat);
48
- }
49
- shuffle($main);
50
- $pass = substr(implode('', $main), 0, $_length);
51
- return $pass;
52
- }
53
- $l = rand($cap_length_min, $cap_length_max);
54
- $code = code_generic($l, $cap_digital, $cap_latin_char);
55
- if (session_id() == '' || (function_exists('session_status') && (session_status() == PHP_SESSION_NONE))) {
56
- @session_start();
57
- }
58
- $_SESSION[$i . '_wd_captcha_code'] = $code;
59
- $canvas = imagecreatetruecolor($cap_width, $cap_height);
60
- $c = imagecolorallocate($canvas, rand(150, 255), rand(150, 255), rand(150, 255));
61
- imagefilledrectangle($canvas, 0, 0, $cap_width, $cap_height, $c);
62
- $count = strlen($code);
63
- $color_text = imagecolorallocate($canvas, 0, 0, 0);
64
- for ($it = 0; $it < $count; $it++) {
65
- $letter = $code[$it];
66
- imagestring($canvas, 6, (10 * $it + 10), $cap_height / 4, $letter, $color_text);
67
- }
68
- for ($c = 0; $c < 150; $c++) {
69
- $x = rand(0, $cap_width - 1);
70
- $y = rand(0, 29);
71
- $col = '0x' . rand(0, 9) . '0' . rand(0, 9) . '0' . rand(0, 9) . '0';
72
- imagesetpixel($canvas, $x, $y, $col);
73
- }
74
- header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
75
- header('Cache-Control: no-store, no-cache, must-revalidate');
76
- header('Cache-Control: post-check=0, pre-check=0', FALSE);
77
- header('Pragma: no-cache');
78
- header('Content-Type: image/jpeg');
79
- imagejpeg($canvas, NULL, $cap_quality);
80
- }
81
- die('');
82
- }
83
-
84
- ////////////////////////////////////////////////////////////////////////////////////////
85
- // Getters & Setters //
86
- ////////////////////////////////////////////////////////////////////////////////////////
87
- ////////////////////////////////////////////////////////////////////////////////////////
88
- // Private Methods //
89
- ////////////////////////////////////////////////////////////////////////////////////////
90
- ////////////////////////////////////////////////////////////////////////////////////////
91
- // Listeners //
92
- ////////////////////////////////////////////////////////////////////////////////////////
93
  }
1
+ <?php
2
+
3
+ class CFMViewContactFormmakerwdcaptcha {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ if (isset($_GET['action']) && esc_html($_GET['action']) == 'ContactFormmakerwdcaptcha') {
27
+ $i = (isset($_GET["i"]) ? esc_html($_GET["i"]) : '');
28
+ $r2 = (isset($_GET["r2"]) ? (int) $_GET["r2"] : 0);
29
+ $rrr = (isset($_GET["rrr"]) ? (int) $_GET["rrr"] : 0);
30
+ $randNum = 0 + $r2 + $rrr;
31
+ $digit = (isset($_GET["digit"]) ? (int) $_GET["digit"] : 6);
32
+ $cap_width = $digit * 10 + 15;
33
+ $cap_height = 26;
34
+ $cap_quality = 100;
35
+ $cap_length_min = $digit;
36
+ $cap_length_max = $digit;
37
+ $cap_digital = 1;
38
+ $cap_latin_char = 1;
39
+ function code_generic($_length, $_digital = 1, $_latin_char = 1) {
40
+ $dig = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
41
+ $lat = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
42
+ $main = array();
43
+ if ($_digital) {
44
+ $main = array_merge($main, $dig);
45
+ }
46
+ if ($_latin_char) {
47
+ $main = array_merge($main, $lat);
48
+ }
49
+ shuffle($main);
50
+ $pass = substr(implode('', $main), 0, $_length);
51
+ return $pass;
52
+ }
53
+ $l = rand($cap_length_min, $cap_length_max);
54
+ $code = code_generic($l, $cap_digital, $cap_latin_char);
55
+ if (session_id() == '' || (function_exists('session_status') && (session_status() == PHP_SESSION_NONE))) {
56
+ @session_start();
57
+ }
58
+ $_SESSION[$i . '_wd_captcha_code'] = $code;
59
+ $canvas = imagecreatetruecolor($cap_width, $cap_height);
60
+ $c = imagecolorallocate($canvas, rand(150, 255), rand(150, 255), rand(150, 255));
61
+ imagefilledrectangle($canvas, 0, 0, $cap_width, $cap_height, $c);
62
+ $count = strlen($code);
63
+ $color_text = imagecolorallocate($canvas, 0, 0, 0);
64
+ for ($it = 0; $it < $count; $it++) {
65
+ $letter = $code[$it];
66
+ imagestring($canvas, 6, (10 * $it + 10), $cap_height / 4, $letter, $color_text);
67
+ }
68
+ for ($c = 0; $c < 150; $c++) {
69
+ $x = rand(0, $cap_width - 1);
70
+ $y = rand(0, 29);
71
+ $col = '0x' . rand(0, 9) . '0' . rand(0, 9) . '0' . rand(0, 9) . '0';
72
+ imagesetpixel($canvas, $x, $y, $col);
73
+ }
74
+ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
75
+ header('Cache-Control: no-store, no-cache, must-revalidate');
76
+ header('Cache-Control: post-check=0, pre-check=0', FALSE);
77
+ header('Pragma: no-cache');
78
+ header('Content-Type: image/jpeg');
79
+ imagejpeg($canvas, NULL, $cap_quality);
80
+ }
81
+ die('');
82
+ }
83
+
84
+ ////////////////////////////////////////////////////////////////////////////////////////
85
+ // Getters & Setters //
86
+ ////////////////////////////////////////////////////////////////////////////////////////
87
+ ////////////////////////////////////////////////////////////////////////////////////////
88
+ // Private Methods //
89
+ ////////////////////////////////////////////////////////////////////////////////////////
90
+ ////////////////////////////////////////////////////////////////////////////////////////
91
+ // Listeners //
92
+ ////////////////////////////////////////////////////////////////////////////////////////
93
  }
admin/views/CFMViewGoptions_cfm.php CHANGED
@@ -1,112 +1,112 @@
1
- <?php
2
- class CFMViewGoptions_cfm {
3
- ////////////////////////////////////////////////////////////////////////////////////////
4
- // Events //
5
- ////////////////////////////////////////////////////////////////////////////////////////
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- // Constants //
8
- ////////////////////////////////////////////////////////////////////////////////////////
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- // Variables //
11
- ////////////////////////////////////////////////////////////////////////////////////////
12
- private $model;
13
-
14
- ////////////////////////////////////////////////////////////////////////////////////////
15
- // Constructor & Destructor //
16
- ////////////////////////////////////////////////////////////////////////////////////////
17
- public function __construct($model) {
18
- $this->model = $model;
19
- }
20
-
21
- ////////////////////////////////////////////////////////////////////////////////////////
22
- // Public Methods //
23
- ////////////////////////////////////////////////////////////////////////////////////////
24
- public function display() {
25
- $cfm_settings = get_option('cfm_settings');
26
- $public_key = isset($cfm_settings['public_key']) ? $cfm_settings['public_key'] : '';
27
- $private_key = isset($cfm_settings['private_key']) ? $cfm_settings['private_key'] : '';
28
- $map_key = isset($cfm_settings['map_key']) ? $cfm_settings['map_key'] : '';
29
- ?>
30
- <div class="fm-user-manual">
31
- <?php echo __("This section allows you to edit forms", "contact_form_maker"); ?>.
32
- <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-contact-form-builder-guide-2.html"><?php echo __("Read More in User Manual","contact_form_maker"); ?></a>
33
- <p><?php echo __("There is no possibility of adding new form fields, whereas you can edit, enable/disable the current fields included in each form","contact_form_maker"); ?>.</p>
34
- </div>
35
- <div class="fm-clear"></div>
36
- <form class="wrap" method="post" action="admin.php?page=goptions_cfm" style="width:99%;">
37
- <?php wp_nonce_field('nonce_cfm', 'nonce_cfm'); ?>
38
- <div class="fm-options-page-banner">
39
- <div class="fm-options-logo"></div>
40
- <div class="fm-options-logo-title">
41
- <?php echo __("Global Options", "contact_form_maker"); ?>
42
- </div>
43
- <div class="fm-page-actions">
44
- <button class="fm-button save-button small" onclick="spider_set_input_value('task', 'save');">
45
- <span></span>
46
- <?php echo __("Save", "contact_form_maker"); ?>
47
- </button>
48
- </div>
49
- </div>
50
-
51
- <table style="clear:both;">
52
- <tbody>
53
- <tr>
54
- <td>
55
- <label for="public_key"><?php echo __("Recaptcha Site Key:", "contact_form_maker"); ?></label>
56
- </td>
57
- <td>
58
- <input type="text" id="public_key" name="public_key" value="<?php echo $public_key; ?>" style="width:250px;" />
59
- </td>
60
- <td rowspan="2">
61
- <a href="https://www.google.com/recaptcha/intro/index.html" target="_blank"><?php echo __("Get Recaptcha", "contact_form_maker"); ?></a>
62
- </td>
63
- </tr>
64
- <tr>
65
- <td>
66
- <label for="private_key"><?php echo __("Recaptcha Secret Key:", "contact_form_maker"); ?></label>
67
- </td>
68
- <td>
69
- <input type="text" id="private_key" name="private_key" value="<?php echo $private_key; ?>" style="width:250px;" />
70
- </td>
71
- </tr>
72
- <tr>
73
- <td>
74
- <label for="public_key"><?php echo __("Maps API Key:", "contact_form_maker"); ?></label>
75
- </td>
76
- <td>
77
- <input type="text" id="map_key" name="map_key" value="<?php echo $map_key; ?>" style="width:250px;" />
78
- </td>
79
- <td>
80
- <a href="https://console.developers.google.com/flows/enableapi?apiid=maps_backend&keyType=CLIENT_SIDE&reusekey=true" target="_blank"><?php echo __("Get maps API key", "contact_form_maker"); ?></a>
81
- </td>
82
- </tr>
83
- <tr>
84
- <td>
85
-
86
- </td>
87
- <td>
88
- <span style="width:250px; display: inline-block; padding: 0 5px;">(It may take up to 5 minutes for API key change to take effect.)</span>
89
- </td>
90
- <td>
91
-
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
- <input type="hidden" id="task" name="task" value=""/>
97
- </form>
98
- <?php
99
- }
100
-
101
-
102
-
103
- ////////////////////////////////////////////////////////////////////////////////////////
104
- // Getters & Setters //
105
- ////////////////////////////////////////////////////////////////////////////////////////
106
- ////////////////////////////////////////////////////////////////////////////////////////
107
- // Private Methods //
108
- ////////////////////////////////////////////////////////////////////////////////////////
109
- ////////////////////////////////////////////////////////////////////////////////////////
110
- // Listeners //
111
- ////////////////////////////////////////////////////////////////////////////////////////
112
  }
1
+ <?php
2
+ class CFMViewGoptions_cfm {
3
+ ////////////////////////////////////////////////////////////////////////////////////////
4
+ // Events //
5
+ ////////////////////////////////////////////////////////////////////////////////////////
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ // Constants //
8
+ ////////////////////////////////////////////////////////////////////////////////////////
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ // Variables //
11
+ ////////////////////////////////////////////////////////////////////////////////////////
12
+ private $model;
13
+
14
+ ////////////////////////////////////////////////////////////////////////////////////////
15
+ // Constructor & Destructor //
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ public function __construct($model) {
18
+ $this->model = $model;
19
+ }
20
+
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // Public Methods //
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+ public function display() {
25
+ $cfm_settings = get_option('cfm_settings');
26
+ $public_key = isset($cfm_settings['public_key']) ? $cfm_settings['public_key'] : '';
27
+ $private_key = isset($cfm_settings['private_key']) ? $cfm_settings['private_key'] : '';
28
+ $map_key = isset($cfm_settings['map_key']) ? $cfm_settings['map_key'] : '';
29
+ ?>
30
+ <div class="fm-user-manual">
31
+ <?php echo __("This section allows you to edit forms", "contact_form_maker"); ?>.
32
+ <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-contact-form-builder-guide-2.html"><?php echo __("Read More in User Manual","contact_form_maker"); ?></a>
33
+ <p><?php echo __("There is no possibility of adding new form fields, whereas you can edit, enable/disable the current fields included in each form","contact_form_maker"); ?>.</p>
34
+ </div>
35
+ <div class="fm-clear"></div>
36
+ <form class="wrap" method="post" action="admin.php?page=goptions_cfm" style="width:99%;">
37
+ <?php wp_nonce_field('nonce_cfm', 'nonce_cfm'); ?>
38
+ <div class="fm-options-page-banner">
39
+ <div class="fm-options-logo"></div>
40
+ <div class="fm-options-logo-title">
41
+ <?php echo __("Global Options", "contact_form_maker"); ?>
42
+ </div>
43
+ <div class="fm-page-actions">
44
+ <button class="fm-button save-button small" onclick="spider_set_input_value('task', 'save');">
45
+ <span></span>
46
+ <?php echo __("Save", "contact_form_maker"); ?>
47
+ </button>
48
+ </div>
49
+ </div>
50
+
51
+ <table style="clear:both;">
52
+ <tbody>
53
+ <tr>
54
+ <td>
55
+ <label for="public_key"><?php echo __("Recaptcha Site Key:", "contact_form_maker"); ?></label>
56
+ </td>
57
+ <td>
58
+ <input type="text" id="public_key" name="public_key" value="<?php echo $public_key; ?>" style="width:250px;" />
59
+ </td>
60
+ <td rowspan="2">
61
+ <a href="https://www.google.com/recaptcha/intro/index.html" target="_blank"><?php echo __("Get Recaptcha", "contact_form_maker"); ?></a>
62
+ </td>
63
+ </tr>
64
+ <tr>
65
+ <td>
66
+ <label for="private_key"><?php echo __("Recaptcha Secret Key:", "contact_form_maker"); ?></label>
67
+ </td>
68
+ <td>
69
+ <input type="text" id="private_key" name="private_key" value="<?php echo $private_key; ?>" style="width:250px;" />
70
+ </td>
71
+ </tr>
72
+ <tr>
73
+ <td>
74
+ <label for="public_key"><?php echo __("Maps API Key:", "contact_form_maker"); ?></label>
75
+ </td>
76
+ <td>
77
+ <input type="text" id="map_key" name="map_key" value="<?php echo $map_key; ?>" style="width:250px;" />
78
+ </td>
79
+ <td>
80
+ <a href="https://console.developers.google.com/flows/enableapi?apiid=maps_backend&keyType=CLIENT_SIDE&reusekey=true" target="_blank"><?php echo __("Get maps API key", "contact_form_maker"); ?></a>
81
+ </td>
82
+ </tr>
83
+ <tr>
84
+ <td>
85
+
86
+ </td>
87
+ <td>
88
+ <span style="width:250px; display: inline-block; padding: 0 5px;">(It may take up to 5 minutes for API key change to take effect.)</span>
89
+ </td>
90
+ <td>
91
+
92
+ </td>
93
+ </tr>
94
+ </tbody>
95
+ </table>
96
+ <input type="hidden" id="task" name="task" value=""/>
97
+ </form>
98
+ <?php
99
+ }
100
+
101
+
102
+
103
+ ////////////////////////////////////////////////////////////////////////////////////////
104
+ // Getters & Setters //
105
+ ////////////////////////////////////////////////////////////////////////////////////////
106
+ ////////////////////////////////////////////////////////////////////////////////////////
107
+ // Private Methods //
108
+ ////////////////////////////////////////////////////////////////////////////////////////
109
+ ////////////////////////////////////////////////////////////////////////////////////////
110
+ // Listeners //
111
+ ////////////////////////////////////////////////////////////////////////////////////////
112
  }
admin/views/CFMViewUninstall_cfm.php CHANGED
@@ -1,125 +1,125 @@
1
- <?php
2
-
3
- class CFMViewUninstall_cfm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
-
16
- ////////////////////////////////////////////////////////////////////////////////////////
17
- // Constructor & Destructor //
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- public function __construct($model) {
20
- $this->model = $model;
21
- }
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- global $wpdb;
27
- $prefix = $wpdb->prefix;
28
- ?>
29
- <form method="post" action="admin.php?page=uninstall_cfm" class="cfm_form">
30
- <?php wp_nonce_field('nonce_cfm', 'nonce_cfm'); ?>
31
- <div class="wrap">
32
- <span class="uninstall_icon"></span>
33
- <h2><?php echo __("Uninstall Contact Form Builder", "contact_form_maker"); ?></h2>
34
- <div class="goodbye-text">
35
- <?php
36
- $support_team = '<a href="https://web-dorado.com/support/contact-us.html?source=form-builder" target="_blank">' . __('support team', 'contact_form_maker') . '</a>';
37
- $contact_us = '<a href="https://web-dorado.com/support/contact-us.html?source=form-builder" target="_blank">' . __('Contact us', 'contact_form_maker') . '</a>';
38
- echo sprintf(__("Before uninstalling the plugin, please Contact our %s. We'll do our best to help you out with your issue. We value each and every user and value what's right for our users in everything we do.<br />
39
- However, if anyway you have made a decision to uninstall the plugin, please take a minute to %s and tell what you didn't like for our plugins further improvement and development. Thank you !!!", "contact_form_maker"), $support_team, $contact_us); ?>
40
- </div>
41
- <p>
42
- <?php echo __("Deactivating Contact Form Builder plugin does not remove any data that may have been created, such as the Forms and the Submissions. To completely remove this plugin, you can uninstall it here", "contact_form_maker"); ?>.
43
- </p>
44
- <p style="color: red;">
45
- <strong><?php echo __("WARNING", "contact_form_maker"); ?>:</strong>
46
- <?php echo __("Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first", "contact_form_maker"); ?>.
47
- </p>
48
- <p style="color: red">
49
- <strong><?php echo __("The following WordPress Options/Tables will be DELETED", "contact_form_maker"); ?>:</strong>
50
- </p>
51
- <table class="widefat">
52
- <thead>
53
- <tr>
54
- <th><?php echo __("Database Tables", "contact_form_maker"); ?></th>
55
- </tr>
56
- </thead>
57
- <tr>
58
- <td valign="top">
59
- <ol>
60
- <li><?php echo $prefix; ?>contactformmaker</li>
61
- <li><?php echo $prefix; ?>contactformmaker_submits</li>
62
- <li><?php echo $prefix; ?>contactformmaker_themes</li>
63
- <li><?php echo $prefix; ?>contactformmaker_views</li>
64
- <li><?php echo $prefix; ?>contactformmaker_blocked</li>
65
- </ol>
66
- </td>
67
- </tr>
68
- </table>
69
- <p style="text-align: center;">
70
- <?php echo __("Do you really want to uninstall Conatct Form Builder", "contact_form_maker"); ?>?
71
- </p>
72
- <p style="text-align: center;">
73
- <input type="checkbox" name="Contact Form Builder" id="check_yes" value="yes" />&nbsp;<label for="check_yes"><?php echo __("Yes", "contact_form_maker"); ?></label>
74
- </p>
75
- <p style="text-align: center;">
76
- <input type="submit" value="<?php echo __("UNINSTALL", "contact_form_maker"); ?>" class="button-primary" onclick="if (check_yes.checked) {
77
- if (confirm('<?php echo addslashes(__('You are About to Uninstall Contact Form Builder from WordPress.\nThis Action Is Not Reversible.', 'contact_form_maker')); ?>')) {
78
- spider_set_input_value('task', 'uninstall');
79
- } else {
80
- return false;
81
- }
82
- }
83
- else {
84
- return false;
85
- }" />
86
- </p>
87
- </div>
88
- <input id="task" name="task" type="hidden" value="" />
89
- </form>
90
- <?php
91
- }
92
-
93
- public function uninstall() {
94
- $this->model->delete_db_tables();
95
- global $wpdb;
96
- $prefix = $wpdb->prefix;
97
- $deactivate_url = add_query_arg(array('action' => 'deactivate', 'plugin' => 'contact-form-builder/contact-form-builder.php'), admin_url('plugins.php'));
98
- $deactivate_url = wp_nonce_url($deactivate_url, 'deactivate-plugin_contact-form-builder/contact-form-builder.php');
99
- ?>
100
- <div id="message" class="updated fade">
101
- <p><?php echo __("The following Database Tables succesfully deleted", "contact_form_maker"); ?>:</p>
102
- <p><?php echo $prefix; ?>contactformmaker,</p>
103
- <p><?php echo $prefix; ?>contactformmaker_submits,</p>
104
- <p><?php echo $prefix; ?>contactformmaker_themes,</p>
105
- <p><?php echo $prefix; ?>contactformmaker_views,</p>
106
- <p><?php echo $prefix; ?>contactformmaker_blocked.</p>
107
- </div>
108
- <div class="wrap">
109
- <h2><?php echo __("Uninstall Conact Form Builder", "contact_form_maker"); ?></h2>
110
- <p><strong><a href="<?php echo $deactivate_url; ?>"><?php echo __("Click Here", "contact_form_maker"); ?></a> <?php echo __("To Finish the Uninstallation and Contact Form Builder will be Deactivated Automatically", "contact_form_maker"); ?>.</strong></p>
111
- <input id="task" name="task" type="hidden" value="" />
112
- </div>
113
- <?php
114
- }
115
-
116
- ////////////////////////////////////////////////////////////////////////////////////////
117
- // Getters & Setters //
118
- ////////////////////////////////////////////////////////////////////////////////////////
119
- ////////////////////////////////////////////////////////////////////////////////////////
120
- // Private Methods //
121
- ////////////////////////////////////////////////////////////////////////////////////////
122
- ////////////////////////////////////////////////////////////////////////////////////////
123
- // Listeners //
124
- ////////////////////////////////////////////////////////////////////////////////////////
125
  }
1
+ <?php
2
+
3
+ class CFMViewUninstall_cfm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ global $wpdb;
27
+ $prefix = $wpdb->prefix;
28
+ ?>
29
+ <form method="post" action="admin.php?page=uninstall_cfm" class="cfm_form">
30
+ <?php wp_nonce_field('nonce_cfm', 'nonce_cfm'); ?>
31
+ <div class="wrap">
32
+ <span class="uninstall_icon"></span>
33
+ <h2><?php echo __("Uninstall Contact Form Builder", "contact_form_maker"); ?></h2>
34
+ <div class="goodbye-text">
35
+ <?php
36
+ $support_team = '<a href="https://web-dorado.com/support/contact-us.html?source=form-builder" target="_blank">' . __('support team', 'contact_form_maker') . '</a>';
37
+ $contact_us = '<a href="https://web-dorado.com/support/contact-us.html?source=form-builder" target="_blank">' . __('Contact us', 'contact_form_maker') . '</a>';
38
+ echo sprintf(__("Before uninstalling the plugin, please Contact our %s. We'll do our best to help you out with your issue. We value each and every user and value what's right for our users in everything we do.<br />
39
+ However, if anyway you have made a decision to uninstall the plugin, please take a minute to %s and tell what you didn't like for our plugins further improvement and development. Thank you !!!", "contact_form_maker"), $support_team, $contact_us); ?>
40
+ </div>
41
+ <p>
42
+ <?php echo __("Deactivating Contact Form Builder plugin does not remove any data that may have been created, such as the Forms and the Submissions. To completely remove this plugin, you can uninstall it here", "contact_form_maker"); ?>.
43
+ </p>
44
+ <p style="color: red;">
45
+ <strong><?php echo __("WARNING", "contact_form_maker"); ?>:</strong>
46
+ <?php echo __("Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first", "contact_form_maker"); ?>.
47
+ </p>
48
+ <p style="color: red">
49
+ <strong><?php echo __("The following WordPress Options/Tables will be DELETED", "contact_form_maker"); ?>:</strong>
50
+ </p>
51
+ <table class="widefat">
52
+ <thead>
53
+ <tr>
54
+ <th><?php echo __("Database Tables", "contact_form_maker"); ?></th>
55
+ </tr>
56
+ </thead>
57
+ <tr>
58
+ <td valign="top">
59
+ <ol>
60
+ <li><?php echo $prefix; ?>contactformmaker</li>
61
+ <li><?php echo $prefix; ?>contactformmaker_submits</li>
62
+ <li><?php echo $prefix; ?>contactformmaker_themes</li>
63
+ <li><?php echo $prefix; ?>contactformmaker_views</li>
64
+ <li><?php echo $prefix; ?>contactformmaker_blocked</li>
65
+ </ol>
66
+ </td>
67
+ </tr>
68
+ </table>
69
+ <p style="text-align: center;">
70
+ <?php echo __("Do you really want to uninstall Conatct Form Builder", "contact_form_maker"); ?>?
71
+ </p>
72
+ <p style="text-align: center;">
73
+ <input type="checkbox" name="Contact Form Builder" id="check_yes" value="yes" />&nbsp;<label for="check_yes"><?php echo __("Yes", "contact_form_maker"); ?></label>
74
+ </p>
75
+ <p style="text-align: center;">
76
+ <input type="submit" value="<?php echo __("UNINSTALL", "contact_form_maker"); ?>" class="button-primary" onclick="if (check_yes.checked) {
77
+ if (confirm('<?php echo addslashes(__('You are About to Uninstall Contact Form Builder from WordPress.\nThis Action Is Not Reversible.', 'contact_form_maker')); ?>')) {
78
+ spider_set_input_value('task', 'uninstall');
79
+ } else {
80
+ return false;
81
+ }
82
+ }
83
+ else {
84
+ return false;
85
+ }" />
86
+ </p>
87
+ </div>
88
+ <input id="task" name="task" type="hidden" value="" />
89
+ </form>
90
+ <?php
91
+ }
92
+
93
+ public function uninstall() {
94
+ $this->model->delete_db_tables();
95
+ global $wpdb;
96
+ $prefix = $wpdb->prefix;
97
+ $deactivate_url = add_query_arg(array('action' => 'deactivate', 'plugin' => 'contact-form-builder/contact-form-builder.php'), admin_url('plugins.php'));
98
+ $deactivate_url = wp_nonce_url($deactivate_url, 'deactivate-plugin_contact-form-builder/contact-form-builder.php');
99
+ ?>
100
+ <div id="message" class="updated fade">
101
+ <p><?php echo __("The following Database Tables succesfully deleted", "contact_form_maker"); ?>:</p>
102
+ <p><?php echo $prefix; ?>contactformmaker,</p>
103
+ <p><?php echo $prefix; ?>contactformmaker_submits,</p>
104
+ <p><?php echo $prefix; ?>contactformmaker_themes,</p>
105
+ <p><?php echo $prefix; ?>contactformmaker_views,</p>
106
+ <p><?php echo $prefix; ?>contactformmaker_blocked.</p>
107
+ </div>
108
+ <div class="wrap">
109
+ <h2><?php echo __("Uninstall Conact Form Builder", "contact_form_maker"); ?></h2>
110
+ <p><strong><a href="<?php echo $deactivate_url; ?>"><?php echo __("Click Here", "contact_form_maker"); ?></a> <?php echo __("To Finish the Uninstallation and Contact Form Builder will be Deactivated Automatically", "contact_form_maker"); ?>.</strong></p>
111
+ <input id="task" name="task" type="hidden" value="" />
112
+ </div>
113
+ <?php
114
+ }
115
+
116
+ ////////////////////////////////////////////////////////////////////////////////////////
117
+ // Getters & Setters //
118
+ ////////////////////////////////////////////////////////////////////////////////////////
119
+ ////////////////////////////////////////////////////////////////////////////////////////
120
+ // Private Methods //
121
+ ////////////////////////////////////////////////////////////////////////////////////////
122
+ ////////////////////////////////////////////////////////////////////////////////////////
123
+ // Listeners //
124
+ ////////////////////////////////////////////////////////////////////////////////////////
125
  }
admin/views/CFMViewWidget.php CHANGED
@@ -1,84 +1,84 @@
1
- <?php
2
-
3
- class CFMViewWidget {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- // Constructor & Destructor //
17
- ////////////////////////////////////////////////////////////////////////////////////////
18
- public function __construct($model) {
19
- $this->model = $model;
20
- }
21
- ////////////////////////////////////////////////////////////////////////////////////////
22
- // Public Methods //
23
- ////////////////////////////////////////////////////////////////////////////////////////
24
-
25
- public function display() {
26
- }
27
-
28
- function widget($args, $instance) {
29
- extract($args);
30
- $title = $instance['title'];
31
- $form_id = (isset($instance['form_id']) ? $instance['form_id'] : 0);
32
- // Before widget.
33
- echo $before_widget;
34
- // Title of widget.
35
- if ($title) {
36
- echo $before_title . $title . $after_title;
37
- }
38
- // Widget output.
39
- require_once(WD_CFM_DIR . '/frontend/controllers/CFMControllerForm_maker.php');
40
- $controller_class = 'CFMControllerForm_maker';
41
- $controller = new $controller_class();
42
- echo $controller->execute($instance['form_id']);
43
- // After widget.
44
- echo $after_widget;
45
- }
46
-
47
- // Widget Control Panel.
48
- function form($instance, $id_title, $name_title, $id_form_id, $name_form_id) {
49
- $defaults = array(
50
- 'title' => '',
51
- 'form_id' => 0
52
- );
53
- $instance = wp_parse_args((array)$instance, $defaults);
54
- global $wpdb;
55
- $ids_Form_Maker = $this->model->get_gallery_rows_data();
56
- ?>
57
- <p>
58
- <label for="<?php echo $id_title; ?>"><?php echo __("Title", "contact_form_maker"); ?>:</label>
59
- <input class="widefat" id="<?php echo $id_title; ?>" name="<?php echo $name_title; ?>" type="text" value="<?php echo $instance['title']; ?>" />
60
- <label for="<?php echo $id_form_id; ?>"><?php echo __("Select a form", "contact_form_maker"); ?>:</label>
61
- <select name="<?php echo $name_form_id; ?>" id="<?php echo $id_form_id; ?>" style="width: 225px; text-align: left;">
62
- <option value="0">- <?php echo __("Select a Form", "contact_form_maker"); ?>-</option>
63
- <?php
64
- foreach ($ids_Form_Maker as $arr_Form_Maker) {
65
- ?>
66
- <option value="<?php echo $arr_Form_Maker->id; ?>" <?php echo ($arr_Form_Maker->id == $instance['form_id']) ? 'SELECTED' : ''; ?>><?php echo $arr_Form_Maker->title; ?></option>
67
- <?php
68
- }
69
- ?>
70
- </select>
71
- </p>
72
- <?php
73
- }
74
-
75
- ////////////////////////////////////////////////////////////////////////////////////////
76
- // Getters & Setters //
77
- ////////////////////////////////////////////////////////////////////////////////////////
78
- ////////////////////////////////////////////////////////////////////////////////////////
79
- // Private Methods //
80
- ////////////////////////////////////////////////////////////////////////////////////////
81
- ////////////////////////////////////////////////////////////////////////////////////////
82
- // Listeners //
83
- ////////////////////////////////////////////////////////////////////////////////////////
84
  }
1
+ <?php
2
+
3
+ class CFMViewWidget {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // Public Methods //
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+
25
+ public function display() {
26
+ }
27
+
28
+ function widget($args, $instance) {
29
+ extract($args);
30
+ $title = $instance['title'];
31
+ $form_id = (isset($instance['form_id']) ? $instance['form_id'] : 0);
32
+ // Before widget.
33
+ echo $before_widget;
34
+ // Title of widget.
35
+ if ($title) {
36
+ echo $before_title . $title . $after_title;
37
+ }
38
+ // Widget output.
39
+ require_once(WD_CFM_DIR . '/frontend/controllers/CFMControllerForm_maker.php');
40
+ $controller_class = 'CFMControllerForm_maker';
41
+ $controller = new $controller_class();
42
+ echo $controller->execute($instance['form_id']);
43
+ // After widget.
44
+ echo $after_widget;
45
+ }
46
+
47
+ // Widget Control Panel.
48
+ function form($instance, $id_title, $name_title, $id_form_id, $name_form_id) {
49
+ $defaults = array(
50
+ 'title' => '',
51
+ 'form_id' => 0
52
+ );
53
+ $instance = wp_parse_args((array)$instance, $defaults);
54
+ global $wpdb;
55
+ $ids_Form_Maker = $this->model->get_gallery_rows_data();
56
+ ?>
57
+ <p>
58
+ <label for="<?php echo $id_title; ?>"><?php echo __("Title", "contact_form_maker"); ?>:</label>
59
+ <input class="widefat" id="<?php echo $id_title; ?>" name="<?php echo $name_title; ?>" type="text" value="<?php echo $instance['title']; ?>" />
60
+ <label for="<?php echo $id_form_id; ?>"><?php echo __("Select a form", "contact_form_maker"); ?>:</label>
61
+ <select name="<?php echo $name_form_id; ?>" id="<?php echo $id_form_id; ?>" style="width: 225px; text-align: left;">
62
+ <option value="0">- <?php echo __("Select a Form", "contact_form_maker"); ?>-</option>
63
+ <?php
64
+ foreach ($ids_Form_Maker as $arr_Form_Maker) {
65
+ ?>
66
+ <option value="<?php echo $arr_Form_Maker->id; ?>" <?php echo ($arr_Form_Maker->id == $instance['form_id']) ? 'SELECTED' : ''; ?>><?php echo $arr_Form_Maker->title; ?></option>
67
+ <?php
68
+ }
69
+ ?>
70
+ </select>
71
+ </p>
72
+ <?php
73
+ }
74
+
75
+ ////////////////////////////////////////////////////////////////////////////////////////
76
+ // Getters & Setters //
77
+ ////////////////////////////////////////////////////////////////////////////////////////
78
+ ////////////////////////////////////////////////////////////////////////////////////////
79
+ // Private Methods //
80
+ ////////////////////////////////////////////////////////////////////////////////////////
81
+ ////////////////////////////////////////////////////////////////////////////////////////
82
+ // Listeners //
83
+ ////////////////////////////////////////////////////////////////////////////////////////
84
  }
contact-form-builder-update.php CHANGED
@@ -1,26 +1,26 @@
1
- <?php
2
-
3
- function contact_form_maker_update($version) {
4
- global $wpdb;
5
- if (version_compare($version, '1.0.18') == -1) {
6
- $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "contactformmaker` ADD `wpmail` tinyint(1) NOT NULL DEFAULT '1'");
7
- }
8
- if (version_compare($version, '1.0.22') == -1) {
9
- $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "contactformmaker` ADD `sortable` tinyint(1) NOT NULL DEFAULT '1'");
10
- }
11
- if (version_compare($version, '1.0.46') == -1) {
12
- $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "contactformmaker_submits` CHANGE `ip` `ip` varchar(128) NOT NULL");
13
- }
14
- if (version_compare($version, '1.0.47') == -1) {
15
- $recaptcha_keys = $wpdb->get_row('SELECT `public_key`, `private_key` FROM ' . $wpdb->prefix . 'contactformmaker WHERE public_key!="" and private_key!=""', ARRAY_A);
16
- $public_key = isset($recaptcha_keys['public_key']) ? $recaptcha_keys['public_key'] : '';
17
- $private_key = isset($recaptcha_keys['private_key']) ? $recaptcha_keys['private_key'] : '';
18
-
19
- if (FALSE === $fm_settings = get_option('cfm_settings')) {
20
- add_option('cfm_settings', array('public_key' => $public_key, 'private_key' => $private_key, 'map_key' => ''));
21
- }
22
- }
23
- return;
24
- }
25
-
26
  ?>
1
+ <?php
2
+
3
+ function contact_form_maker_update($version) {
4
+ global $wpdb;
5
+ if (version_compare($version, '1.0.18') == -1) {
6
+ $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "contactformmaker` ADD `wpmail` tinyint(1) NOT NULL DEFAULT '1'");
7
+ }
8
+ if (version_compare($version, '1.0.22') == -1) {
9
+ $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "contactformmaker` ADD `sortable` tinyint(1) NOT NULL DEFAULT '1'");
10
+ }
11
+ if (version_compare($version, '1.0.46') == -1) {
12
+ $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "contactformmaker_submits` CHANGE `ip` `ip` varchar(128) NOT NULL");
13
+ }
14
+ if (version_compare($version, '1.0.47') == -1) {
15
+ $recaptcha_keys = $wpdb->get_row('SELECT `public_key`, `private_key` FROM ' . $wpdb->prefix . 'contactformmaker WHERE public_key!="" and private_key!=""', ARRAY_A);
16
+ $public_key = isset($recaptcha_keys['public_key']) ? $recaptcha_keys['public_key'] : '';
17
+ $private_key = isset($recaptcha_keys['private_key']) ? $recaptcha_keys['private_key'] : '';
18
+
19
+ if (FALSE === $fm_settings = get_option('cfm_settings')) {
20
+ add_option('cfm_settings', array('public_key' => $public_key, 'private_key' => $private_key, 'map_key' => ''));
21
+ }
22
+ }
23
+ return;
24
+ }
25
+
26
  ?>
contact-form-builder.php CHANGED
@@ -3,14 +3,14 @@
3
  * Plugin Name: Contact Form Builder
4
  * Plugin URI: http://web-dorado.com/products/wordpress-contact-form-builder.html
5
  * Description: Contact Form Builder is an advanced plugin to add contact forms into your website. It comes along with multiple default templates which can be customized.
6
- * Version: 1.0.51
7
  * Author: WebDorado
8
  * Author URI: http://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
11
  define('WD_CFM_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
12
  define('WD_CFM_URL', plugins_url(plugin_basename(dirname(__FILE__))));
13
- define('WD_CFM_VERSION', '1.0.51');
14
 
15
  // Plugin menu.
16
  function contact_form_maker_options_panel() {
3
  * Plugin Name: Contact Form Builder
4
  * Plugin URI: http://web-dorado.com/products/wordpress-contact-form-builder.html
5
  * Description: Contact Form Builder is an advanced plugin to add contact forms into your website. It comes along with multiple default templates which can be customized.
6
+ * Version: 1.0.52
7
  * Author: WebDorado
8
  * Author URI: http://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
11
  define('WD_CFM_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
12
  define('WD_CFM_URL', plugins_url(plugin_basename(dirname(__FILE__))));
13
+ define('WD_CFM_VERSION', '1.0.52');
14
 
15
  // Plugin menu.
16
  function contact_form_maker_options_panel() {
css/contact_form_maker_first.css CHANGED
@@ -1,173 +1,173 @@
1
- .wdform-page-and-images {
2
- color: #000000;
3
- font-size: 14px;
4
- font-weight: normal;
5
- width: 100%;
6
- }
7
-
8
- .wdform_table1 {
9
- color: #000000;
10
- font-size: 14px;
11
- font-weight: normal;
12
- width: 100%;
13
- }
14
-
15
- .wdform_tbody1 {
16
- float: left;
17
- }
18
-
19
- .wdform_table2 {
20
- border-collapse: separate !important;
21
- border-spacing: 0px;
22
- float: left;
23
- padding-right: 50px !important;
24
- }
25
-
26
- #edit_main_table label {
27
- line-height: 19px;
28
- }
29
-
30
- #edit_main_table td {
31
- padding-right: 5px;
32
- }
33
-
34
- .time_box {
35
- border-width: 1px;
36
- margin: 0px;
37
- padding: 0px;
38
- text-align: right;
39
- vertical-align: middle
40
- width: 30px;
41
- }
42
-
43
- .mini_label {
44
- font-family: 'Lucida Grande', Tahoma, Arial, Verdana, sans-serif;
45
- font-size: 10px;
46
- }
47
-
48
- .ch_rad_label {
49
- display: inline;
50
- float: none;
51
- margin-left: 5px;
52
- margin-right: 15px;
53
- }
54
-
55
- .label {
56
- border: none;
57
- }
58
-
59
- .td_am_pm_select {
60
- padding-left: 5px;
61
- }
62
-
63
- .am_pm_select {
64
- height: 16px;
65
- margin: 0;
66
- padding: 0
67
- }
68
-
69
- .input_deactive {
70
- border-width: 1px;
71
- color: #999999;
72
- font-style: italic;
73
- margin: 0px;
74
- padding: 0px
75
- }
76
-
77
- .input_active {
78
- border-width: 1px;
79
- color: #000000;
80
- font-style: normal;
81
- margin: 0px;
82
- padding: 0px
83
- }
84
-
85
- .required {
86
- border: none;
87
- color: red
88
- }
89
-
90
- .captcha_img {
91
- border-width: 0px;
92
- cursor: pointer;
93
- margin: 0px;
94
- padding: 0px;
95
- }
96
-
97
- .captcha_refresh {
98
- background-image: url("../images/refresh_black.png");
99
- border-width: 0px;
100
- cursor: pointer;
101
- height: 30px;
102
- margin: 0px;
103
- padding: 0px;
104
- vertical-align: middle;
105
- width: 30px;
106
- }
107
-
108
- .captcha_input {
109
- border-width: 1px;
110
- height: 20px;
111
- margin: 0px;
112
- padding: 0px;
113
- vertical-align: middle;
114
- }
115
-
116
- .file_upload {
117
- border-width: 1px;
118
- margin: 0px;
119
- padding: 0px
120
- }
121
-
122
- .page_deactive {
123
- background-color: #DBDBDB;
124
- border: 1px solid black;
125
- cursor: pointer;
126
- margin: 4px;
127
- padding: 4px 7px 4px 7px;
128
- }
129
-
130
- .page_active {
131
- background-color: #878787;
132
- border: 1px solid black;
133
- cursor: pointer;
134
- padding: 4px 7px 4px 7px;
135
- margin: 4px;
136
- }
137
-
138
- .page_percentage_active {
139
- background-color: yellow;
140
- border-radius: 30px;
141
- border-spacing: 0px;
142
- height: 30px;
143
- line-height: 30px;
144
- float: left;
145
- font-size: 15px;
146
- margin: 0px;
147
- padding: 0px;
148
- text-align: right !important;
149
- }
150
-
151
-
152
- .page_percentage_deactive {
153
- background-color: white;
154
- border: 1px solid black;
155
- border-radius: 30px;
156
- height: 30px;
157
- line-height: 30px;
158
- padding: 5px;
159
- text-align: left !important;
160
- width: 100%;
161
- }
162
-
163
- .page_numbers {
164
- font-size: 11px;
165
- }
166
-
167
- .phone_area_code {
168
- width: 50px;
169
- }
170
-
171
- .phone_number {
172
- width: 100px;
173
- }
1
+ .wdform-page-and-images {
2
+ color: #000000;
3
+ font-size: 14px;
4
+ font-weight: normal;
5
+ width: 100%;
6
+ }
7
+
8
+ .wdform_table1 {
9
+ color: #000000;
10
+ font-size: 14px;
11
+ font-weight: normal;
12
+ width: 100%;
13
+ }
14
+
15
+ .wdform_tbody1 {
16
+ float: left;
17
+ }
18
+
19
+ .wdform_table2 {
20
+ border-collapse: separate !important;
21
+ border-spacing: 0px;
22
+ float: left;
23
+ padding-right: 50px !important;
24
+ }
25
+
26
+ #edit_main_table label {
27
+ line-height: 19px;
28
+ }
29
+
30
+ #edit_main_table td {
31
+ padding-right: 5px;
32
+ }
33
+
34
+ .time_box {
35
+ border-width: 1px;
36
+ margin: 0px;
37
+ padding: 0px;
38
+ text-align: right;
39
+ vertical-align: middle
40
+ width: 30px;
41
+ }
42
+
43
+ .mini_label {
44
+ font-family: 'Lucida Grande', Tahoma, Arial, Verdana, sans-serif;
45
+ font-size: 10px;
46
+ }
47
+
48
+ .ch_rad_label {
49
+ display: inline;
50
+ float: none;
51
+ margin-left: 5px;
52
+ margin-right: 15px;
53
+ }
54
+
55
+ .label {
56
+ border: none;
57
+ }
58
+
59
+ .td_am_pm_select {
60
+ padding-left: 5px;
61
+ }
62
+
63
+ .am_pm_select {
64
+ height: 16px;
65
+ margin: 0;
66
+ padding: 0
67
+ }
68
+
69
+ .input_deactive {
70
+ border-width: 1px;
71
+ color: #999999;
72
+ font-style: italic;
73
+ margin: 0px;
74
+ padding: 0px
75
+ }
76
+
77
+ .input_active {
78
+ border-width: 1px;
79
+ color: #000000;
80
+ font-style: normal;
81
+ margin: 0px;
82
+ padding: 0px
83
+ }
84
+
85
+ .required {
86
+ border: none;
87
+ color: red
88
+ }
89
+
90
+ .captcha_img {
91
+ border-width: 0px;
92
+ cursor: pointer;
93
+ margin: 0px;
94
+ padding: 0px;
95
+ }
96
+
97
+ .captcha_refresh {
98
+ background-image: url("../images/refresh_black.png");
99
+ border-width: 0px;
100
+ cursor: pointer;
101
+ height: 30px;
102
+ margin: 0px;
103
+ padding: 0px;
104
+ vertical-align: middle;
105
+ width: 30px;
106
+ }
107
+
108
+ .captcha_input {
109
+ border-width: 1px;
110
+ height: 20px;
111
+ margin: 0px;
112
+ padding: 0px;
113
+ vertical-align: middle;
114
+ }
115
+
116
+ .file_upload {
117
+ border-width: 1px;
118
+ margin: 0px;
119
+ padding: 0px
120
+ }
121
+
122
+ .page_deactive {
123
+ background-color: #DBDBDB;
124
+ border: 1px solid black;
125
+ cursor: pointer;
126
+ margin: 4px;
127
+ padding: 4px 7px 4px 7px;
128
+ }
129
+
130
+ .page_active {
131
+ background-color: #878787;
132
+ border: 1px solid black;
133
+ cursor: pointer;
134
+ padding: 4px 7px 4px 7px;
135
+ margin: 4px;
136
+ }
137
+
138
+ .page_percentage_active {
139
+ background-color: yellow;
140
+ border-radius: 30px;
141
+ border-spacing: 0px;
142
+ height: 30px;
143
+ line-height: 30px;
144
+ float: left;
145
+ font-size: 15px;
146
+ margin: 0px;
147
+ padding: 0px;
148
+ text-align: right !important;
149
+ }
150
+
151
+
152
+ .page_percentage_deactive {
153
+ background-color: white;
154
+ border: 1px solid black;
155
+ border-radius: 30px;
156
+ height: 30px;
157
+ line-height: 30px;
158
+ padding: 5px;
159
+ text-align: left !important;
160
+ width: 100%;
161
+ }
162
+
163
+ .page_numbers {
164
+ font-size: 11px;
165
+ }
166
+
167
+ .phone_area_code {
168
+ width: 50px;
169
+ }
170
+
171
+ .phone_number {
172
+ width: 100px;
173
+ }
css/contact_form_maker_frontend.css CHANGED
@@ -1,39 +1,39 @@
1
- .wdform_map img {
2
- max-width: none !important;
3
- }
4
-
5
- .wdform-page-and-images {
6
- box-sizing: border-box;
7
- }
8
-
9
- .wdform_row .wdform-field .wdform_map {
10
- width: inherit !important;
11
- }
12
-
13
- .radio-div,
14
- .radio-div *,
15
- .checkbox-div,
16
- .checkbox-div *,
17
- .wdform-page-button {
18
- -moz-box-sizing: content-box !important;
19
- -webkit-box-sizing: content-box !important;
20
- box-sizing: content-box !important;
21
- }
22
-
23
- .page_percentage_deactive,
24
- .page_percentage_deactive * {
25
- word-wrap: normal;
26
- }
27
-
28
- .wdform_percentage_text,
29
- .wdform_percentage_arrow {
30
- vertical-align: top !important;
31
- }
32
-
33
- div[type="type_captcha"] .wdform-element-section * {
34
- vertical-align: middle;
35
- }
36
-
37
- .recaptcha_input_area input {
38
- height: initial !important;
39
- }
1
+ .wdform_map img {
2
+ max-width: none !important;
3
+ }
4
+
5
+ .wdform-page-and-images {
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ .wdform_row .wdform-field .wdform_map {
10
+ width: inherit !important;
11
+ }
12
+
13
+ .radio-div,
14
+ .radio-div *,
15
+ .checkbox-div,
16
+ .checkbox-div *,
17
+ .wdform-page-button {
18
+ -moz-box-sizing: content-box !important;
19
+ -webkit-box-sizing: content-box !important;
20
+ box-sizing: content-box !important;
21
+ }
22
+
23
+ .page_percentage_deactive,
24
+ .page_percentage_deactive * {
25
+ word-wrap: normal;
26
+ }
27
+
28
+ .wdform_percentage_text,
29
+ .wdform_percentage_arrow {
30
+ vertical-align: top !important;
31
+ }
32
+
33
+ div[type="type_captcha"] .wdform-element-section * {
34
+ vertical-align: middle;
35
+ }
36
+
37
+ .recaptcha_input_area input {
38
+ height: initial !important;
39
+ }
featured/featured.php CHANGED
@@ -1,171 +1,171 @@
1
- <?php
2
- function spider_featured($current_plugin = '') {
3
- $plugins = array(
4
- "ecommerce-wd" => array(
5
- 'title' => 'Ecommerce',
6
- 'text' => 'Wordpress ecommerce plugin',
7
- 'content' => 'Ecommerce WD is a highly-functional, user friendly WordPress Ecommerce plugin, which is perfect for developing online stores for any level of complexity.',
8
- 'href' => 'https://web-dorado.com/products/wordpress-ecommerce.html'
9
- ),
10
- "form-maker" => array(
11
- 'title' => 'Form Maker',
12
- 'text' => 'Wordpress form builder plugin',
13
- 'content' => 'Form Maker is a modern and advanced tool for creating WordPress forms easily and fast.',
14
- 'href' => 'https://web-dorado.com/products/wordpress-form.html'
15
- ),
16
- "photo-gallery" => array(
17
- 'title' => 'Photo Gallery',
18
- 'text' => 'WordPress Photo Gallery plugin',
19
- 'content' => 'Photo Gallery is a fully responsive WordPress Gallery plugin with advanced functionality.',
20
- 'href' => 'https://web-dorado.com/products/wordpress-photo-gallery-plugin.html'
21
- ),
22
- "contact_form_builder" => array(
23
- 'title' => 'Contact Form Builder',
24
- 'text' => 'WordPress contact form builder plugin',
25
- 'content' => 'Contact Form Builder is the best tool for quickly arranging a contact form for your clients and visitors.',
26
- 'href' => 'https://web-dorado.com/products/wordpress-contact-form-builder.html'
27
- ),
28
- "slider_wd" => array(
29
- 'title' => 'Slider WD',
30
- 'text' => 'WordPress slider plugin',
31
- 'content' => 'Create responsive, highly configurable sliders with various effects for your WordPress site.',
32
- 'href' => 'https://web-dorado.com/products/wordpress-slider-plugin.html'
33
- ),
34
- "events-wd" => array(
35
- 'title' => 'Event Calendar WD',
36
- 'text' => 'WordPress calendar plugin',
37
- 'content' => 'Organize and publish your events in an easy and elegant way using Event Calendar WD.',
38
- 'href' => 'https://web-dorado.com/products/wordpress-event-calendar-wd.html'
39
- ),
40
- "contact-maker" => array(
41
- 'title' => 'Contact Form Maker',
42
- 'text' => 'WordPress contact form maker plugin',
43
- 'content' => 'WordPress Contact Form Maker is an advanced and easy-to-use tool for creating forms.',
44
- 'href' => 'https://web-dorado.com/products/wordpress-contact-form-maker-plugin.html'
45
- ),
46
- "spider-calendar" => array(
47
- 'title' => 'Spider Calendar',
48
- 'text' => 'WordPress event calendar plugin',
49
- 'content' => 'Spider Event Calendar is a highly configurable product which allows you to have multiple organized events.',
50
- 'href' => 'https://web-dorado.com/products/wordpress-calendar.html'
51
- ),
52
- "catalog" => array(
53
- 'title' => 'Spider Catalog',
54
- 'text' => 'WordPress product catalog plugin',
55
- 'content' => 'Spider Catalog for WordPress is a convenient tool for organizing the products represented on your website into catalogs.',
56
- 'href' => 'https://web-dorado.com/products/wordpress-catalog.html'
57
- ),
58
- "player" => array(
59
- 'title' => 'Video Player',
60
- 'text' => 'WordPress Video player plugin',
61
- 'content' => 'Spider Video Player for WordPress is a Flash & HTML5 video player plugin that allows you to easily add videos to your website with the possibility.',
62
- 'href' => 'https://web-dorado.com/products/wordpress-player.html'
63
- ),
64
- "contacts" => array(
65
- 'title' => 'Spider Contacts',
66
- 'text' => 'Wordpress staff list plugin',
67
- 'content' => 'Spider Contacts helps you to display information about the group of people more intelligible, effective and convenient.',
68
- 'href' => 'https://web-dorado.com/products/wordpress-contacts-plugin.html'
69
- ),
70
- "facebook" => array(
71
- 'title' => 'Spider Facebook',
72
- 'text' => 'WordPress Facebook plugin',
73
- 'content' => 'Spider Facebook is a WordPress integration tool for Facebook.It includes all the available Facebook social plugins and widgets.',
74
- 'href' => 'https://web-dorado.com/products/wordpress-facebook.html'
75
- ),
76
- "twitter-widget" => array(
77
- 'title' => 'Widget Twitter',
78
- 'text' => 'WordPress Widget Twitter plugin',
79
- 'content' => 'The Widget Twitter plugin lets you to fully integrate your WordPress site with your Twitter account.',
80
- 'href' => 'https://web-dorado.com/products/wordpress-twitter-integration-plugin.html'
81
- ),
82
- "faq" => array(
83
- 'title' => 'Spider FAQ',
84
- 'text' => 'WordPress FAQ Plugin',
85
- 'content' => 'The Spider FAQ WordPress plugin is for creating an FAQ (Frequently Asked Questions) section for your website.',
86
- 'href' => 'https://web-dorado.com/products/wordpress-faq-plugin.html'
87
- ),
88
- "zoom" => array(
89
- 'title' => 'Zoom',
90
- 'text' => 'WordPress text zoom plugin',
91
- 'content' => 'Zoom enables site users to resize the predefined areas of the web site.',
92
- 'href' => 'https://web-dorado.com/products/wordpress-zoom.html'
93
- ),
94
- "flash-calendar" => array(
95
- 'title' => 'Flash Calendar',
96
- 'text' => 'WordPress flash calendar plugin',
97
- 'content' => 'Spider Flash Calendar is a highly configurable Flash calendar plugin which allows you to have multiple organized events.',
98
- 'href' => 'https://web-dorado.com/products/wordpress-events-calendar.html'
99
- ),
100
- "folder_menu" => array(
101
- 'title' => 'Folder Menu',
102
- 'text' => 'WordPress folder menu plugin',
103
- 'content' => 'Folder Menu Vertical is a WordPress Flash menu module for your website, designed to meet your needs and preferences.',
104
- 'href' => 'https://web-dorado.com/products/wordpress-menu-vertical.html'
105
- ),
106
- "random_post" => array(
107
- 'title' => 'Random post',
108
- 'text' => 'WordPress random post plugin',
109
- 'content' => 'Spider Random Post is a small but very smart solution for your WordPress web site.',
110
- 'href' => 'https://web-dorado.com/products/wordpress-random-post.html'
111
- ),
112
- "faq_wd" => array(
113
- 'title' => 'FAQ WD',
114
- 'text' => 'WordPress FAQ plugin',
115
- 'content' => 'Organize and publish your FAQs in an easy and elegant way using FAQ WD.',
116
- 'href' => 'https://web-dorado.com/products/wordpress-faq-wd.html'
117
- ),
118
- "instagram_feed" => array(
119
- 'title' => 'Instagram Feed WD',
120
- 'text' => 'WordPress Instagram Feed plugin',
121
- 'content' => 'WD Instagram Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website.',
122
- 'href' => 'https://web-dorado.com/products/wordpress-instagram-feed-wd.html'
123
- ),
124
- "post-slider" => array(
125
- 'title' => 'Post Slider',
126
- 'text' => 'WordPress Post Slider plugin',
127
- 'content' => 'Post Slider WD is designed to show off the selected posts of your website in a slider.',
128
- 'href' => 'https://web-dorado.com/products/wordpress-post-slider-plugin.html'
129
- ),
130
- "google-maps" => array(
131
- 'title' => 'Google Map',
132
- 'text' => 'WordPress Google Maps Plugin',
133
- 'content' => 'Google Maps WD is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.',
134
- 'href' => 'https://web-dorado.com/products/wordpress-google-maps-plugin.html'
135
- ),
136
- );
137
- ?>
138
- <div id="main_featured_plugins_page">
139
- <h3>Featured Plugins</h3>
140
- <div class="featured_header">
141
- <a target="_blank" href="https://web-dorado.com/wordpress-plugins.html?source=<?php echo $current_plugin; ?>">
142
- <h1>GET <?php echo $plugins[$current_plugin]["title"]; ?> +18 PLUGINS</h1>
143
- <h1 class="get_plugins">FOR $100 ONLY <span>- SAVE 70%</span></h1>
144
- <div class="try-now">
145
- <span>TRY NOW</span>
146
- </div>
147
- </a>
148
- </div>
149
- <ul id="featured-plugins-list">
150
- <?php
151
- foreach ($plugins as $key => $plugins) {
152
- if ($current_plugin != $key) {
153
- ?>
154
- <li class="<?php echo $key; ?>">
155
- <div class="product"></div>
156
- <div class="title">
157
- <strong class="heading"><?php echo $plugins['title']; ?></strong>
158
- </div>
159
- <div class="description">
160
- <p><?php echo $plugins['content']; ?></p>
161
- </div>
162
- <a target="_blank" href="<?php echo $plugins['href']; ?>?source=<?php echo $current_plugin; ?>" class="download">Download Plugin &#9658;</a>
163
- </li>
164
- <?php
165
- }
166
- }
167
- ?>
168
- </ul>
169
- </div>
170
- <?php
171
  }
1
+ <?php
2
+ function spider_featured($current_plugin = '') {
3
+ $plugins = array(
4
+ "ecommerce-wd" => array(
5
+ 'title' => 'Ecommerce',
6
+ 'text' => 'Wordpress ecommerce plugin',
7
+ 'content' => 'Ecommerce WD is a highly-functional, user friendly WordPress Ecommerce plugin, which is perfect for developing online stores for any level of complexity.',
8
+ 'href' => 'https://web-dorado.com/products/wordpress-ecommerce.html'
9
+ ),
10
+ "form-maker" => array(
11
+ 'title' => 'Form Maker',
12
+ 'text' => 'Wordpress form builder plugin',
13
+ 'content' => 'Form Maker is a modern and advanced tool for creating WordPress forms easily and fast.',
14
+ 'href' => 'https://web-dorado.com/products/wordpress-form.html'
15
+ ),
16
+ "photo-gallery" => array(
17
+ 'title' => 'Photo Gallery',
18
+ 'text' => 'WordPress Photo Gallery plugin',
19
+ 'content' => 'Photo Gallery is a fully responsive WordPress Gallery plugin with advanced functionality.',
20
+ 'href' => 'https://web-dorado.com/products/wordpress-photo-gallery-plugin.html'
21
+ ),
22
+ "contact_form_builder" => array(
23
+ 'title' => 'Contact Form Builder',
24
+ 'text' => 'WordPress contact form builder plugin',
25
+ 'content' => 'Contact Form Builder is the best tool for quickly arranging a contact form for your clients and visitors.',
26
+ 'href' => 'https://web-dorado.com/products/wordpress-contact-form-builder.html'
27
+ ),
28
+ "slider_wd" => array(
29
+ 'title' => 'Slider WD',
30
+ 'text' => 'WordPress slider plugin',
31
+ 'content' => 'Create responsive, highly configurable sliders with various effects for your WordPress site.',
32
+ 'href' => 'https://web-dorado.com/products/wordpress-slider-plugin.html'
33
+ ),
34
+ "events-wd" => array(
35
+ 'title' => 'Event Calendar WD',
36
+ 'text' => 'WordPress calendar plugin',
37
+ 'content' => 'Organize and publish your events in an easy and elegant way using Event Calendar WD.',
38
+ 'href' => 'https://web-dorado.com/products/wordpress-event-calendar-wd.html'
39
+ ),
40
+ "contact-maker" => array(
41
+ 'title' => 'Contact Form Maker',
42
+ 'text' => 'WordPress contact form maker plugin',
43
+ 'content' => 'WordPress Contact Form Maker is an advanced and easy-to-use tool for creating forms.',
44
+ 'href' => 'https://web-dorado.com/products/wordpress-contact-form-maker-plugin.html'
45
+ ),
46
+ "spider-calendar" => array(
47
+ 'title' => 'Spider Calendar',
48
+ 'text' => 'WordPress event calendar plugin',
49
+ 'content' => 'Spider Event Calendar is a highly configurable product which allows you to have multiple organized events.',
50
+ 'href' => 'https://web-dorado.com/products/wordpress-calendar.html'
51
+ ),
52
+ "catalog" => array(
53
+ 'title' => 'Spider Catalog',
54
+ 'text' => 'WordPress product catalog plugin',
55
+ 'content' => 'Spider Catalog for WordPress is a convenient tool for organizing the products represented on your website into catalogs.',
56
+ 'href' => 'https://web-dorado.com/products/wordpress-catalog.html'
57
+ ),
58
+ "player" => array(
59
+ 'title' => 'Video Player',
60
+ 'text' => 'WordPress Video player plugin',
61
+ 'content' => 'Spider Video Player for WordPress is a Flash & HTML5 video player plugin that allows you to easily add videos to your website with the possibility.',
62
+ 'href' => 'https://web-dorado.com/products/wordpress-player.html'
63
+ ),
64
+ "contacts" => array(
65
+ 'title' => 'Spider Contacts',
66
+ 'text' => 'Wordpress staff list plugin',
67
+ 'content' => 'Spider Contacts helps you to display information about the group of people more intelligible, effective and convenient.',
68
+ 'href' => 'https://web-dorado.com/products/wordpress-contacts-plugin.html'
69
+ ),
70
+ "facebook" => array(
71
+ 'title' => 'Spider Facebook',
72
+ 'text' => 'WordPress Facebook plugin',
73
+ 'content' => 'Spider Facebook is a WordPress integration tool for Facebook.It includes all the available Facebook social plugins and widgets.',
74
+ 'href' => 'https://web-dorado.com/products/wordpress-facebook.html'
75
+ ),
76
+ "twitter-widget" => array(
77
+ 'title' => 'Widget Twitter',
78
+ 'text' => 'WordPress Widget Twitter plugin',
79
+ 'content' => 'The Widget Twitter plugin lets you to fully integrate your WordPress site with your Twitter account.',
80
+ 'href' => 'https://web-dorado.com/products/wordpress-twitter-integration-plugin.html'
81
+ ),
82
+ "faq" => array(
83
+ 'title' => 'Spider FAQ',
84
+ 'text' => 'WordPress FAQ Plugin',
85
+ 'content' => 'The Spider FAQ WordPress plugin is for creating an FAQ (Frequently Asked Questions) section for your website.',
86
+ 'href' => 'https://web-dorado.com/products/wordpress-faq-plugin.html'
87
+ ),
88
+ "zoom" => array(
89
+ 'title' => 'Zoom',
90
+ 'text' => 'WordPress text zoom plugin',
91
+ 'content' => 'Zoom enables site users to resize the predefined areas of the web site.',
92
+ 'href' => 'https://web-dorado.com/products/wordpress-zoom.html'
93
+ ),
94
+ "flash-calendar" => array(
95
+ 'title' => 'Flash Calendar',
96
+ 'text' => 'WordPress flash calendar plugin',
97
+ 'content' => 'Spider Flash Calendar is a highly configurable Flash calendar plugin which allows you to have multiple organized events.',
98
+ 'href' => 'https://web-dorado.com/products/wordpress-events-calendar.html'
99
+ ),
100
+ "folder_menu" => array(
101
+ 'title' => 'Folder Menu',
102
+ 'text' => 'WordPress folder menu plugin',
103
+ 'content' => 'Folder Menu Vertical is a WordPress Flash menu module for your website, designed to meet your needs and preferences.',
104
+ 'href' => 'https://web-dorado.com/products/wordpress-menu-vertical.html'
105
+ ),
106
+ "random_post" => array(
107
+ 'title' => 'Random post',
108
+ 'text' => 'WordPress random post plugin',
109
+ 'content' => 'Spider Random Post is a small but very smart solution for your WordPress web site.',
110
+ 'href' => 'https://web-dorado.com/products/wordpress-random-post.html'
111
+ ),
112
+ "faq_wd" => array(
113
+ 'title' => 'FAQ WD',
114
+ 'text' => 'WordPress FAQ plugin',
115
+ 'content' => 'Organize and publish your FAQs in an easy and elegant way using FAQ WD.',
116
+ 'href' => 'https://web-dorado.com/products/wordpress-faq-wd.html'
117
+ ),
118
+ "instagram_feed" => array(
119
+ 'title' => 'Instagram Feed WD',
120
+ 'text' => 'WordPress Instagram Feed plugin',
121
+ 'content' => 'WD Instagram Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website.',
122
+ 'href' => 'https://web-dorado.com/products/wordpress-instagram-feed-wd.html'
123
+ ),
124
+ "post-slider" => array(
125
+ 'title' => 'Post Slider',
126
+ 'text' => 'WordPress Post Slider plugin',
127
+ 'content' => 'Post Slider WD is designed to show off the selected posts of your website in a slider.',
128
+ 'href' => 'https://web-dorado.com/products/wordpress-post-slider-plugin.html'
129
+ ),
130
+ "google-maps" => array(
131
+ 'title' => 'Google Map',
132
+ 'text' => 'WordPress Google Maps Plugin',
133
+ 'content' => 'Google Maps WD is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.',
134
+ 'href' => 'https://web-dorado.com/products/wordpress-google-maps-plugin.html'
135
+ ),
136
+ );
137
+ ?>
138
+ <div id="main_featured_plugins_page">
139
+ <h3>Featured Plugins</h3>
140
+ <div class="featured_header">
141
+ <a target="_blank" href="https://web-dorado.com/wordpress-plugins.html?source=<?php echo $current_plugin; ?>">
142
+ <h1>GET <?php echo $plugins[$current_plugin]["title"]; ?> +18 PLUGINS</h1>
143
+ <h1 class="get_plugins">FOR $100 ONLY <span>- SAVE 70%</span></h1>
144
+ <div class="try-now">
145
+ <span>TRY NOW</span>
146
+ </div>
147
+ </a>
148
+ </div>
149
+ <ul id="featured-plugins-list">
150
+ <?php
151
+ foreach ($plugins as $key => $plugins) {
152
+ if ($current_plugin != $key) {
153
+ ?>
154
+ <li class="<?php echo $key; ?>">
155
+ <div class="product"></div>
156
+ <div class="title">
157
+ <strong class="heading"><?php echo $plugins['title']; ?></strong>
158
+ </div>
159
+ <div class="description">
160
+ <p><?php echo $plugins['content']; ?></p>
161
+ </div>
162
+ <a target="_blank" href="<?php echo $plugins['href']; ?>?source=<?php echo $current_plugin; ?>" class="download">Download Plugin &#9658;</a>
163
+ </li>
164
+ <?php
165
+ }
166
+ }
167
+ ?>
168
+ </ul>
169
+ </div>
170
+ <?php
171
  }
featured/style.css CHANGED
@@ -1,202 +1,202 @@
1
- @import url(http://fonts.googleapis.com/css?family=Oswald);
2
- #main_featured_plugins_page {
3
- font-family: Oswald;
4
- width: 90%;
5
- margin: 15px auto 0px auto;
6
- }
7
-
8
- #main_featured_plugins_page h3 {
9
- border-bottom: 2px solid #CECECE;
10
- color: rgb(111, 111, 111);
11
- font-family: Segoe UI;
12
- font-size: 18px;
13
- margin: 0px auto 15px auto;
14
- padding: 20px 0;
15
- }
16
-
17
- #main_featured_plugins_page #featured-plugins-list {
18
- position:relative;
19
- margin:0px auto;
20
- height:auto;
21
- display:table;
22
- list-style:none;
23
- text-align: center;
24
- width: 100%;
25
- }
26
-
27
- #main_featured_plugins_page #featured-plugins-list li {
28
- display: inline-table;
29
- width: 200px;
30
- margin: 20px 10px 0px 10px;
31
- background: #FFFFFF;
32
- border-right: 3px solid #E5E5E5;
33
- height: 335px;
34
- border-bottom: 3px solid #E5E5E5;
35
- position: relative;
36
- }
37
-
38
- #main_featured_plugins_page #featured-plugins-list li .product {
39
- position:relative;
40
- height:113px;
41
- background-color: transparent !important;
42
- background-position-x: 50% !important;
43
- margin: 7px;
44
- border-radius: 3px;
45
- background-size: 115px !important;
46
- }
47
-
48
- #main_featured_plugins_page #featured-plugins-list li .title {
49
- width: 90%;
50
- text-align: center;
51
- margin: 0 auto;
52
- }
53
-
54
- #main_featured_plugins_page #featured-plugins-list li.ecommerce-wd .product {background:url("images/ecommerce.png") center center no-repeat;}
55
- #main_featured_plugins_page #featured-plugins-list li.form-maker .product {background:url("images/form.png") center center no-repeat;}
56
- #main_featured_plugins_page #featured-plugins-list li.catalog .product {background:url("images/catalog.png") center center no-repeat;}
57
- #main_featured_plugins_page #featured-plugins-list li.contact-maker .product {background:url("images/contact.maker.png") center center no-repeat;}
58
- #main_featured_plugins_page #featured-plugins-list li.contacts .product {background:url("images/contacts.png") center center no-repeat;}
59
- #main_featured_plugins_page #featured-plugins-list li.facebook .product {background:url("images/facebook.png") center center no-repeat;}
60
- #main_featured_plugins_page #featured-plugins-list li.faq .product {background:url("images/faq.png") center center no-repeat;}
61
- #main_featured_plugins_page #featured-plugins-list li.flash-calendar .product {background:url("images/flash.calendar.png") center center no-repeat;}
62
- #main_featured_plugins_page #featured-plugins-list li.player .product {background:url("images/player.png") center center no-repeat; }
63
- #main_featured_plugins_page #featured-plugins-list li.spider-calendar .product {background:url("images/spider.calendar.png") center center no-repeat;}
64
- #main_featured_plugins_page #featured-plugins-list li.contact_form_builder .product {background:url("images/contact.builder.png") center center no-repeat;}
65
- #main_featured_plugins_page #featured-plugins-list li.random_post .product {background:url("images/random.post.png") center center no-repeat;}
66
- #main_featured_plugins_page #featured-plugins-list li.slider_wd .product {background:url("images/slider.png") center center no-repeat;}
67
- #main_featured_plugins_page #featured-plugins-list li.folder_menu .product {background:url("images/folder.menu.png") center center no-repeat;}
68
- #main_featured_plugins_page #featured-plugins-list li.zoom .product {background:url("images/zoom.png") center center no-repeat;}
69
- #main_featured_plugins_page #featured-plugins-list li.fm-import .product {background:url("images/fm-import.png") center center no-repeat;}
70
- #main_featured_plugins_page #featured-plugins-list li.photo-gallery .product {background:url("images/photo-gallery.png") center center no-repeat;}
71
- #main_featured_plugins_page #featured-plugins-list li.twitter-widget .product {background:url("images/twittertools.png") center center no-repeat;}
72
- #main_featured_plugins_page #featured-plugins-list li.events-wd .product {background:url("images/events-wd.png") center center no-repeat;}
73
- #main_featured_plugins_page #featured-plugins-list li.faq_wd .product {background:url("images/faq_wd.png") center center no-repeat;}
74
- #main_featured_plugins_page #featured-plugins-list li.instagram_feed .product {background:url("images/instagram_feed.png") center center no-repeat;}
75
- #main_featured_plugins_page #featured-plugins-list li.post-slider .product {background:url("images/post-slider.png") center center no-repeat;}
76
- #main_featured_plugins_page #featured-plugins-list li.google-maps .product {background:url("images/google-maps.png") center center no-repeat;}
77
-
78
- #main_featured_plugins_page #featured-plugins-list li .title .heading {
79
- display: block;
80
- position: relative;
81
- font-size: 17px;
82
- color: #767676;
83
- margin: 13px 0px 13px 0px;
84
- text-transform: uppercase;
85
- }
86
-
87
- #main_featured_plugins_page #featured-plugins-list li .title p {
88
- font-size:14px;
89
- color:#444;
90
- margin-left:20px;
91
- }
92
-
93
- #main_featured_plugins_page #featured-plugins-list li .description {
94
- height: 127px;
95
- width: 90%;
96
- margin: 0 auto;
97
- }
98
-
99
- #main_featured_plugins_page #featured-plugins-list li .description p {
100
- text-align: center;
101
- width: 100%;
102
- color: #9A9A9A;
103
- font-family: Segoe UI Light;
104
- }
105
-
106
- #featured-plugins-list li a.download {
107
- display: block;
108
- border-top: 1px solid #CACACA;
109
- outline: none;
110
- width: 90%;
111
- margin: 0 auto;
112
- font-size: 14px;
113
- line-height: 40px;
114
- text-decoration: none;
115
- font-weight: bolder;
116
- text-align: center;
117
- color: #134D68;
118
- position: absolute;
119
- text-transform: uppercase;
120
- bottom: 0;
121
- left: 10px;
122
- font-family: Segoe UI Black;
123
- text-shadow: 1px 0;
124
- }
125
-
126
- #featured-plugins-list li a.download:hover {
127
- color: #F47629;
128
- }
129
-
130
- .featured_header {
131
- background: #11465F;
132
- border-right: 3px solid #E5E5E5;
133
- border-bottom: 3px solid #E5E5E5;
134
- position: relative;
135
- padding: 20px 0;
136
- }
137
-
138
- .featured_header .old_price {
139
- color: rgba(180, 180, 180, 0.3);
140
- text-decoration: line-through;
141
- font-family: Oswald;
142
- }
143
-
144
- .featured_header h1.get_plugins {
145
- color: #FFFFFF;
146
- height: 85px;
147
- margin: 0;
148
- background-size: 85% 100%;
149
- background-position: center;
150
- line-height: 60px;
151
- }
152
-
153
- .featured_header .try-now {
154
- text-align: center;
155
- }
156
-
157
- .featured_header .try-now span {
158
- display: inline-block;
159
- padding: 7px 16px;
160
- background: #F47629;
161
- border-radius: 10px;
162
- color: #ffffff;
163
- font-size: 23px;
164
- }
165
-
166
- .featured_header h1 {
167
- font-size: 50px;
168
- text-align: center;
169
- color: #FFFFFF;
170
- letter-spacing: 3px;
171
- text-transform: uppercase;
172
- }
173
-
174
- .featured_header a {
175
- text-decoration: none;
176
- }
177
-
178
- @media screen and (max-width: 1105px) {
179
- .featured_header h1 {
180
- font-size: 37px;
181
- line-height: 0;
182
- }
183
- }
184
-
185
- @media screen and (max-width: 835px) {
186
- .get_plugins span {
187
- display: none;
188
- }
189
- }
190
-
191
- @media screen and (max-width: 700px) {
192
- .featured_header h1 {
193
- line-height: 40px;
194
- }
195
- }
196
-
197
- @media screen and (max-width: 435px) {
198
- .featured_header h1 {
199
- font-size: 20px;
200
- line-height: 25px;
201
- }
202
  }
1
+ @import url(http://fonts.googleapis.com/css?family=Oswald);
2
+ #main_featured_plugins_page {
3
+ font-family: Oswald;
4
+ width: 90%;
5
+ margin: 15px auto 0px auto;
6
+ }
7
+
8
+ #main_featured_plugins_page h3 {
9
+ border-bottom: 2px solid #CECECE;
10
+ color: rgb(111, 111, 111);
11
+ font-family: Segoe UI;
12
+ font-size: 18px;
13
+ margin: 0px auto 15px auto;
14
+ padding: 20px 0;
15
+ }
16
+
17
+ #main_featured_plugins_page #featured-plugins-list {
18
+ position:relative;
19
+ margin:0px auto;
20
+ height:auto;
21
+ display:table;
22
+ list-style:none;
23
+ text-align: center;
24
+ width: 100%;
25
+ }
26
+
27
+ #main_featured_plugins_page #featured-plugins-list li {
28
+ display: inline-table;
29
+ width: 200px;
30
+ margin: 20px 10px 0px 10px;
31
+ background: #FFFFFF;
32
+ border-right: 3px solid #E5E5E5;
33
+ height: 335px;
34
+ border-bottom: 3px solid #E5E5E5;
35
+ position: relative;
36
+ }
37
+
38
+ #main_featured_plugins_page #featured-plugins-list li .product {
39
+ position:relative;
40
+ height:113px;
41
+ background-color: transparent !important;
42
+ background-position-x: 50% !important;
43
+ margin: 7px;
44
+ border-radius: 3px;
45
+ background-size: 115px !important;
46
+ }
47
+
48
+ #main_featured_plugins_page #featured-plugins-list li .title {
49
+ width: 90%;
50
+ text-align: center;
51
+ margin: 0 auto;
52
+ }
53
+
54
+ #main_featured_plugins_page #featured-plugins-list li.ecommerce-wd .product {background:url("images/ecommerce.png") center center no-repeat;}
55
+ #main_featured_plugins_page #featured-plugins-list li.form-maker .product {background:url("images/form.png") center center no-repeat;}
56
+ #main_featured_plugins_page #featured-plugins-list li.catalog .product {background:url("images/catalog.png") center center no-repeat;}
57
+ #main_featured_plugins_page #featured-plugins-list li.contact-maker .product {background:url("images/contact.maker.png") center center no-repeat;}
58
+ #main_featured_plugins_page #featured-plugins-list li.contacts .product {background:url("images/contacts.png") center center no-repeat;}
59
+ #main_featured_plugins_page #featured-plugins-list li.facebook .product {background:url("images/facebook.png") center center no-repeat;}
60
+ #main_featured_plugins_page #featured-plugins-list li.faq .product {background:url("images/faq.png") center center no-repeat;}
61
+ #main_featured_plugins_page #featured-plugins-list li.flash-calendar .product {background:url("images/flash.calendar.png") center center no-repeat;}
62
+ #main_featured_plugins_page #featured-plugins-list li.player .product {background:url("images/player.png") center center no-repeat; }
63
+ #main_featured_plugins_page #featured-plugins-list li.spider-calendar .product {background:url("images/spider.calendar.png") center center no-repeat;}
64
+ #main_featured_plugins_page #featured-plugins-list li.contact_form_builder .product {background:url("images/contact.builder.png") center center no-repeat;}
65
+ #main_featured_plugins_page #featured-plugins-list li.random_post .product {background:url("images/random.post.png") center center no-repeat;}
66
+ #main_featured_plugins_page #featured-plugins-list li.slider_wd .product {background:url("images/slider.png") center center no-repeat;}
67
+ #main_featured_plugins_page #featured-plugins-list li.folder_menu .product {background:url("images/folder.menu.png") center center no-repeat;}
68
+ #main_featured_plugins_page #featured-plugins-list li.zoom .product {background:url("images/zoom.png") center center no-repeat;}
69
+ #main_featured_plugins_page #featured-plugins-list li.fm-import .product {background:url("images/fm-import.png") center center no-repeat;}
70
+ #main_featured_plugins_page #featured-plugins-list li.photo-gallery .product {background:url("images/photo-gallery.png") center center no-repeat;}
71
+ #main_featured_plugins_page #featured-plugins-list li.twitter-widget .product {background:url("images/twittertools.png") center center no-repeat;}
72
+ #main_featured_plugins_page #featured-plugins-list li.events-wd .product {background:url("images/events-wd.png") center center no-repeat;}
73
+ #main_featured_plugins_page #featured-plugins-list li.faq_wd .product {background:url("images/faq_wd.png") center center no-repeat;}
74
+ #main_featured_plugins_page #featured-plugins-list li.instagram_feed .product {background:url("images/instagram_feed.png") center center no-repeat;}
75
+ #main_featured_plugins_page #featured-plugins-list li.post-slider .product {background:url("images/post-slider.png") center center no-repeat;}
76
+ #main_featured_plugins_page #featured-plugins-list li.google-maps .product {background:url("images/google-maps.png") center center no-repeat;}
77
+
78
+ #main_featured_plugins_page #featured-plugins-list li .title .heading {
79
+ display: block;
80
+ position: relative;
81
+ font-size: 17px;
82
+ color: #767676;
83
+ margin: 13px 0px 13px 0px;
84
+ text-transform: uppercase;
85
+ }
86
+
87
+ #main_featured_plugins_page #featured-plugins-list li .title p {
88
+ font-size:14px;
89
+ color:#444;
90
+ margin-left:20px;
91
+ }
92
+
93
+ #main_featured_plugins_page #featured-plugins-list li .description {
94
+ height: 127px;
95
+ width: 90%;
96
+ margin: 0 auto;
97
+ }
98
+
99
+ #main_featured_plugins_page #featured-plugins-list li .description p {
100
+ text-align: center;
101
+ width: 100%;
102
+ color: #9A9A9A;
103
+ font-family: Segoe UI Light;
104
+ }
105
+
106
+ #featured-plugins-list li a.download {
107
+ display: block;
108
+ border-top: 1px solid #CACACA;
109
+ outline: none;
110
+ width: 90%;
111
+ margin: 0 auto;
112
+ font-size: 14px;
113
+ line-height: 40px;
114
+ text-decoration: none;
115
+ font-weight: bolder;
116
+ text-align: center;
117
+ color: #134D68;
118
+ position: absolute;
119
+ text-transform: uppercase;
120
+ bottom: 0;
121
+ left: 10px;
122
+ font-family: Segoe UI Black;
123
+ text-shadow: 1px 0;
124
+ }
125
+
126
+ #featured-plugins-list li a.download:hover {
127
+ color: #F47629;
128
+ }
129
+
130
+ .featured_header {
131
+ background: #11465F;
132
+ border-right: 3px solid #E5E5E5;
133
+ border-bottom: 3px solid #E5E5E5;
134
+ position: relative;
135
+ padding: 20px 0;
136
+ }
137
+
138
+ .featured_header .old_price {
139
+ color: rgba(180, 180, 180, 0.3);
140
+ text-decoration: line-through;
141
+ font-family: Oswald;
142
+ }
143
+
144
+ .featured_header h1.get_plugins {
145
+ color: #FFFFFF;
146
+ height: 85px;
147
+ margin: 0;
148
+ background-size: 85% 100%;
149
+ background-position: center;
150
+ line-height: 60px;
151
+ }
152
+
153
+ .featured_header .try-now {
154
+ text-align: center;
155
+ }
156
+
157
+ .featured_header .try-now span {
158
+ display: inline-block;
159
+ padding: 7px 16px;
160
+ background: #F47629;
161
+ border-radius: 10px;
162
+ color: #ffffff;
163
+ font-size: 23px;
164
+ }
165
+
166
+ .featured_header h1 {
167
+ font-size: 50px;
168
+ text-align: center;
169
+ color: #FFFFFF;
170
+ letter-spacing: 3px;
171
+ text-transform: uppercase;
172
+ }
173
+
174
+ .featured_header a {
175
+ text-decoration: none;
176
+ }
177
+
178
+ @media screen and (max-width: 1105px) {
179
+ .featured_header h1 {
180
+ font-size: 37px;
181
+ line-height: 0;
182
+ }
183
+ }
184
+
185
+ @media screen and (max-width: 835px) {
186
+ .get_plugins span {
187
+ display: none;
188
+ }
189
+ }
190
+
191
+ @media screen and (max-width: 700px) {
192
+ .featured_header h1 {
193
+ line-height: 40px;
194
+ }
195
+ }
196
+
197
+ @media screen and (max-width: 435px) {
198
+ .featured_header h1 {
199
+ font-size: 20px;
200
+ line-height: 25px;
201
+ }
202
  }
framework/WDW_CFM_Library.php CHANGED
@@ -1,432 +1,432 @@
1
- <?php
2
-
3
- class WDW_CFM_Library {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
-
19
-
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- // Public Methods //
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- ////////////////////////////////////////////////////////////////////////////////////////
24
- // Getters & Setters //
25
- ////////////////////////////////////////////////////////////////////////////////////////
26
- public static function get($key, $default_value = '') {
27
- if (isset($_GET[$key])) {
28
- $value = $_GET[$key];
29
- }
30
- elseif (isset($_POST[$key])) {
31
- $value = $_POST[$key];
32
- }
33
- else {
34
- $value = '';
35
- }
36
- if (!$value) {
37
- $value = $default_value;
38
- }
39
- return esc_html($value);
40
- }
41
-
42
- public static function message_id($message_id) {
43
- if ($message_id) {
44
- switch($message_id) {
45
- case 1: {
46
- $message = __("Item Succesfully Saved.", "contact_form_maker");
47
- $type = 'updated';
48
- break;
49
-
50
- }
51
- case 2: {
52
- $message = __("Error. Please install plugin again.", "contact_form_maker");
53
- $type = 'error';
54
- break;
55
-
56
- }
57
- case 3: {
58
- $message = __("Item Succesfully Deleted.", "contact_form_maker");
59
- $type = 'updated';
60
- break;
61
-
62
- }
63
- case 4: {
64
- $message = __("You can't delete default theme", "contact_form_maker");
65
- $type = 'error';
66
- break;
67
-
68
- }
69
- case 5: {
70
- $message = __("Items Succesfully Deleted.", "contact_form_maker");
71
- $type = 'updated';
72
- break;
73
-
74
- }
75
- case 6: {
76
- $message = __("You must select at least one item.", "contact_form_maker");
77
- $type = 'error';
78
- break;
79
-
80
- }
81
- case 7: {
82
- $message = __("The item is successfully set as default.", "contact_form_maker");
83
- $type = 'updated';
84
- break;
85
-
86
- }
87
- case 8: {
88
- $message = __("Options Succesfully Saved.", "contact_form_maker");
89
- $type = 'updated';
90
- break;
91
-
92
- }
93
- }
94
- return '<div style="width: 99%;"><div class="' . $type . '"><p><strong>' . $message . '</strong></p></div></div>';
95
- }
96
- }
97
-
98
- public static function message($message, $type, $form_id = 0) {
99
- return '<div style="width: 100%;" class="contactform' . $form_id . '"><div class="' . $type . '"><p><strong>' . $message . '</strong></p></div></div>';
100
- }
101
-
102
- public static function search($search_by, $search_value, $form_id) {
103
- ?>
104
- <div class="alignleft actions" style="clear:both;">
105
- <script>
106
- function spider_search() {
107
- document.getElementById("page_number").value = "1";
108
- document.getElementById("search_or_not").value = "search";
109
- document.getElementById("<?php echo $form_id; ?>").submit();
110
- }
111
- function spider_reset() {
112
- if (document.getElementById("search_value")) {
113
- document.getElementById("search_value").value = "";
114
- }
115
- if (document.getElementById("search_select_value")) {
116
- document.getElementById("search_select_value").value = 0;
117
- }
118
- document.getElementById("<?php echo $form_id; ?>").submit();
119
- }
120
- </script>
121
- <div class="fm-search">
122
- <label for="search_value"><?php echo $search_by; ?>:</label>
123
- <input type="text" id="search_value" name="search_value" value="<?php echo esc_html($search_value); ?>"/>
124
- <button class="fm-icon search-icon" onclick="spider_search()">
125
- </button>
126
- <button class="fm-icon reset-icon" onclick="spider_reset()">
127
- </button>
128
- </div>
129
- </div>
130
- <?php
131
- }
132
-
133
- public static function search_select($search_by, $search_select_value, $playlists, $form_id) {
134
- ?>
135
- <div class="alignleft actions" style="clear:both;">
136
- <script>
137
- function spider_search_select() {
138
- document.getElementById("page_number").value = "1";
139
- document.getElementById("search_or_not").value = "search";
140
- document.getElementById("<?php echo $form_id; ?>").submit();
141
- }
142
- </script>
143
- <div class="alignleft actions" >
144
- <label for="search_select_value" style="font-size:14px; width:50px; display:inline-block;"><?php echo $search_by; ?>:</label>
145
- <select id="search_select_value" name="search_select_value" onchange="spider_search_select();" style="float: none; width: 150px;">
146
- <?php
147
- foreach ($playlists as $id => $playlist) {
148
- ?>
149
- <option value="<?php echo $id; ?>" <?php echo (($search_select_value == $id) ? 'selected="selected"' : ''); ?>><?php echo $playlist; ?></option>
150
- <?php
151
- }
152
- ?>
153
- </select>
154
- </div>
155
- </div>
156
- <?php
157
- }
158
-
159
- public static function html_page_nav($count_items, $page_number, $form_id, $items_per_page = 20) {
160
- $limit = 20;
161
- if ($count_items) {
162
- if ($count_items % $limit) {
163
- $items_county = ($count_items - $count_items % $limit) / $limit + 1;
164
- }
165
- else {
166
- $items_county = ($count_items - $count_items % $limit) / $limit;
167
- }
168
- }
169
- else {
170
- $items_county = 1;
171
- }
172
- ?>
173
- <script type="text/javascript">
174
- var items_county = <?php echo $items_county; ?>;
175
- function spider_page(x, y) {
176
- switch (y) {
177
- case 1:
178
- if (x >= items_county) {
179
- document.getElementById('page_number').value = items_county;
180
- }
181
- else {
182
- document.getElementById('page_number').value = x + 1;
183
- }
184
- break;
185
- case 2:
186
- document.getElementById('page_number').value = items_county;
187
- break;
188
- case -1:
189
- if (x == 1) {
190
- document.getElementById('page_number').value = 1;
191
- }
192
- else {
193
- document.getElementById('page_number').value = x - 1;
194
- }
195
- break;
196
- case -2:
197
- document.getElementById('page_number').value = 1;
198
- break;
199
- default:
200
- document.getElementById('page_number').value = 1;
201
- }
202
- document.getElementById('<?php echo $form_id; ?>').submit();
203
- }
204
- function check_enter_key(e) {
205
- var key_code = (e.keyCode ? e.keyCode : e.which);
206
- if (key_code == 13) { /*Enter keycode*/
207
- if (jQuery('#current_page').val() >= items_county) {
208
- document.getElementById('page_number').value = items_county;
209
- }
210
- else {
211
- document.getElementById('page_number').value = jQuery('#current_page').val();
212
- }
213
- document.getElementById('<?php echo $form_id; ?>').submit();
214
- }
215
- return true;
216
- }
217
- </script>
218
- <div class="tablenav-pages">
219
- <span class="displaying-num">
220
- <?php
221
- if ($count_items != 0) {
222
- echo $count_items; ?> <?php echo (($count_items == 1) ? __("item", "contact_form_maker") : __("items", "contact_form_maker"));
223
- }
224
- ?>
225
- </span>
226
- <?php
227
- if ($count_items > $items_per_page) {
228
- $first_page = "first-page";
229
- $prev_page = "prev-page";
230
- $next_page = "next-page";
231
- $last_page = "last-page";
232
- if ($page_number == 1) {
233
- $first_page = "first-page disabled";
234
- $prev_page = "prev-page disabled";
235
- $next_page = "next-page";
236
- $last_page = "last-page";
237
- }
238
- if ($page_number >= $items_county) {
239
- $first_page = "first-page ";
240
- $prev_page = "prev-page";
241
- $next_page = "next-page disabled";
242
- $last_page = "last-page disabled";
243
- }
244
- ?>
245
- <span class="pagination-links">
246
- <a class="<?php echo $first_page; ?>" title="<?php echo __("Go to the first page", "contact_form_maker"); ?>" href="javascript:spider_page(<?php echo $page_number; ?>,-2);">«</a>
247
- <a class="<?php echo $prev_page; ?>" title="<?php echo __("Go to the previous page", "contact_form_maker"); ?>" href="javascript:spider_page(<?php echo $page_number; ?>,-1);">‹</a>
248
- <span class="paging-input">
249
- <span class="total-pages">
250
- <input class="current_page" id="current_page" name="current_page" value="<?php echo $page_number; ?>" onkeypress="return check_enter_key(event)" title="<?php echo __("Go to the page", "contact_form_maker"); ?>" type="text" size="1" />
251
- </span> <?php echo __("of","contact_form_maker"); ?>
252
- <span class="total-pages">
253
- <?php echo $items_county; ?>
254
- </span>
255
- </span>
256
- <a class="<?php echo $next_page ?>" title="<?php echo __("Go to the next page", "contact_form_maker"); ?>" href="javascript:spider_page(<?php echo $page_number; ?>,1);">›</a>
257
- <a class="<?php echo $last_page ?>" title="<?php echo __("Go to the last page", "contact_form_maker"); ?>" href="javascript:spider_page(<?php echo $page_number; ?>,2);">»</a>
258
- <?php
259
- }
260
- ?>
261
- </span>
262
- </div>
263
- <input type="hidden" id="page_number" name="page_number" value="<?php echo ((isset($_POST['page_number'])) ? (int) $_POST['page_number'] : 1); ?>" />
264
- <input type="hidden" id="search_or_not" name="search_or_not" value="<?php echo ((isset($_POST['search_or_not'])) ? esc_html($_POST['search_or_not']) : ''); ?>"/>
265
- <?php
266
- }
267
-
268
- public static function ajax_search($search_by, $search_value, $form_id) {
269
- ?>
270
- <div class="alignleft actions" style="clear:both;">
271
- <script>
272
- function spider_search() {
273
- document.getElementById("page_number").value = "1";
274
- document.getElementById("search_or_not").value = "search";
275
- spider_ajax_save('<?php echo $form_id; ?>');
276
- }
277
- function spider_reset() {
278
- if (document.getElementById("search_value")) {
279
- document.getElementById("search_value").value = "";
280
- }
281
- spider_ajax_save('<?php echo $form_id; ?>');
282
- }
283
- </script>
284
- <div class="alignleft actions" style="">
285
- <label for="search_value" style="font-size:14px; width:60px; display:inline-block;"><?php echo $search_by; ?>:</label>
286
- <input type="text" id="search_value" name="search_value" class="spider_search_value" value="<?php echo esc_html($search_value); ?>" style="width: 150px;<?php echo (get_bloginfo('version') > '3.7') ? ' height: 28px;' : ''; ?>" />
287
- </div>
288
- <div class="alignleft actions">
289
- <input type="button" value="<?php echo __("Search", "contact_form_maker"); ?>" onclick="spider_search()" class="button-secondary action" />
290
- <input type="button" value="<?php echo __("Reset", "contact_form_maker"); ?>" onclick="spider_reset()" class="button-secondary action" />
291
- </div>
292
- </div>
293
- <?php
294
- }
295
-
296
- public static function ajax_html_page_nav($count_items, $page_number, $form_id) {
297
- $limit = 20;
298
- if ($count_items) {
299
- if ($count_items % $limit) {
300
- $items_county = ($count_items - $count_items % $limit) / $limit + 1;
301
- }
302
- else {
303
- $items_county = ($count_items - $count_items % $limit) / $limit;
304
- }
305
- }
306
- else {
307
- $items_county = 1;
308
- }
309
- ?>
310
- <script type="text/javascript">
311
- var items_county = <?php echo $items_county; ?>;
312
- function spider_page(x, y) {
313
- switch (y) {
314
- case 1:
315
- if (x >= items_county) {
316
- document.getElementById('page_number').value = items_county;
317
- }
318
- else {
319
- document.getElementById('page_number').value = x + 1;
320
- }
321
- break;
322
- case 2:
323
- document.getElementById('page_number').value = items_county;
324
- break;
325
- case -1:
326
- if (x == 1) {
327
- document.getElementById('page_number').value = 1;
328
- }
329
- else {
330
- document.getElementById('page_number').value = x - 1;
331
- }
332
- break;
333
- case -2:
334
- document.getElementById('page_number').value = 1;
335
- break;
336
- default:
337
- document.getElementById('page_number').value = 1;
338
- }
339
- spider_ajax_save('<?php echo $form_id; ?>');
340
- }
341
- function check_enter_key(e) {
342
- var key_code = (e.keyCode ? e.keyCode : e.which);
343
- if (key_code == 13) { /*Enter keycode*/
344
- if (jQuery('#current_page').val() >= items_county) {
345
- document.getElementById('page_number').value = items_county;
346
- }
347
- else {
348
- document.getElementById('page_number').value = jQuery('#current_page').val();
349
- }
350
- spider_ajax_save('<?php echo $form_id; ?>');
351
- return false;
352
- }
353
- return true;
354
- }
355
- </script>
356
- <div id="tablenav-pages" class="tablenav-pages">
357
- <span class="displaying-num">
358
- <?php
359
- if ($count_items != 0) {
360
- echo $count_items; ?> <?php echo (($count_items == 1) ? __("item", "contact_form_maker") : __("items", "contact_form_maker"));
361
- }
362
- ?>
363
- </span>
364
- <?php
365
- if ($count_items > $limit) {
366
- $first_page = "first-page";
367
- $prev_page = "prev-page";
368
- $next_page = "next-page";
369
- $last_page = "last-page";
370
- if ($page_number == 1) {
371
- $first_page = "first-page disabled";
372
- $prev_page = "prev-page disabled";
373
- $next_page = "next-page";
374
- $last_page = "last-page";
375
- }
376
- if ($page_number >= $items_county) {
377
- $first_page = "first-page ";
378
- $prev_page = "prev-page";
379
- $next_page = "next-page disabled";
380
- $last_page = "last-page disabled";
381
- }
382
- ?>
383
- <span class="pagination-links">
384
- <a class="<?php echo $first_page; ?>" title="<?php echo __("Go to the first page", "contact_form_maker"); ?>" onclick="spider_page(<?php echo $page_number; ?>,-2)">«</a>
385
- <a class="<?php echo $prev_page; ?>" title="<?php echo __("Go to the previous page", "contact_form_maker"); ?>" onclick="spider_page(<?php echo $page_number; ?>,-1)">‹</a>
386
- <span class="paging-input">
387
- <span class="total-pages">
388
- <input class="current_page" id="current_page" name="current_page" value="<?php echo $page_number; ?>" onkeypress="return check_enter_key(event)" title="<?php echo __("Go to the page", "contact_form_maker"); ?>" type="text" size="1" />
389
- </span> <?php echo __("of","contact_form_maker"); ?>
390
- <span class="total-pages">
391
- <?php echo $items_county; ?>
392
- </span>
393
- </span>
394
- <a class="<?php echo $next_page ?>" title="<?php echo __("Go to the next page", "contact_form_maker"); ?>" onclick="spider_page(<?php echo $page_number; ?>,1)">›</a>
395
- <a class="<?php echo $last_page ?>" title="<?php echo __("Go to the last page", "contact_form_maker"); ?>" onclick="spider_page(<?php echo $page_number; ?>,2)">»</a>
396
- <?php
397
- }
398
- ?>
399
- </span>
400
- </div>
401
- <input type="hidden" id="page_number" name="page_number" value="<?php echo ((isset($_POST['page_number'])) ? (int) $_POST['page_number'] : 1); ?>" />
402
- <input type="hidden" id="search_or_not" name="search_or_not" value="<?php echo ((isset($_POST['search_or_not'])) ? esc_html($_POST['search_or_not']) : ''); ?>"/>
403
- <?php
404
- }
405
-
406
- public static function spider_redirect($url) {
407
- $url = html_entity_decode(wp_nonce_url($url, 'nonce_cfm', 'nonce_cfm'));
408
- ?>
409
- <script>
410
- window.location = "<?php echo $url; ?>";
411
- </script>
412
- <?php
413
- exit();
414
- }
415
-
416
- public static function no_items($title) {
417
- $title = ($title != '') ? strtolower($title) : 'items';
418
- ob_start();
419
- ?>
420
- <tr class="no-items">
421
- <td class="colspanchange" colspan="0"><?php echo sprintf(__('No %s found.', 'wds'), $title); ?></td>
422
- </tr>
423
- <?php
424
- return ob_get_clean();
425
- }
426
- ////////////////////////////////////////////////////////////////////////////////////////
427
- // Private Methods //
428
- ////////////////////////////////////////////////////////////////////////////////////////
429
- ////////////////////////////////////////////////////////////////////////////////////////
430
- // Listeners //
431
- ////////////////////////////////////////////////////////////////////////////////////////
432
  }
1
+ <?php
2
+
3
+ class WDW_CFM_Library {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+
19
+
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ // Public Methods //
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+ // Getters & Setters //
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ public static function get($key, $default_value = '') {
27
+ if (isset($_GET[$key])) {
28
+ $value = $_GET[$key];
29
+ }
30
+ elseif (isset($_POST[$key])) {
31
+ $value = $_POST[$key];
32
+ }
33
+ else {
34
+ $value = '';
35
+ }
36
+ if (!$value) {
37
+ $value = $default_value;
38
+ }
39
+ return esc_html($value);
40
+ }
41
+
42
+ public static function message_id($message_id) {
43
+ if ($message_id) {
44
+ switch($message_id) {
45
+ case 1: {
46
+ $message = __("Item Succesfully Saved.", "contact_form_maker");
47
+ $type = 'updated';
48
+ break;
49
+
50
+ }
51
+ case 2: {
52
+ $message = __("Error. Please install plugin again.", "contact_form_maker");
53
+ $type = 'error';
54
+ break;
55
+
56
+ }
57
+ case 3: {
58
+ $message = __("Item Succesfully Deleted.", "contact_form_maker");
59
+ $type = 'updated';
60
+ break;
61
+
62
+ }
63
+ case 4: {
64
+ $message = __("You can't delete default theme", "contact_form_maker");
65
+ $type = 'error';
66
+ break;
67
+
68
+ }
69
+ case 5: {
70
+ $message = __("Items Succesfully Deleted.", "contact_form_maker");
71
+ $type = 'updated';
72
+ break;
73
+
74
+ }
75
+ case 6: {
76
+ $message = __("You must select at least one item.", "contact_form_maker");
77
+ $type = 'error';
78
+ break;
79
+
80
+ }
81
+ case 7: {
82
+ $message = __("The item is successfully set as default.", "contact_form_maker");
83
+ $type = 'updated';
84
+ break;
85
+
86
+ }
87
+ case 8: {
88
+ $message = __("Options Succesfully Saved.", "contact_form_maker");
89
+ $type = 'updated';
90
+ break;
91
+
92
+ }
93
+ }
94
+ return '<div style="width: 99%;"><div class="' . $type . '"><p><strong>' . $message . '</strong></p></div></div>';
95
+ }
96
+ }
97
+
98
+ public static function message($message, $type, $form_id = 0) {
99
+ return '<div style="width: 100%;" class="contactform' . $form_id . '"><div class="' . $type . '"><p><strong>' . $message . '</strong></p></div></div>';
100
+ }
101
+
102
+ public static function search($search_by, $search_value, $form_id) {
103
+ ?>
104
+ <div class="alignleft actions" style="clear:both;">
105
+ <script>
106
+ function spider_search() {
107
+ document.getElementById("page_number").value = "1";
108
+ document.getElementById("search_or_not").value = "search";
109
+ document.getElementById("<?php echo $form_id; ?>").submit();
110
+ }
111
+ function spider_reset() {
112
+ if (document.getElementById("search_value")) {
113
+ document.getElementById("search_value").value = "";
114
+ }
115
+ if (document.getElementById("search_select_value")) {
116
+ document.getElementById("search_select_value").value = 0;
117
+ }
118
+ document.getElementById("<?php echo $form_id; ?>").submit();
119
+ }
120
+ </script>
121
+ <div class="fm-search">
122
+ <label for="search_value"><?php echo $search_by; ?>:</label>
123
+ <input type="text" id="search_value" name="search_value" value="<?php echo esc_html($search_value); ?>"/>
124
+ <button class="fm-icon search-icon" onclick="spider_search()">
125
+ </button>
126
+ <button class="fm-icon reset-icon" onclick="spider_reset()">
127
+ </button>
128
+ </div>
129
+ </div>
130
+ <?php
131
+ }
132
+
133
+ public static function search_select($search_by, $search_select_value, $playlists, $form_id) {
134
+ ?>
135
+ <div class="alignleft actions" style="clear:both;">
136
+ <script>
137
+ function spider_search_select() {
138
+ document.getElementById("page_number").value = "1";
139
+ document.getElementById("search_or_not").value = "search";
140
+ document.getElementById("<?php echo $form_id; ?>").submit();
141
+ }
142
+ </script>
143
+ <div class="alignleft actions" >
144
+ <label for="search_select_value" style="font-size:14px; width:50px; display:inline-block;"><?php echo $search_by; ?>:</label>
145
+ <select id="search_select_value" name="search_select_value" onchange="spider_search_select();" style="float: none; width: 150px;">
146
+ <?php
147
+ foreach ($playlists as $id => $playlist) {
148
+ ?>
149
+ <option value="<?php echo $id; ?>" <?php echo (($search_select_value == $id) ? 'selected="selected"' : ''); ?>><?php echo $playlist; ?></option>
150
+ <?php
151
+ }
152
+ ?>
153
+ </select>
154
+ </div>
155
+ </div>
156
+ <?php
157
+ }
158
+
159
+ public static function html_page_nav($count_items, $page_number, $form_id, $items_per_page = 20) {
160
+ $limit = 20;
161
+ if ($count_items) {
162
+ if ($count_items % $limit) {
163
+ $items_county = ($count_items - $count_items % $limit) / $limit + 1;
164
+ }
165
+ else {
166
+ $items_county = ($count_items - $count_items % $limit) / $limit;
167
+ }
168
+ }
169
+ else {
170
+ $items_county = 1;
171
+ }
172
+ ?>
173
+ <script type="text/javascript">
174
+ var items_county = <?php echo $items_county; ?>;
175
+ function spider_page(x, y) {
176
+ switch (y) {
177
+ case 1:
178
+ if (x >= items_county) {
179
+ document.getElementById('page_number').value = items_county;
180
+ }
181
+ else {
182
+ document.getElementById('page_number').value = x + 1;
183
+ }
184
+ break;
185
+ case 2:
186
+ document.getElementById('page_number').value = items_county;
187
+ break;
188
+ case -1:
189
+ if (x == 1) {
190
+ document.getElementById('page_number').value = 1;
191
+ }
192
+ else {
193
+ document.getElementById('page_number').value = x - 1;
194
+ }
195
+ break;
196
+ case -2:
197
+ document.getElementById('page_number').value = 1;
198
+ break;
199
+ default:
200
+ document.getElementById('page_number').value = 1;
201
+ }
202
+ document.getElementById('<?php echo $form_id; ?>').submit();
203
+ }
204
+ function check_enter_key(e) {
205
+ var key_code = (e.keyCode ? e.keyCode : e.which);
206
+ if (key_code == 13) { /*Enter keycode*/
207
+ if (jQuery('#current_page').val() >= items_county) {
208
+ document.getElementById('page_number').value = items_county;
209
+ }
210
+ else {
211
+ document.getElementById('page_number').value = jQuery('#current_page').val();
212
+ }
213
+ document.getElementById('<?php echo $form_id; ?>').submit();
214
+ }
215
+ return true;
216
+ }
217
+ </script>
218
+ <div class="tablenav-pages">
219
+ <span class="displaying-num">
220
+ <?php
221
+ if ($count_items != 0) {
222
+ echo $count_items; ?> <?php echo (($count_items == 1) ? __("item", "contact_form_maker") : __("items", "contact_form_maker"));
223
+ }
224
+ ?>
225
+ </span>
226
+ <?php
227
+ if ($count_items > $items_per_page) {
228
+ $first_page = "first-page";
229
+ $prev_page = "prev-page";
230
+ $next_page = "next-page";
231
+ $last_page = "last-page";
232
+ if ($page_number == 1) {
233
+ $first_page = "first-page disabled";
234
+ $prev_page = "prev-page disabled";
235
+ $next_page = "next-page";
236
+ $last_page = "last-page";
237
+ }
238
+ if ($page_number >= $items_county) {
239
+ $first_page = "first-page ";
240
+ $prev_page = "prev-page";
241
+ $next_page = "next-page disabled";
242
+ $last_page = "last-page disabled";
243
+ }
244
+ ?>
245
+ <span class="pagination-links">
246
+ <a class="<?php echo $first_page; ?>" title="<?php echo __("Go to the first page", "contact_form_maker"); ?>" href="javascript:spider_page(<?php echo $page_number; ?>,-2);">«</a>
247
+ <a class="<?php echo $prev_page; ?>" title="<?php echo __("Go to the previous page", "contact_form_maker"); ?>" href="javascript:spider_page(<?php echo $page_number; ?>,-1);">‹</a>
248
+ <span class="paging-input">
249
+ <span class="total-pages">
250
+ <input class="current_page" id="current_page" name="current_page" value="<?php echo $page_number; ?>" onkeypress="return check_enter_key(event)" title="<?php echo __("Go to the page", "contact_form_maker"); ?>" type="text" size="1" />
251
+ </span> <?php echo __("of","contact_form_maker"); ?>
252
+ <span class="total-pages">
253
+ <?php echo $items_county; ?>
254
+ </span>
255
+ </span>
256
+ <a class="<?php echo $next_page ?>" title="<?php echo __("Go to the next page", "contact_form_maker"); ?>" href="javascript:spider_page(<?php echo $page_number; ?>,1);">›</a>
257
+ <a class="<?php echo $last_page ?>" title="<?php echo __("Go to the last page", "contact_form_maker"); ?>" href="javascript:spider_page(<?php echo $page_number; ?>,2);">»</a>
258
+ <?php
259
+ }
260
+ ?>
261
+ </span>
262
+ </div>
263
+ <input type="hidden" id="page_number" name="page_number" value="<?php echo ((isset($_POST['page_number'])) ? (int) $_POST['page_number'] : 1); ?>" />
264
+ <input type="hidden" id="search_or_not" name="search_or_not" value="<?php echo ((isset($_POST['search_or_not'])) ? esc_html($_POST['search_or_not']) : ''); ?>"/>
265
+ <?php
266
+ }
267
+
268
+ public static function ajax_search($search_by, $search_value, $form_id) {
269
+ ?>
270
+ <div class="alignleft actions" style="clear:both;">
271
+ <script>
272
+ function spider_search() {
273
+ document.getElementById("page_number").value = "1";
274
+ document.getElementById("search_or_not").value = "search";
275
+ spider_ajax_save('<?php echo $form_id; ?>');
276
+ }
277
+ function spider_reset() {
278
+ if (document.getElementById("search_value")) {
279
+ document.getElementById("search_value").value = "";
280
+ }
281
+ spider_ajax_save('<?php echo $form_id; ?>');
282
+ }
283
+ </script>
284
+ <div class="alignleft actions" style="">
285
+ <label for="search_value" style="font-size:14px; width:60px; display:inline-block;"><?php echo $search_by; ?>:</label>
286
+ <input type="text" id="search_value" name="search_value" class="spider_search_value" value="<?php echo esc_html($search_value); ?>" style="width: 150px;<?php echo (get_bloginfo('version') > '3.7') ? ' height: 28px;' : ''; ?>" />
287
+ </div>
288
+ <div class="alignleft actions">
289
+ <input type="button" value="<?php echo __("Search", "contact_form_maker"); ?>" onclick="spider_search()" class="button-secondary action" />
290
+ <input type="button" value="<?php echo __("Reset", "contact_form_maker"); ?>" onclick="spider_reset()" class="button-secondary action" />
291
+ </div>
292
+ </div>
293
+ <?php
294
+ }
295
+
296
+ public static function ajax_html_page_nav($count_items, $page_number, $form_id) {
297
+ $limit = 20;
298
+ if ($count_items) {
299
+ if ($count_items % $limit) {
300
+ $items_county = ($count_items - $count_items % $limit) / $limit + 1;
301
+ }
302
+ else {
303
+ $items_county = ($count_items - $count_items % $limit) / $limit;
304
+ }
305
+ }
306
+ else {
307
+ $items_county = 1;
308
+ }
309
+ ?>
310
+ <script type="text/javascript">
311
+ var items_county = <?php echo $items_county; ?>;
312
+ function spider_page(x, y) {
313
+ switch (y) {
314
+ case 1:
315
+ if (x >= items_county) {
316
+ document.getElementById('page_number').value = items_county;
317
+ }
318
+ else {
319
+ document.getElementById('page_number').value = x + 1;
320
+ }
321
+ break;
322
+ case 2:
323
+ document.getElementById('page_number').value = items_county;
324
+ break;
325
+ case -1:
326
+ if (x == 1) {
327
+ document.getElementById('page_number').value = 1;
328
+ }
329
+ else {
330
+ document.getElementById('page_number').value = x - 1;
331
+ }
332
+ break;
333
+ case -2:
334
+ document.getElementById('page_number').value = 1;
335
+ break;
336
+ default:
337
+ document.getElementById('page_number').value = 1;
338
+ }
339
+ spider_ajax_save('<?php echo $form_id; ?>');
340
+ }
341
+ function check_enter_key(e) {
342
+ var key_code = (e.keyCode ? e.keyCode : e.which);
343
+ if (key_code == 13) { /*Enter keycode*/
344
+ if (jQuery('#current_page').val() >= items_county) {
345
+ document.getElementById('page_number').value = items_county;
346
+ }
347
+ else {
348
+ document.getElementById('page_number').value = jQuery('#current_page').val();
349
+ }
350
+ spider_ajax_save('<?php echo $form_id; ?>');
351
+ return false;
352
+ }
353
+ return true;
354
+ }
355
+ </script>
356
+ <div id="tablenav-pages" class="tablenav-pages">
357
+ <span class="displaying-num">
358
+ <?php
359
+ if ($count_items != 0) {
360
+ echo $count_items; ?> <?php echo (($count_items == 1) ? __("item", "contact_form_maker") : __("items", "contact_form_maker"));
361
+ }
362
+ ?>
363
+ </span>
364
+ <?php
365
+ if ($count_items > $limit) {
366
+ $first_page = "first-page";
367
+ $prev_page = "prev-page";
368
+ $next_page = "next-page";
369
+ $last_page = "last-page";
370
+ if ($page_number == 1) {
371
+ $first_page = "first-page disabled";
372
+ $prev_page = "prev-page disabled";
373
+ $next_page = "next-page";
374
+ $last_page = "last-page";
375
+ }
376
+ if ($page_number >= $items_county) {
377
+ $first_page = "first-page ";
378
+ $prev_page = "prev-page";
379
+ $next_page = "next-page disabled";
380
+ $last_page = "last-page disabled";
381
+ }
382
+ ?>
383
+ <span class="pagination-links">
384
+ <a class="<?php echo $first_page; ?>" title="<?php echo __("Go to the first page", "contact_form_maker"); ?>" onclick="spider_page(<?php echo $page_number; ?>,-2)">«</a>
385
+ <a class="<?php echo $prev_page; ?>" title="<?php echo __("Go to the previous page", "contact_form_maker"); ?>" onclick="spider_page(<?php echo $page_number; ?>,-1)">‹</a>
386
+ <span class="paging-input">
387
+ <span class="total-pages">
388
+ <input class="current_page" id="current_page" name="current_page" value="<?php echo $page_number; ?>" onkeypress="return check_enter_key(event)" title="<?php echo __("Go to the page", "contact_form_maker"); ?>" type="text" size="1" />
389
+ </span> <?php echo __("of","contact_form_maker"); ?>
390
+ <span class="total-pages">
391
+ <?php echo $items_county; ?>
392
+ </span>
393
+ </span>
394
+ <a class="<?php echo $next_page ?>" title="<?php echo __("Go to the next page", "contact_form_maker"); ?>" onclick="spider_page(<?php echo $page_number; ?>,1)">›</a>
395
+ <a class="<?php echo $last_page ?>" title="<?php echo __("Go to the last page", "contact_form_maker"); ?>" onclick="spider_page(<?php echo $page_number; ?>,2)">»</a>
396
+ <?php
397
+ }
398
+ ?>
399
+ </span>
400
+ </div>
401
+ <input type="hidden" id="page_number" name="page_number" value="<?php echo ((isset($_POST['page_number'])) ? (int) $_POST['page_number'] : 1); ?>" />
402
+ <input type="hidden" id="search_or_not" name="search_or_not" value="<?php echo ((isset($_POST['search_or_not'])) ? esc_html($_POST['search_or_not']) : ''); ?>"/>
403
+ <?php
404
+ }
405
+
406
+ public static function spider_redirect($url) {
407
+ $url = html_entity_decode(wp_nonce_url($url, 'nonce_cfm', 'nonce_cfm'));
408
+ ?>
409
+ <script>
410
+ window.location = "<?php echo $url; ?>";
411
+ </script>
412
+ <?php
413
+ exit();
414
+ }
415
+
416
+ public static function no_items($title) {
417
+ $title = ($title != '') ? strtolower($title) : 'items';
418
+ ob_start();
419
+ ?>
420
+ <tr class="no-items">
421
+ <td class="colspanchange" colspan="0"><?php echo sprintf(__('No %s found.', 'wds'), $title); ?></td>
422
+ </tr>
423
+ <?php
424
+ return ob_get_clean();
425
+ }
426
+ ////////////////////////////////////////////////////////////////////////////////////////
427
+ // Private Methods //
428
+ ////////////////////////////////////////////////////////////////////////////////////////
429
+ ////////////////////////////////////////////////////////////////////////////////////////
430
+ // Listeners //
431
+ ////////////////////////////////////////////////////////////////////////////////////////
432
  }
frontend/controllers/CFMControllerForm_maker.php CHANGED
@@ -1,46 +1,46 @@
1
- <?php
2
-
3
- class CFMControllerForm_maker {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute($id) {
22
- return $this->display($id);
23
- }
24
-
25
- public function display($id) {
26
- if (session_id() == '' || (function_exists('session_status') && (session_status() == PHP_SESSION_NONE))) {
27
- @session_start();
28
- }
29
- require_once WD_CFM_DIR . "/frontend/models/CFMModelForm_maker.php";
30
- $model = new CFMModelForm_maker();
31
-
32
- require_once WD_CFM_DIR . "/frontend/views/CFMViewForm_maker.php";
33
- $view = new CFMViewForm_maker($model);
34
-
35
- return $view->display($id);
36
- }
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Getters & Setters //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Private Methods //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
- ////////////////////////////////////////////////////////////////////////////////////////
44
- // Listeners //
45
- ////////////////////////////////////////////////////////////////////////////////////////
46
  }
1
+ <?php
2
+
3
+ class CFMControllerForm_maker {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute($id) {
22
+ return $this->display($id);
23
+ }
24
+
25
+ public function display($id) {
26
+ if (session_id() == '' || (function_exists('session_status') && (session_status() == PHP_SESSION_NONE))) {
27
+ @session_start();
28
+ }
29
+ require_once WD_CFM_DIR . "/frontend/models/CFMModelForm_maker.php";
30
+ $model = new CFMModelForm_maker();
31
+
32
+ require_once WD_CFM_DIR . "/frontend/views/CFMViewForm_maker.php";
33
+ $view = new CFMViewForm_maker($model);
34
+
35
+ return $view->display($id);
36
+ }
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Getters & Setters //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Private Methods //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ ////////////////////////////////////////////////////////////////////////////////////////
44
+ // Listeners //
45
+ ////////////////////////////////////////////////////////////////////////////////////////
46
  }
frontend/models/CFMModelForm_maker.php CHANGED
@@ -1,950 +1,950 @@
1
- <?php
2
-
3
- class CFMModelForm_maker {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function showform($id) {
22
- global $wpdb;
23
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'contactformmaker WHERE id="%d"', $id));
24
- if (!$row || !$row->published) {
25
- return FALSE;
26
- }
27
- if (isset($_GET['test_theme']) && (esc_html(stripslashes($_GET['test_theme'])) != '')) {
28
- /* From preview.*/
29
- $theme_id = esc_html(stripslashes($_GET['test_theme']));
30
- }
31
- else {
32
- $theme_id = $row->theme;
33
- }
34
- $form_theme = $wpdb->get_var($wpdb->prepare('SELECT css FROM ' . $wpdb->prefix . 'contactformmaker_themes WHERE id="%d"', $theme_id));
35
- if (!$form_theme) {
36
- $form_theme = $wpdb->get_var('SELECT css FROM ' . $wpdb->prefix . 'contactformmaker_themes');
37
- if (!$form_theme) {
38
- return FALSE;
39
- }
40
- }
41
- $pattern = '/\/\/(.+)(\r\n|\r|\n)/';
42
- $form_theme = preg_replace($pattern, ' ', $form_theme);
43
- $form_theme = str_replace('//', ' ', $form_theme);
44
- $label_id = array();
45
- $label_type = array();
46
- $label_all = explode('#****#', $row->label_order);
47
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
48
- foreach ($label_all as $key => $label_each) {
49
- $label_id_each = explode('#**id**#', $label_each);
50
- array_push($label_id, $label_id_each[0]);
51
- $label_order_each = explode('#**label**#', $label_id_each[1]);
52
- array_push($label_type, $label_order_each[1]);
53
- }
54
- return array(
55
- $row,
56
- 1,
57
- $label_id,
58
- $label_type,
59
- $form_theme
60
- );
61
- }
62
-
63
- public function savedata($form, $id) {
64
- $fm_settings = get_option('cfm_settings');
65
- $all_files = array();
66
- $correct = FALSE;
67
- $id_for_old = $id;
68
- if (!$form->form_front) {
69
- $id = '';
70
- }
71
- if (isset($_POST["counter" . $id])) {
72
- $counter = esc_html($_POST["counter" . $id]);
73
- if (isset($_POST["captcha_input"])) {
74
- $captcha_input = esc_html($_POST["captcha_input"]);
75
- $session_wd_captcha_code = isset($_SESSION[$id . '_wd_captcha_code']) ? $_SESSION[$id . '_wd_captcha_code'] : '-';
76
- if ($captcha_input == $session_wd_captcha_code) {
77
- $correct = TRUE;
78
- }
79
- else {
80
- ?>
81
- <script>alert("<?php echo addslashes(__('Error, incorrect Security code.', 'contact_form_maker')); ?>");</script>
82
- <?php
83
- }
84
- }
85
- elseif (isset($_POST["recaptcha_response_field"])) {
86
- $recaptcha_response_field = esc_html($_POST["recaptcha_response_field"]);
87
- $privatekey= isset($fm_settings['private_key']) ? $fm_settings['private_key'] : '';
88
- $recaptcha_challenge_field = ((isset($_POST['recaptcha_challenge_field'])) ? esc_html($_POST['recaptcha_challenge_field']) : '');
89
- require_once(WD_CFM_DIR . '/recaptchalib.php');
90
- $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $recaptcha_challenge_field, $recaptcha_response_field);
91
- if ($resp->is_valid) {
92
- $correct = TRUE;
93
- }
94
- else {
95
- ?>
96
- <script>alert("<?php echo addslashes(__('Error, incorrect Security code.', 'contact_form_maker')); ?>");</script>
97
- <?php
98
- }
99
- }
100
- elseif (isset($_POST["g-recaptcha-response"])) {
101
- $privatekey= isset($fm_settings['private_key']) ? $fm_settings['private_key'] : '';
102
- $w = stream_get_wrappers();
103
- if (in_array('https', $w)) {
104
- $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=" . $privatekey . "&response=" . $_POST['g-recaptcha-response']);
105
- $response = json_decode($response, true);
106
- if ($response["success"] === true) {
107
- $correct = TRUE;
108
- }
109
- else {
110
- ?>
111
- <script>alert("<?php echo addslashes(__('Error, incorrect Security code.', 'contact_form_maker')); ?>");</script>
112
- <?php
113
- }
114
- }
115
- else {
116
- ?>
117
- <script>alert("<?php echo addslashes(__('`php_openssl` extension is not enabled.', 'contact_form_maker')); ?>");</script>
118
- <?php
119
- }
120
- }
121
- else {
122
- $correct = TRUE;
123
- }
124
- if ($correct) {
125
- $ip = $_SERVER['REMOTE_ADDR'];
126
- global $wpdb;
127
- $blocked_ip = $wpdb->get_var($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'contactformmaker_blocked WHERE ip="%s"', $ip));
128
- if ($blocked_ip) {
129
- $_SESSION['cfm_massage_after_submit' . $id] = addslashes(__('Your ip is blacklisted. Please contact the website administrator.', 'contact_form_maker'));
130
- wp_redirect($_SERVER["REQUEST_URI"]);
131
- exit;
132
- }
133
-
134
- $all_files = $this->save_db($counter, $id_for_old);
135
- if (is_numeric($all_files)) {
136
- $this->remove($all_files, $id_for_old);
137
- }
138
- elseif (isset($counter)) {
139
- $this->gen_mail($counter, $all_files, $id_for_old);
140
- }
141
- }
142
- return $all_files;
143
- }
144
- return $all_files;
145
- }
146
-
147
- public function save_db($counter, $id) {
148
- global $wpdb;
149
- $chgnac = TRUE;
150
- $all_files = array();
151
- $form = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "contactformmaker WHERE id= %d", $id));
152
- $id_old = $id;
153
- if (!$form->form_front) {
154
- $id = '';
155
- }
156
- $label_id = array();
157
- $label_label = array();
158
- $label_type = array();
159
- $label_all = explode('#****#',$form->label_order_current);
160
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
161
- foreach ($label_all as $key => $label_each) {
162
- $label_id_each = explode('#**id**#', $label_each);
163
- array_push($label_id, $label_id_each[0]);
164
- $label_order_each = explode('#**label**#', $label_id_each[1]);
165
- array_push($label_label, $label_order_each[0]);
166
- array_push($label_type, $label_order_each[1]);
167
- }
168
- $disabled_fields = explode(',', $form->disabled_fields);
169
- $disabled_fields = array_slice($disabled_fields, 0, count($disabled_fields) - 1);
170
- $max = $wpdb->get_var("SELECT MAX( group_id ) FROM " . $wpdb->prefix . "contactformmaker_submits");
171
- foreach ($label_type as $key => $type) {
172
- $value = '';
173
- if ($type == "type_submit_reset" or $type == "type_map" or $type == "type_editor" or $type == "type_captcha" or $type == "type_recaptcha" or $type == "type_send_copy") {
174
- continue;
175
- }
176
- $i = $label_id[$key];
177
- if (!in_array($i, $disabled_fields)) {
178
- switch ($type) {
179
- case 'type_text':
180
- case 'type_password':
181
- case 'type_textarea':
182
- case "type_submitter_mail":
183
- case "type_own_select":
184
- case "type_number": {
185
- $value = isset($_POST['wdform_'.$i."_element".$id]) ? esc_html($_POST['wdform_'.$i."_element".$id]) : "";
186
- break;
187
- }
188
- case "type_phone": {
189
- $value = (isset($_POST['wdform_'.$i."_element_first".$id]) ? esc_html($_POST['wdform_'.$i."_element_first".$id]) : "") . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? esc_html($_POST['wdform_'.$i."_element_last".$id]) : "");
190
- break;
191
- }
192
- case "type_name": {
193
- $element_title = isset($_POST['wdform_'.$i."_element_title".$id]) ? esc_html($_POST['wdform_'.$i."_element_title".$id]) : NULL;
194
- if (isset($element_title)) {
195
- $value = (isset($_POST['wdform_'.$i."_element_title".$id]) ? esc_html($_POST['wdform_'.$i."_element_title".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_first".$id]) ? esc_html($_POST['wdform_'.$i."_element_first".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? esc_html($_POST['wdform_'.$i."_element_last".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_middle".$id]) ? esc_html($_POST['wdform_'.$i."_element_middle".$id]) : "");
196
- }
197
- else {
198
- $value = (isset($_POST['wdform_'.$i."_element_first".$id]) ? esc_html($_POST['wdform_'.$i."_element_first".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? esc_html($_POST['wdform_'.$i."_element_last".$id]) : "");
199
- }
200
- break;
201
- }
202
- case 'type_address': {
203
- $value = '*#*#*#';
204
- $element = isset($_POST['wdform_'.$i."_street1".$id]) ? esc_html($_POST['wdform_'.$i."_street1".$id]) : NULL;
205
- if (isset($element)) {
206
- $value = $element;
207
- break;
208
- }
209
-
210
- $element = isset($_POST['wdform_'.$i."_street2".$id]) ? esc_html($_POST['wdform_'.$i."_street2".$id]) : NULL;
211
- if (isset($element)) {
212
- $value = $element;
213
- break;
214
- }
215
-
216
- $element = isset($_POST['wdform_'.$i."_city".$id]) ? esc_html($_POST['wdform_'.$i."_city".$id]) : NULL;
217
- if(isset($element)) {
218
- $value = $element;
219
- break;
220
- }
221
-
222
- $element = isset($_POST['wdform_'.$i."_state".$id]) ? esc_html($_POST['wdform_'.$i."_state".$id]) : NULL;
223
- if(isset($element)) {
224
- $value = $element;
225
- break;
226
- }
227
-
228
- $element = isset($_POST['wdform_'.$i."_postal".$id]) ? esc_html($_POST['wdform_'.$i."_postal".$id]) : NULL;
229
- if(isset($element)) {
230
- $value = $element;
231
- break;
232
- }
233
-
234
- $element = isset($_POST['wdform_'.$i."_country".$id]) ? esc_html($_POST['wdform_'.$i."_country".$id]) : NULL;
235
- if(isset($element)) {
236
- $value = $element;
237
- break;
238
- }
239
- break;
240
- }
241
- case "type_radio": {
242
- $element = isset($_POST['wdform_'.$i."_other_input".$id]) ? esc_html($_POST['wdform_'.$i."_other_input".$id]) : NULL;
243
- if(isset($element)) {
244
- $value = $element;
245
- break;
246
- }
247
- $value = isset($_POST['wdform_'.$i."_element".$id]) ? esc_html($_POST['wdform_'.$i."_element".$id]) : "";
248
- break;
249
- }
250
- case "type_checkbox": {
251
- $start = -1;
252
- $value = '';
253
- for($j = 0; $j < 100; $j++) {
254
- $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? esc_html($_POST['wdform_'.$i."_element".$id.$j]) : NULL;
255
- if(isset($element)) {
256
- $start = $j;
257
- break;
258
- }
259
- }
260
-
261
- $other_element_id = -1;
262
- $is_other = isset($_POST['wdform_'.$i."_allow_other".$id]) ? esc_html($_POST['wdform_'.$i."_allow_other".$id]) : "";
263
- if($is_other == "yes") {
264
- $other_element_id = isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? esc_html($_POST['wdform_'.$i."_allow_other_num".$id]) : "";
265
- }
266
-
267
- if($start != -1) {
268
- for($j = $start; $j < 100; $j++) {
269
- $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? esc_html($_POST['wdform_'.$i."_element".$id.$j]) : NULL;
270
- if(isset($element)) {
271
- if($j == $other_element_id) {
272
- $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? esc_html($_POST['wdform_'.$i."_other_input".$id]) : "") . '***br***';
273
- }
274
- else {
275
- $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? esc_html($_POST['wdform_'.$i."_element".$id.$j]) : "") . '***br***';
276
- }
277
- }
278
- }
279
- }
280
- break;
281
- }
282
- }
283
- if ($type == "type_address") {
284
- if( $value == '*#*#*#') {
285
- continue;
286
- }
287
- }
288
- if ($type == "type_text" or $type == "type_password" or $type == "type_textarea" or $type == "type_name" or $type == "type_submitter_mail" or $type == "type_number" or $type == "type_phone") {
289
- $untilupload = $form->form_fields;
290
- $untilupload = substr($untilupload, strpos($untilupload, $i.'*:*id*:*'.$type), -1);
291
- $untilupload = substr($untilupload, 0, strpos($untilupload, '*:*new_field*:'));
292
- $untilupload = explode('*:*w_required*:*', $untilupload);
293
- $untilupload = $untilupload[1];
294
- $untilupload = explode('*:*w_unique*:*', $untilupload);
295
- $unique_element = $untilupload[0];
296
- if ($unique_element == 'yes') {
297
- $unique = $wpdb->get_col($wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "contactformmaker_submits WHERE form_id= %d and element_label= %s and element_value= %s", $id, $i, addslashes($value)));
298
- if ($unique) {
299
- echo "<script> alert('" . addslashes(__('This field %s requires a unique entry and this value was already submitted.', 'contact_form_maker')) . "'.replace('%s','" . $label_label[$key] . "'));</script>";
300
- return array($max + 1);
301
- }
302
- }
303
- }
304
- if ($form->savedb) {
305
- $save_or_no = $wpdb->insert($wpdb->prefix . "contactformmaker_submits", array(
306
- 'form_id' => $id,
307
- 'element_label' => $i,
308
- 'element_value' => stripslashes($value),
309
- 'group_id' => ($max + 1),
310
- 'date' => date('Y-m-d H:i:s'),
311
- 'ip' => $_SERVER['REMOTE_ADDR'],
312
- ), array(
313
- '%d',
314
- '%s',
315
- '%s',
316
- '%d',
317
- '%s',
318
- '%s'
319
- ));
320
- }
321
- if (!$save_or_no) {
322
- return FALSE;
323
- }
324
- $chgnac = FALSE;
325
- }
326
- }
327
- if ($chgnac) {
328
- global $wpdb;
329
- if ($form->submit_text_type != 4) {
330
- $_SESSION['cfm_massage_after_submit' . $id] = addslashes(addslashes(__('Nothing was submitted.', 'contact_form_maker')));
331
- }
332
- $_SESSION['cfm_error_or_no' . $id] = 1;
333
- $_SESSION['cfm_form_submit_type' . $id] = $form->submit_text_type . "," . $form->id;
334
- wp_redirect($_SERVER["REQUEST_URI"]);
335
- exit;
336
- }
337
- return array($all_files);
338
- }
339
-
340
- public function remove($group_id) {
341
- global $wpdb;
342
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'contactformmaker_submits WHERE group_id= %d', $group_id));
343
- }
344
-
345
- public function get_after_submission_text($form_id) {
346
- global $wpdb;
347
- return $wpdb->get_var("SELECT submit_text FROM " . $wpdb->prefix . "contactformmaker WHERE id='" . $form_id . "'");
348
- }
349
-
350
- public function increment_views_count($id) {
351
- global $wpdb;
352
- $vives_form = $wpdb->get_var($wpdb->prepare("SELECT views FROM " . $wpdb->prefix . "contactformmaker_views WHERE form_id=%d", $id));
353
- if (isset($vives_form)) {
354
- $vives_form = $vives_form + 1;
355
- $wpdb->update($wpdb->prefix . "contactformmaker_views", array(
356
- 'views' => $vives_form,
357
- ), array('form_id' => $id), array(
358
- '%d',
359
- ), array('%d'));
360
- }
361
- else {
362
- $wpdb->insert($wpdb->prefix . 'contactformmaker_views', array(
363
- 'form_id' => $id,
364
- 'views' => 1
365
- ), array(
366
- '%d',
367
- '%d'
368
- ));
369
- }
370
- }
371
-
372
- public function gen_mail($counter, $all_files, $id) {
373
- global $wpdb;
374
- $row = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "contactformmaker WHERE id=%d", $id));
375
- if (!$row->form_front) {
376
- $id = '';
377
- }
378
- $ip = $_SERVER['REMOTE_ADDR'];
379
- $replyto = '';
380
- $label_order_original = array();
381
- $label_order_ids = array();
382
- $label_label = array();
383
- $label_type = array();
384
- $cc = array();
385
- $row_mail_one_time = 1;
386
- $label_type = array();
387
- $label_all = explode('#****#', $row->label_order_current);
388
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
389
- foreach ($label_all as $key => $label_each) {
390
- $label_id_each = explode('#**id**#', $label_each);
391
- $label_id = $label_id_each[0];
392
- array_push($label_order_ids, $label_id);
393
- $label_order_each = explode('#**label**#', $label_id_each[1]);
394
- $label_order_original[$label_id] = $label_order_each[0];
395
- $label_type[$label_id] = $label_order_each[1];
396
- array_push($label_label, $label_order_each[0]);
397
- array_push($label_type, $label_order_each[1]);
398
- }
399
- $disabled_fields = explode(',', $row->disabled_fields);
400
- $disabled_fields = array_slice($disabled_fields, 0, count($disabled_fields) - 1);
401
- $list = '<table border="1" cellpadding="3" cellspacing="0" style="width:600px;">';
402
- $list_text_mode = '';
403
- foreach ($label_order_ids as $key => $label_order_id) {
404
- $i = $label_order_id;
405
- $type = $label_type[$i];
406
- if ($type != "type_map" and $type != "type_submit_reset" and $type != "type_editor" and $type != "type_captcha" and $type != "type_recaptcha" and $type != "type_send_copy") {
407
- $element_label = $label_order_original[$i];
408
- if (!in_array($i, $disabled_fields)) {
409
- switch ($type) {
410
- case 'type_text':
411
- case 'type_password':
412
- case 'type_textarea':
413
- case "type_own_select":
414
- case "type_number": {
415
- $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
416
- if (isset($element)) {
417
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td><pre style="font-family:inherit; margin:0px; padding:0px">' . $element . '</pre></td></tr>';
418
- $list_text_mode .= $element_label . ' - ' . $element . "\r\n";
419
- }
420
- break;
421
- }
422
- case "type_submitter_mail": {
423
- $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
424
- if (isset($element)) {
425
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">' . $element . '</pre></td></tr>';
426
- $list_text_mode .= $element_label . ' - ' . $element . "\r\n";
427
- }
428
- break;
429
- }
430
- case "type_phone": {
431
- $element_first = isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL;
432
- if (isset($element_first)) {
433
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element_first . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "") . '</td></tr>';
434
- $list_text_mode .= $element_label . ' - ' . $element_first . ' ' . (isset($_POST['wdform_' . $i . "_element_last" . $id]) ? $_POST['wdform_' . $i . "_element_last" . $id] : "") . "\r\n";
435
- }
436
- break;
437
- }
438
- case "type_name": {
439
- $element_first = isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL;
440
- if (isset($element_first)) {
441
- $element_title = isset($_POST['wdform_'.$i."_element_title".$id]) ? $_POST['wdform_'.$i."_element_title".$id] : NULL;
442
- if (isset($element_title)) {
443
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element_title . ' ' . $element_first . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "") . ' ' . (isset($_POST['wdform_'.$i."_element_middle".$id]) ? $_POST['wdform_'.$i."_element_middle".$id] : "") . '</td></tr>';
444
- $list_text_mode .= $element_label . ' - ' . $element_title . ' ' . $element_first . ' ' . (isset($_POST['wdform_' . $i . "_element_last" . $id]) ? $_POST['wdform_' . $i . "_element_last" . $id] : "") . ' ' . (isset($_POST['wdform_' . $i . "_element_middle" . $id]) ? $_POST['wdform_' . $i . "_element_middle" . $id] : "") . "\r\n";
445
- }
446
- else {
447
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element_first . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "") . '</td></tr>';
448
- $list_text_mode .= $element_label . ' - ' . $element_first . ' ' . (isset($_POST['wdform_' . $i . "_element_last" . $id]) ? $_POST['wdform_' . $i . "_element_last" . $id] : "") . "\r\n";
449
- }
450
- }
451
- break;
452
- }
453
- case "type_address": {
454
- $element = isset($_POST['wdform_'.$i."_street1".$id]) ? $_POST['wdform_'.$i."_street1".$id] : NULL;
455
- if (isset($element)) {
456
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
457
- $list_text_mode .= $label_order_original[$i] . ' - ' . $element . "\r\n";
458
- break;
459
- }
460
- $element = isset($_POST['wdform_'.$i."_street2".$id]) ? $_POST['wdform_'.$i."_street2".$id] : NULL;
461
- if (isset($element)) {
462
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
463
- $list_text_mode .= $label_order_original[$i] . ' - ' . $element . "\r\n";
464
- break;
465
- }
466
- $element = isset($_POST['wdform_'.$i."_city".$id]) ? $_POST['wdform_'.$i."_city".$id] : NULL;
467
- if (isset($element)) {
468
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
469
- $list_text_mode .= $label_order_original[$i] . ' - ' . $element . "\r\n";
470
- break;
471
- }
472
- $element = isset($_POST['wdform_'.$i."_state".$id]) ? $_POST['wdform_'.$i."_state".$id] : NULL;
473
- if (isset($element)) {
474
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
475
- $list_text_mode .= $label_order_original[$i] . ' - ' . $element . "\r\n";
476
- break;
477
- }
478
- $element = isset($_POST['wdform_'.$i."_postal".$id]) ? $_POST['wdform_'.$i."_postal".$id] : NULL;
479
- if (isset($element)) {
480
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
481
- $list_text_mode .= $label_order_original[$i] . ' - ' . $element . "\r\n";
482
- break;
483
- }
484
- $element = isset($_POST['wdform_'.$i."_country".$id]) ? $_POST['wdform_'.$i."_country".$id] : NULL;
485
- if (isset($element)) {
486
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
487
- $list_text_mode .= $label_order_original[$i] . ' - ' . $element . "\r\n";
488
- break;
489
- }
490
- break;
491
- }
492
- case "type_radio": {
493
- $element = isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL;
494
- if (isset($element)) {
495
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
496
- $list_text_mode .= $element_label . ' - ' . $element . "\r\n";
497
- break;
498
- }
499
- $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
500
- if(isset($element)) {
501
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">' . $element . '</pre></td></tr>';
502
- $list_text_mode .= $element_label . ' - ' . $element . "\r\n";
503
- }
504
- break;
505
- }
506
- case "type_checkbox": {
507
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >';
508
- $list_text_mode .= $element_label . ' - ';
509
- $start = -1;
510
- for ($j = 0; $j < 100; $j++) {
511
- $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
512
- if (isset($element)) {
513
- $start = $j;
514
- break;
515
- }
516
- }
517
- $other_element_id = -1;
518
- $is_other = isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : "";
519
- if ($is_other == "yes") {
520
- $other_element_id = isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : "";
521
- }
522
- if ($start != -1) {
523
- for ($j = $start; $j < 100; $j++) {
524
- $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
525
- if (isset($element)) {
526
- if ($j == $other_element_id) {
527
- $list = $list . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : "") . '<br>';
528
- $list_text_mode .= (isset($_POST['wdform_' . $i . "_other_input" . $id]) ? $_POST['wdform_' . $i . "_other_input" . $id] : "") . ', ';
529
- }
530
- else {
531
- $list = $list . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : "") . '<br>';
532
- $list_text_mode .= (isset($_POST['wdform_' . $i . "_element" . $id . $j]) ? $_POST['wdform_' . $i . "_element" . $id . $j] : "") . ', ';
533
- }
534
- }
535
- }
536
- $list = $list . '</td></tr>';
537
- }
538
- break;
539
- }
540
- default: break;
541
- }
542
- }
543
- }
544
- }
545
- $list = $list . '</table>';
546
- // $list = wordwrap($list, 70, "\n", TRUE);
547
-
548
-
549
- if ($row->sendemail) {
550
- if ($row->send_to) {
551
- $fromname = $row->mail_from_name_user;
552
- if ($row->mail_subject_user) {
553
- $subject = $row->mail_subject_user;
554
- }
555
- else {
556
- $subject = $row->title;
557
- }
558
- /*if (isset($_REQUEST['wdform_22_element' . $id])) {
559
- $subject = ($row->title) . ' : ' . $_REQUEST['wdform_22_element' . $id];
560
- }
561
- else {
562
- $subject = $row->title;
563
- }*/
564
- if ($row->reply_to_user) {
565
- $replyto = $row->reply_to_user;
566
- }
567
- if ($row->mail_mode_user) {
568
- $content_type = "text/html";
569
- $list_user = wordwrap($list, 70, "\n", TRUE);
570
- $new_script = $row->script_mail_user;
571
- }
572
- else {
573
- $content_type = "text/plain";
574
- $list_user = wordwrap($list_text_mode, 1000, "\n", TRUE);
575
- $new_script = str_replace(array('<p>', '</p>'), '', $row->script_mail_user);
576
- }
577
- foreach ($label_order_original as $key => $label_each) {
578
- $type = $label_type[$key];
579
- if (strpos($row->script_mail_user, "%" . $label_each . "%") !== FALSE && !in_array($key,$disabled_fields)) {
580
- $new_value = $this->custom_fields_mail($type, $key, $id);
581
- $new_script = str_replace("%" . $label_each . "%", $new_value, $new_script);
582
- }
583
- if (strpos($fromname, "%" . $label_each . "%") !== FALSE && !in_array($key,$disabled_fields)) {
584
- $new_value = str_replace('<br>', ', ', $this->custom_fields_mail($type, $key, $id));
585
- if (substr($new_value, -2) == ', ') {
586
- $new_value = substr($new_value, 0, -2);
587
- }
588
- $fromname = str_replace("%" . $label_each . "%", $new_value, $fromname);
589
- }
590
- if (strpos($subject, "%" . $label_each . "%") > -1) {
591
- $new_value = str_replace('<br>', ', ', $this->custom_fields_mail($type, $key, $id));
592
- if (substr($new_value, -2) == ', ') {
593
- $new_value = substr($new_value, 0, -2);
594
- }
595
- $subject = str_replace("%" . $label_each . "%", $new_value, $subject);
596
- }
597
- }
598
- $recipient = '';
599
- $cca = $row->mail_cc_user;
600
- $bcc = $row->mail_bcc_user;
601
- $send_tos = explode('**', $row->send_to);
602
- if ($row->mail_from_user != '') {
603
- if ($row->mail_from_name_user != '') {
604
- $from = "From: '" . htmlspecialchars_decode($row->mail_from_name_user, ENT_QUOTES) . "' <" . $row->mail_from_user . ">" . "\r\n";
605
- }
606
- else {
607
- $from = "From: '" . $row->mail_from_user . "' <" . $row->mail_from_user . ">" . "\r\n";
608
- }
609
- }
610
- else {
611
- $from = '';
612
- }
613
-
614
- $headers = ''; //'MIME-Version: 1.0' . "\r\n";
615
- $headers .= $from;
616
- $headers .= 'Content-type: ' . $content_type . '; charset="' . get_option('blog_charset') . '"' . "\r\n";
617
-
618
- if ($replyto) {
619
- $headers .= "Reply-To: <" . $replyto . ">\r\n";
620
- }
621
- if ($cca) {
622
- $headers .= "Cc: " . $cca . "\r\n";
623
- }
624
- if ($bcc) {
625
- $headers .= "Bcc: " . $bcc . "\r\n";
626
- }
627
- if (strpos($new_script, "%ip%") > -1) {
628
- $new_script = str_replace("%ip%", $ip, $new_script);
629
- }
630
- if (strpos($new_script, "%all%") > -1) {
631
- $new_script = str_replace("%all%", $list_user, $new_script);
632
- }
633
- $body = $new_script;
634
- $send_copy = isset($_POST["wdform_send_copy_".$id]) ? $_POST["wdform_send_copy_".$id] : NULL;
635
- if (isset($send_copy)) {
636
- $send = TRUE;
637
- }
638
- else {
639
- foreach ($send_tos as $send_to) {
640
- $recipient = isset($_POST['wdform_'.str_replace('*', '', $send_to)."_element".$id]) ? $_POST['wdform_'.str_replace('*', '', $send_to)."_element".$id] : NULL;
641
- if ($recipient) {
642
- if ($row->wpmail) {
643
- $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers);
644
- }
645
- else {
646
- $send = mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers);
647
- }
648
- }
649
- }
650
- }
651
- }
652
- }
653
-
654
- if ($row->sendemail) {
655
- if ($row->mail) {
656
- if ($row->reply_to) {
657
- $replyto = isset($_POST['wdform_'.$row->reply_to."_element".$id]) ? $_POST['wdform_'.$row->reply_to."_element".$id] : NULL;
658
- if (!isset($replyto)) {
659
- $replyto = $row->reply_to;
660
- }
661
- }
662
- $recipient = $row->mail;
663
- /*if (isset($_REQUEST['wdform_22_element' . $id])) {
664
- $subject = $row->title . ' : ' . $_REQUEST['wdform_22_element' . $id];
665
- }
666
- else {
667
- $subject = $row->title;
668
- }*/
669
- if ($row->mail_subject) {
670
- $subject = $row->mail_subject;
671
- }
672
- else {
673
- $subject = $row->title;
674
- }
675
- if ($row->mail_from_name) {
676
- $fromname = $row->mail_from_name;
677
- }
678
- else {
679
- $fromname = '';
680
- }
681
- if ($row->mail_mode) {
682
- $content_type = "text/html";
683
- $list = wordwrap($list, 70, "\n", TRUE);
684
- $new_script = $row->script_mail;
685
- }
686
- else {
687
- $content_type = "text/plain";
688
- $list = $list_text_mode;
689
- $list = wordwrap($list, 1000, "\n", TRUE);
690
- $new_script = str_replace(array('<p>', '</p>'), '', $row->script_mail);
691
- }
692
- foreach ($label_order_original as $key => $label_each) {
693
- $type = $label_type[$key];
694
- if (strpos($row->script_mail, "%" . $label_each . "%") !== FALSE && !in_array($key,$disabled_fields)) {
695
- $new_value = $this->custom_fields_mail($type, $key, $id);
696
- $new_script = str_replace("%" . $label_each . "%", $new_value, $new_script);
697
- }
698
- if (strpos($fromname, "%" . $label_each . "%") !== FALSE && !in_array($key,$disabled_fields)) {
699
- $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id));
700
- if (substr($new_value, -2) == ', ') {
701
- $new_value = substr($new_value, 0, -2);
702
- }
703
- $fromname = str_replace("%".$label_each."%", $new_value, $fromname);
704
- }
705
- if (strpos($subject, "%" . $label_each . "%") > -1) {
706
- $new_value = str_replace('<br>', ', ', $this->custom_fields_mail($type, $key, $id));
707
- if (substr($new_value, -2) == ', ') {
708
- $new_value = substr($new_value, 0, -2);
709
- }
710
- $subject = str_replace("%" . $label_each . "%", $new_value, $subject);
711
- }
712
- }
713
- if ($row->mail_from) {
714
- $from = isset($_POST['wdform_' . $row->mail_from . "_element" . $id]) ? $_POST['wdform_' . $row->mail_from . "_element" . $id] : NULL;
715
- if (!isset($from)) {
716
- $from = $row->mail_from;
717
- }
718
- $from = "From: '" . htmlspecialchars_decode($fromname, ENT_QUOTES) . "' <" . $from . ">" . "\r\n";
719
- }
720
- else {
721
- $from = "";
722
- }
723
-
724
- $headers = ''; //'MIME-Version: 1.0' . "\r\n";
725
- $headers .= $from;
726
- $headers .= 'Content-type: ' . $content_type . '; charset="' . get_option('blog_charset') . '"' . "\r\n";
727
-
728
- if ($replyto) {
729
- $headers .= "Reply-To: <" . $replyto . ">\r\n";
730
- }
731
- $cca = $row->mail_cc;
732
- $bcc = $row->mail_bcc;
733
- if ($cca) {
734
- $headers .= "Cc: " . $cca . "\r\n";
735
- }
736
- if ($bcc) {
737
- $headers .= "Bcc: " . $bcc . "\r\n";
738
- }
739
- if (strpos($new_script, "%ip%") > -1) {
740
- $new_script = str_replace("%ip%", $ip, $new_script);
741
- }
742
- if (strpos($new_script, "%all%") > -1) {
743
- $new_script = str_replace("%all%", $list, $new_script);
744
- }
745
- $body = $new_script;
746
- if ($row->sendemail) {
747
- if ($row->wpmail) {
748
- $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers);
749
- }
750
- else {
751
- $send = mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers);
752
- }
753
- }
754
- }
755
- }
756
-
757
- $_SESSION['cfm_error_or_no' . $id] = 0;
758
- $msg = addslashes(__('Your form was successfully submitted.', 'contact_form_maker'));
759
- $succes = 1;
760
-
761
- if ($row->sendemail) {
762
- if ($row->mail || $row->send_to) {
763
- if ($send) {
764
- if ($send !== TRUE) {
765
- $_SESSION['cfm_error_or_no' . $id] = 1;
766
- $msg = addslashes(__('Error, email was not sent.', 'contact_form_maker'));
767
- $succes = 0;
768
- }
769
- else {
770
- $_SESSION['cfm_error_or_no' . $id] = 0;
771
- $msg = addslashes(__('Your form was successfully submitted.', 'contact_form_maker'));
772
- }
773
- }
774
- }
775
- }
776
-
777
- $https = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://');
778
- switch ($row->submit_text_type) {
779
- case "2":
780
- case "5": {
781
- if ($row->submit_text_type != 4) {
782
- $_SESSION['cfm_massage_after_submit' . $id] = $msg;
783
- }
784
- $_SESSION['cfm_form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
785
- if ($row->article_id) {
786
- $redirect_url = $row->article_id;
787
- }
788
- else {
789
- $redirect_url = $https . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
790
- }
791
- break;
792
- }
793
- case "3": {
794
- if ($row->submit_text_type != 4) {
795
- $_SESSION['cfm_massage_after_submit' . $id] = $msg;
796
- }
797
- $_SESSION['cfm_form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
798
- $redirect_url = $https . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
799
- break;
800
- }
801
- case "4": {
802
- if ($row->submit_text_type != 4) {
803
- $_SESSION['cfm_massage_after_submit' . $id] = $msg;
804
- }
805
- $_SESSION['cfm_form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
806
- $redirect_url = $row->url;
807
- break;
808
- }
809
- default: {
810
- if ($row->submit_text_type != 4) {
811
- $_SESSION['cfm_massage_after_submit' . $id] = $msg;
812
- }
813
- $_SESSION['cfm_form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
814
- $redirect_url = $https . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
815
- break;
816
- }
817
- }
818
- wp_redirect($redirect_url);
819
- exit;
820
- }
821
-
822
- public function custom_fields_mail($type, $key, $id) {
823
- $new_value = "";
824
- if ($type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type != "type_captcha" or $type != "type_recaptcha" or $type != "type_button") {
825
- switch ($type) {
826
- case 'type_text':
827
- case 'type_password':
828
- case 'type_textarea':
829
- case 'type_own_select':
830
- case 'type_number': {
831
- if (isset($_POST['wdform_' . $key . "_element" . $id])) {
832
- $new_value = $_POST['wdform_'.$key."_element".$id];
833
- }
834
- break;
835
- }
836
- case "type_submitter_mail": {
837
- if (isset($_POST['wdform_' . $key . "_element" . $id])) {
838
- $new_value = $_POST['wdform_' . $key . "_element" . $id];
839
- }
840
- break;
841
- }
842
- case "type_phone": {
843
- if (isset($_POST['wdform_' . $key . "_element_first" . $id])) {
844
- $new_value = $_POST['wdform_'.$key."_element_first".$id] . ' ' . (isset($_POST['wdform_'.$key."_element_last".$id]) ? $_POST['wdform_'.$key."_element_last".$id] : "");
845
- }
846
- break;
847
- }
848
- case "type_name": {
849
- $element_first = isset($_POST['wdform_'.$key."_element_first".$id]) ? $_POST['wdform_'.$key."_element_first".$id] : NULL;
850
- if (isset($element_first)) {
851
- $element_title = isset($_POST['wdform_'.$key."_element_title".$id]) ? $_POST['wdform_'.$key."_element_title".$id] : NULL;
852
- if (isset($element_title)) {
853
- $new_value = $element_title . ' ' . $element_first . ' ' . (isset($_POST['wdform_'.$key."_element_last".$id]) ? $_POST['wdform_'.$key."_element_last".$id] : "") . ' ' . (isset($_POST['wdform_'.$key."_element_middle".$id]) ? $_POST['wdform_'.$key."_element_middle".$id] : "");
854
- }
855
- else {
856
- $new_value = $element_first . ' ' . (isset($_POST['wdform_'.$key."_element_last".$id]) ? $_POST['wdform_'.$key."_element_last".$id] : "");
857
- }
858
- }
859
- break;
860
- }
861
- case "type_address": {
862
- $street1 = isset($_POST['wdform_'.$key."_street1".$id]) ? $_POST['wdform_'.$key."_street1".$id] : NULL;
863
- if (isset($street1)) {
864
- $new_value = $street1;
865
- break;
866
- }
867
- $street2 = isset($_POST['wdform_'.$key."_street2".$id]) ? $_POST['wdform_'.$key."_street2".$id] : NULL;
868
- if (isset($street2)) {
869
- $new_value = $street2;
870
- break;
871
- }
872
- $city = isset($_POST['wdform_'.$key."_city".$id]) ? $_POST['wdform_'.$key."_city".$id] : NULL;
873
- if (isset($city)) {
874
- $new_value = $city;
875
- break;
876
- }
877
- $state = isset($_POST['wdform_'.$key."_state".$id]) ? $_POST['wdform_'.$key."_state".$id] : NULL;
878
- if (isset($state)) {
879
- $new_value = $state;
880
- break;
881
- }
882
- $postal = isset($_POST['wdform_'.$key."_postal".$id]) ? $_POST['wdform_'.$key."_postal".$id] : NULL;
883
- if (isset($postal)) {
884
- $new_value = $postal;
885
- break;
886
- }
887
- $country = isset($_POST['wdform_'.$key."_country".$id]) ? $_POST['wdform_'.$key."_country".$id] : NULL;
888
- if (isset($country)) {
889
- $new_value = $country;
890
- break;
891
- }
892
- break;
893
- }
894
- case "type_radio": {
895
- $element = isset($_POST['wdform_'.$key."_other_input".$id]) ? $_POST['wdform_'.$key."_other_input".$id] : NULL;
896
- if (isset($element)) {
897
- $new_value = $element;
898
- break;
899
- }
900
- $element = isset($_POST['wdform_'.$key."_element".$id]) ? $_POST['wdform_'.$key."_element".$id] : NULL;
901
- if(isset($element)) {
902
- $new_value = $element;
903
- }
904
- break;
905
- }
906
- case "type_checkbox": {
907
- $start = -1;
908
- for ($j = 0; $j < 100; $j++) {
909
- $element = isset($_POST['wdform_'.$key."_element".$id.$j]) ? $_POST['wdform_'.$key."_element".$id.$j] : NULL;
910
- if (isset($element)) {
911
- $start = $j;
912
- break;
913
- }
914
- }
915
- $other_element_id = -1;
916
- $is_other = isset($_POST['wdform_'.$key."_allow_other".$id]) ? $_POST['wdform_'.$key."_allow_other".$id] : "";
917
- if ($is_other == "yes") {
918
- $other_element_id = isset($_POST['wdform_'.$key."_allow_other_num".$id]) ? $_POST['wdform_'.$key."_allow_other_num".$id] : "";
919
- }
920
- if ($start != -1) {
921
- for ($j = $start; $j < 100; $j++) {
922
- $element = isset($_POST['wdform_'.$key."_element".$id.$j]) ? $_POST['wdform_'.$key."_element".$id.$j] : NULL;
923
- if (isset($element)) {
924
- if ($j == $other_element_id) {
925
- $new_value = $new_value . (isset($_POST['wdform_'.$key."_other_input".$id]) ? $_POST['wdform_'.$key."_other_input".$id] : "") . '<br>';
926
- }
927
- else {
928
- $new_value = $new_value . $element . '<br>';
929
- }
930
- }
931
- }
932
- }
933
- break;
934
- }
935
- default: break;
936
- }
937
- }
938
- return $new_value;
939
- }
940
-
941
- ////////////////////////////////////////////////////////////////////////////////////////
942
- // Getters & Setters //
943
- ////////////////////////////////////////////////////////////////////////////////////////
944
- ////////////////////////////////////////////////////////////////////////////////////////
945
- // Private Methods //
946
- ////////////////////////////////////////////////////////////////////////////////////////
947
- ////////////////////////////////////////////////////////////////////////////////////////
948
- // Listeners //
949
- ////////////////////////////////////////////////////////////////////////////////////////
950
  }
1
+ <?php
2
+
3
+ class CFMModelForm_maker {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function showform($id) {
22
+ global $wpdb;
23
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'contactformmaker WHERE id="%d"', $id));
24
+ if (!$row || !$row->published) {
25
+ return FALSE;
26
+ }
27
+ if (isset($_GET['test_theme']) && (esc_html(stripslashes($_GET['test_theme'])) != '')) {
28
+ /* From preview.*/
29
+ $theme_id = esc_html(stripslashes($_GET['test_theme']));
30
+ }
31
+ else {
32
+ $theme_id = $row->theme;
33
+ }
34
+ $form_theme = $wpdb->get_var($wpdb->prepare('SELECT css FROM ' . $wpdb->prefix . 'contactformmaker_themes WHERE id="%d"', $theme_id));
35
+ if (!$form_theme) {
36
+ $form_theme = $wpdb->get_var('SELECT css FROM ' . $wpdb->prefix . 'contactformmaker_themes');
37
+ if (!$form_theme) {
38
+ return FALSE;
39
+ }
40
+ }
41
+ $pattern = '/\/\/(.+)(\r\n|\r|\n)/';
42
+ $form_theme = preg_replace($pattern, ' ', $form_theme);
43
+ $form_theme = str_replace('//', ' ', $form_theme);
44
+ $label_id = array();
45
+ $label_type = array();
46
+ $label_all = explode('#****#', $row->label_order);
47
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
48
+ foreach ($label_all as $key => $label_each) {
49
+ $label_id_each = explode('#**id**#', $label_each);
50
+ array_push($label_id, $label_id_each[0]);
51
+ $label_order_each = explode('#**label**#', $label_id_each[1]);
52
+ array_push($label_type, $label_order_each[1]);
53
+ }
54
+ return array(
55
+ $row,
56
+ 1,
57
+ $label_id,
58
+ $label_type,
59
+ $form_theme
60
+ );
61
+ }
62
+
63
+ public function savedata($form, $id) {
64
+ $fm_settings = get_option('cfm_settings');
65
+ $all_files = array();
66
+ $correct = FALSE;
67
+ $id_for_old = $id;
68
+ if (!$form->form_front) {
69
+ $id = '';
70
+ }
71
+ if (isset($_POST["counter" . $id])) {
72
+ $counter = esc_html($_POST["counter" . $id]);
73
+ if (isset($_POST["captcha_input"])) {
74
+ $captcha_input = esc_html($_POST["captcha_input"]);
75
+ $session_wd_captcha_code = isset($_SESSION[$id . '_wd_captcha_code']) ? $_SESSION[$id . '_wd_captcha_code'] : '-';
76
+ if ($captcha_input == $session_wd_captcha_code) {
77
+ $correct = TRUE;
78
+ }
79
+ else {
80
+ ?>
81
+ <script>alert("<?php echo addslashes(__('Error, incorrect Security code.', 'contact_form_maker')); ?>");</script>
82
+ <?php
83
+ }
84
+ }
85
+ elseif (isset($_POST["recaptcha_response_field"])) {
86
+ $recaptcha_response_field = esc_html($_POST["recaptcha_response_field"]);
87
+ $privatekey= isset($fm_settings['private_key']) ? $fm_settings['private_key'] : '';
88
+ $recaptcha_challenge_field = ((isset($_POST['recaptcha_challenge_field'])) ? esc_html($_POST['recaptcha_challenge_field']) : '');
89
+ require_once(WD_CFM_DIR . '/recaptchalib.php');
90
+ $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $recaptcha_challenge_field, $recaptcha_response_field);
91
+ if ($resp->is_valid) {
92
+ $correct = TRUE;
93
+ }
94
+ else {
95
+ ?>
96
+ <script>alert("<?php echo addslashes(__('Error, incorrect Security code.', 'contact_form_maker')); ?>");</script>
97
+ <?php
98
+ }
99
+ }
100
+ elseif (isset($_POST["g-recaptcha-response"])) {
101
+ $privatekey= isset($fm_settings['private_key']) ? $fm_settings['private_key'] : '';
102
+ $w = stream_get_wrappers();
103
+ if (in_array('https', $w)) {
104
+ $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=" . $privatekey . "&response=" . $_POST['g-recaptcha-response']);
105
+ $response = json_decode($response, true);
106
+ if ($response["success"] === true) {
107
+ $correct = TRUE;
108
+ }
109
+ else {
110
+ ?>
111
+ <script>alert("<?php echo addslashes(__('Error, incorrect Security code.', 'contact_form_maker')); ?>");</script>
112
+ <?php
113
+ }
114
+ }
115
+ else {
116
+ ?>
117
+ <script>alert("<?php echo addslashes(__('`php_openssl` extension is not enabled.', 'contact_form_maker')); ?>");</script>
118
+ <?php
119
+ }
120
+ }
121
+ else {
122
+ $correct = TRUE;
123
+ }
124
+ if ($correct) {
125
+ $ip = $_SERVER['REMOTE_ADDR'];
126
+ global $wpdb;
127
+ $blocked_ip = $wpdb->get_var($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'contactformmaker_blocked WHERE ip="%s"', $ip));
128
+ if ($blocked_ip) {
129
+ $_SESSION['cfm_massage_after_submit' . $id] = addslashes(__('Your ip is blacklisted. Please contact the website administrator.', 'contact_form_maker'));
130
+ wp_redirect($_SERVER["REQUEST_URI"]);
131
+ exit;
132
+ }
133
+
134
+ $all_files = $this->save_db($counter, $id_for_old);
135
+ if (is_numeric($all_files)) {
136
+ $this->remove($all_files, $id_for_old);
137
+ }
138
+ elseif (isset($counter)) {
139
+ $this->gen_mail($counter, $all_files, $id_for_old);
140
+ }
141
+ }
142
+ return $all_files;
143
+ }
144
+ return $all_files;
145
+ }
146
+
147
+ public function save_db($counter, $id) {
148
+ global $wpdb;
149
+ $chgnac = TRUE;
150
+ $all_files = array();
151
+ $form = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "contactformmaker WHERE id= %d", $id));
152
+ $id_old = $id;
153
+ if (!$form->form_front) {
154
+ $id = '';
155
+ }
156
+ $label_id = array();
157
+ $label_label = array();
158
+ $label_type = array();
159
+ $label_all = explode('#****#',$form->label_order_current);
160
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
161
+ foreach ($label_all as $key => $label_each) {
162
+ $label_id_each = explode('#**id**#', $label_each);
163
+ array_push($label_id, $label_id_each[0]);
164
+ $label_order_each = explode('#**label**#', $label_id_each[1]);
165
+ array_push($label_label, $label_order_each[0]);
166
+ array_push($label_type, $label_order_each[1]);
167
+ }
168
+ $disabled_fields = explode(',', $form->disabled_fields);
169
+ $disabled_fields = array_slice($disabled_fields, 0, count($disabled_fields) - 1);
170
+ $max = $wpdb->get_var("SELECT MAX( group_id ) FROM " . $wpdb->prefix . "contactformmaker_submits");
171
+ foreach ($label_type as $key => $type) {
172
+ $value = '';
173
+ if ($type == "type_submit_reset" or $type == "type_map" or $type == "type_editor" or $type == "type_captcha" or $type == "type_recaptcha" or $type == "type_send_copy") {
174
+ continue;
175
+ }
176
+ $i = $label_id[$key];
177
+ if (!in_array($i, $disabled_fields)) {
178
+ switch ($type) {
179
+ case 'type_text':
180
+ case 'type_password':
181
+ case 'type_textarea':
182
+ case "type_submitter_mail":
183
+ case "type_own_select":
184
+ case "type_number": {
185
+ $value = isset($_POST['wdform_'.$i."_element".$id]) ? esc_html($_POST['wdform_'.$i."_element".$id]) : "";
186
+ break;
187
+ }
188
+ case "type_phone": {
189
+ $value = (isset($_POST['wdform_'.$i."_element_first".$id]) ? esc_html($_POST['wdform_'.$i."_element_first".$id]) : "") . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? esc_html($_POST['wdform_'.$i."_element_last".$id]) : "");
190
+ break;
191
+ }
192
+ case "type_name": {
193
+ $element_title = isset($_POST['wdform_'.$i."_element_title".$id]) ? esc_html($_POST['wdform_'.$i."_element_title".$id]) : NULL;
194
+ if (isset($element_title)) {
195
+ $value = (isset($_POST['wdform_'.$i."_element_title".$id]) ? esc_html($_POST['wdform_'.$i."_element_title".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_first".$id]) ? esc_html($_POST['wdform_'.$i."_element_first".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? esc_html($_POST['wdform_'.$i."_element_last".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_middle".$id]) ? esc_html($_POST['wdform_'.$i."_element_middle".$id]) : "");
196
+ }
197
+ else {
198
+ $value = (isset($_POST['wdform_'.$i."_element_first".$id]) ? esc_html($_POST['wdform_'.$i."_element_first".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? esc_html($_POST['wdform_'.$i."_element_last".$id]) : "");
199
+ }
200
+ break;
201
+ }
202
+ case 'type_address': {
203
+ $value = '*#*#*#';
204
+ $element = isset($_POST['wdform_'.$i."_street1".$id]) ? esc_html($_POST['wdform_'.$i."_street1".$id]) : NULL;
205
+ if (isset($element)) {
206
+ $value = $element;
207
+ break;
208
+ }
209
+
210
+ $element = isset($_POST['wdform_'.$i."_street2".$id]) ? esc_html($_POST['wdform_'.$i."_street2".$id]) : NULL;
211
+ if (isset($element)) {
212
+ $value = $element;
213
+ break;
214
+ }
215
+
216
+ $element = isset($_POST['wdform_'.$i."_city".$id]) ? esc_html($_POST['wdform_'.$i."_city".$id]) : NULL;
217
+ if(isset($element)) {
218
+ $value = $element;
219
+ break;
220
+ }
221
+
222
+ $element = isset($_POST['wdform_'.$i."_state".$id]) ? esc_html($_POST['wdform_'.$i."_state".$id]) : NULL;
223
+ if(isset($element)) {
224
+ $value = $element;
225
+ break;
226
+ }
227
+
228
+ $element = isset($_POST['wdform_'.$i."_postal".$id]) ? esc_html($_POST['wdform_'.$i."_postal".$id]) : NULL;
229
+ if(isset($element)) {
230
+ $value = $element;
231
+ break;
232
+ }
233
+
234
+ $element = isset($_POST['wdform_'.$i."_country".$id]) ? esc_html($_POST['wdform_'.$i."_country".$id]) : NULL;
235
+ if(isset($element)) {
236
+ $value = $element;
237
+ break;
238
+ }
239
+ break;
240
+ }
241
+ case "type_radio": {
242
+ $element = isset($_POST['wdform_'.$i."_other_input".$id]) ? esc_html($_POST['wdform_'.$i."_other_input".$id]) : NULL;
243
+ if(isset($element)) {
244
+ $value = $element;
245
+ break;
246
+ }
247
+ $value = isset($_POST['wdform_'.$i."_element".$id]) ? esc_html($_POST['wdform_'.$i."_element".$id]) : "";
248
+ break;
249
+ }
250
+ case "type_checkbox": {
251
+ $start = -1;
252
+ $value = '';
253
+ for($j = 0; $j < 100; $j++) {
254
+ $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? esc_html($_POST['wdform_'.$i."_element".$id.$j]) : NULL;
255
+ if(isset($element)) {
256
+ $start = $j;
257
+ break;
258
+ }
259
+ }
260
+
261
+ $other_element_id = -1;
262
+ $is_other = isset($_POST['wdform_'.$i."_allow_other".$id]) ? esc_html($_POST['wdform_'.$i."_allow_other".$id]) : "";
263
+ if($is_other == "yes") {
264
+ $other_element_id = isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? esc_html($_POST['wdform_'.$i."_allow_other_num".$id]) : "";
265
+ }
266
+
267
+ if($start != -1) {
268
+ for($j = $start; $j < 100; $j++) {
269
+ $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? esc_html($_POST['wdform_'.$i."_element".$id.$j]) : NULL;
270
+ if(isset($element)) {
271
+ if($j == $other_element_id) {
272
+ $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? esc_html($_POST['wdform_'.$i."_other_input".$id]) : "") . '***br***';
273
+ }
274
+ else {
275
+ $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? esc_html($_POST['wdform_'.$i."_element".$id.$j]) : "") . '***br***';
276
+ }
277
+ }
278
+ }
279
+ }
280
+ break;
281
+ }
282
+ }
283
+ if ($type == "type_address") {
284
+ if( $value == '*#*#*#') {
285
+ continue;
286
+ }
287
+ }
288
+ if ($type == "type_text" or $type == "type_password" or $type == "type_textarea" or $type == "type_name" or $type == "type_submitter_mail" or $type == "type_number" or $type == "type_phone") {
289
+ $untilupload = $form->form_fields;
290
+ $untilupload = substr($untilupload, strpos($untilupload, $i.'*:*id*:*'.$type), -1);
291
+ $untilupload = substr($untilupload, 0, strpos($untilupload, '*:*new_field*:'));
292
+ $untilupload = explode('*:*w_required*:*', $untilupload);
293
+ $untilupload = $untilupload[1];
294
+ $untilupload = explode('*:*w_unique*:*', $untilupload);
295
+ $unique_element = $untilupload[0];
296
+ if ($unique_element == 'yes') {
297
+ $unique = $wpdb->get_col($wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "contactformmaker_submits WHERE form_id= %d and element_label= %s and element_value= %s", $id, $i, addslashes($value)));
298
+ if ($unique) {
299
+ echo "<script> alert('" . addslashes(__('This field %s requires a unique entry and this value was already submitted.', 'contact_form_maker')) . "'.replace('%s','" . $label_label[$key] . "'));</script>";
300
+ return array($max + 1);
301
+ }
302
+ }
303
+ }
304
+ if ($form->savedb) {
305
+ $save_or_no = $wpdb->insert($wpdb->prefix . "contactformmaker_submits", array(
306
+ 'form_id' => $id,
307
+ 'element_label' => $i,
308
+ 'element_value' => stripslashes($value),
309
+ 'group_id' => ($max + 1),
310
+ 'date' => date('Y-m-d H:i:s'),
311
+ 'ip' => $_SERVER['REMOTE_ADDR'],
312
+ ), array(
313
+ '%d',
314
+ '%s',
315
+ '%s',
316
+ '%d',
317
+ '%s',
318
+ '%s'
319
+ ));
320
+ }
321
+ if (!$save_or_no) {
322
+ return FALSE;
323
+ }
324
+ $chgnac = FALSE;
325
+ }
326
+ }
327
+ if ($chgnac) {
328
+ global $wpdb;
329
+ if ($form->submit_text_type != 4) {
330
+ $_SESSION['cfm_massage_after_submit' . $id] = addslashes(addslashes(__('Nothing was submitted.', 'contact_form_maker')));
331
+ }
332
+ $_SESSION['cfm_error_or_no' . $id] = 1;
333
+ $_SESSION['cfm_form_submit_type' . $id] = $form->submit_text_type . "," . $form->id;
334
+ wp_redirect($_SERVER["REQUEST_URI"]);
335
+ exit;
336
+ }
337
+ return array($all_files);
338
+ }
339
+
340
+ public function remove($group_id) {
341
+ global $wpdb;
342
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'contactformmaker_submits WHERE group_id= %d', $group_id));
343
+ }
344
+
345
+ public function get_after_submission_text($form_id) {
346
+ global $wpdb;
347
+ return $wpdb->get_var("SELECT submit_text FROM " . $wpdb->prefix . "contactformmaker WHERE id='" . $form_id . "'");
348
+ }
349
+
350
+ public function increment_views_count($id) {
351
+ global $wpdb;
352
+ $vives_form = $wpdb->get_var($wpdb->prepare("SELECT views FROM " . $wpdb->prefix . "contactformmaker_views WHERE form_id=%d", $id));
353
+ if (isset($vives_form)) {
354
+ $vives_form = $vives_form + 1;
355
+ $wpdb->update($wpdb->prefix . "contactformmaker_views", array(
356
+ 'views' => $vives_form,
357
+ ), array('form_id' => $id), array(
358
+ '%d',
359
+ ), array('%d'));
360
+ }
361
+ else {
362
+ $wpdb->insert($wpdb->prefix . 'contactformmaker_views', array(
363
+ 'form_id' => $id,
364
+ 'views' => 1
365
+ ), array(
366
+ '%d',
367
+ '%d'
368
+ ));
369
+ }
370
+ }
371
+
372
+ public function gen_mail($counter, $all_files, $id) {
373
+ global $wpdb;
374
+ $row = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "contactformmaker WHERE id=%d", $id));
375
+ if (!$row->form_front) {
376
+ $id = '';
377
+ }
378
+ $ip = $_SERVER['REMOTE_ADDR'];
379
+ $replyto = '';
380
+ $label_order_original = array();
381
+ $label_order_ids = array();
382
+ $label_label = array();
383
+ $label_type = array();
384
+ $cc = array();
385
+ $row_mail_one_time = 1;
386
+ $label_type = array();
387
+ $label_all = explode('#****#', $row->label_order_current);
388
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
389
+ foreach ($label_all as $key => $label_each) {
390
+ $label_id_each = explode('#**id**#', $label_each);
391
+ $label_id = $label_id_each[0];
392
+ array_push($label_order_ids, $label_id);
393
+ $label_order_each = explode('#**label**#', $label_id_each[1]);
394
+ $label_order_original[$label_id] = $label_order_each[0];
395
+ $label_type[$label_id] = $label_order_each[1];
396
+ array_push($label_label, $label_order_each[0]);
397
+ array_push($label_type, $label_order_each[1]);
398
+ }
399
+ $disabled_fields = explode(',', $row->disabled_fields);
400
+ $disabled_fields = array_slice($disabled_fields, 0, count($disabled_fields) - 1);
401
+ $list = '<table border="1" cellpadding="3" cellspacing="0" style="width:600px;">';
402
+ $list_text_mode = '';
403
+ foreach ($label_order_ids as $key => $label_order_id) {
404
+ $i = $label_order_id;
405
+ $type = $label_type[$i];
406
+ if ($type != "type_map" and $type != "type_submit_reset" and $type != "type_editor" and $type != "type_captcha" and $type != "type_recaptcha" and $type != "type_send_copy") {
407
+ $element_label = $label_order_original[$i];
408
+ if (!in_array($i, $disabled_fields)) {
409
+ switch ($type) {
410
+ case 'type_text':
411
+ case 'type_password':
412
+ case 'type_textarea':
413
+ case "type_own_select":
414
+ case "type_number": {
415
+ $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
416
+ if (isset($element)) {
417
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td><pre style="font-family:inherit; margin:0px; padding:0px">' . $element . '</pre></td></tr>';
418
+ $list_text_mode .= $element_label . ' - ' . $element . "\r\n";
419
+ }
420
+ break;
421
+ }
422
+ case "type_submitter_mail": {
423
+ $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
424
+ if (isset($element)) {
425
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">' . $element . '</pre></td></tr>';
426
+ $list_text_mode .= $element_label . ' - ' . $element . "\r\n";
427
+ }
428
+ break;
429
+ }
430
+ case "type_phone": {
431
+ $element_first = isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL;
432
+ if (isset($element_first)) {
433
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element_first . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "") . '</td></tr>';
434
+ $list_text_mode .= $element_label . ' - ' . $element_first . ' ' . (isset($_POST['wdform_' . $i . "_element_last" . $id]) ? $_POST['wdform_' . $i . "_element_last" . $id] : "") . "\r\n";
435
+ }
436
+ break;
437
+ }
438
+ case "type_name": {
439
+ $element_first = isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL;
440
+ if (isset($element_first)) {
441
+ $element_title = isset($_POST['wdform_'.$i."_element_title".$id]) ? $_POST['wdform_'.$i."_element_title".$id] : NULL;
442
+ if (isset($element_title)) {
443
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element_title . ' ' . $element_first . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "") . ' ' . (isset($_POST['wdform_'.$i."_element_middle".$id]) ? $_POST['wdform_'.$i."_element_middle".$id] : "") . '</td></tr>';
444
+ $list_text_mode .= $element_label . ' - ' . $element_title . ' ' . $element_first . ' ' . (isset($_POST['wdform_' . $i . "_element_last" . $id]) ? $_POST['wdform_' . $i . "_element_last" . $id] : "") . ' ' . (isset($_POST['wdform_' . $i . "_element_middle" . $id]) ? $_POST['wdform_' . $i . "_element_middle" . $id] : "") . "\r\n";
445
+ }
446
+ else {
447
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element_first . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "") . '</td></tr>';
448
+ $list_text_mode .= $element_label . ' - ' . $element_first . ' ' . (isset($_POST['wdform_' . $i . "_element_last" . $id]) ? $_POST['wdform_' . $i . "_element_last" . $id] : "") . "\r\n";
449
+ }
450
+ }
451
+ break;
452
+ }
453
+ case "type_address": {
454
+ $element = isset($_POST['wdform_'.$i."_street1".$id]) ? $_POST['wdform_'.$i."_street1".$id] : NULL;
455
+ if (isset($element)) {
456
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
457
+ $list_text_mode .= $label_order_original[$i] . ' - ' . $element . "\r\n";
458
+ break;
459
+ }
460
+ $element = isset($_POST['wdform_'.$i."_street2".$id]) ? $_POST['wdform_'.$i."_street2".$id] : NULL;
461
+ if (isset($element)) {
462
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
463
+ $list_text_mode .= $label_order_original[$i] . ' - ' . $element . "\r\n";
464
+ break;
465
+ }
466
+ $element = isset($_POST['wdform_'.$i."_city".$id]) ? $_POST['wdform_'.$i."_city".$id] : NULL;
467
+ if (isset($element)) {
468
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
469
+ $list_text_mode .= $label_order_original[$i] . ' - ' . $element . "\r\n";
470
+ break;
471
+ }
472
+ $element = isset($_POST['wdform_'.$i."_state".$id]) ? $_POST['wdform_'.$i."_state".$id] : NULL;
473
+ if (isset($element)) {
474
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
475
+ $list_text_mode .= $label_order_original[$i] . ' - ' . $element . "\r\n";
476
+ break;
477
+ }
478
+ $element = isset($_POST['wdform_'.$i."_postal".$id]) ? $_POST['wdform_'.$i."_postal".$id] : NULL;
479
+ if (isset($element)) {
480
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
481
+ $list_text_mode .= $label_order_original[$i] . ' - ' . $element . "\r\n";
482
+ break;
483
+ }
484
+ $element = isset($_POST['wdform_'.$i."_country".$id]) ? $_POST['wdform_'.$i."_country".$id] : NULL;
485
+ if (isset($element)) {
486
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
487
+ $list_text_mode .= $label_order_original[$i] . ' - ' . $element . "\r\n";
488
+ break;
489
+ }
490
+ break;
491
+ }
492
+ case "type_radio": {
493
+ $element = isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL;
494
+ if (isset($element)) {
495
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
496
+ $list_text_mode .= $element_label . ' - ' . $element . "\r\n";
497
+ break;
498
+ }
499
+ $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
500
+ if(isset($element)) {
501
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">' . $element . '</pre></td></tr>';
502
+ $list_text_mode .= $element_label . ' - ' . $element . "\r\n";
503
+ }
504
+ break;
505
+ }
506
+ case "type_checkbox": {
507
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >';
508
+ $list_text_mode .= $element_label . ' - ';
509
+ $start = -1;
510
+ for ($j = 0; $j < 100; $j++) {
511
+ $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
512
+ if (isset($element)) {
513
+ $start = $j;
514
+ break;
515
+ }
516
+ }
517
+ $other_element_id = -1;
518
+ $is_other = isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : "";
519
+ if ($is_other == "yes") {
520
+ $other_element_id = isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : "";
521
+ }
522
+ if ($start != -1) {
523
+ for ($j = $start; $j < 100; $j++) {
524
+ $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
525
+ if (isset($element)) {
526
+ if ($j == $other_element_id) {
527
+ $list = $list . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : "") . '<br>';
528
+ $list_text_mode .= (isset($_POST['wdform_' . $i . "_other_input" . $id]) ? $_POST['wdform_' . $i . "_other_input" . $id] : "") . ', ';
529
+ }
530
+ else {
531
+ $list = $list . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : "") . '<br>';
532
+ $list_text_mode .= (isset($_POST['wdform_' . $i . "_element" . $id . $j]) ? $_POST['wdform_' . $i . "_element" . $id . $j] : "") . ', ';
533
+ }
534
+ }
535
+ }
536
+ $list = $list . '</td></tr>';
537
+ }
538
+ break;
539
+ }
540
+ default: break;
541
+ }
542
+ }
543
+ }
544
+ }
545
+ $list = $list . '</table>';
546
+ // $list = wordwrap($list, 70, "\n", TRUE);
547
+
548
+
549
+ if ($row->sendemail) {
550
+ if ($row->send_to) {
551
+ $fromname = $row->mail_from_name_user;
552
+ if ($row->mail_subject_user) {
553
+ $subject = $row->mail_subject_user;
554
+ }
555
+ else {
556
+ $subject = $row->title;
557
+ }
558
+ /*if (isset($_REQUEST['wdform_22_element' . $id])) {
559
+ $subject = ($row->title) . ' : ' . $_REQUEST['wdform_22_element' . $id];
560
+ }
561
+ else {
562
+ $subject = $row->title;
563
+ }*/
564
+ if ($row->reply_to_user) {
565
+ $replyto = $row->reply_to_user;
566
+ }
567
+ if ($row->mail_mode_user) {
568
+ $content_type = "text/html";
569
+ $list_user = wordwrap($list, 70, "\n", TRUE);
570
+ $new_script = $row->script_mail_user;
571
+ }
572
+ else {
573
+ $content_type = "text/plain";
574
+ $list_user = wordwrap($list_text_mode, 1000, "\n", TRUE);
575
+ $new_script = str_replace(array('<p>', '</p>'), '', $row->script_mail_user);
576
+ }
577
+ foreach ($label_order_original as $key => $label_each) {
578
+ $type = $label_type[$key];
579
+ if (strpos($row->script_mail_user, "%" . $label_each . "%") !== FALSE && !in_array($key,$disabled_fields)) {
580
+ $new_value = $this->custom_fields_mail($type, $key, $id);
581
+ $new_script = str_replace("%" . $label_each . "%", $new_value, $new_script);
582
+ }
583
+ if (strpos($fromname, "%" . $label_each . "%") !== FALSE && !in_array($key,$disabled_fields)) {
584
+ $new_value = str_replace('<br>', ', ', $this->custom_fields_mail($type, $key, $id));
585
+ if (substr($new_value, -2) == ', ') {
586
+ $new_value = substr($new_value, 0, -2);
587
+ }
588
+ $fromname = str_replace("%" . $label_each . "%", $new_value, $fromname);
589
+ }
590
+ if (strpos($subject, "%" . $label_each . "%") > -1) {
591
+ $new_value = str_replace('<br>', ', ', $this->custom_fields_mail($type, $key, $id));
592
+ if (substr($new_value, -2) == ', ') {
593
+ $new_value = substr($new_value, 0, -2);
594
+ }
595
+ $subject = str_replace("%" . $label_each . "%", $new_value, $subject);
596
+ }
597
+ }
598
+ $recipient = '';
599
+ $cca = $row->mail_cc_user;
600
+ $bcc = $row->mail_bcc_user;
601
+ $send_tos = explode('**', $row->send_to);
602
+ if ($row->mail_from_user != '') {
603
+ if ($row->mail_from_name_user != '') {
604
+ $from = "From: '" . htmlspecialchars_decode($row->mail_from_name_user, ENT_QUOTES) . "' <" . $row->mail_from_user . ">" . "\r\n";
605
+ }
606
+ else {
607
+ $from = "From: '" . $row->mail_from_user . "' <" . $row->mail_from_user . ">" . "\r\n";
608
+ }
609
+ }
610
+ else {
611
+ $from = '';
612
+ }
613
+
614
+ $headers = ''; //'MIME-Version: 1.0' . "\r\n";
615
+ $headers .= $from;
616
+ $headers .= 'Content-type: ' . $content_type . '; charset="' . get_option('blog_charset') . '"' . "\r\n";
617
+
618
+ if ($replyto) {
619
+ $headers .= "Reply-To: <" . $replyto . ">\r\n";
620
+ }
621
+ if ($cca) {
622
+ $headers .= "Cc: " . $cca . "\r\n";
623
+ }
624
+ if ($bcc) {
625
+ $headers .= "Bcc: " . $bcc . "\r\n";
626
+ }
627
+ if (strpos($new_script, "%ip%") > -1) {
628
+ $new_script = str_replace("%ip%", $ip, $new_script);
629
+ }
630
+ if (strpos($new_script, "%all%") > -1) {
631
+ $new_script = str_replace("%all%", $list_user, $new_script);
632
+ }
633
+ $body = $new_script;
634
+ $send_copy = isset($_POST["wdform_send_copy_".$id]) ? $_POST["wdform_send_copy_".$id] : NULL;
635
+ if (isset($send_copy)) {
636
+ $send = TRUE;
637
+ }
638
+ else {
639
+ foreach ($send_tos as $send_to) {
640
+ $recipient = isset($_POST['wdform_'.str_replace('*', '', $send_to)."_element".$id]) ? $_POST['wdform_'.str_replace('*', '', $send_to)."_element".$id] : NULL;
641
+ if ($recipient) {
642
+ if ($row->wpmail) {
643
+ $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers);
644
+ }
645
+ else {
646
+ $send = mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers);
647
+ }
648
+ }
649
+ }
650
+ }
651
+ }
652
+ }
653
+
654
+ if ($row->sendemail) {
655
+ if ($row->mail) {
656
+ if ($row->reply_to) {
657
+ $replyto = isset($_POST['wdform_'.$row->reply_to."_element".$id]) ? $_POST['wdform_'.$row->reply_to."_element".$id] : NULL;
658
+ if (!isset($replyto)) {
659
+ $replyto = $row->reply_to;
660
+ }
661
+ }
662
+ $recipient = $row->mail;
663
+ /*if (isset($_REQUEST['wdform_22_element' . $id])) {
664
+ $subject = $row->title . ' : ' . $_REQUEST['wdform_22_element' . $id];
665
+ }
666
+ else {
667
+ $subject = $row->title;
668
+ }*/
669
+ if ($row->mail_subject) {
670
+ $subject = $row->mail_subject;
671
+ }
672
+ else {
673
+ $subject = $row->title;
674
+ }
675
+ if ($row->mail_from_name) {
676
+ $fromname = $row->mail_from_name;
677
+ }
678
+ else {
679
+ $fromname = '';
680
+ }
681
+ if ($row->mail_mode) {
682
+ $content_type = "text/html";
683
+ $list = wordwrap($list, 70, "\n", TRUE);
684
+ $new_script = $row->script_mail;
685
+ }
686
+ else {
687
+ $content_type = "text/plain";
688
+ $list = $list_text_mode;
689
+ $list = wordwrap($list, 1000, "\n", TRUE);
690
+ $new_script = str_replace(array('<p>', '</p>'), '', $row->script_mail);
691
+ }
692
+ foreach ($label_order_original as $key => $label_each) {
693
+ $type = $label_type[$key];
694
+ if (strpos($row->script_mail, "%" . $label_each . "%") !== FALSE && !in_array($key,$disabled_fields)) {
695
+ $new_value = $this->custom_fields_mail($type, $key, $id);
696
+ $new_script = str_replace("%" . $label_each . "%", $new_value, $new_script);
697
+ }
698
+ if (strpos($fromname, "%" . $label_each . "%") !== FALSE && !in_array($key,$disabled_fields)) {
699
+ $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id));
700
+ if (substr($new_value, -2) == ', ') {
701
+ $new_value = substr($new_value, 0, -2);
702
+ }
703
+ $fromname = str_replace("%".$label_each."%", $new_value, $fromname);
704
+ }
705
+ if (strpos($subject, "%" . $label_each . "%") > -1) {
706
+ $new_value = str_replace('<br>', ', ', $this->custom_fields_mail($type, $key, $id));
707
+ if (substr($new_value, -2) == ', ') {
708
+ $new_value = substr($new_value, 0, -2);
709
+ }
710
+ $subject = str_replace("%" . $label_each . "%", $new_value, $subject);
711
+ }
712
+ }
713
+ if ($row->mail_from) {
714
+ $from = isset($_POST['wdform_' . $row->mail_from . "_element" . $id]) ? $_POST['wdform_' . $row->mail_from . "_element" . $id] : NULL;
715
+ if (!isset($from)) {
716
+ $from = $row->mail_from;
717
+ }
718
+ $from = "From: '" . htmlspecialchars_decode($fromname, ENT_QUOTES) . "' <" . $from . ">" . "\r\n";
719
+ }
720
+ else {
721
+ $from = "";
722
+ }
723
+
724
+ $headers = ''; //'MIME-Version: 1.0' . "\r\n";
725
+ $headers .= $from;
726
+ $headers .= 'Content-type: ' . $content_type . '; charset="' . get_option('blog_charset') . '"' . "\r\n";
727
+
728
+ if ($replyto) {
729
+ $headers .= "Reply-To: <" . $replyto . ">\r\n";
730
+ }
731
+ $cca = $row->mail_cc;
732
+ $bcc = $row->mail_bcc;
733
+ if ($cca) {
734
+ $headers .= "Cc: " . $cca . "\r\n";
735
+ }
736
+ if ($bcc) {
737
+ $headers .= "Bcc: " . $bcc . "\r\n";
738
+ }
739
+ if (strpos($new_script, "%ip%") > -1) {
740
+ $new_script = str_replace("%ip%", $ip, $new_script);
741
+ }
742
+ if (strpos($new_script, "%all%") > -1) {
743
+ $new_script = str_replace("%all%", $list, $new_script);
744
+ }
745
+ $body = $new_script;
746
+ if ($row->sendemail) {
747
+ if ($row->wpmail) {
748
+ $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers);
749
+ }
750
+ else {
751
+ $send = mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers);
752
+ }
753
+ }
754
+ }
755
+ }
756
+
757
+ $_SESSION['cfm_error_or_no' . $id] = 0;
758
+ $msg = addslashes(__('Your form was successfully submitted.', 'contact_form_maker'));
759
+ $succes = 1;
760
+
761
+ if ($row->sendemail) {
762
+ if ($row->mail || $row->send_to) {
763
+ if ($send) {
764
+ if ($send !== TRUE) {
765
+ $_SESSION['cfm_error_or_no' . $id] = 1;
766
+ $msg = addslashes(__('Error, email was not sent.', 'contact_form_maker'));
767
+ $succes = 0;
768
+ }
769
+ else {
770
+ $_SESSION['cfm_error_or_no' . $id] = 0;
771
+ $msg = addslashes(__('Your form was successfully submitted.', 'contact_form_maker'));
772
+ }
773
+ }
774
+ }
775
+ }
776
+
777
+ $https = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://');
778
+ switch ($row->submit_text_type) {
779
+ case "2":
780
+ case "5": {
781
+ if ($row->submit_text_type != 4) {
782
+ $_SESSION['cfm_massage_after_submit' . $id] = $msg;
783
+ }
784
+ $_SESSION['cfm_form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
785
+ if ($row->article_id) {
786
+ $redirect_url = $row->article_id;
787
+ }
788
+ else {
789
+ $redirect_url = $https . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
790
+ }
791
+ break;
792
+ }
793
+ case "3": {
794
+ if ($row->submit_text_type != 4) {
795
+ $_SESSION['cfm_massage_after_submit' . $id] = $msg;
796
+ }
797
+ $_SESSION['cfm_form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
798
+ $redirect_url = $https . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
799
+ break;
800
+ }
801
+ case "4": {
802
+ if ($row->submit_text_type != 4) {
803
+ $_SESSION['cfm_massage_after_submit' . $id] = $msg;
804
+ }
805
+ $_SESSION['cfm_form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
806
+ $redirect_url = $row->url;
807
+ break;
808
+ }
809
+ default: {
810
+ if ($row->submit_text_type != 4) {
811
+ $_SESSION['cfm_massage_after_submit' . $id] = $msg;
812
+ }
813
+ $_SESSION['cfm_form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
814
+ $redirect_url = $https . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
815
+ break;
816
+ }
817
+ }
818
+ wp_redirect($redirect_url);
819
+ exit;
820
+ }
821
+
822
+ public function custom_fields_mail($type, $key, $id) {
823
+ $new_value = "";
824
+ if ($type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type != "type_captcha" or $type != "type_recaptcha" or $type != "type_button") {
825
+ switch ($type) {
826
+ case 'type_text':
827
+ case 'type_password':
828
+ case 'type_textarea':
829
+ case 'type_own_select':
830
+ case 'type_number': {
831
+ if (isset($_POST['wdform_' . $key . "_element" . $id])) {
832
+ $new_value = $_POST['wdform_'.$key."_element".$id];
833
+ }
834
+ break;
835
+ }
836
+ case "type_submitter_mail": {
837
+ if (isset($_POST['wdform_' . $key . "_element" . $id])) {
838
+ $new_value = $_POST['wdform_' . $key . "_element" . $id];
839
+ }
840
+ break;
841
+ }
842
+ case "type_phone": {
843
+ if (isset($_POST['wdform_' . $key . "_element_first" . $id])) {
844
+ $new_value = $_POST['wdform_'.$key."_element_first".$id] . ' ' . (isset($_POST['wdform_'.$key."_element_last".$id]) ? $_POST['wdform_'.$key."_element_last".$id] : "");
845
+ }
846
+ break;
847
+ }
848
+ case "type_name": {
849
+ $element_first = isset($_POST['wdform_'.$key."_element_first".$id]) ? $_POST['wdform_'.$key."_element_first".$id] : NULL;
850
+ if (isset($element_first)) {
851
+ $element_title = isset($_POST['wdform_'.$key."_element_title".$id]) ? $_POST['wdform_'.$key."_element_title".$id] : NULL;
852
+ if (isset($element_title)) {
853
+ $new_value = $element_title . ' ' . $element_first . ' ' . (isset($_POST['wdform_'.$key."_element_last".$id]) ? $_POST['wdform_'.$key."_element_last".$id] : "") . ' ' . (isset($_POST['wdform_'.$key."_element_middle".$id]) ? $_POST['wdform_'.$key."_element_middle".$id] : "");
854
+ }
855
+ else {
856
+ $new_value = $element_first . ' ' . (isset($_POST['wdform_'.$key."_element_last".$id]) ? $_POST['wdform_'.$key."_element_last".$id] : "");
857
+ }
858
+ }
859
+ break;
860
+ }
861
+ case "type_address": {
862
+ $street1 = isset($_POST['wdform_'.$key."_street1".$id]) ? $_POST['wdform_'.$key."_street1".$id] : NULL;
863
+ if (isset($street1)) {
864
+ $new_value = $street1;
865
+ break;
866
+ }
867
+ $street2 = isset($_POST['wdform_'.$key."_street2".$id]) ? $_POST['wdform_'.$key."_street2".$id] : NULL;
868
+ if (isset($street2)) {
869
+ $new_value = $street2;
870
+ break;
871
+ }
872
+ $city = isset($_POST['wdform_'.$key."_city".$id]) ? $_POST['wdform_'.$key."_city".$id] : NULL;
873
+ if (isset($city)) {
874
+ $new_value = $city;
875
+ break;
876
+ }
877
+ $state = isset($_POST['wdform_'.$key."_state".$id]) ? $_POST['wdform_'.$key."_state".$id] : NULL;
878
+ if (isset($state)) {
879
+ $new_value = $state;
880
+ break;
881
+ }
882
+ $postal = isset($_POST['wdform_'.$key."_postal".$id]) ? $_POST['wdform_'.$key."_postal".$id] : NULL;
883
+ if (isset($postal)) {
884
+ $new_value = $postal;
885
+ break;
886
+ }
887
+ $country = isset($_POST['wdform_'.$key."_country".$id]) ? $_POST['wdform_'.$key."_country".$id] : NULL;
888
+ if (isset($country)) {
889
+ $new_value = $country;
890
+ break;
891
+ }
892
+ break;
893
+ }
894
+ case "type_radio": {
895
+ $element = isset($_POST['wdform_'.$key."_other_input".$id]) ? $_POST['wdform_'.$key."_other_input".$id] : NULL;
896
+ if (isset($element)) {
897
+ $new_value = $element;
898
+ break;
899
+ }
900
+ $element = isset($_POST['wdform_'.$key."_element".$id]) ? $_POST['wdform_'.$key."_element".$id] : NULL;
901
+ if(isset($element)) {
902
+ $new_value = $element;
903
+ }
904
+ break;
905
+ }
906
+ case "type_checkbox": {
907
+ $start = -1;
908
+ for ($j = 0; $j < 100; $j++) {
909
+ $element = isset($_POST['wdform_'.$key."_element".$id.$j]) ? $_POST['wdform_'.$key."_element".$id.$j] : NULL;
910
+ if (isset($element)) {
911
+ $start = $j;
912
+ break;
913
+ }
914
+ }
915
+ $other_element_id = -1;
916
+ $is_other = isset($_POST['wdform_'.$key."_allow_other".$id]) ? $_POST['wdform_'.$key."_allow_other".$id] : "";
917
+ if ($is_other == "yes") {
918
+ $other_element_id = isset($_POST['wdform_'.$key."_allow_other_num".$id]) ? $_POST['wdform_'.$key."_allow_other_num".$id] : "";
919
+ }
920
+ if ($start != -1) {
921
+ for ($j = $start; $j < 100; $j++) {
922
+ $element = isset($_POST['wdform_'.$key."_element".$id.$j]) ? $_POST['wdform_'.$key."_element".$id.$j] : NULL;
923
+ if (isset($element)) {
924
+ if ($j == $other_element_id) {
925
+ $new_value = $new_value . (isset($_POST['wdform_'.$key."_other_input".$id]) ? $_POST['wdform_'.$key."_other_input".$id] : "") . '<br>';
926
+ }
927
+ else {
928
+ $new_value = $new_value . $element . '<br>';
929
+ }
930
+ }
931
+ }
932
+ }
933
+ break;
934
+ }
935
+ default: break;
936
+ }
937
+ }
938
+ return $new_value;
939
+ }
940
+
941
+ ////////////////////////////////////////////////////////////////////////////////////////
942
+ // Getters & Setters //
943
+ ////////////////////////////////////////////////////////////////////////////////////////
944
+ ////////////////////////////////////////////////////////////////////////////////////////
945
+ // Private Methods //
946
+ ////////////////////////////////////////////////////////////////////////////////////////
947
+ ////////////////////////////////////////////////////////////////////////////////////////
948
+ // Listeners //
949
+ ////////////////////////////////////////////////////////////////////////////////////////
950
  }
frontend/views/CFMViewForm_maker.php CHANGED
@@ -29,6 +29,18 @@ class CFMViewForm_maker {
29
  wp_enqueue_script('gmap_form_api');
30
  wp_enqueue_script('gmap_form');
31
  wp_enqueue_script('cfm_main_front_end');
 
 
 
 
 
 
 
 
 
 
 
 
32
  $form_maker_front_end = "";
33
  $result = $this->model->showform($id);
34
  if (!$result) {
@@ -512,6 +524,9 @@ class CFMViewForm_maker {
512
  case 'type_name': {
513
  $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class');
514
  $temp = $params;
 
 
 
515
  foreach ($params_names as $params_name) {
516
  $temp = explode('*:*'.$params_name.'*:*', $temp);
517
  $param[$params_name] = $temp[0];
@@ -529,6 +544,7 @@ class CFMViewForm_maker {
529
  $w_mini_labels = explode('***', $param['w_mini_labels']);
530
  $element_title = isset($_POST['wdform_'.$id1.'_element_title'.$form_id]) ? $_POST['wdform_'.$id1.'_element_title'.$form_id] : NULL;
531
  $element_first = isset($_POST['wdform_'.$id1.'_element_first'.$form_id]) ? $_POST['wdform_'.$id1.'_element_first'.$form_id] : NULL;
 
532
  if (isset($element_title)) {
533
  $param['w_first_val'] = (isset($_POST['wdform_'.$id1.'_element_title'.$form_id]) ? $_POST['wdform_'.$id1.'_element_title'.$form_id] : $w_first_val[0]).'***'.(isset($_POST['wdform_'.$id1.'_element_first'.$form_id]) ? $_POST['wdform_'.$id1.'_element_first'.$form_id] : $w_first_val[1]).'***'.(isset($_POST['wdform_'.$id1.'_element_last'.$form_id]) ? $_POST['wdform_'.$id1.'_element_last'.$form_id] : $w_first_val[2]).'***'.(isset($_POST['wdform_'.$id1.'_element_middle'.$form_id]) ? $_POST['wdform_'.$id1.'_element_middle'.$form_id] : $w_first_val[3]);
534
  }
@@ -537,19 +553,23 @@ class CFMViewForm_maker {
537
  $param['w_first_val'] = (isset($_POST['wdform_'.$id1.'_element_first'.$form_id]) ? $_POST['wdform_'.$id1.'_element_first'.$form_id] : $w_first_val[0]).'***'.(isset($_POST['wdform_'.$id1.'_element_last'.$form_id]) ? $_POST['wdform_'.$id1.'_element_last'.$form_id] : $w_first_val[1]);
538
  }
539
  }
540
- $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
541
- $required = ($param['w_required'] == "yes" ? TRUE : FALSE);
542
  $w_first_val = explode('***', $param['w_first_val']);
543
- $w_title = explode('***', $param['w_title']);
 
 
 
 
544
  if ($param['w_name_format'] == 'normal') {
545
  $w_name_format = '
546
  <div style="display: table-cell; width:50%">
547
- <div><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element_first'.$form_id.'" name="wdform_'.$id1.'_element_first'.$form_id.'" value="'.$w_first_val[0].'" title="'.$w_title[0].'" style="width: 100%;"'.$param['attributes'].'></div>
548
  <div><label class="mini_label">'.$w_mini_labels[1].'</label></div>
549
  </div>
550
  <div style="display:table-cell;"><div style="margin: 0px 8px; padding: 0px;"></div></div>
551
  <div style="display: table-cell; width:50%">
552
- <div><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element_last'.$form_id.'" name="wdform_'.$id1.'_element_last'.$form_id.'" value="'.$w_first_val[1].'" title="'.$w_title[1].'" style="width: 100%;" '.$param['attributes'].'></div>
553
  <div><label class="mini_label">'.$w_mini_labels[2].'</label></div>
554
  </div>';
555
  $w_size = 2 * $param['w_size'];
@@ -557,22 +577,22 @@ class CFMViewForm_maker {
557
  else {
558
  $w_name_format = '
559
  <div style="display: table-cell;">
560
- <div><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element_title'.$form_id.'" name="wdform_'.$id1.'_element_title'.$form_id.'" value="'.$w_first_val[0].'" title="'.$w_title[0].'" style="width: 40px;"></div>
561
  <div><label class="mini_label">'.$w_mini_labels[0].'</label></div>
562
  </div>
563
  <div style="display:table-cell;"><div style="margin: 0px 1px; padding: 0px;"></div></div>
564
  <div style="display: table-cell; width:30%">
565
- <div><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element_first'.$form_id.'" name="wdform_'.$id1.'_element_first'.$form_id.'" value="'.$w_first_val[1].'" title="'.$w_title[1].'" style="width:100%;"></div>
566
  <div><label class="mini_label">'.$w_mini_labels[1].'</label></div>
567
  </div>
568
  <div style="display:table-cell;"><div style="margin: 0px 4px; padding: 0px;"></div></div>
569
  <div style="display: table-cell; width:30%">
570
- <div><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element_last'.$form_id.'" name="wdform_'.$id1.'_element_last'.$form_id.'" value="'.$w_first_val[2].'" title="'.$w_title[2].'" style="width: 100%;"></div>
571
  <div><label class="mini_label">'.$w_mini_labels[2].'</label></div>
572
  </div>
573
  <div style="display:table-cell;"><div style="margin: 0px 4px; padding: 0px;"></div></div>
574
  <div style="display: table-cell; width:30%">
575
- <div><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element_middle'.$form_id.'" name="wdform_'.$id1.'_element_middle'.$form_id.'" value="'.$w_first_val[3].'" title="'.$w_title[3].'" style="width: 100%;"></div>
576
  <div><label class="mini_label">'.$w_mini_labels[3].'</label></div>
577
  </div>';
578
  $w_size = 3 * $param['w_size'] + 80;
@@ -732,6 +752,9 @@ class CFMViewForm_maker {
732
  case 'type_submitter_mail': {
733
  $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
734
  $temp = $params;
 
 
 
735
  foreach ($params_names as $params_name ) {
736
  $temp = explode('*:*' . $params_name . '*:*', $temp);
737
  $param[$params_name] = $temp[0];
@@ -750,6 +773,15 @@ class CFMViewForm_maker {
750
  $param['w_field_label_pos2'] = ($param['w_field_label_pos'] == "left" ? "" : "display: block;");
751
  $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
752
  $required = ($param['w_required'] == "yes" ? TRUE : FALSE);
 
 
 
 
 
 
 
 
 
753
  $rep = '<div type="type_submitter_mail" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
754
  if ($required) {
755
  $rep .= '<span class="wdform-required">'.$required_sym.'</span>';
29
  wp_enqueue_script('gmap_form_api');
30
  wp_enqueue_script('gmap_form');
31
  wp_enqueue_script('cfm_main_front_end');
32
+
33
+ $current_user = wp_get_current_user();
34
+ if ($current_user->ID != 0){
35
+ $wp_userid = $current_user->ID;
36
+ $wp_username = $current_user->display_name;
37
+ $wp_useremail = $current_user->user_email;
38
+ }
39
+ else {
40
+ $wp_userid = '';
41
+ $wp_username = '';
42
+ $wp_useremail = '';
43
+ }
44
  $form_maker_front_end = "";
45
  $result = $this->model->showform($id);
46
  if (!$result) {
524
  case 'type_name': {
525
  $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class');
526
  $temp = $params;
527
+ if(strpos($temp, 'w_autofill') > -1){
528
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_autofill');
529
+ }
530
  foreach ($params_names as $params_name) {
531
  $temp = explode('*:*'.$params_name.'*:*', $temp);
532
  $param[$params_name] = $temp[0];
544
  $w_mini_labels = explode('***', $param['w_mini_labels']);
545
  $element_title = isset($_POST['wdform_'.$id1.'_element_title'.$form_id]) ? $_POST['wdform_'.$id1.'_element_title'.$form_id] : NULL;
546
  $element_first = isset($_POST['wdform_'.$id1.'_element_first'.$form_id]) ? $_POST['wdform_'.$id1.'_element_first'.$form_id] : NULL;
547
+ $param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
548
  if (isset($element_title)) {
549
  $param['w_first_val'] = (isset($_POST['wdform_'.$id1.'_element_title'.$form_id]) ? $_POST['wdform_'.$id1.'_element_title'.$form_id] : $w_first_val[0]).'***'.(isset($_POST['wdform_'.$id1.'_element_first'.$form_id]) ? $_POST['wdform_'.$id1.'_element_first'.$form_id] : $w_first_val[1]).'***'.(isset($_POST['wdform_'.$id1.'_element_last'.$form_id]) ? $_POST['wdform_'.$id1.'_element_last'.$form_id] : $w_first_val[2]).'***'.(isset($_POST['wdform_'.$id1.'_element_middle'.$form_id]) ? $_POST['wdform_'.$id1.'_element_middle'.$form_id] : $w_first_val[3]);
550
  }
553
  $param['w_first_val'] = (isset($_POST['wdform_'.$id1.'_element_first'.$form_id]) ? $_POST['wdform_'.$id1.'_element_first'.$form_id] : $w_first_val[0]).'***'.(isset($_POST['wdform_'.$id1.'_element_last'.$form_id]) ? $_POST['wdform_'.$id1.'_element_last'.$form_id] : $w_first_val[1]);
554
  }
555
  }
556
+ // $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
557
+ $required = ($param['w_required'] == "yes" ? TRUE : FALSE);
558
  $w_first_val = explode('***', $param['w_first_val']);
559
+ if ($param['w_autofill'] == 'yes' && $wp_username) {
560
+ $user_display_name = explode(' ', $wp_username);
561
+ $w_first_val[0] = $user_display_name[0];
562
+ $w_first_val[1] = isset($user_display_name[1]) ? $user_display_name[1] : $w_first_val[1];
563
+ }
564
  if ($param['w_name_format'] == 'normal') {
565
  $w_name_format = '
566
  <div style="display: table-cell; width:50%">
567
+ <div><input type="text" class="'.($w_first_val[0] == $w_title[0] ? "input_deactive" : "input_active").'"name="wdform_'.$id1.'_element_first'.$form_id.'" value="'.$w_first_val[0].'" title="'.$w_title[0].'" style="width: 100%;"'.$param['attributes'].'></div>
568
  <div><label class="mini_label">'.$w_mini_labels[1].'</label></div>
569
  </div>
570
  <div style="display:table-cell;"><div style="margin: 0px 8px; padding: 0px;"></div></div>
571
  <div style="display: table-cell; width:50%">
572
+ <div><input type="text" class="'.($w_first_val[1] == $w_title[1] ? "input_deactive" : "input_active").'" name="wdform_'.$id1.'_element_last'.$form_id.'" value="'.$w_first_val[1].'" title="'.$w_title[1].'" style="width: 100%;" '.$param['attributes'].'></div>
573
  <div><label class="mini_label">'.$w_mini_labels[2].'</label></div>
574
  </div>';
575
  $w_size = 2 * $param['w_size'];
577
  else {
578
  $w_name_format = '
579
  <div style="display: table-cell;">
580
+ <div><input type="text" class="'.($w_first_val[0] == $w_title[0] ? "input_deactive" : "input_active").'" name="wdform_'.$id1.'_element_title'.$form_id.'" value="'.$w_first_val[0].'" title="'.$w_title[0].'" style="width: 40px;"></div>
581
  <div><label class="mini_label">'.$w_mini_labels[0].'</label></div>
582
  </div>
583
  <div style="display:table-cell;"><div style="margin: 0px 1px; padding: 0px;"></div></div>
584
  <div style="display: table-cell; width:30%">
585
+ <div><input type="text" class="'.($w_first_val[1] == $w_title[1] ? "input_deactive" : "input_active").'" name="wdform_'.$id1.'_element_first'.$form_id.'" value="'.$w_first_val[1].'" title="'.$w_title[1].'" style="width:100%;"></div>
586
  <div><label class="mini_label">'.$w_mini_labels[1].'</label></div>
587
  </div>
588
  <div style="display:table-cell;"><div style="margin: 0px 4px; padding: 0px;"></div></div>
589
  <div style="display: table-cell; width:30%">
590
+ <div><input type="text" class="'.($w_first_val[2] == $w_title[2] ? "input_deactive" : "input_active").'" name="wdform_'.$id1.'_element_last'.$form_id.'" value="'.$w_first_val[2].'" title="'.$w_title[2].'" style="width: 100%;"></div>
591
  <div><label class="mini_label">'.$w_mini_labels[2].'</label></div>
592
  </div>
593
  <div style="display:table-cell;"><div style="margin: 0px 4px; padding: 0px;"></div></div>
594
  <div style="display: table-cell; width:30%">
595
+ <div><input type="text" class="'.($w_first_val[3] == $w_title[3] ? "input_deactive" : "input_active").'" name="wdform_'.$id1.'_element_middle'.$form_id.'" value="'.$w_first_val[3].'" title="'.$w_title[3].'" style="width: 100%;"></div>
596
  <div><label class="mini_label">'.$w_mini_labels[3].'</label></div>
597
  </div>';
598
  $w_size = 3 * $param['w_size'] + 80;
752
  case 'type_submitter_mail': {
753
  $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
754
  $temp = $params;
755
+ if (strpos($temp, 'w_autofill') > -1) {
756
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class', 'w_autofill');
757
+ }
758
  foreach ($params_names as $params_name ) {
759
  $temp = explode('*:*' . $params_name . '*:*', $temp);
760
  $param[$params_name] = $temp[0];
773
  $param['w_field_label_pos2'] = ($param['w_field_label_pos'] == "left" ? "" : "display: block;");
774
  $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
775
  $required = ($param['w_required'] == "yes" ? TRUE : FALSE);
776
+ $param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
777
+ if ($param['w_autofill'] == 'yes' && $wp_useremail) {
778
+ $param['w_first_val'] = (isset($_POST['wdform_'.$id1.'_element'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id])) : $wp_useremail);
779
+ $input_active = "input_active";
780
+ }
781
+ else {
782
+ $param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id])) : $param['w_first_val']);
783
+ $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
784
+ }
785
  $rep = '<div type="type_submitter_mail" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
786
  if ($required) {
787
  $rep .= '<span class="wdform-required">'.$required_sym.'</span>';
js/contact_form_maker_admin.js CHANGED
@@ -271,4 +271,3 @@ function stopRKey(evt) {
271
  }
272
 
273
  document.onkeypress = stopRKey;
274
-
271
  }
272
 
273
  document.onkeypress = stopRKey;
 
js/contact_form_maker_manage.js CHANGED
@@ -67,9 +67,7 @@ function all_sortable_events() {
67
  }
68
  else {
69
  jQuery(".wdform_arrows_show").addClass("wdform_arrows");
70
- if (jQuery('#enable_sortable').prop('checked')) {
71
  jQuery(".wdform_arrows").hide();
72
- }
73
  jQuery(".wdform_arrows_show").removeClass("wdform_arrows_show");
74
  jQuery(".wdform_field, .wdform_field_section_break").css("background-color","#fff");
75
  jQuery(".wdform_field").css("margin-top", "");
67
  }
68
  else {
69
  jQuery(".wdform_arrows_show").addClass("wdform_arrows");
 
70
  jQuery(".wdform_arrows").hide();
 
71
  jQuery(".wdform_arrows_show").removeClass("wdform_arrows_show");
72
  jQuery(".wdform_field, .wdform_field_section_break").css("background-color","#fff");
73
  jQuery(".wdform_field").css("margin-top", "");
js/contactformmaker.js CHANGED
@@ -4997,7 +4997,7 @@ jQuery(document).ready(function() {
4997
  }
4998
 
4999
 
5000
- function type_name(i, w_field_label, w_field_label_size, w_field_label_pos, w_first_val, w_title, w_mini_labels, w_size, w_name_format, w_required, w_unique, w_class, w_attr_name, w_attr_value) {
5001
  document.getElementById("element_type").value="type_name";
5002
 
5003
  delete_last_child();
@@ -5022,6 +5022,7 @@ function type_name(i, w_field_label, w_field_label_size, w_field_label_pos, w_fi
5022
  var edit_main_tr9 = document.createElement('tr');
5023
  var edit_main_tr10 = document.createElement('tr');
5024
  var edit_main_tr11 = document.createElement('tr');
 
5025
  var edit_main_td1 = document.createElement('td');
5026
  var edit_main_td1_1 = document.createElement('td');
5027
  var edit_main_td2 = document.createElement('td');
@@ -5044,6 +5045,8 @@ function type_name(i, w_field_label, w_field_label_size, w_field_label_pos, w_fi
5044
  var edit_main_td10_1 = document.createElement('td');
5045
  var edit_main_td11 = document.createElement('td');
5046
  var edit_main_td11_1 = document.createElement('td');
 
 
5047
 
5048
  var el_label_disable = document.createElement('label');
5049
  el_label_disable.setAttribute("for", "edit_for_disable");
@@ -5174,6 +5177,17 @@ function type_name(i, w_field_label, w_field_label_size, w_field_label_pos, w_fi
5174
  if(w_required=="yes")
5175
  el_required.setAttribute("checked", "checked");
5176
 
 
 
 
 
 
 
 
 
 
 
 
5177
  var el_unique_label = document.createElement('label');
5178
  el_unique_label.setAttribute("for", "el_unique");
5179
  el_unique_label.innerHTML = fmc_objectL10n.fmc_Allow_only_unique_values;
@@ -5329,6 +5343,9 @@ function type_name(i, w_field_label, w_field_label_size, w_field_label_pos, w_fi
5329
 
5330
  edit_main_td5.appendChild(el_required_label);
5331
  edit_main_td5_1.appendChild(el_required);
 
 
 
5332
 
5333
  edit_main_td8.appendChild(el_unique_label);
5334
  edit_main_td8_1.appendChild(el_unique);
@@ -5359,6 +5376,8 @@ function type_name(i, w_field_label, w_field_label_size, w_field_label_pos, w_fi
5359
  edit_main_tr6.appendChild(edit_main_td6_1);
5360
  edit_main_tr8.appendChild(edit_main_td8);
5361
  edit_main_tr8.appendChild(edit_main_td8_1);
 
 
5362
  edit_main_tr9.appendChild(edit_main_td9);
5363
  edit_main_tr9.appendChild(edit_main_td9_1);
5364
  edit_main_table.appendChild(edit_main_tr11);
@@ -5371,6 +5390,7 @@ function type_name(i, w_field_label, w_field_label_size, w_field_label_pos, w_fi
5371
  edit_main_table.appendChild(edit_main_tr4);
5372
  edit_main_table.appendChild(edit_main_tr5);
5373
  edit_main_table.appendChild(edit_main_tr8);
 
5374
  edit_main_table.appendChild(edit_main_tr6);
5375
  edit_div.appendChild(edit_main_table);
5376
 
@@ -5384,6 +5404,13 @@ function type_name(i, w_field_label, w_field_label_size, w_field_label_pos, w_fi
5384
  adding_type.setAttribute("value", "type_name");
5385
  adding_type.setAttribute("name", i+"_typeform_id_temp");
5386
  adding_type.setAttribute("id", i+"_typeform_id_temp");
 
 
 
 
 
 
 
5387
  var adding_required= document.createElement("input");
5388
  adding_required.setAttribute("type", "hidden");
5389
  adding_required.setAttribute("value", w_required);
@@ -5536,7 +5563,8 @@ function type_name(i, w_field_label, w_field_label_size, w_field_label_pos, w_fi
5536
  div_element.appendChild(adding_type);
5537
  div_element.appendChild(adding_required);
5538
  div_element.appendChild(adding_unique);
5539
- div_element.appendChild(table_name);
 
5540
  div_field.appendChild(div_label);
5541
  div_field.appendChild(div_element);
5542
 
@@ -6376,7 +6404,16 @@ jQuery("label#"+i+"_mini_label_street1").click(function() {
6376
 
6377
  }
6378
 
6379
- function type_submitter_mail(i, w_field_label, w_field_label_size, w_field_label_pos, w_size, w_first_val, w_title, w_required, w_unique, w_class, w_attr_name, w_attr_value){
 
 
 
 
 
 
 
 
 
6380
  document.getElementById("element_type").value="type_submitter_mail";
6381
 
6382
  delete_last_child();
@@ -6406,6 +6443,7 @@ function type_submitter_mail(i, w_field_label, w_field_label_size, w_field_label
6406
 
6407
  var edit_main_tr10 = document.createElement('tr');
6408
  var edit_main_tr11 = document.createElement('tr');
 
6409
 
6410
 
6411
  var edit_main_td1 = document.createElement('td');
@@ -6433,7 +6471,8 @@ function type_submitter_mail(i, w_field_label, w_field_label_size, w_field_label
6433
  var edit_main_td10_1 = document.createElement('td');
6434
  var edit_main_td11 = document.createElement('td');
6435
  var edit_main_td11_1 = document.createElement('td');
6436
-
 
6437
  var el_label_disable = document.createElement('label');
6438
  el_label_disable.setAttribute("for", "edit_for_disable");
6439
  el_label_disable.innerHTML = fmc_objectL10n.fmc_Enable_field;
@@ -6543,7 +6582,19 @@ function type_submitter_mail(i, w_field_label, w_field_label_size, w_field_label
6543
  if(w_required=="yes")
6544
 
6545
  el_required.setAttribute("checked", "checked");
6546
-
 
 
 
 
 
 
 
 
 
 
 
 
6547
  var el_unique_label = document.createElement('label');
6548
  el_unique_label.setAttribute("for", "el_unique");
6549
  el_unique_label.innerHTML = fmc_objectL10n.fmc_Allow_only_unique_values;
@@ -6677,7 +6728,10 @@ function type_submitter_mail(i, w_field_label, w_field_label_size, w_field_label
6677
 
6678
  edit_main_td9.appendChild(el_unique_label);
6679
  edit_main_td9_1.appendChild(el_unique);
6680
-
 
 
 
6681
  edit_main_td8.appendChild(el_attr_label);
6682
  edit_main_td8.appendChild(el_attr_add);
6683
  edit_main_td8.appendChild(br4);
@@ -6704,6 +6758,8 @@ function type_submitter_mail(i, w_field_label, w_field_label_size, w_field_label
6704
  edit_main_tr7.appendChild(edit_main_td7_1);
6705
  edit_main_tr9.appendChild(edit_main_td9);
6706
  edit_main_tr9.appendChild(edit_main_td9_1);
 
 
6707
  edit_main_tr8.appendChild(edit_main_td8);
6708
  edit_main_tr8.appendChild(edit_main_td8_1);
6709
  edit_main_table.appendChild(edit_main_tr11);
@@ -6715,6 +6771,7 @@ function type_submitter_mail(i, w_field_label, w_field_label_size, w_field_label
6715
  edit_main_table.appendChild(edit_main_tr5);
6716
  edit_main_table.appendChild(edit_main_tr7);
6717
  edit_main_table.appendChild(edit_main_tr9);
 
6718
  edit_main_table.appendChild(edit_main_tr8);
6719
  edit_div.appendChild(edit_main_table);
6720
 
@@ -6728,6 +6785,12 @@ function type_submitter_mail(i, w_field_label, w_field_label_size, w_field_label
6728
  adding_type.setAttribute("value", "type_submitter_mail");
6729
  adding_type.setAttribute("name", i+"_typeform_id_temp");
6730
  adding_type.setAttribute("id", i+"_typeform_id_temp");
 
 
 
 
 
 
6731
 
6732
  var adding_required = document.createElement("input");
6733
  adding_required.setAttribute("type", "hidden");
@@ -6810,6 +6873,7 @@ function type_submitter_mail(i, w_field_label, w_field_label_size, w_field_label
6810
  div_element.appendChild(adding_type);
6811
  div_element.appendChild(adding_required);
6812
  div_element.appendChild(adding_unique);
 
6813
  div_element.appendChild(adding);
6814
  div_field.appendChild(div_label);
6815
  div_field.appendChild(div_element);
@@ -10414,6 +10478,10 @@ function add(key) {
10414
  else alert(fmc_objectL10n.fmc_select_element_add);
10415
  if(document.getElementById('enable_sortable').value==1)
10416
  jQuery( ".wdform_arrows" ).hide();
 
 
 
 
10417
  }
10418
 
10419
  function call(i,key)
@@ -10598,14 +10666,14 @@ function edit(id) {
10598
  w_mini_middle = "Middle";
10599
 
10600
  w_mini_labels = [w_mini_title, document.getElementById(id+"_mini_label_first").innerHTML,document.getElementById(id+"_mini_label_last").innerHTML, w_mini_middle];
10601
-
10602
 
10603
  s=document.getElementById(id+"_element_firstform_id_temp").style.width;
10604
  w_size=s.substring(0,s.length-2);
10605
  atrs=return_attributes(id+'_element_firstform_id_temp');
10606
  w_attr_name=atrs[0];
10607
  w_attr_value=atrs[1];
10608
- type_name(id, w_field_label, w_field_label_size, w_field_label_pos,w_first_val, w_title, w_mini_labels, w_size, w_name_format, w_required, w_unique, w_class, w_attr_name, w_attr_value); break;
10609
  }
10610
  case 'type_address':
10611
  {
@@ -10669,11 +10737,11 @@ function edit(id) {
10669
  {
10670
  w_first_val=document.getElementById(id+"_elementform_id_temp").value;
10671
  w_title=document.getElementById(id+"_elementform_id_temp").title;
10672
-
10673
  atrs=return_attributes(id+'_elementform_id_temp');
10674
  w_attr_name=atrs[0];
10675
  w_attr_value=atrs[1];
10676
- type_submitter_mail(id, w_field_label, w_field_label_size, w_field_label_pos, w_size, w_first_val, w_title, w_required, w_unique, w_class, w_attr_name, w_attr_value); break;
10677
  }
10678
  case 'type_captcha':
10679
  {
@@ -11057,7 +11125,7 @@ function gen_form_fields()
11057
  w_mini_middle = "Middle";
11058
 
11059
  w_mini_labels = [ w_mini_title, document.getElementById(id+"_mini_label_first").innerHTML,document.getElementById(id+"_mini_label_last").innerHTML, w_mini_middle];
11060
-
11061
 
11062
 
11063
  s=document.getElementById(id+"_element_firstform_id_temp").style.width;
@@ -11078,7 +11146,7 @@ function gen_form_fields()
11078
  form_fields+=w_required+"*:*w_required*:*";
11079
  form_fields+=w_unique+"*:*w_unique*:*";
11080
  form_fields+=w_class+"*:*w_class*:*";
11081
-
11082
  for(j=0; j<w_attr_name.length; j++)
11083
  {
11084
  form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";
@@ -11167,6 +11235,7 @@ function gen_form_fields()
11167
  {
11168
  w_first_val=document.getElementById(id+"_elementform_id_temp").value;
11169
  w_title=document.getElementById(id+"_elementform_id_temp").title;
 
11170
 
11171
  atrs=return_attributes(id+'_elementform_id_temp');
11172
  w_attr_name=atrs[0];
@@ -11181,6 +11250,7 @@ function gen_form_fields()
11181
  form_fields+=w_required+"*:*w_required*:*";
11182
  form_fields+=w_unique+"*:*w_unique*:*";
11183
  form_fields+=w_class+"*:*w_class*:*";
 
11184
 
11185
  for(j=0; j<w_attr_name.length; j++)
11186
  {
@@ -11236,8 +11306,8 @@ function gen_form_fields()
11236
  form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";
11237
  }
11238
  form_fields+="*:*new_field*:*";
11239
- document.getElementById("public_key").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("public_key");
11240
- document.getElementById("private_key").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("private_key");
11241
 
11242
  break;
11243
 
4997
  }
4998
 
4999
 
5000
+ function type_name(i, w_field_label, w_field_label_size, w_field_label_pos, w_first_val, w_title, w_mini_labels, w_size, w_name_format, w_required, w_unique, w_class, w_attr_name, w_attr_value, w_autofill) {
5001
  document.getElementById("element_type").value="type_name";
5002
 
5003
  delete_last_child();
5022
  var edit_main_tr9 = document.createElement('tr');
5023
  var edit_main_tr10 = document.createElement('tr');
5024
  var edit_main_tr11 = document.createElement('tr');
5025
+ var edit_main_tr12 = document.createElement('tr');
5026
  var edit_main_td1 = document.createElement('td');
5027
  var edit_main_td1_1 = document.createElement('td');
5028
  var edit_main_td2 = document.createElement('td');
5045
  var edit_main_td10_1 = document.createElement('td');
5046
  var edit_main_td11 = document.createElement('td');
5047
  var edit_main_td11_1 = document.createElement('td');
5048
+ var edit_main_td12 = document.createElement('td');
5049
+ var edit_main_td12_1 = document.createElement('td');
5050
 
5051
  var el_label_disable = document.createElement('label');
5052
  el_label_disable.setAttribute("for", "edit_for_disable");
5177
  if(w_required=="yes")
5178
  el_required.setAttribute("checked", "checked");
5179
 
5180
+ var el_autofill_label = document.createElement('label');
5181
+ el_autofill_label.setAttribute("for", "el_autofill");
5182
+ el_autofill_label.innerHTML = "Autofill with user name";
5183
+
5184
+ var el_autofill = document.createElement('input');
5185
+ el_autofill.setAttribute("id", "el_autofill");
5186
+ el_autofill.setAttribute("type", "checkbox");
5187
+ el_autofill.setAttribute("onclick", "set_autofill('"+i+"_autofillform_id_temp')");
5188
+ if(w_autofill=="yes")
5189
+ el_autofill.setAttribute("checked", "checked");
5190
+
5191
  var el_unique_label = document.createElement('label');
5192
  el_unique_label.setAttribute("for", "el_unique");
5193
  el_unique_label.innerHTML = fmc_objectL10n.fmc_Allow_only_unique_values;
5343
 
5344
  edit_main_td5.appendChild(el_required_label);
5345
  edit_main_td5_1.appendChild(el_required);
5346
+
5347
+ edit_main_td12.appendChild(el_autofill_label);
5348
+ edit_main_td12_1.appendChild(el_autofill);
5349
 
5350
  edit_main_td8.appendChild(el_unique_label);
5351
  edit_main_td8_1.appendChild(el_unique);
5376
  edit_main_tr6.appendChild(edit_main_td6_1);
5377
  edit_main_tr8.appendChild(edit_main_td8);
5378
  edit_main_tr8.appendChild(edit_main_td8_1);
5379
+ edit_main_tr12.appendChild(edit_main_td12);
5380
+ edit_main_tr12.appendChild(edit_main_td12_1);
5381
  edit_main_tr9.appendChild(edit_main_td9);
5382
  edit_main_tr9.appendChild(edit_main_td9_1);
5383
  edit_main_table.appendChild(edit_main_tr11);
5390
  edit_main_table.appendChild(edit_main_tr4);
5391
  edit_main_table.appendChild(edit_main_tr5);
5392
  edit_main_table.appendChild(edit_main_tr8);
5393
+ edit_main_table.appendChild(edit_main_tr12);
5394
  edit_main_table.appendChild(edit_main_tr6);
5395
  edit_div.appendChild(edit_main_table);
5396
 
5404
  adding_type.setAttribute("value", "type_name");
5405
  adding_type.setAttribute("name", i+"_typeform_id_temp");
5406
  adding_type.setAttribute("id", i+"_typeform_id_temp");
5407
+
5408
+ var adding_autofill = document.createElement("input");
5409
+ adding_autofill.setAttribute("type", "hidden");
5410
+ adding_autofill.setAttribute("value", w_autofill);
5411
+ adding_autofill.setAttribute("name", i+"_autofillform_id_temp");
5412
+ adding_autofill.setAttribute("id", i+"_autofillform_id_temp");
5413
+
5414
  var adding_required= document.createElement("input");
5415
  adding_required.setAttribute("type", "hidden");
5416
  adding_required.setAttribute("value", w_required);
5563
  div_element.appendChild(adding_type);
5564
  div_element.appendChild(adding_required);
5565
  div_element.appendChild(adding_unique);
5566
+ div_element.appendChild(adding_autofill);
5567
+ div_element.appendChild(table_name);
5568
  div_field.appendChild(div_label);
5569
  div_field.appendChild(div_element);
5570
 
6404
 
6405
  }
6406
 
6407
+ function set_autofill(element){
6408
+ if(document.getElementById(element).value == 'yes') {
6409
+ document.getElementById(element).value = 'no';
6410
+ }
6411
+ else {
6412
+ document.getElementById(element).value = 'yes';
6413
+ }
6414
+ }
6415
+
6416
+ function type_submitter_mail(i, w_field_label, w_field_label_size, w_field_label_pos, w_size, w_first_val, w_title, w_required, w_unique, w_class, w_attr_name, w_attr_value, w_autofill){
6417
  document.getElementById("element_type").value="type_submitter_mail";
6418
 
6419
  delete_last_child();
6443
 
6444
  var edit_main_tr10 = document.createElement('tr');
6445
  var edit_main_tr11 = document.createElement('tr');
6446
+ var edit_main_tr12 = document.createElement('tr');
6447
 
6448
 
6449
  var edit_main_td1 = document.createElement('td');
6471
  var edit_main_td10_1 = document.createElement('td');
6472
  var edit_main_td11 = document.createElement('td');
6473
  var edit_main_td11_1 = document.createElement('td');
6474
+ var edit_main_td12 = document.createElement('td');
6475
+ var edit_main_td12_1 = document.createElement('td');
6476
  var el_label_disable = document.createElement('label');
6477
  el_label_disable.setAttribute("for", "edit_for_disable");
6478
  el_label_disable.innerHTML = fmc_objectL10n.fmc_Enable_field;
6582
  if(w_required=="yes")
6583
 
6584
  el_required.setAttribute("checked", "checked");
6585
+
6586
+ var el_autofill_label = document.createElement('label');
6587
+ el_autofill_label.setAttribute("class", "fm-field-label");
6588
+ el_autofill_label.setAttribute("for", "el_autofill");
6589
+ el_autofill_label.innerHTML = "Autofill with user email";
6590
+
6591
+ var el_autofill = document.createElement('input');
6592
+ el_autofill.setAttribute("id", "el_autofill");
6593
+ el_autofill.setAttribute("type", "checkbox");
6594
+ el_autofill.setAttribute("onclick", "set_autofill('"+i+"_autofillform_id_temp')");
6595
+ if(w_autofill=="yes")
6596
+ el_autofill.setAttribute("checked", "checked");
6597
+
6598
  var el_unique_label = document.createElement('label');
6599
  el_unique_label.setAttribute("for", "el_unique");
6600
  el_unique_label.innerHTML = fmc_objectL10n.fmc_Allow_only_unique_values;
6728
 
6729
  edit_main_td9.appendChild(el_unique_label);
6730
  edit_main_td9_1.appendChild(el_unique);
6731
+
6732
+ edit_main_td12.appendChild(el_autofill_label);
6733
+ edit_main_td12_1.appendChild(el_autofill);
6734
+
6735
  edit_main_td8.appendChild(el_attr_label);
6736
  edit_main_td8.appendChild(el_attr_add);
6737
  edit_main_td8.appendChild(br4);
6758
  edit_main_tr7.appendChild(edit_main_td7_1);
6759
  edit_main_tr9.appendChild(edit_main_td9);
6760
  edit_main_tr9.appendChild(edit_main_td9_1);
6761
+ edit_main_tr12.appendChild(edit_main_td12);
6762
+ edit_main_tr12.appendChild(edit_main_td12_1);
6763
  edit_main_tr8.appendChild(edit_main_td8);
6764
  edit_main_tr8.appendChild(edit_main_td8_1);
6765
  edit_main_table.appendChild(edit_main_tr11);
6771
  edit_main_table.appendChild(edit_main_tr5);
6772
  edit_main_table.appendChild(edit_main_tr7);
6773
  edit_main_table.appendChild(edit_main_tr9);
6774
+ edit_main_table.appendChild(edit_main_tr12);
6775
  edit_main_table.appendChild(edit_main_tr8);
6776
  edit_div.appendChild(edit_main_table);
6777
 
6785
  adding_type.setAttribute("value", "type_submitter_mail");
6786
  adding_type.setAttribute("name", i+"_typeform_id_temp");
6787
  adding_type.setAttribute("id", i+"_typeform_id_temp");
6788
+
6789
+ var adding_autofill = document.createElement("input");
6790
+ adding_autofill.setAttribute("type", "hidden");
6791
+ adding_autofill.setAttribute("value", w_autofill);
6792
+ adding_autofill.setAttribute("name", i+"_autofillform_id_temp");
6793
+ adding_autofill.setAttribute("id", i+"_autofillform_id_temp");
6794
 
6795
  var adding_required = document.createElement("input");
6796
  adding_required.setAttribute("type", "hidden");
6873
  div_element.appendChild(adding_type);
6874
  div_element.appendChild(adding_required);
6875
  div_element.appendChild(adding_unique);
6876
+ div_element.appendChild(adding_autofill);
6877
  div_element.appendChild(adding);
6878
  div_field.appendChild(div_label);
6879
  div_field.appendChild(div_element);
10478
  else alert(fmc_objectL10n.fmc_select_element_add);
10479
  if(document.getElementById('enable_sortable').value==1)
10480
  jQuery( ".wdform_arrows" ).hide();
10481
+
10482
+ jQuery(".wdform_page input[type='text'], .wdform_page input[type='password'], .wdform_page input[type='file'], .wdform_page textarea, .wdform_page input[type='checkbox'], .wdform_page input[type='radio'], .wdform_page select").prop("disabled", true);
10483
+
10484
+ jQuery(".element_toolbar").find("input[type='checkbox']").prop("disabled", false);
10485
  }
10486
 
10487
  function call(i,key)
10666
  w_mini_middle = "Middle";
10667
 
10668
  w_mini_labels = [w_mini_title, document.getElementById(id+"_mini_label_first").innerHTML,document.getElementById(id+"_mini_label_last").innerHTML, w_mini_middle];
10669
+ w_autofill = document.getElementById(id+"_autofillform_id_temp").value;
10670
 
10671
  s=document.getElementById(id+"_element_firstform_id_temp").style.width;
10672
  w_size=s.substring(0,s.length-2);
10673
  atrs=return_attributes(id+'_element_firstform_id_temp');
10674
  w_attr_name=atrs[0];
10675
  w_attr_value=atrs[1];
10676
+ type_name(id, w_field_label, w_field_label_size, w_field_label_pos,w_first_val, w_title, w_mini_labels, w_size, w_name_format, w_required, w_unique, w_class, w_attr_name, w_attr_value, w_autofill); break;
10677
  }
10678
  case 'type_address':
10679
  {
10737
  {
10738
  w_first_val=document.getElementById(id+"_elementform_id_temp").value;
10739
  w_title=document.getElementById(id+"_elementform_id_temp").title;
10740
+ w_autofill = document.getElementById(id+"_autofillform_id_temp").value;
10741
  atrs=return_attributes(id+'_elementform_id_temp');
10742
  w_attr_name=atrs[0];
10743
  w_attr_value=atrs[1];
10744
+ type_submitter_mail(id, w_field_label, w_field_label_size, w_field_label_pos, w_size, w_first_val, w_title, w_required, w_unique, w_class, w_attr_name, w_attr_value, w_autofill); break;
10745
  }
10746
  case 'type_captcha':
10747
  {
11125
  w_mini_middle = "Middle";
11126
 
11127
  w_mini_labels = [ w_mini_title, document.getElementById(id+"_mini_label_first").innerHTML,document.getElementById(id+"_mini_label_last").innerHTML, w_mini_middle];
11128
+ w_autofill = document.getElementById(id+"_autofillform_id_temp").value;
11129
 
11130
 
11131
  s=document.getElementById(id+"_element_firstform_id_temp").style.width;
11146
  form_fields+=w_required+"*:*w_required*:*";
11147
  form_fields+=w_unique+"*:*w_unique*:*";
11148
  form_fields+=w_class+"*:*w_class*:*";
11149
+ form_fields+=w_autofill+"*:*w_autofill*:*";
11150
  for(j=0; j<w_attr_name.length; j++)
11151
  {
11152
  form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";
11235
  {
11236
  w_first_val=document.getElementById(id+"_elementform_id_temp").value;
11237
  w_title=document.getElementById(id+"_elementform_id_temp").title;
11238
+ w_autofill = document.getElementById(id+"_autofillform_id_temp").value;
11239
 
11240
  atrs=return_attributes(id+'_elementform_id_temp');
11241
  w_attr_name=atrs[0];
11250
  form_fields+=w_required+"*:*w_required*:*";
11251
  form_fields+=w_unique+"*:*w_unique*:*";
11252
  form_fields+=w_class+"*:*w_class*:*";
11253
+ form_fields+=w_autofill+"*:*w_autofill*:*";
11254
 
11255
  for(j=0; j<w_attr_name.length; j++)
11256
  {
11306
  form_fields+=w_attr_name[j]+"="+w_attr_value[j]+"*:*w_attr_name*:*";
11307
  }
11308
  form_fields+="*:*new_field*:*";
11309
+ document.getElementById("public_key").value = '';
11310
+ document.getElementById("private_key").value= '';
11311
 
11312
  break;
11313
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://web-dorado.com/products/wordpress-contact-form-builder.html
4
  Tags: captcha, contact, contact form, contact forms, custom form, email, feedback, form, form builder, form manager, forms, survey
5
  Requires at least: 3.0.0
6
  Tested up to: 4.6
7
- Stable tag: 1.0.51
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -137,6 +137,10 @@ After downloading the ZIP file,
137
 
138
 
139
  == Changelog ==
 
 
 
 
140
  = 1.0.51 =
141
  * Changed: Featured Themes page
142
 
4
  Tags: captcha, contact, contact form, contact forms, custom form, email, feedback, form, form builder, form manager, forms, survey
5
  Requires at least: 3.0.0
6
  Tested up to: 4.6
7
+ Stable tag: 1.0.52
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
137
 
138
 
139
  == Changelog ==
140
+ = 1.0.52 =
141
+ * Added: Autofill with user name
142
+ * Added: Autofill with user email
143
+
144
  = 1.0.51 =
145
  * Changed: Featured Themes page
146