Contact Bank: WordPress Form Builder for Contact Forms - Version 2.1.38

Version Description

  • FIX: Proper Sanitization, Escaping, Validation of all Post Calls
  • FIX: Removal of all function_exists, class_exists, typeof from all the files.
  • FIX: Uninstall File moved to root folder and changes done as per wordpress guidelines.
  • FIX: Error Reporting in file Removed
  • FIX: Auto Updates Removed
  • FIX: Curl Calls Removed
Download this release

Release Info

Developer contact-banker
Plugin Icon 128x128 Contact Bank: WordPress Form Builder for Contact Forms
Version 2.1.38
Comparing to
See all releases

Code changes from version 2.1.37 to 2.1.38

contact-bank.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://tech-banker.com
5
  * Description: Build Complex, Powerful Contact Forms in Just Seconds. No Programming Knowledge Required! Yeah, It's Really That Easy.
6
  * Author: Tech Banker
7
- * Version: 2.1.37
8
  * Author URI: http://tech-banker.com
9
  * License: GPLv3 or later
10
  * Text Domain: contact-bank
@@ -18,30 +18,8 @@ if(!defined("CONTACT_BK_PLUGIN_DIR")) define("CONTACT_BK_PLUGIN_DIR", plugin_di
18
  if(!defined("CONTACT_BK_PLUGIN_DIRNAME")) define("CONTACT_BK_PLUGIN_DIRNAME", plugin_basename(dirname(__FILE__)));
19
  if(!defined("CONTACT_BK")) define("CONTACT_BK","contact-bank/contact-bank.php");
20
  if(!defined("CONTACT_BK_PLUGIN_BASENAME")) define("CONTACT_BK_PLUGIN_BASENAME", plugin_basename(__FILE__));
21
- if(!defined("tech_banker_stats_url")) define("tech_banker_stats_url", "stats.tech-banker-services.org");
22
- if(!defined("contact_bank_version_number")) define("contact_bank_version_number","2.1.37");
23
- if (!defined("CONTACT_MAIN_DIR")) define("CONTACT_MAIN_DIR", dirname(dirname(dirname(__FILE__)))."/contact-bank");
24
- if(!defined("CONTACT_BK_ERROR_LOGS_FILE")) define("CONTACT_BK_ERROR_LOGS_FILE",CONTACT_MAIN_DIR."/error-logs.txt");
25
- if (!is_dir(CONTACT_MAIN_DIR))
26
- {
27
- wp_mkdir_p(CONTACT_MAIN_DIR);
28
- }
29
- @ini_set("log_errors",1);
30
- @ini_set("error_log",CONTACT_BK_ERROR_LOGS_FILE);
31
-
32
- /*************************************************************************************/
33
- if(!function_exists("contact_bank_error_log_file"))
34
- {
35
- function contact_bank_error_log_file()
36
- {
37
- if(!file_exists(CONTACT_BK_ERROR_LOGS_FILE))
38
- {
39
- $error_file = fopen(CONTACT_BK_ERROR_LOGS_FILE, 'wb');
40
- fclose($error_file);
41
- }
42
- }
43
- }
44
-
45
 
46
  /* Function Name : plugin_install_script_for_contact_bank
47
  * Paramters : None
@@ -51,74 +29,72 @@ if(!function_exists("contact_bank_error_log_file"))
51
  * Last Modified : 1.0
52
  * Reasons for change : None
53
  */
54
- if(!function_exists("plugin_install_script_for_contact_bank"))
 
55
  {
56
- function plugin_install_script_for_contact_bank()
57
- {
58
- global $wpdb,$current_user,$cb_user_role_permission;
59
- if (is_super_admin())
60
- {
61
- $cb_role = "administrator";
62
- }
63
- else
64
- {
65
- $cb_role = $wpdb->prefix . "capabilities";
66
- $current_user->role = array_keys($current_user->$cb_role);
67
- $cb_role = $current_user->role[0];
68
- }
69
- if (is_multisite())
70
- {
71
- $blog_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
72
- foreach($blog_ids as $blog_id)
73
- {
74
- switch_to_blog($blog_id);
75
- if(file_exists(CONTACT_BK_PLUGIN_DIR. "/lib/install-script.php"))
76
- {
77
- include CONTACT_BK_PLUGIN_DIR ."/lib/install-script.php";
78
- }
79
- restore_current_blog();
80
- }
81
- }
82
- else
83
- {
84
- if(file_exists(CONTACT_BK_PLUGIN_DIR. "/lib/install-script.php"))
85
- {
86
- include CONTACT_BK_PLUGIN_DIR ."/lib/install-script.php";
87
- }
88
- }
89
- }
90
  }
91
 
 
92
  /*************************************************************************************/
93
 
94
- if(!class_exists("class_plugin_info_contact_bank"))
 
95
  {
96
- class class_plugin_info_contact_bank
97
- {
98
- function get_plugin_info()
99
- {
100
- $active_plugins = (array)get_option("active_plugins", array());
101
- if (is_multisite())
102
- $active_plugins = array_merge($active_plugins, get_site_option("active_sitewide_plugins", array()));
103
- $plugins = array();
104
- if(count($active_plugins) > 0)
105
- {
106
- $get_plugins = array();
107
- foreach ($active_plugins as $plugin)
108
- {
109
- $plugin_data = @get_plugin_data(WP_PLUGIN_DIR . "/" . $plugin);
110
-
111
- $get_plugins["plugin_name"] = strip_tags($plugin_data["Name"]);
112
- $get_plugins["plugin_author"] = strip_tags($plugin_data["Author"]);
113
- $get_plugins["plugin_version"] = strip_tags($plugin_data["Version"]);
114
- array_push($plugins,$get_plugins);
115
- }
116
- return $plugins;
117
- }
118
- }
119
- }
120
  }
121
 
 
122
  /*
123
  Function Name: deactivation_function_for_contact_bank
124
  Description: This function is used for executing the code on deactivation.
@@ -126,175 +102,63 @@ Parameters: No
126
  Created On: 07-04-2017 09:54
127
  Created By: Tech Banker Team
128
  */
129
- if(!function_exists("deactivation_function_for_contact_bank"))
130
- {
131
- function deactivation_function_for_contact_bank()
132
- {
133
- $type = get_option("contact-bank-wizard");
134
- if($type == "opt_in")
135
- {
136
- $class_plugin_info_contact_bank = new class_plugin_info_contact_bank();
137
- global $wp_version,$wpdb;
138
-
139
- $url = tech_banker_stats_url."/wp-admin/admin-ajax.php";
140
-
141
- $theme_details = array();
142
-
143
- if($wp_version >= 3.4)
144
- {
145
- $active_theme = wp_get_theme();
146
- $theme_details["theme_name"] = strip_tags($active_theme->Name);
147
- $theme_details["theme_version"] = strip_tags($active_theme->Version);
148
- $theme_details["author_url"] = strip_tags($active_theme->{"Author URI"});
149
- }
150
-
151
- $plugin_stat_data = array();
152
- $plugin_stat_data["plugin_slug"] = "contact-bank";
153
- $plugin_stat_data["type"] = "standard_edition";
154
- $plugin_stat_data["version_number"] = contact_bank_version_number;
155
- $plugin_stat_data["status"] = $type;
156
- $plugin_stat_data["event"] = "de-activate";
157
- $plugin_stat_data["domain_url"] = site_url();
158
- $plugin_stat_data["wp_language"] = defined("WPLANG") && WPLANG ? WPLANG : get_locale();
159
-
160
- $plugin_stat_data["email"] = get_option("admin_email");
161
- $plugin_stat_data["wp_version"] = $wp_version;
162
- $plugin_stat_data["php_version"] = esc_html(phpversion());
163
- $plugin_stat_data["mysql_version"] = $wpdb->db_version();
164
- $plugin_stat_data["max_input_vars"] = ini_get("max_input_vars");
165
- $plugin_stat_data["operating_system"] = PHP_OS ." (".PHP_INT_SIZE * 8 .") BIT";
166
- $plugin_stat_data["php_memory_limit"] = ini_get("memory_limit") ? ini_get("memory_limit") : "N/A";
167
- $plugin_stat_data["extensions"] = get_loaded_extensions();
168
- $plugin_stat_data["plugins"] = $class_plugin_info_contact_bank->get_plugin_info();
169
- $plugin_stat_data["themes"] = $theme_details;
170
-
171
- if(function_exists("curl_init"))
172
- {
173
- $ch = curl_init();
174
- curl_setopt($ch, CURLOPT_URL, $url);
175
- curl_setopt($ch, CURLOPT_POST, 1);
176
- curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json"));
177
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
178
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
179
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
180
- curl_setopt($ch, CURLOPT_POSTFIELDS,
181
- http_build_query(array( "data" => serialize($plugin_stat_data), "site_id" => get_option("contact_bank_site_id") !="" ? get_option("contact_bank_site_id") : "", "action"=>"plugin_analysis_data")));
182
- $result = curl_exec($ch);
183
- update_option("contact_bank_site_id",$result);
184
- curl_close($ch);
185
- }
186
- else
187
- {
188
- $response = wp_safe_remote_post($url, array
189
- (
190
- "method" => "POST",
191
- "timeout" => 45,
192
- "redirection" => 5,
193
- "httpversion" => "1.0",
194
- "blocking" => true,
195
- "headers" => array(),
196
- "body" => array( "data" => serialize($plugin_stat_data), "site_id" => get_option("contact_bank_site_id") != "" ? get_option("contact_bank_site_id") : "","action"=>"plugin_analysis_data")
197
- ));
198
-
199
- if(!is_wp_error($response))
200
- {
201
- $response["body"] != "" ? update_option("contact_bank_site_id", $response["body"]) : "";
202
- }
203
- else
204
- {
205
- update_option("contact_bank_site_id", "error");
206
- }
207
- }
208
- }
209
- }
210
- }
211
 
212
- if(!function_exists("plugin_uninstall_script_for_contact_bank"))
213
  {
214
- function plugin_uninstall_script_for_contact_bank()
215
- {
216
- wp_clear_scheduled_hook("contact_bank_auto_update");
217
- $type = get_option("contact-bank-wizard");
218
- if($type == "opt_in")
219
- {
220
- $class_plugin_info_contact_bank = new class_plugin_info_contact_bank();
221
- global $wp_version,$wpdb;
222
-
223
- $url = tech_banker_stats_url."/wp-admin/admin-ajax.php";
224
-
225
- $theme_details = array();
226
-
227
- if($wp_version >= 3.4)
228
- {
229
- $active_theme = wp_get_theme();
230
- $theme_details["theme_name"] = strip_tags($active_theme->Name);
231
- $theme_details["theme_version"] = strip_tags($active_theme->Version);
232
- $theme_details["author_url"] = strip_tags($active_theme->{"Author URI"});
233
- }
234
-
235
- $plugin_stat_data = array();
236
- $plugin_stat_data["plugin_slug"] = "contact-bank";
237
- $plugin_stat_data["type"] = "standard_edition";
238
- $plugin_stat_data["version_number"] = contact_bank_version_number;
239
- $plugin_stat_data["status"] = $type;
240
- $plugin_stat_data["event"] = "uninstall";
241
- $plugin_stat_data["domain_url"] = site_url();
242
- $plugin_stat_data["wp_language"] = defined("WPLANG") && WPLANG ? WPLANG : get_locale();
243
-
244
- $plugin_stat_data["email"] = get_option("admin_email");
245
- $plugin_stat_data["wp_version"] = $wp_version;
246
- $plugin_stat_data["php_version"] = esc_html(phpversion());
247
- $plugin_stat_data["mysql_version"] = $wpdb->db_version();
248
- $plugin_stat_data["max_input_vars"] = ini_get("max_input_vars");
249
- $plugin_stat_data["operating_system"] = PHP_OS ." (".PHP_INT_SIZE * 8 .") BIT";
250
- $plugin_stat_data["php_memory_limit"] = ini_get("memory_limit") ? ini_get("memory_limit") : "N/A";
251
- $plugin_stat_data["extensions"] = get_loaded_extensions();
252
- $plugin_stat_data["plugins"] = $class_plugin_info_contact_bank->get_plugin_info();
253
- $plugin_stat_data["themes"] = $theme_details;
254
-
255
- if(function_exists("curl_init"))
256
- {
257
- $ch = curl_init();
258
- curl_setopt($ch, CURLOPT_URL, $url);
259
- curl_setopt($ch, CURLOPT_POST, 1);
260
- curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json"));
261
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
262
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
263
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
264
- curl_setopt($ch, CURLOPT_POSTFIELDS,
265
- http_build_query(array( "data" => serialize($plugin_stat_data), "site_id" => get_option("contact_bank_site_id") !="" ? get_option("contact_bank_site_id") : "", "action"=>"plugin_analysis_data")));
266
- $result = curl_exec($ch);
267
- update_option("contact_bank_site_id",$result);
268
- curl_close($ch);
269
- }
270
- else
271
- {
272
- $response = wp_safe_remote_post($url, array
273
- (
274
- "method" => "POST",
275
- "timeout" => 45,
276
- "redirection" => 5,
277
- "httpversion" => "1.0",
278
- "blocking" => true,
279
- "headers" => array(),
280
- "body" => array( "data" => serialize($plugin_stat_data), "site_id" => get_option("contact_bank_site_id") != "" ? get_option("contact_bank_site_id") : "","action"=>"plugin_analysis_data")
281
- ));
282
-
283
- if(!is_wp_error($response))
284
- {
285
- $response["body"] != "" ? update_option("contact_bank_site_id", $response["body"]) : "";
286
- }
287
- else
288
- {
289
- update_option("contact_bank_site_id", "error");
290
- }
291
- }
292
- }
293
- delete_option("contact-bank-wizard");
294
- }
295
  }
296
 
297
 
 
 
 
298
  /* Function Name : create_global_menus_for_contact_bank
299
  * Paramters : None
300
  * Return : None
@@ -303,110 +167,109 @@ if(!function_exists("plugin_uninstall_script_for_contact_bank"))
303
  * Last Modified : 1.0
304
  * Reasons for change : None
305
  */
306
- if(!function_exists("create_global_menus_for_contact_bank"))
 
307
  {
308
- function create_global_menus_for_contact_bank()
309
- {
310
- global $wpdb,$current_user;
311
- if (is_super_admin())
312
- {
313
- $cb_role = "administrator";
314
- }
315
- else
316
- {
317
- $cb_role = $wpdb->prefix . "capabilities";
318
- $current_user->role = array_keys($current_user->$cb_role);
319
- $cb_role = $current_user->role[0];
320
- }
321
- $contact_bank_wizard = get_option("contact-bank-wizard");
322
- global $wp_version;
323
-
324
- switch ($cb_role) {
325
- case "administrator":
326
- if(get_option("contact-bank-wizard"))
327
- {
328
- add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
329
- }
330
- else
331
- {
332
- add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read","contact_bank_wizard","",plugins_url("/assets/images/icon.png" , __FILE__));
333
- add_submenu_page("Contact Bank", __("Contact Bank", "contact-bank") ,"","read","contact_bank_wizard", "contact_bank_wizard");
334
- }
335
- add_submenu_page("contact_dashboard", "Dashboard", __("Dashboard", "contact-bank"), "read", "contact_dashboard", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_dashboard");
336
- add_submenu_page("","","", "read", "contact_bank","contact_bank");
337
- add_submenu_page("contact_dashboard", "Plugin Updates", __("Plugin Updates", "contact-bank"), "read", "contact_plugin_update", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_plugin_update" );
338
- add_submenu_page("contact_dashboard", "Short-Codes", __("Short-Codes", "contact-bank"), "read", "contact_short_code", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_short_code" );
339
- add_submenu_page("contact_dashboard", "Form Entries", __("Form Entries", "contact-bank"), "read", "contact_frontend_data", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_frontend_data");
340
- add_submenu_page("contact_dashboard", "Email Settings", __("Email Settings", "contact-bank"), "read", "contact_email", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_email");
341
- add_submenu_page("contact_dashboard", "Global Settings", __("Global Settings", "contact-bank"), "read", "contact_layout_settings", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_layout_settings");
342
- add_submenu_page("contact_dashboard", "Feature Requests", __("Feature Requests", "contact-bank"), "read", "contact_feature_request", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_feature_request");
343
- add_submenu_page("contact_dashboard", "System Status", __("System Status", "contact-bank"), "read", "contact_system_status", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_system_status" );
344
- add_submenu_page("contact_dashboard", "Recommendations", __("Recommendations", "contact-bank"), "read", "contact_bank_recommended_plugins", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_bank_recommended_plugins");
345
- add_submenu_page("contact_dashboard", "Premium Editions", __("Premium Editions", "contact-bank"), "read", "contact_pro_version", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_pro_version" );
346
- add_submenu_page("contact_dashboard", " Our Other Services ", __("Our Other Services", "contact-bank"), "read", "contact_bank_other_services", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_bank_other_services");
347
- add_submenu_page("","","", "read", "add_contact_email_settings", "add_contact_email_settings" );
348
- add_submenu_page("","","", "read", "form_preview", "form_preview" );
349
- break;
350
- case "editor":
351
- if(get_option("contact-bank-wizard"))
352
- {
353
- add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
354
- }
355
- else
356
- {
357
- add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read","contact_bank_wizard","",plugins_url("/assets/images/icon.png" , __FILE__));
358
- add_submenu_page("Contact Bank", __("Contact Bank", "contact-bank") ,"","read","contact_bank_wizard", "contact_bank_wizard");
359
- }
360
- add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
361
- add_submenu_page("contact_dashboard", "Dashboard", __("Dashboard", "contact-bank"), "read", "contact_dashboard","contact_dashboard");
362
- add_submenu_page("","","", "read", "contact_bank","contact_bank");
363
- add_submenu_page("contact_dashboard", "Plugin Updates", __("Plugin Updates", "contact-bank"), "read", "contact_plugin_update", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_plugin_update" );
364
- add_submenu_page("contact_dashboard", "Short-Codes", __("Short-Codes", "contact-bank"), "read", "contact_short_code", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_short_code" );
365
- add_submenu_page("contact_dashboard", "Form Entries", __("Form Entries", "contact-bank"), "read", "contact_frontend_data", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_frontend_data");
366
- add_submenu_page("contact_dashboard", "Email Settings", __("Email Settings", "contact-bank"), "read", "contact_email", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_email");
367
- add_submenu_page("contact_dashboard", "Global Settings", __("Global Settings", "contact-bank"), "read", "contact_layout_settings", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_layout_settings");
368
- add_submenu_page("contact_dashboard", "Feature Requests", __("Feature Requests", "contact-bank"), "read", "contact_feature_request", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_feature_request");
369
- add_submenu_page("contact_dashboard", "System Status", __("System Status", "contact-bank"), "read", "contact_system_status", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_system_status" );
370
- add_submenu_page("contact_dashboard", "Recommendations", __("Recommendations", "contact-bank"), "read", "contact_bank_recommended_plugins", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_bank_recommended_plugins");
371
- add_submenu_page("contact_dashboard", "Premium Editions", __("Premium Editions", "contact-bank"), "read", "contact_pro_version", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_pro_version" );
372
- add_submenu_page("contact_dashboard", " Our Other Services ", __("Our Other Services", "contact-bank"), "read", "contact_bank_other_services", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_bank_other_services");
373
- add_submenu_page("","","", "read", "add_contact_email_settings", "add_contact_email_settings" );
374
- add_submenu_page("","","", "read", "form_preview", "form_preview" );
375
- break;
376
- case "author":
377
- if(get_option("contact-bank-wizard"))
378
- {
379
- add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
380
- }
381
- else
382
- {
383
- add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read","contact_bank_wizard","",plugins_url("/assets/images/icon.png" , __FILE__));
384
- add_submenu_page("Contact Bank", __("Contact Bank", "contact-bank") ,"","read","contact_bank_wizard", "contact_bank_wizard");
385
- }
386
- add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
387
- add_submenu_page("contact_dashboard", "Dashboard", __("Dashboard", "contact-bank"), "read", "contact_dashboard","contact_dashboard");
388
- add_submenu_page("","","", "read", "contact_bank","contact_bank");
389
- add_submenu_page("contact_dashboard", "Plugin Updates", __("Plugin Updates", "contact-bank"), "read", "contact_plugin_update", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_plugin_update" );
390
- add_submenu_page("contact_dashboard", "Short-Codes", __("Short-Codes", "contact-bank"), "read", "contact_short_code", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_short_code" );
391
- add_submenu_page("contact_dashboard", "Form Entries", __("Form Entries", "contact-bank"), "read", "contact_frontend_data", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_frontend_data");
392
- add_submenu_page("contact_dashboard", "Email Settings", __("Email Settings", "contact-bank"), "read", "contact_email", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_email");
393
- add_submenu_page("contact_dashboard", "Global Settings", __("Global Settings", "contact-bank"), "read", "contact_layout_settings", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_layout_settings");
394
- add_submenu_page("contact_dashboard", "Feature Requests", __("Feature Requests", "contact-bank"), "read", "contact_feature_request", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_feature_request");
395
- add_submenu_page("contact_dashboard", "System Status", __("System Status", "contact-bank"), "read", "contact_system_status", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_system_status" );
396
- add_submenu_page("contact_dashboard", "Recommendations", __("Recommendations", "contact-bank"), "read", "contact_bank_recommended_plugins", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_bank_recommended_plugins");
397
- add_submenu_page("contact_dashboard", "Premium Editions", __("Premium Editions", "contact-bank"), "read", "contact_pro_version", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_pro_version" );
398
- add_submenu_page("contact_dashboard", " Our Other Services ", __("Our Other Services", "contact-bank"), "read", "contact_bank_other_services", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_bank_other_services");
399
- add_submenu_page("","","", "read", "add_contact_email_settings", "add_contact_email_settings" );
400
- add_submenu_page("","","", "read", "form_preview", "form_preview" );
401
- break;
402
- case "contributor":
403
- break;
404
-
405
- case "subscriber":
406
- break;
407
- }
408
- }
409
  }
 
410
  /* Function Name : contact_bank
411
  * Paramters : None
412
  * Return : None
@@ -415,682 +278,650 @@ if(!function_exists("create_global_menus_for_contact_bank"))
415
  * Last Modified : 1.0
416
  * Reasons for change : None
417
  */
418
- if(!function_exists("contact_bank"))
 
419
  {
420
- function contact_bank()
421
- {
422
- global $wpdb,$current_user,$cb_user_role_permission;
423
- if (is_super_admin())
424
- {
425
- $cb_role = "administrator";
426
- }
427
- else
428
- {
429
- $cb_role = $wpdb->prefix . "capabilities";
430
- $current_user->role = array_keys($current_user->$cb_role);
431
- $cb_role = $current_user->role[0];
432
- }
433
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
434
- {
435
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
436
- }
437
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php"))
438
- {
439
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php";
440
- }
441
- if(file_exists(CONTACT_BK_PLUGIN_DIR . "/views/includes_common_after.php"))
442
- {
443
- include_once CONTACT_BK_PLUGIN_DIR . "/views/includes_common_after.php";
444
- }
445
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
446
- {
447
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
448
- }
449
- }
450
  }
451
- if(!function_exists("contact_dashboard"))
 
 
452
  {
453
- function contact_dashboard()
454
- {
455
- global $wpdb,$current_user,$cb_user_role_permission;
456
- if (is_super_admin())
457
- {
458
- $cb_role = "administrator";
459
- }
460
- else
461
- {
462
- $cb_role = $wpdb->prefix . "capabilities";
463
- $current_user->role = array_keys($current_user->$cb_role);
464
- $cb_role = $current_user->role[0];
465
- }
466
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
467
- {
468
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
469
- }
470
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/dashboard.php"))
471
- {
472
- include_once CONTACT_BK_PLUGIN_DIR ."/views/dashboard.php";
473
- }
474
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
475
- {
476
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
477
- }
478
- }
479
  }
480
 
481
- if(!function_exists("contact_bank_wizard"))
 
482
  {
483
- function contact_bank_wizard()
484
- {
485
- global $wpdb,$current_user,$cb_user_role_permission;
486
- if (is_super_admin())
487
- {
488
- $cb_role = "administrator";
489
- }
490
- else
491
- {
492
- $cb_role = $wpdb->prefix . "capabilities";
493
- $current_user->role = array_keys($current_user->$cb_role);
494
- $cb_role = $current_user->role[0];
495
- }
496
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/wizard.php"))
497
- {
498
- include_once CONTACT_BK_PLUGIN_DIR ."/views/wizard.php";
499
- }
500
- }
501
  }
502
 
503
- if(!function_exists("edit_contact_view"))
 
 
504
  {
505
- function edit_contact_view()
506
- {
507
- global $wpdb,$current_user,$cb_user_role_permission;
508
- if (is_super_admin())
509
- {
510
- $cb_role = "administrator";
511
- }
512
- else
513
- {
514
- $cb_role = $wpdb->prefix . "capabilities";
515
- $current_user->role = array_keys($current_user->$cb_role);
516
- $cb_role = $current_user->role[0];
517
- }
518
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
519
- {
520
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
521
- }
522
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php"))
523
- {
524
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php";
525
- }
526
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
527
- {
528
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
529
- }
530
- }
531
  }
532
- if(!function_exists("contact_plugin_update"))
 
 
533
  {
534
- function contact_plugin_update()
535
- {
536
- global $wpdb,$current_user,$cb_user_role_permission;
537
- if (is_super_admin())
538
- {
539
- $cb_role = "administrator";
540
- }
541
- else
542
- {
543
- $cb_role = $wpdb->prefix . "capabilities";
544
- $current_user->role = array_keys($current_user->$cb_role);
545
- $cb_role = $current_user->role[0];
546
- }
547
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
548
- {
549
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
550
- }
551
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/automatic-plugin-update.php"))
552
- {
553
- include_once CONTACT_BK_PLUGIN_DIR ."/views/automatic-plugin-update.php";
554
- }
555
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
556
- {
557
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
558
- }
559
- }
560
  }
561
- if(!function_exists("contact_email"))
562
- {
563
  function contact_email()
564
- {
565
- global $wpdb,$current_user,$cb_user_role_permission;
566
- if (is_super_admin())
567
- {
568
- $cb_role = "administrator";
569
- }
570
- else
571
- {
572
- $cb_role = $wpdb->prefix . "capabilities";
573
- $current_user->role = array_keys($current_user->$cb_role);
574
- $cb_role = $current_user->role[0];
575
- }
576
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
577
- {
578
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
579
- }
580
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_email_settings.php"))
581
- {
582
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_email_settings.php";
583
- }
584
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
585
- {
586
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
587
- }
588
- }
589
  }
590
- if(!function_exists("contact_frontend_data"))
 
 
591
  {
592
- function contact_frontend_data()
593
- {
594
- global $wpdb,$current_user,$cb_user_role_permission;
595
- if (is_super_admin())
596
- {
597
- $cb_role = "administrator";
598
- }
599
- else
600
- {
601
- $cb_role = $wpdb->prefix . "capabilities";
602
- $current_user->role = array_keys($current_user->$cb_role);
603
- $cb_role = $current_user->role[0];
604
- }
605
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
606
- {
607
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
608
- }
609
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_frontend_data.php"))
610
- {
611
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_frontend_data.php";
612
- }
613
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
614
- {
615
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
616
- }
617
- }
618
  }
619
- if(!function_exists("add_contact_email_settings"))
 
 
620
  {
621
- function add_contact_email_settings()
622
- {
623
- global $wpdb,$current_user,$cb_user_role_permission;
624
- if (is_super_admin())
625
- {
626
- $cb_role = "administrator";
627
- }
628
- else
629
- {
630
- $cb_role = $wpdb->prefix . "capabilities";
631
- $current_user->role = array_keys($current_user->$cb_role);
632
- $cb_role = $current_user->role[0];
633
- }
634
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
635
- {
636
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
637
- }
638
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/add_contact_email.php"))
639
- {
640
- include_once CONTACT_BK_PLUGIN_DIR ."/views/add_contact_email.php";
641
- }
642
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
643
- {
644
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
645
- }
646
- }
647
  }
648
- if(!function_exists("contact_layout_settings"))
 
 
649
  {
650
- function contact_layout_settings()
651
- {
652
- global $wpdb,$current_user,$cb_user_role_permission;
653
- if (is_super_admin())
654
- {
655
- $cb_role = "administrator";
656
- }
657
- else
658
- {
659
- $cb_role = $wpdb->prefix . "capabilities";
660
- $current_user->role = array_keys($current_user->$cb_role);
661
- $cb_role = $current_user->role[0];
662
- }
663
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
664
- {
665
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
666
- }
667
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_layout_settings.php"))
668
- {
669
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_layout_settings.php";
670
- }
671
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
672
- {
673
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
674
- }
675
- }
676
  }
677
- if(!function_exists("contact_feature_request"))
 
678
  {
679
- function contact_feature_request()
680
- {
681
- global $wpdb,$current_user,$user_role_permission;
682
- if(is_super_admin())
683
- {
684
- $cb_role = "administrator";
685
- }
686
- else
687
- {
688
- $cb_role = $wpdb->prefix . "capabilities";
689
- $current_user->role = array_keys($current_user->$cb_role);
690
- $cb_role = $current_user->role[0];
691
- }
692
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
693
- {
694
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
695
- }
696
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact-feedback.php"))
697
- {
698
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact-feedback.php";
699
- }
700
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
701
- {
702
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
703
- }
704
- }
705
  }
706
- if(!function_exists("contact_system_status"))
 
 
707
  {
708
- function contact_system_status()
709
- {
710
- global $wpdb,$current_user,$cb_user_role_permission;
711
- if (is_super_admin())
712
- {
713
- $cb_role = "administrator";
714
- }
715
- else
716
- {
717
- $cb_role = $wpdb->prefix . "capabilities";
718
- $current_user->role = array_keys($current_user->$cb_role);
719
- $cb_role = $current_user->role[0];
720
- }
721
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
722
- {
723
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
724
- }
725
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact-bank-system-report.php"))
726
- {
727
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact-bank-system-report.php";
728
- }
729
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
730
- {
731
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
732
- }
733
- }
734
  }
735
- if(!function_exists("form_preview"))
 
 
736
  {
737
- function form_preview()
738
- {
739
- global $wpdb,$current_user,$cb_user_role_permission;
740
- if (is_super_admin())
741
- {
742
- $cb_role = "administrator";
743
- }
744
- else
745
- {
746
- $cb_role = $wpdb->prefix . "capabilities";
747
- $current_user->role = array_keys($current_user->$cb_role);
748
- $cb_role = $current_user->role[0];
749
- }
750
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
751
- {
752
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
753
- }
754
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_form_preview.php"))
755
- {
756
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_form_preview.php";
757
- }
758
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
759
- {
760
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
761
- }
762
- }
763
  }
764
- if(!function_exists("contact_pro_version"))
 
 
765
  {
766
- function contact_pro_version()
767
- {
768
- global $wpdb,$current_user,$cb_user_role_permission;
769
- if (is_super_admin())
770
- {
771
- $cb_role = "administrator";
772
- }
773
- else
774
- {
775
- $cb_role = $wpdb->prefix . "capabilities";
776
- $current_user->role = array_keys($current_user->$cb_role);
777
- $cb_role = $current_user->role[0];
778
- }
779
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
780
- {
781
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
782
- }
783
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/purchase_pro_version.php"))
784
- {
785
- include_once CONTACT_BK_PLUGIN_DIR ."/views/purchase_pro_version.php";
786
- }
787
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
788
- {
789
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
790
- }
791
- }
792
  }
793
- if(!function_exists("contact_bank_recommended_plugins"))
 
 
794
  {
795
- function contact_bank_recommended_plugins()
796
- {
797
- global $wpdb,$current_user,$cb_user_role_permission;
798
- if (is_super_admin())
799
- {
800
- $cb_role = "administrator";
801
- }
802
- else
803
- {
804
- $cb_role = $wpdb->prefix . "capabilities";
805
- $current_user->role = array_keys($current_user->$cb_role);
806
- $cb_role = $current_user->role[0];
807
- }
808
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
809
- {
810
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
811
- }
812
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/recommended-plugins.php"))
813
- {
814
- include_once CONTACT_BK_PLUGIN_DIR ."/views/recommended-plugins.php";
815
- }
816
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
817
- {
818
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
819
- }
820
- }
821
  }
822
- if(!function_exists("contact_bank_other_services"))
 
 
823
  {
824
- function contact_bank_other_services()
825
- {
826
- global $wpdb,$current_user,$cb_user_role_permission;
827
- if (is_super_admin())
828
- {
829
- $cb_role = "administrator";
830
- }
831
- else
832
- {
833
- $cb_role = $wpdb->prefix . "capabilities";
834
- $current_user->role = array_keys($current_user->$cb_role);
835
- $cb_role = $current_user->role[0];
836
- }
837
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
838
- {
839
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
840
- }
841
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/other-services.php"))
842
- {
843
- include_once CONTACT_BK_PLUGIN_DIR ."/views/other-services.php";
844
- }
845
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
846
- {
847
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
848
- }
849
- }
850
  }
851
- if(!function_exists("contact_short_code"))
 
852
  {
853
- function contact_short_code()
854
- {
855
- global $wpdb,$current_user,$cb_user_role_permission;
856
- if (is_super_admin())
857
- {
858
- $cb_role = "administrator";
859
- }
860
- else
861
- {
862
- $cb_role = $wpdb->prefix . "capabilities";
863
- $current_user->role = array_keys($current_user->$cb_role);
864
- $cb_role = $current_user->role[0];
865
- }
866
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
867
- {
868
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
869
- }
870
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/shortcode.php"))
871
- {
872
- include_once CONTACT_BK_PLUGIN_DIR ."/views/shortcode.php";
873
- }
874
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
875
- {
876
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
877
- }
878
- }
879
  }
880
- if(!function_exists("backend_plugin_js_scripts_contact_bank"))
 
881
  {
882
- function backend_plugin_js_scripts_contact_bank()
883
- {
884
- wp_enqueue_script("jquery");
885
- wp_enqueue_script("jquery-ui-sortable");
886
- wp_enqueue_script("jquery-ui-droppable");
887
- wp_enqueue_script("jquery-ui-draggable");
888
- wp_enqueue_script("farbtastic");
889
- wp_enqueue_script("jquery-ui-dialog");
890
- wp_enqueue_script("jquery.Tooltip.js", plugins_url("/assets/js/jquery.Tooltip.js",__FILE__));
891
- wp_enqueue_script("jquery.dataTables.min", plugins_url("/assets/js/jquery.dataTables.min.js",__FILE__));
892
- wp_enqueue_script("jquery.validate.min", plugins_url("/assets/js/jquery.validate.min.js",__FILE__));
893
- wp_enqueue_script("bootstrap.js", plugins_url("/assets/js/bootstrap.js",__FILE__));
894
- wp_enqueue_script("jquery.prettyPhoto.js", plugins_url("/assets/js/jquery.prettyPhoto.js",__FILE__));
895
- }
896
  }
897
- if(!function_exists("frontend_plugin_js_scripts_contact_bank"))
 
 
898
  {
899
- function frontend_plugin_js_scripts_contact_bank()
900
- {
901
- wp_enqueue_script("jquery");
902
- wp_enqueue_script("jquery.Tooltip.js", plugins_url("/assets/js/jquery.Tooltip.js",__FILE__));
903
- wp_enqueue_script("jquery.validate.min", plugins_url("/assets/js/jquery.validate.min.js",__FILE__));
904
- }
905
  }
906
- if(!function_exists("backend_plugin_css_styles_contact_bank"))
 
 
907
  {
908
- function backend_plugin_css_styles_contact_bank()
909
- {
910
- wp_enqueue_style("farbtastic");
911
- wp_enqueue_style("wp-jquery-ui-dialog");
912
- wp_enqueue_style("stylesheet", plugins_url("/assets/css/stylesheet.css",__FILE__));
913
- wp_enqueue_style("simple-line-icon", plugins_url("/assets/css/icons/icons.css",__FILE__));
914
- wp_enqueue_style("system-message", plugins_url("/assets/css/system-message.css",__FILE__));
915
- wp_enqueue_style("prettyPhoto", plugins_url("/assets/css/prettyPhoto.css",__FILE__));
916
- wp_enqueue_style("premium-edition.css", plugins_url("/assets/css/premium-edition.css",__FILE__));
917
- wp_enqueue_style("responsive.css", plugins_url("/assets/css/responsive.css",__FILE__));
918
- wp_enqueue_style("google-fonts-roboto", "//fonts.googleapis.com/css?family=Roboto Condensed:300|Roboto Condensed:300|Roboto Condensed:300|Roboto Condensed:regular|Roboto Condensed:300");
919
- }
920
  }
921
- if(!function_exists("frontend_plugin_css_styles_contact_bank"))
 
 
922
  {
923
- function frontend_plugin_css_styles_contact_bank()
924
- {
925
- wp_enqueue_style("stylesheet", plugins_url("/assets/css/stylesheet.css",__FILE__));
926
- wp_enqueue_style("system-message", plugins_url("/assets/css/system-message.css",__FILE__));
927
- contact_bank_error_log_file();
928
- }
929
  }
 
930
  if(isset($_REQUEST["action"]))
931
  {
932
  switch(esc_attr($_REQUEST["action"]))
933
  {
934
  case "add_contact_form_library":
935
  add_action( "admin_init", "add_contact_form_library");
936
- if(!function_exists("add_contact_form_library"))
937
- {
938
- function add_contact_form_library()
939
- {
940
- global $wpdb,$current_user,$cb_user_role_permission;
941
- if (is_super_admin())
942
- {
943
- $cb_role = "administrator";
944
- }
945
- else
946
- {
947
- $cb_role = $wpdb->prefix . "capabilities";
948
- $current_user->role = array_keys($current_user->$cb_role);
949
- $cb_role = $current_user->role[0];
950
- }
951
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_view-class.php"))
952
- {
953
- include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_view-class.php";
954
- }
955
- }
956
- }
957
 
958
  break;
959
 
960
  case "frontend_contact_form_library":
961
 
962
  add_action( "admin_init", "frontend_contact_form_library");
963
- if(!function_exists("frontend_contact_form_library"))
964
- {
965
- function frontend_contact_form_library()
966
- {
967
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_frontend-class.php"))
968
- {
969
- include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_frontend-class.php";
970
- }
971
- }
972
- }
973
  break;
974
 
975
  case "email_contact_form_library":
976
 
977
  add_action( "admin_init", "email_contact_form_library");
978
- if(!function_exists("email_contact_form_library"))
979
- {
980
- function email_contact_form_library()
981
- {
982
- global $wpdb,$current_user,$cb_user_role_permission;
983
- if (is_super_admin())
984
- {
985
- $cb_role = "administrator";
986
- }
987
- else
988
- {
989
- $cb_role = $wpdb->prefix . "capabilities";
990
- $current_user->role = array_keys($current_user->$cb_role);
991
- $cb_role = $current_user->role[0];
992
- }
993
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_email-class.php"))
994
- {
995
- include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_email-class.php";
996
- }
997
- }
998
- }
999
 
1000
  break;
1001
 
1002
  case "email_management_contact_form_library":
1003
 
1004
  add_action( "admin_init", "email_management_contact_form_library");
1005
- if(!function_exists("email_management_contact_form_library"))
1006
- {
1007
- function email_management_contact_form_library()
1008
- {
1009
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_email_management.php"))
1010
- {
1011
- include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_email_management.php";
1012
- }
1013
- }
1014
- }
1015
 
1016
  break;
1017
 
1018
  case "frontend_data_contact_library":
1019
 
1020
  add_action( "admin_init", "frontend_data_contact_library");
1021
- if(!function_exists("frontend_data_contact_library"))
1022
- {
1023
- function frontend_data_contact_library()
1024
- {
1025
- global $wpdb,$current_user,$cb_user_role_permission;
1026
- if (is_super_admin())
1027
- {
1028
- $cb_role = "administrator";
1029
- }
1030
- else
1031
- {
1032
- $cb_role = $wpdb->prefix . "capabilities";
1033
- $current_user->role = array_keys($current_user->$cb_role);
1034
- $cb_role = $current_user->role[0];
1035
- }
1036
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_frontend_data_class.php"))
1037
- {
1038
- include CONTACT_BK_PLUGIN_DIR . "/lib/contact_frontend_data_class.php";
1039
- }
1040
- }
1041
- }
1042
  break;
1043
 
1044
  case "show_form_control_data_contact_library":
1045
 
1046
  add_action( "admin_init", "show_form_control_data_contact_library");
1047
- if(!function_exists("show_form_control_data_contact_library"))
1048
- {
1049
- function show_form_control_data_contact_library()
1050
- {
1051
- global $wpdb,$current_user,$cb_user_role_permission;
1052
- if (is_super_admin())
1053
- {
1054
- $cb_role = "administrator";
1055
- }
1056
- else
1057
- {
1058
- $cb_role = $wpdb->prefix . "capabilities";
1059
- $current_user->role = array_keys($current_user->$cb_role);
1060
- $cb_role = $current_user->role[0];
1061
- }
1062
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_show_form_control_data-class.php"))
1063
- {
1064
- include CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_show_form_control_data-class.php";
1065
- }
1066
- }
1067
- }
1068
  break;
1069
 
1070
  case "layout_settings_contact_library":
1071
 
1072
  add_action( "admin_init", "layout_settings_contact_library");
1073
- if(!function_exists("layout_settings_contact_library"))
1074
- {
1075
- function layout_settings_contact_library()
1076
- {
1077
- global $wpdb,$current_user,$cb_user_role_permission;
1078
- if (is_super_admin())
1079
- {
1080
- $cb_role = "administrator";
1081
- }
1082
- else
1083
- {
1084
- $cb_role = $wpdb->prefix . "capabilities";
1085
- $current_user->role = array_keys($current_user->$cb_role);
1086
- $cb_role = $current_user->role[0];
1087
- }
1088
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_layout_settings-class.php"))
1089
- {
1090
- include CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_layout_settings-class.php";
1091
- }
1092
- }
1093
- }
1094
  break;
1095
  }
1096
  }
@@ -1100,457 +931,424 @@ if(isset($_REQUEST["action"]))
1100
  * Last Modified : 1.0
1101
  * Reasons for change : None
1102
  */
1103
- if(!function_exists("contact_bank_contact_form"))
1104
  {
1105
- function contact_bank_contact_form()
1106
- {
1107
- global $wpdb;
1108
- return $wpdb->prefix . "cb_contact_form";
1109
- }
1110
  }
1111
- if(!function_exists("contact_bank_dynamic_settings_form"))
 
 
1112
  {
1113
- function contact_bank_dynamic_settings_form()
1114
- {
1115
- global $wpdb;
1116
- return $wpdb->prefix . "cb_dynamic_settings";
1117
- }
1118
  }
1119
- if(!function_exists("create_control_Table"))
 
1120
  {
1121
- function create_control_Table()
1122
- {
1123
- global $wpdb;
1124
- return $wpdb->prefix . "cb_create_control_form";
1125
- }
1126
  }
1127
- if(!function_exists("frontend_controls_data_Table"))
 
1128
  {
1129
- function frontend_controls_data_Table()
1130
- {
1131
- global $wpdb;
1132
- return $wpdb->prefix . "cb_frontend_data_table";
1133
- }
1134
  }
1135
- if(!function_exists("contact_bank_email_template_admin"))
 
1136
  {
1137
- function contact_bank_email_template_admin()
1138
- {
1139
- global $wpdb;
1140
- return $wpdb->prefix . "cb_email_template_admin";
1141
- }
1142
  }
1143
- if(!function_exists("contact_bank_frontend_forms_Table"))
 
1144
  {
1145
- function contact_bank_frontend_forms_Table()
1146
- {
1147
- global $wpdb;
1148
- return $wpdb->prefix . "cb_frontend_forms_table";
1149
- }
1150
  }
1151
- if(!function_exists("contact_bank_form_settings_Table"))
 
1152
  {
1153
- function contact_bank_form_settings_Table()
1154
- {
1155
- global $wpdb;
1156
- return $wpdb->prefix . "cb_form_settings_table";
1157
- }
1158
  }
1159
- if(!function_exists("contact_bank_layout_settings_Table"))
 
1160
  {
1161
- function contact_bank_layout_settings_Table()
1162
- {
1163
- global $wpdb;
1164
- return $wpdb->prefix . "cb_layout_settings_table";
1165
- }
1166
  }
1167
- if(!function_exists("contact_bank_licensing"))
 
1168
  {
1169
- function contact_bank_licensing()
1170
- {
1171
- global $wpdb;
1172
- return $wpdb->prefix . "cb_licensing";
1173
- }
1174
  }
1175
- if(!function_exists("contact_bank_roles_capability"))
 
1176
  {
1177
- function contact_bank_roles_capability()
1178
- {
1179
- global $wpdb;
1180
- return $wpdb->prefix . "cb_roles_capability";
1181
- }
1182
  }
1183
- if(!function_exists("contact_bank_short_code"))
 
1184
  {
1185
- function contact_bank_short_code($atts)
1186
- {
1187
- extract(shortcode_atts(array(
1188
- "form_id" => "",
1189
- "show_title" => "",
1190
- "show_desc" => "",
1191
- ), $atts));
1192
- if(!is_feed())
1193
- {
1194
- return extract_short_code($form_id,$show_title,$show_desc);
1195
- }
1196
- }
1197
  }
1198
- if(!function_exists("extract_short_code"))
 
1199
  {
1200
- function extract_short_code($form_id,$show_title,$show_desc)
1201
- {
1202
- ob_start();
1203
- require CONTACT_BK_PLUGIN_DIR."/frontend_views/contact_bank_forms.php";
1204
- $contact_bank_output = ob_get_clean();
1205
- wp_reset_query();
1206
- return $contact_bank_output;
1207
- }
1208
  }
1209
- if(!function_exists("add_contact_bank_icon"))
 
1210
  {
1211
- function add_contact_bank_icon($meta = TRUE)
1212
- {
1213
- if (!is_user_logged_in() )
1214
- {
1215
- return;
1216
- }
1217
- else
1218
- {
1219
- global $wp_admin_bar,$wpdb,$current_user;
1220
- if (is_super_admin())
1221
- {
1222
- $cb_role = "administrator";
1223
- }
1224
- else
1225
- {
1226
- $cb_role = $wpdb->prefix . "capabilities";
1227
- $current_user->role = array_keys($current_user->$cb_role);
1228
- $cb_role = $current_user->role[0];
1229
- }
1230
-
1231
- switch ($cb_role)
1232
- {
1233
- case "administrator":
1234
- $wp_admin_bar->add_menu( array(
1235
- "id" => "contact_bank_links",
1236
- "title" => "<img src=\"".plugins_url("/assets/images/icon.png",__FILE__)."\" width=\"25\" height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Contact Bank" ,
1237
- "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1238
- ));
1239
- $wp_admin_bar->add_menu( array(
1240
- "parent" => "contact_bank_links",
1241
- "id" => "cb_dashboard_links",
1242
- "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1243
- "title" => __( "Dashboard", "contact-bank") ) /* set the sub-menu name */
1244
- );
1245
- $wp_admin_bar->add_menu( array(
1246
- "parent" => "contact_bank_links",
1247
- "id" => "plugin_updates_links",
1248
- "href" => site_url() ."/wp-admin/admin.php?page=contact_plugin_update",
1249
- "title" => __( "Plugin Updates", "contact-bank")) /* set the sub-menu name */
1250
- );
1251
- $wp_admin_bar->add_menu( array(
1252
- "parent" => "contact_bank_links",
1253
- "id" => "short_code_links",
1254
- "href" => site_url() ."/wp-admin/admin.php?page=contact_short_code",
1255
- "title" => __( "Short-Codes", "contact-bank")) /* set the sub-menu name */
1256
- );
1257
- $wp_admin_bar->add_menu( array(
1258
- "parent" => "contact_bank_links",
1259
- "id" => "frontend_data_links",
1260
- "href" => site_url() ."/wp-admin/admin.php?page=contact_frontend_data",
1261
- "title" => __( "Form Entries", "contact-bank")) /* set the sub-menu name */
1262
- );
1263
- $wp_admin_bar->add_menu( array(
1264
- "parent" => "contact_bank_links",
1265
- "id" => "email_links",
1266
- "href" => site_url() ."/wp-admin/admin.php?page=contact_email",
1267
- "title" => __( "Email Settings", "contact-bank") ) /* set the sub-menu name */
1268
- );
1269
- $wp_admin_bar->add_menu( array(
1270
- "parent" => "contact_bank_links",
1271
- "id" => "form_settings_data_links",
1272
- "href" => site_url() ."/wp-admin/admin.php?page=contact_layout_settings",
1273
- "title" => __( "Global Settings", "contact-bank")) /* set the sub-menu name */
1274
- );
1275
- $wp_admin_bar->add_menu( array(
1276
- "parent" => "contact_bank_links",
1277
- "id" => "feature_request_data_links",
1278
- "href" => site_url() ."/wp-admin/admin.php?page=contact_feature_request",
1279
- "title" => __( "Feature Requests", "contact-bank")) /* set the sub-menu name */
1280
- );
1281
- $wp_admin_bar->add_menu( array(
1282
- "parent" => "contact_bank_links",
1283
- "id" => "system_status_data_links",
1284
- "href" => site_url() ."/wp-admin/admin.php?page=contact_system_status",
1285
- "title" => __( "System Status", "contact-bank")) /* set the sub-menu name */
1286
- );
1287
- $wp_admin_bar->add_menu(array(
1288
- "parent" => "contact_bank_links",
1289
- "id" => "contact_bank_recommended_plugins_links",
1290
- "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_recommended_plugins",
1291
- "title" => __("Recommendations", "contact-bank"))
1292
- );
1293
-
1294
- $wp_admin_bar->add_menu(array(
1295
- "parent" => "contact_bank_links",
1296
- "id" => "pro_version_links",
1297
- "href" => site_url() . "/wp-admin/admin.php?page=contact_pro_version",
1298
- "title" => __("Premium Editions", "contact-bank"))
1299
- );
1300
-
1301
- $wp_admin_bar->add_menu(array(
1302
- "parent" => "contact_bank_links",
1303
- "id" => "contact_bank_other_services_links",
1304
- "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_other_services",
1305
- "title" => __("Our Other Services", "contact-bank"))
1306
- );
1307
- break;
1308
-
1309
- case "editor":
1310
- $wp_admin_bar->add_menu( array(
1311
- "id" => "contact_bank_links",
1312
- "title" => "<img src=\"".plugins_url("/assets/images/icon.png",__FILE__)."\" width=\"25\" height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Contact Bank" ,
1313
- "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1314
- ));
1315
-
1316
- $wp_admin_bar->add_menu( array(
1317
- "parent" => "contact_bank_links",
1318
- "id" => "dashboard_links",
1319
- "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1320
- "title" => __( "Dashboard", "contact-bank") ) /* set the sub-menu name */
1321
- );
1322
- $wp_admin_bar->add_menu( array(
1323
- "parent" => "contact_bank_links",
1324
- "id" => "plugin_updates_links",
1325
- "href" => site_url() ."/wp-admin/admin.php?page=contact_plugin_update",
1326
- "title" => __( "Plugin Updates", "contact-bank")) /* set the sub-menu name */
1327
- );
1328
- $wp_admin_bar->add_menu( array(
1329
- "parent" => "contact_bank_links",
1330
- "id" => "short_code_links",
1331
- "href" => site_url() ."/wp-admin/admin.php?page=contact_short_code",
1332
- "title" => __( "Short-Codes", "contact-bank")) /* set the sub-menu name */
1333
- );
1334
- $wp_admin_bar->add_menu( array(
1335
- "parent" => "contact_bank_links",
1336
- "id" => "frontend_data_links",
1337
- "href" => site_url() ."/wp-admin/admin.php?page=contact_frontend_data",
1338
- "title" => __( "Form Entries", "contact-bank")) /* set the sub-menu name */
1339
- );
1340
- $wp_admin_bar->add_menu( array(
1341
- "parent" => "contact_bank_links",
1342
- "id" => "email_links",
1343
- "href" => site_url() ."/wp-admin/admin.php?page=contact_email",
1344
- "title" => __( "Email Settings", "contact-bank") ) /* set the sub-menu name */
1345
- );
1346
- $wp_admin_bar->add_menu( array(
1347
- "parent" => "contact_bank_links",
1348
- "id" => "form_settings_data_links",
1349
- "href" => site_url() ."/wp-admin/admin.php?page=contact_layout_settings",
1350
- "title" => __( "Global Settings", "contact-bank")) /* set the sub-menu name */
1351
- );
1352
- $wp_admin_bar->add_menu( array(
1353
- "parent" => "contact_bank_links",
1354
- "id" => "feature_request_data_links",
1355
- "href" => site_url() ."/wp-admin/admin.php?page=contact_feature_request",
1356
- "title" => __( "Feature Requests", "contact-bank")) /* set the sub-menu name */
1357
- );
1358
-
1359
- $wp_admin_bar->add_menu( array(
1360
- "parent" => "contact_bank_links",
1361
- "id" => "system_status_data_links",
1362
- "href" => site_url() ."/wp-admin/admin.php?page=contact_system_status",
1363
- "title" => __( "System Status", "contact-bank")) /* set the sub-menu name */
1364
- );
1365
- $wp_admin_bar->add_menu(array(
1366
- "parent" => "contact_bank_links",
1367
- "id" => "contact_bank_recommended_plugins_links",
1368
- "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_recommended_plugins",
1369
- "title" => __("Recommendations", "contact-bank"))
1370
- );
1371
-
1372
- $wp_admin_bar->add_menu(array(
1373
- "parent" => "contact_bank_links",
1374
- "id" => "pro_version_links",
1375
- "href" => site_url() . "/wp-admin/admin.php?page=contact_pro_version",
1376
- "title" => __("Premium Editions", "contact-bank"))
1377
- );
1378
-
1379
- $wp_admin_bar->add_menu(array(
1380
- "parent" => "contact_bank_links",
1381
- "id" => "contact_bank_other_services_links",
1382
- "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_other_services",
1383
- "title" => __("Our Other Services", "contact-bank"))
1384
- );
1385
- break;
1386
-
1387
- case "author":
1388
- $wp_admin_bar->add_menu( array(
1389
- "id" => "contact_bank_links",
1390
- "title" => "<img src=\"".plugins_url("/assets/images/icon.png",__FILE__)."\" width=\"25\" height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Contact Bank" ,
1391
- "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1392
- ));
1393
- $wp_admin_bar->add_menu( array(
1394
- "parent" => "contact_bank_links",
1395
- "id" => "dashboard_links",
1396
- "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1397
- "title" => __( "Dashboard", "contact-bank") ) /* set the sub-menu name */
1398
- );
1399
- $wp_admin_bar->add_menu( array(
1400
- "parent" => "contact_bank_links",
1401
- "id" => "plugin_updates_links",
1402
- "href" => site_url() ."/wp-admin/admin.php?page=contact_plugin_update",
1403
- "title" => __( "Plugin Updates", "contact-bank")) /* set the sub-menu name */
1404
- );
1405
- $wp_admin_bar->add_menu( array(
1406
- "parent" => "contact_bank_links",
1407
- "id" => "short_code_links",
1408
- "href" => site_url() ."/wp-admin/admin.php?page=contact_short_code",
1409
- "title" => __( "Short-Codes", "contact-bank")) /* set the sub-menu name */
1410
- );
1411
- $wp_admin_bar->add_menu( array(
1412
- "parent" => "contact_bank_links",
1413
- "id" => "frontend_data_links",
1414
- "href" => site_url() ."/wp-admin/admin.php?page=contact_frontend_data",
1415
- "title" => __( "Form Entries", "contact-bank")) /* set the sub-menu name */
1416
- );
1417
- $wp_admin_bar->add_menu( array(
1418
- "parent" => "contact_bank_links",
1419
- "id" => "email_links",
1420
- "href" => site_url() ."/wp-admin/admin.php?page=contact_email",
1421
- "title" => __( "Email Settings", "contact-bank") ) /* set the sub-menu name */
1422
- );
1423
- $wp_admin_bar->add_menu( array(
1424
- "parent" => "contact_bank_links",
1425
- "id" => "form_settings_data_links",
1426
- "href" => site_url() ."/wp-admin/admin.php?page=contact_layout_settings",
1427
- "title" => __( "Global Settings", "contact-bank")) /* set the sub-menu name */
1428
- );
1429
- $wp_admin_bar->add_menu( array(
1430
- "parent" => "contact_bank_links",
1431
- "id" => "feature_request_data_links",
1432
- "href" => site_url() ."/wp-admin/admin.php?page=contact_feature_request",
1433
- "title" => __( "Feature Requests", "contact-bank")) /* set the sub-menu name */
1434
- );
1435
- $wp_admin_bar->add_menu(array(
1436
- "parent" => "contact_bank_links",
1437
- "id" => "contact_bank_recommended_plugins_links",
1438
- "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_recommended_plugins",
1439
- "title" => __("Recommendations", "contact-bank"))
1440
- );
1441
-
1442
- $wp_admin_bar->add_menu(array(
1443
- "parent" => "contact_bank_links",
1444
- "id" => "pro_version_links",
1445
- "href" => site_url() . "/wp-admin/admin.php?page=contact_pro_version",
1446
- "title" => __("Premium Editions", "contact-bank"))
1447
- );
1448
-
1449
- $wp_admin_bar->add_menu(array(
1450
- "parent" => "contact_bank_links",
1451
- "id" => "contact_bank_other_services_links",
1452
- "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_other_services",
1453
- "title" => __("Our Other Services", "contact-bank"))
1454
- );
1455
- break;
1456
- }
1457
- }
1458
- }
1459
  }
 
1460
  add_action( "media_buttons_context", "add_contact_shortcode_button", 1);
1461
- if(!function_exists("add_contact_shortcode_button"))
 
1462
  {
1463
- function add_contact_shortcode_button($context)
1464
- {
1465
- add_thickbox();
1466
- $context .= "<a href=\"#TB_inline?width=300&height=400&inlineId=contact-bank\" class=\"button thickbox\" title=\"" . __("Add Contact Bank Form", "contact-bank") . "\">
1467
- <span class=\"contact_icon\"></span> Add Contact Bank Form</a>";
1468
- return $context;
1469
- }
1470
  }
 
1471
  add_action("admin_footer","add_contact_mce_popup");
1472
 
1473
- if(!function_exists("add_contact_mce_popup"))
 
1474
  {
1475
- function add_contact_mce_popup()
1476
- {
1477
- ?>
1478
- <?php add_thickbox(); ?>
1479
- <div id="contact-bank" style="display:none;">
1480
- <div class="fluid-layout responsive">
1481
- <div style="padding:20px 0 10px 15px;">
1482
- <h3 class="label-shortcode"><?php _e("Insert Contact Bank Form", "contact-bank"); ?></h3>
1483
- <span>
1484
- <i><?php _e("Select a form below to add it to your post or page.", "contact-bank"); ?></i>
1485
- </span>
1486
- </div>
1487
- <div class="layout-span12 responsive" style="padding:15px 15px 0 0;">
1488
- <div class="layout-control-group">
1489
- <label class="custom-layout-label" for="ux_form_name"><?php _e("Form Name", "contact-bank"); ?> : </label>
1490
- <select id="add_contact_form_id" class="layout-span9">
1491
- <option value="0"><?php _e("Select a Form", "contact-bank"); ?> </option>
1492
- <?php
1493
- global $wpdb;
1494
- $forms = $wpdb->get_results
1495
- (
1496
- "SELECT * FROM " .contact_bank_contact_form()
1497
- );
1498
- for($flag = 0;$flag<count($forms);$flag++)
1499
- {
1500
- ?>
1501
- <option value="<?php echo intval($forms[$flag]->form_id); ?>"><?php echo esc_html($forms[$flag]->form_name) ?></option>
1502
- <?php
1503
- }
1504
- ?>
1505
- </select>
1506
- </div>
1507
- <div class="layout-control-group">
1508
- <label class="custom-layout-label"><?php _e("Show Form Title", "contact-bank"); ?> : </label>
1509
- <input type="checkbox" checked="checked" name="ux_form_title" id="ux_form_title"/>
1510
- </div>
1511
- <div class="layout-control-group">
1512
- <label class="custom-layout-label"><?php _e("Show Form Description", "contact-bank"); ?> : </label>
1513
- <input type="checkbox" name="ux_form_desc" id="ux_form_desc"/>
1514
- </div>
1515
- <div class="layout-control-group">
1516
- <label class="custom-layout-label"></label>
1517
- <input type="button" class="button-primary" value="<?php _e("Insert Form", "contact-bank"); ?>"
1518
- onclick="Insert_Contact_Form();"/>&nbsp;&nbsp;&nbsp;
1519
- <a class="button" style="color:#bbb;" href="#"
1520
- onclick="tb_remove(); return false;"><?php _e("Cancel", "contact-bank"); ?></a>
1521
- </div>
1522
- </div>
1523
- </div>
1524
- </div>
1525
- <script type="text/javascript">
1526
- function Insert_Contact_Form()
1527
- {
1528
- var form_id = jQuery("#add_contact_form_id").val();
1529
- var show_title = jQuery("#ux_form_title").prop("checked");
1530
- var show_desc = jQuery("#ux_form_desc").prop("checked");
1531
- if(form_id == 0)
1532
- {
1533
- alert("<?php _e("Please choose a Form to insert into Shortcode", "contact-bank") ?>");
1534
- return;
1535
- }
1536
- window.send_to_editor("[contact_bank form_id=" + form_id + " show_title=" + show_title +" show_desc=" + show_desc +"]");
1537
- }
1538
- </script>
1539
- <?php
1540
- }
1541
  }
1542
- if(!function_exists("plugin_load_textdomain_contact_bank"))
 
1543
  {
1544
- function plugin_load_textdomain_contact_bank()
1545
- {
1546
- if(function_exists( "load_plugin_textdomain" ))
1547
- {
1548
- load_plugin_textdomain("contact-bank", false, CONTACT_BK_PLUGIN_DIRNAME ."/languages");
1549
- }
1550
- }
1551
  }
1552
- add_action("plugins_loaded", "plugin_load_textdomain_contact_bank");
1553
 
 
1554
  $version = get_option("contact-bank-version-number");
1555
  if (is_admin() && !request_is_frontend_ajax())
1556
  {
@@ -1559,70 +1357,43 @@ if (is_admin() && !request_is_frontend_ajax())
1559
  add_action("admin_init", "plugin_install_script_for_contact_bank");
1560
  }
1561
  }
1562
- if(!function_exists("contact_bank_plugin_row"))
 
1563
  {
1564
- function contact_bank_plugin_row($links,$file)
1565
- {
1566
- if ($file == CONTACT_BK_PLUGIN_BASENAME)
1567
- {
1568
- $cpo_row_meta = array(
1569
- "docs" => "<a href='".esc_url( apply_filters("contact_bank_docs_url","http://tech-banker.com/products/wp-contact-bank/knowledge-base/"))."' title='".esc_attr(__( "View Contact Bank Documentation","contact-bank"))."'>".__("Docs","contact-bank")."</a>",
1570
- "gopremium" => "<a href='" .esc_url( apply_filters("contact_bank_premium_editions_url", "http://tech-banker.com/products/wp-contact-bank/pricing/"))."' title='".esc_attr(__( "View Contact Bank Premium Editions","contact-bank"))."'>".__("Go for Premium!","contact-bank")."</a>",
1571
- );
1572
- return array_merge($links,$cpo_row_meta);
1573
- }
1574
- return (array)$links;
1575
- }
1576
  }
1577
 
1578
- function request_is_frontend_ajax()
1579
- {
1580
- $script_filename = isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : '';
1581
- //Try to figure out if frontend AJAX request... If we are DOING_AJAX; let's look closer
1582
- if((defined('DOING_AJAX') && DOING_AJAX))
1583
- {
1584
- //From wp-includes/functions.php, wp_get_referer() function.
1585
- //Required to fix: https://core.trac.wordpress.org/ticket/25294
1586
- $ref = '';
1587
- if ( ! empty( $_REQUEST['_wp_http_referer'] ) )
1588
- $ref = wp_unslash( $_REQUEST['_wp_http_referer'] );
1589
- elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) )
1590
- $ref = wp_unslash( $_SERVER['HTTP_REFERER'] );
1591
- //If referer does not contain admin URL and we are using the admin-ajax.php endpoint, this is likely a frontend AJAX request
1592
- if(((strpos($ref, admin_url()) === false) && (basename($script_filename) === 'admin-ajax.php')))
1593
- return true;
1594
- }
1595
- //If no checks triggered, we end up here - not an AJAX request.
1596
- return false;
1597
- }
1598
 
1599
- //--------------------------------------------------------------------------------------------------------------//
1600
- // CODE FOR PLUGIN UPDATE MESSAGE
1601
- //--------------------------------------------------------------------------------------------------------------//
1602
- if(!function_exists("contact_bank_plugin_update_message"))
1603
  {
1604
- function contact_bank_plugin_update_message($args)
1605
- {
1606
- $response = wp_remote_get( 'http://plugins.svn.wordpress.org/contact-bank/trunk/readme.txt' );
1607
- if ( ! is_wp_error( $response ) && ! empty( $response['body'] ) )
1608
- {
1609
- // Output Upgrade Notice
1610
- $matches = null;
1611
- $regexp = '~==\s*Changelog\s*==\s*=\s*[0-9.]+\s*=(.*)(=\s*' . preg_quote($args['Version']) . '\s*=|$)~Uis';
1612
- $upgrade_notice = '';
1613
- if ( preg_match( $regexp, $response['body'], $matches ) ) {
1614
- $changelog = (array) preg_split('~[\r\n]+~', trim($matches[1]));
1615
- $upgrade_notice .= '<div class="framework_plugin_message">';
1616
- foreach ( $changelog as $index => $line ) {
1617
- $upgrade_notice .= "<p>".$line."</p>";
1618
- }
1619
- $upgrade_notice .= '</div> ';
1620
- echo $upgrade_notice;
1621
- }
1622
- }
1623
- }
1624
  }
1625
 
 
1626
  add_filter("plugin_row_meta","contact_bank_plugin_row", 10, 2 );
1627
  /*************************************************************************************/
1628
  add_action("admin_bar_menu", "add_contact_bank_icon",100);
@@ -1640,131 +1411,87 @@ add_action("admin_menu","create_global_menus_for_contact_bank");
1640
  register_activation_hook(__FILE__,"plugin_install_script_for_contact_bank");
1641
  // add_Shortcode Hook called for function contact_bank_short_code for FrontEnd
1642
  add_shortcode("contact_bank", "contact_bank_short_code");
1643
- // Uninstall Hook called for function plugin_uninstall_script_for_contact_bank
1644
- register_uninstall_hook(__FILE__,"plugin_uninstall_script_for_contact_bank");
1645
  // Deactivation Hook called for function deactivation_function_for_contact_bank
1646
  register_deactivation_hook(__FILE__,"deactivation_function_for_contact_bank");
1647
 
1648
  add_action( "network_admin_menu", "create_global_menus_for_contact_bank" );
1649
- // in_plugin_update_message Hook called for function to check updates
1650
- add_action("in_plugin_update_message-".CONTACT_BK,"contact_bank_plugin_update_message" );
1651
 
1652
  add_filter("widget_text", "do_shortcode");
1653
- if(!class_exists("Contact_Bank_Widget"))
 
1654
  {
1655
- class Contact_Bank_Widget extends WP_Widget
1656
- {
1657
- function __construct()
1658
- {
1659
- parent::__construct(
1660
- "Contact_Bank_Widget", // Base ID
1661
- __("Contact Bank Widget", "contact_bank"), // Name
1662
- array( "description" => __( "Build Complex, Powerful Contact Forms in Just Seconds.", "contact_bank" ), ) // Args
1663
- );
1664
- }
1665
-
1666
- function form($instance)
1667
- {
1668
- $instance = wp_parse_args((array) $instance, array( "title" => "", "form_id" => "0" ) );
1669
- $title = $instance["title"];
1670
- global $wpdb;
1671
- $form_data = $wpdb->get_results
1672
- (
1673
- "SELECT * FROM " .contact_bank_contact_form()
1674
- );
1675
- ?>
1676
- <p><label for="<?php echo $this->get_field_id("title"); ?>"> Widget Title: <input class="widefat" id="<?php echo $this->get_field_id("title"); ?>" name="<?php echo $this->get_field_name("title"); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
1677
- <p><label for="<?php echo $this->get_field_id("form_id"); ?>"><?php _e("Select Form :", "contact-bank"); ?></label>
1678
- <select size="1" name="<?php echo $this->get_field_name("form_id"); ?>" id="<?php echo $this->get_field_id("form_id"); ?>" class="widefat">
1679
- <option value="0" ><?php _e("Select Form", "contact-bank"); ?></option>
1680
- <?php
1681
- if($form_data)
1682
- {
1683
- foreach($form_data as $form)
1684
- {
1685
- echo "<option value=\"" . $form->form_id . "\"";
1686
- if ($form->form_id == $instance["form_id"])
1687
- echo "selected=\"selected\"";
1688
- echo ">" . stripslashes(html_entity_decode($form->form_name)) . "</option>" . "\n\t";
1689
- }
1690
- }
1691
- ?>
1692
- </select>
1693
- </p>
1694
- <?php
1695
- }
1696
- function update($new_instance, $old_instance)
1697
- {
1698
- $instance = $old_instance;
1699
- $instance["title"] = $new_instance["title"];
1700
- $instance["form_id"] = (int) $new_instance["form_id"];
1701
- return $instance;
1702
- }
1703
- function widget($args, $instance)
1704
- {
1705
- global $wpdb;
1706
- $form_data = $wpdb->get_var
1707
- (
1708
- $wpdb->prepare
1709
- (
1710
- "SELECT count(*) FROM " .contact_bank_contact_form() . " WHERE form_id = %d",
1711
- $instance["form_id"]
1712
- )
1713
- );
1714
-
1715
- extract($args, EXTR_SKIP);
1716
- echo $before_widget;
1717
- $title = empty($instance["title"]) ? " " : apply_filters("widget_title", $instance["title"]);
1718
- if($form_data > 0)
1719
- {
1720
- if($instance["form_id"] != 0)
1721
- {
1722
- echo $before_title . $title . $after_title;
1723
- $shortcode_for_contact_bank_form = "[contact_bank form_id=" . $instance["form_id"] . " ]";
1724
- echo do_shortcode( $shortcode_for_contact_bank_form );
1725
- echo $after_widget;
1726
- }
1727
- }
1728
- }
1729
- }
1730
- }
1731
 
1732
- add_action( "widgets_init", create_function("", "return register_widget(\"Contact_Bank_Widget\");"));
1733
- $is_option_auto_update = get_option("contact-bank-automatic_update");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1734
 
1735
- if($is_option_auto_update == "" || $is_option_auto_update == "1")
1736
- {
1737
- if (!wp_next_scheduled("contact_bank_auto_update"))
1738
- {
1739
- wp_schedule_event(time(), "daily", "contact_bank_auto_update");
1740
- }
1741
- add_action("contact_bank_auto_update", "contact_plugin_autoUpdate");
1742
- }
1743
- else
1744
- {
1745
- wp_clear_scheduled_hook("contact_bank_auto_update");
1746
- }
1747
- if(!function_exists("contact_plugin_autoUpdate"))
1748
- {
1749
- function contact_plugin_autoUpdate()
1750
- {
1751
- try
1752
- {
1753
- require_once(ABSPATH . "wp-admin/includes/class-wp-upgrader.php");
1754
- require_once(ABSPATH . "wp-admin/includes/misc.php");
1755
- define("FS_METHOD", "direct");
1756
- require_once(ABSPATH . "wp-includes/update.php");
1757
- require_once(ABSPATH . "wp-admin/includes/file.php");
1758
- wp_update_plugins();
1759
- ob_start();
1760
- $plugin_upgrader = new Plugin_Upgrader();
1761
- $plugin_upgrader->upgrade("contact-bank/contact-bank.php");
1762
- $output = @ob_get_contents();
1763
- @ob_end_clean();
1764
- }
1765
- catch(Exception $e)
1766
- {
1767
- }
1768
- }
1769
  }
 
1770
  ?>
4
  * Plugin URI: http://tech-banker.com
5
  * Description: Build Complex, Powerful Contact Forms in Just Seconds. No Programming Knowledge Required! Yeah, It's Really That Easy.
6
  * Author: Tech Banker
7
+ * Version: 2.1.38
8
  * Author URI: http://tech-banker.com
9
  * License: GPLv3 or later
10
  * Text Domain: contact-bank
18
  if(!defined("CONTACT_BK_PLUGIN_DIRNAME")) define("CONTACT_BK_PLUGIN_DIRNAME", plugin_basename(dirname(__FILE__)));
19
  if(!defined("CONTACT_BK")) define("CONTACT_BK","contact-bank/contact-bank.php");
20
  if(!defined("CONTACT_BK_PLUGIN_BASENAME")) define("CONTACT_BK_PLUGIN_BASENAME", plugin_basename(__FILE__));
21
+ if(!defined("tech_banker_stats_url")) define("tech_banker_stats_url", "http://stats.tech-banker-services.org");
22
+ if(!defined("contact_bank_version_number")) define("contact_bank_version_number","2.1.38");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  /* Function Name : plugin_install_script_for_contact_bank
25
  * Paramters : None
29
  * Last Modified : 1.0
30
  * Reasons for change : None
31
  */
32
+
33
+ function plugin_install_script_for_contact_bank()
34
  {
35
+ global $wpdb,$current_user,$cb_user_role_permission;
36
+ if (is_super_admin())
37
+ {
38
+ $cb_role = "administrator";
39
+ }
40
+ else
41
+ {
42
+ $cb_role = $wpdb->prefix . "capabilities";
43
+ $current_user->role = array_keys($current_user->$cb_role);
44
+ $cb_role = $current_user->role[0];
45
+ }
46
+ if (is_multisite())
47
+ {
48
+ $blog_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
49
+ foreach($blog_ids as $blog_id)
50
+ {
51
+ switch_to_blog($blog_id);
52
+ if(file_exists(CONTACT_BK_PLUGIN_DIR. "/lib/install-script.php"))
53
+ {
54
+ include CONTACT_BK_PLUGIN_DIR ."/lib/install-script.php";
55
+ }
56
+ restore_current_blog();
57
+ }
58
+ }
59
+ else
60
+ {
61
+ if(file_exists(CONTACT_BK_PLUGIN_DIR. "/lib/install-script.php"))
62
+ {
63
+ include CONTACT_BK_PLUGIN_DIR ."/lib/install-script.php";
64
+ }
65
+ }
 
 
 
66
  }
67
 
68
+
69
  /*************************************************************************************/
70
 
71
+
72
+ class class_plugin_info_contact_bank
73
  {
74
+ function get_plugin_info()
75
+ {
76
+ $active_plugins = (array)get_option("active_plugins", array());
77
+ if (is_multisite())
78
+ $active_plugins = array_merge($active_plugins, get_site_option("active_sitewide_plugins", array()));
79
+ $plugins = array();
80
+ if(count($active_plugins) > 0)
81
+ {
82
+ $get_plugins = array();
83
+ foreach ($active_plugins as $plugin)
84
+ {
85
+ $plugin_data = @get_plugin_data(WP_PLUGIN_DIR . "/" . $plugin);
86
+
87
+ $get_plugins["plugin_name"] = strip_tags($plugin_data["Name"]);
88
+ $get_plugins["plugin_author"] = strip_tags($plugin_data["Author"]);
89
+ $get_plugins["plugin_version"] = strip_tags($plugin_data["Version"]);
90
+ array_push($plugins,$get_plugins);
91
+ }
92
+ return $plugins;
93
+ }
94
+ }
 
 
 
95
  }
96
 
97
+
98
  /*
99
  Function Name: deactivation_function_for_contact_bank
100
  Description: This function is used for executing the code on deactivation.
102
  Created On: 07-04-2017 09:54
103
  Created By: Tech Banker Team
104
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
+ function deactivation_function_for_contact_bank()
107
  {
108
+ $type = get_option("contact-bank-wizard");
109
+ if($type == "opt_in")
110
+ {
111
+ $class_plugin_info_contact_bank = new class_plugin_info_contact_bank();
112
+ global $wp_version,$wpdb;
113
+ $theme_details = array();
114
+ if($wp_version >= 3.4)
115
+ {
116
+ $active_theme = wp_get_theme();
117
+ $theme_details["theme_name"] = strip_tags($active_theme->Name);
118
+ $theme_details["theme_version"] = strip_tags($active_theme->Version);
119
+ $theme_details["author_url"] = strip_tags($active_theme->{"Author URI"});
120
+ }
121
+ $plugin_stat_data = array();
122
+ $plugin_stat_data["plugin_slug"] = "contact-bank";
123
+ $plugin_stat_data["type"] = "standard_edition";
124
+ $plugin_stat_data["version_number"] = contact_bank_version_number;
125
+ $plugin_stat_data["status"] = $type;
126
+ $plugin_stat_data["event"] = "de-activate";
127
+ $plugin_stat_data["domain_url"] = site_url();
128
+ $plugin_stat_data["wp_language"] = defined("WPLANG") && WPLANG ? WPLANG : get_locale();
129
+
130
+ $plugin_stat_data["email"] = get_option("admin_email");
131
+ $plugin_stat_data["wp_version"] = $wp_version;
132
+ $plugin_stat_data["php_version"] = esc_html(phpversion());
133
+ $plugin_stat_data["mysql_version"] = $wpdb->db_version();
134
+ $plugin_stat_data["max_input_vars"] = ini_get("max_input_vars");
135
+ $plugin_stat_data["operating_system"] = PHP_OS ." (".PHP_INT_SIZE * 8 .") BIT";
136
+ $plugin_stat_data["php_memory_limit"] = ini_get("memory_limit") ? ini_get("memory_limit") : "N/A";
137
+ $plugin_stat_data["extensions"] = get_loaded_extensions();
138
+ $plugin_stat_data["plugins"] = $class_plugin_info_contact_bank->get_plugin_info();
139
+ $plugin_stat_data["themes"] = $theme_details;
140
+ $url = tech_banker_stats_url."/wp-admin/admin-ajax.php";
141
+ $response = wp_safe_remote_post($url, array
142
+ (
143
+ "method" => "POST",
144
+ "timeout" => 45,
145
+ "redirection" => 5,
146
+ "httpversion" => "1.0",
147
+ "blocking" => true,
148
+ "headers" => array(),
149
+ "body" => array( "data" => serialize($plugin_stat_data), "site_id" => get_option("contact_bank_site_id") != "" ? get_option("contact_bank_site_id") : "","action"=>"plugin_analysis_data")
150
+ ));
151
+ if(!is_wp_error($response))
152
+ {
153
+ $response["body"] != "" ? update_option("contact_bank_site_id", $response["body"]) : "";
154
+ }
155
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
  }
157
 
158
 
159
+
160
+
161
+
162
  /* Function Name : create_global_menus_for_contact_bank
163
  * Paramters : None
164
  * Return : None
167
  * Last Modified : 1.0
168
  * Reasons for change : None
169
  */
170
+
171
+ function create_global_menus_for_contact_bank()
172
  {
173
+ global $wpdb,$current_user;
174
+ if (is_super_admin())
175
+ {
176
+ $cb_role = "administrator";
177
+ }
178
+ else
179
+ {
180
+ $cb_role = $wpdb->prefix . "capabilities";
181
+ $current_user->role = array_keys($current_user->$cb_role);
182
+ $cb_role = $current_user->role[0];
183
+ }
184
+ $contact_bank_wizard = get_option("contact-bank-wizard");
185
+ global $wp_version;
186
+
187
+ switch ($cb_role) {
188
+ case "administrator":
189
+ if(get_option("contact-bank-wizard"))
190
+ {
191
+ add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
192
+ }
193
+ else
194
+ {
195
+ add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read","contact_bank_wizard","",plugins_url("/assets/images/icon.png" , __FILE__));
196
+ add_submenu_page("Contact Bank", __("Contact Bank", "contact-bank") ,"","read","contact_bank_wizard", "contact_bank_wizard");
197
+ }
198
+ add_submenu_page("contact_dashboard", "Dashboard", __("Dashboard", "contact-bank"), "read", "contact_dashboard", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_dashboard");
199
+ add_submenu_page("","","", "read", "contact_bank","contact_bank");
200
+ add_submenu_page("contact_dashboard", "Other Settings", __("Other Settings", "contact-bank"), "read", "contact_other_settings", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_other_settings" );
201
+ add_submenu_page("contact_dashboard", "Short-Codes", __("Short-Codes", "contact-bank"), "read", "contact_short_code", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_short_code" );
202
+ add_submenu_page("contact_dashboard", "Form Entries", __("Form Entries", "contact-bank"), "read", "contact_frontend_data", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_frontend_data");
203
+ add_submenu_page("contact_dashboard", "Email Settings", __("Email Settings", "contact-bank"), "read", "contact_email", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_email");
204
+ add_submenu_page("contact_dashboard", "Global Settings", __("Global Settings", "contact-bank"), "read", "contact_layout_settings", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_layout_settings");
205
+ add_submenu_page("contact_dashboard", "Feature Requests", __("Feature Requests", "contact-bank"), "read", "contact_feature_request", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_feature_request");
206
+ add_submenu_page("contact_dashboard", "System Status", __("System Status", "contact-bank"), "read", "contact_system_status", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_system_status" );
207
+ add_submenu_page("contact_dashboard", "Recommendations", __("Recommendations", "contact-bank"), "read", "contact_bank_recommended_plugins", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_bank_recommended_plugins");
208
+ add_submenu_page("contact_dashboard", "Premium Editions", __("Premium Editions", "contact-bank"), "read", "contact_pro_version", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_pro_version" );
209
+ add_submenu_page("contact_dashboard", " Our Other Services ", __("Our Other Services", "contact-bank"), "read", "contact_bank_other_services", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_bank_other_services");
210
+ add_submenu_page("","","", "read", "add_contact_email_settings", "add_contact_email_settings" );
211
+ add_submenu_page("","","", "read", "form_preview", "form_preview" );
212
+ break;
213
+ case "editor":
214
+ if(get_option("contact-bank-wizard"))
215
+ {
216
+ add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
217
+ }
218
+ else
219
+ {
220
+ add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read","contact_bank_wizard","",plugins_url("/assets/images/icon.png" , __FILE__));
221
+ add_submenu_page("Contact Bank", __("Contact Bank", "contact-bank") ,"","read","contact_bank_wizard", "contact_bank_wizard");
222
+ }
223
+ add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
224
+ add_submenu_page("contact_dashboard", "Dashboard", __("Dashboard", "contact-bank"), "read", "contact_dashboard","contact_dashboard");
225
+ add_submenu_page("","","", "read", "contact_bank","contact_bank");
226
+ add_submenu_page("contact_dashboard", "Other Settings", __("Other Settings", "contact-bank"), "read", "contact_other_settings", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_other_settings" );
227
+ add_submenu_page("contact_dashboard", "Short-Codes", __("Short-Codes", "contact-bank"), "read", "contact_short_code", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_short_code" );
228
+ add_submenu_page("contact_dashboard", "Form Entries", __("Form Entries", "contact-bank"), "read", "contact_frontend_data", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_frontend_data");
229
+ add_submenu_page("contact_dashboard", "Email Settings", __("Email Settings", "contact-bank"), "read", "contact_email", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_email");
230
+ add_submenu_page("contact_dashboard", "Global Settings", __("Global Settings", "contact-bank"), "read", "contact_layout_settings", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_layout_settings");
231
+ add_submenu_page("contact_dashboard", "Feature Requests", __("Feature Requests", "contact-bank"), "read", "contact_feature_request", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_feature_request");
232
+ add_submenu_page("contact_dashboard", "System Status", __("System Status", "contact-bank"), "read", "contact_system_status", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_system_status" );
233
+ add_submenu_page("contact_dashboard", "Recommendations", __("Recommendations", "contact-bank"), "read", "contact_bank_recommended_plugins", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_bank_recommended_plugins");
234
+ add_submenu_page("contact_dashboard", "Premium Editions", __("Premium Editions", "contact-bank"), "read", "contact_pro_version", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_pro_version" );
235
+ add_submenu_page("contact_dashboard", " Our Other Services ", __("Our Other Services", "contact-bank"), "read", "contact_bank_other_services", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_bank_other_services");
236
+ add_submenu_page("","","", "read", "add_contact_email_settings", "add_contact_email_settings" );
237
+ add_submenu_page("","","", "read", "form_preview", "form_preview" );
238
+ break;
239
+ case "author":
240
+ if(get_option("contact-bank-wizard"))
241
+ {
242
+ add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
243
+ }
244
+ else
245
+ {
246
+ add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read","contact_bank_wizard","",plugins_url("/assets/images/icon.png" , __FILE__));
247
+ add_submenu_page("Contact Bank", __("Contact Bank", "contact-bank") ,"","read","contact_bank_wizard", "contact_bank_wizard");
248
+ }
249
+ add_menu_page("Contact Bank", __("Contact Bank", "contact-bank"), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
250
+ add_submenu_page("contact_dashboard", "Dashboard", __("Dashboard", "contact-bank"), "read", "contact_dashboard","contact_dashboard");
251
+ add_submenu_page("","","", "read", "contact_bank","contact_bank");
252
+ add_submenu_page("contact_dashboard", "Other Settings", __("Other Settings", "contact-bank"), "read", "contact_other_settings", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_other_settings" );
253
+ add_submenu_page("contact_dashboard", "Short-Codes", __("Short-Codes", "contact-bank"), "read", "contact_short_code", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_short_code" );
254
+ add_submenu_page("contact_dashboard", "Form Entries", __("Form Entries", "contact-bank"), "read", "contact_frontend_data", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_frontend_data");
255
+ add_submenu_page("contact_dashboard", "Email Settings", __("Email Settings", "contact-bank"), "read", "contact_email", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_email");
256
+ add_submenu_page("contact_dashboard", "Global Settings", __("Global Settings", "contact-bank"), "read", "contact_layout_settings", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_layout_settings");
257
+ add_submenu_page("contact_dashboard", "Feature Requests", __("Feature Requests", "contact-bank"), "read", "contact_feature_request", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_feature_request");
258
+ add_submenu_page("contact_dashboard", "System Status", __("System Status", "contact-bank"), "read", "contact_system_status", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_system_status" );
259
+ add_submenu_page("contact_dashboard", "Recommendations", __("Recommendations", "contact-bank"), "read", "contact_bank_recommended_plugins", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_bank_recommended_plugins");
260
+ add_submenu_page("contact_dashboard", "Premium Editions", __("Premium Editions", "contact-bank"), "read", "contact_pro_version", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_pro_version" );
261
+ add_submenu_page("contact_dashboard", " Our Other Services ", __("Our Other Services", "contact-bank"), "read", "contact_bank_other_services", $contact_bank_wizard == "" ? "contact_bank_wizard" : "contact_bank_other_services");
262
+ add_submenu_page("","","", "read", "add_contact_email_settings", "add_contact_email_settings" );
263
+ add_submenu_page("","","", "read", "form_preview", "form_preview" );
264
+ break;
265
+ case "contributor":
266
+ break;
267
+
268
+ case "subscriber":
269
+ break;
270
+ }
 
 
 
271
  }
272
+
273
  /* Function Name : contact_bank
274
  * Paramters : None
275
  * Return : None
278
  * Last Modified : 1.0
279
  * Reasons for change : None
280
  */
281
+
282
+ function contact_bank()
283
  {
284
+ global $wpdb,$current_user,$cb_user_role_permission;
285
+ if (is_super_admin())
286
+ {
287
+ $cb_role = "administrator";
288
+ }
289
+ else
290
+ {
291
+ $cb_role = $wpdb->prefix . "capabilities";
292
+ $current_user->role = array_keys($current_user->$cb_role);
293
+ $cb_role = $current_user->role[0];
294
+ }
295
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
296
+ {
297
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
298
+ }
299
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php"))
300
+ {
301
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php";
302
+ }
303
+ if(file_exists(CONTACT_BK_PLUGIN_DIR . "/views/includes_common_after.php"))
304
+ {
305
+ include_once CONTACT_BK_PLUGIN_DIR . "/views/includes_common_after.php";
306
+ }
307
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
308
+ {
309
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
310
+ }
 
 
 
311
  }
312
+
313
+
314
+ function contact_dashboard()
315
  {
316
+ global $wpdb,$current_user,$cb_user_role_permission;
317
+ if (is_super_admin())
318
+ {
319
+ $cb_role = "administrator";
320
+ }
321
+ else
322
+ {
323
+ $cb_role = $wpdb->prefix . "capabilities";
324
+ $current_user->role = array_keys($current_user->$cb_role);
325
+ $cb_role = $current_user->role[0];
326
+ }
327
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
328
+ {
329
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
330
+ }
331
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/dashboard.php"))
332
+ {
333
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/dashboard.php";
334
+ }
335
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
336
+ {
337
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
338
+ }
 
 
 
339
  }
340
 
341
+
342
+ function contact_bank_wizard()
343
  {
344
+ global $wpdb,$current_user,$cb_user_role_permission;
345
+ if (is_super_admin())
346
+ {
347
+ $cb_role = "administrator";
348
+ }
349
+ else
350
+ {
351
+ $cb_role = $wpdb->prefix . "capabilities";
352
+ $current_user->role = array_keys($current_user->$cb_role);
353
+ $cb_role = $current_user->role[0];
354
+ }
355
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/wizard.php"))
356
+ {
357
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/wizard.php";
358
+ }
 
 
 
359
  }
360
 
361
+
362
+
363
+ function edit_contact_view()
364
  {
365
+ global $wpdb,$current_user,$cb_user_role_permission;
366
+ if (is_super_admin())
367
+ {
368
+ $cb_role = "administrator";
369
+ }
370
+ else
371
+ {
372
+ $cb_role = $wpdb->prefix . "capabilities";
373
+ $current_user->role = array_keys($current_user->$cb_role);
374
+ $cb_role = $current_user->role[0];
375
+ }
376
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
377
+ {
378
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
379
+ }
380
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php"))
381
+ {
382
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php";
383
+ }
384
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
385
+ {
386
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
387
+ }
 
 
 
388
  }
389
+
390
+
391
+ function contact_other_settings()
392
  {
393
+ global $wpdb,$current_user,$cb_user_role_permission;
394
+ if (is_super_admin())
395
+ {
396
+ $cb_role = "administrator";
397
+ }
398
+ else
399
+ {
400
+ $cb_role = $wpdb->prefix . "capabilities";
401
+ $current_user->role = array_keys($current_user->$cb_role);
402
+ $cb_role = $current_user->role[0];
403
+ }
404
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
405
+ {
406
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
407
+ }
408
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/other-settings.php"))
409
+ {
410
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/other-settings.php";
411
+ }
412
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
413
+ {
414
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
415
+ }
 
 
 
416
  }
417
+
418
+
419
  function contact_email()
420
+ {
421
+ global $wpdb,$current_user,$cb_user_role_permission;
422
+ if (is_super_admin())
423
+ {
424
+ $cb_role = "administrator";
425
+ }
426
+ else
427
+ {
428
+ $cb_role = $wpdb->prefix . "capabilities";
429
+ $current_user->role = array_keys($current_user->$cb_role);
430
+ $cb_role = $current_user->role[0];
431
+ }
432
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
433
+ {
434
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
435
+ }
436
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_email_settings.php"))
437
+ {
438
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_email_settings.php";
439
+ }
440
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
441
+ {
442
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
443
+ }
 
444
  }
445
+
446
+
447
+ function contact_frontend_data()
448
  {
449
+ global $wpdb,$current_user,$cb_user_role_permission;
450
+ if (is_super_admin())
451
+ {
452
+ $cb_role = "administrator";
453
+ }
454
+ else
455
+ {
456
+ $cb_role = $wpdb->prefix . "capabilities";
457
+ $current_user->role = array_keys($current_user->$cb_role);
458
+ $cb_role = $current_user->role[0];
459
+ }
460
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
461
+ {
462
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
463
+ }
464
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_frontend_data.php"))
465
+ {
466
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_frontend_data.php";
467
+ }
468
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
469
+ {
470
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
471
+ }
 
 
 
472
  }
473
+
474
+
475
+ function add_contact_email_settings()
476
  {
477
+ global $wpdb,$current_user,$cb_user_role_permission;
478
+ if (is_super_admin())
479
+ {
480
+ $cb_role = "administrator";
481
+ }
482
+ else
483
+ {
484
+ $cb_role = $wpdb->prefix . "capabilities";
485
+ $current_user->role = array_keys($current_user->$cb_role);
486
+ $cb_role = $current_user->role[0];
487
+ }
488
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
489
+ {
490
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
491
+ }
492
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/add_contact_email.php"))
493
+ {
494
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/add_contact_email.php";
495
+ }
496
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
497
+ {
498
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
499
+ }
 
 
 
500
  }
501
+
502
+
503
+ function contact_layout_settings()
504
  {
505
+ global $wpdb,$current_user,$cb_user_role_permission;
506
+ if (is_super_admin())
507
+ {
508
+ $cb_role = "administrator";
509
+ }
510
+ else
511
+ {
512
+ $cb_role = $wpdb->prefix . "capabilities";
513
+ $current_user->role = array_keys($current_user->$cb_role);
514
+ $cb_role = $current_user->role[0];
515
+ }
516
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
517
+ {
518
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
519
+ }
520
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_layout_settings.php"))
521
+ {
522
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_layout_settings.php";
523
+ }
524
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
525
+ {
526
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
527
+ }
 
 
 
528
  }
529
+
530
+ function contact_feature_request()
531
  {
532
+ global $wpdb,$current_user,$user_role_permission;
533
+ if(is_super_admin())
534
+ {
535
+ $cb_role = "administrator";
536
+ }
537
+ else
538
+ {
539
+ $cb_role = $wpdb->prefix . "capabilities";
540
+ $current_user->role = array_keys($current_user->$cb_role);
541
+ $cb_role = $current_user->role[0];
542
+ }
543
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
544
+ {
545
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
546
+ }
547
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact-feedback.php"))
548
+ {
549
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact-feedback.php";
550
+ }
551
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
552
+ {
553
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
554
+ }
 
 
 
555
  }
556
+
557
+
558
+ function contact_system_status()
559
  {
560
+ global $wpdb,$current_user,$cb_user_role_permission;
561
+ if (is_super_admin())
562
+ {
563
+ $cb_role = "administrator";
564
+ }
565
+ else
566
+ {
567
+ $cb_role = $wpdb->prefix . "capabilities";
568
+ $current_user->role = array_keys($current_user->$cb_role);
569
+ $cb_role = $current_user->role[0];
570
+ }
571
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
572
+ {
573
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
574
+ }
575
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact-bank-system-report.php"))
576
+ {
577
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact-bank-system-report.php";
578
+ }
579
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
580
+ {
581
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
582
+ }
 
 
 
583
  }
584
+
585
+
586
+ function form_preview()
587
  {
588
+ global $wpdb,$current_user,$cb_user_role_permission;
589
+ if (is_super_admin())
590
+ {
591
+ $cb_role = "administrator";
592
+ }
593
+ else
594
+ {
595
+ $cb_role = $wpdb->prefix . "capabilities";
596
+ $current_user->role = array_keys($current_user->$cb_role);
597
+ $cb_role = $current_user->role[0];
598
+ }
599
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
600
+ {
601
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
602
+ }
603
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_form_preview.php"))
604
+ {
605
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_form_preview.php";
606
+ }
607
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
608
+ {
609
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
610
+ }
 
 
 
611
  }
612
+
613
+
614
+ function contact_pro_version()
615
  {
616
+ global $wpdb,$current_user,$cb_user_role_permission;
617
+ if (is_super_admin())
618
+ {
619
+ $cb_role = "administrator";
620
+ }
621
+ else
622
+ {
623
+ $cb_role = $wpdb->prefix . "capabilities";
624
+ $current_user->role = array_keys($current_user->$cb_role);
625
+ $cb_role = $current_user->role[0];
626
+ }
627
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
628
+ {
629
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
630
+ }
631
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/purchase_pro_version.php"))
632
+ {
633
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/purchase_pro_version.php";
634
+ }
635
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
636
+ {
637
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
638
+ }
 
 
 
639
  }
640
+
641
+
642
+ function contact_bank_recommended_plugins()
643
  {
644
+ global $wpdb,$current_user,$cb_user_role_permission;
645
+ if (is_super_admin())
646
+ {
647
+ $cb_role = "administrator";
648
+ }
649
+ else
650
+ {
651
+ $cb_role = $wpdb->prefix . "capabilities";
652
+ $current_user->role = array_keys($current_user->$cb_role);
653
+ $cb_role = $current_user->role[0];
654
+ }
655
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
656
+ {
657
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
658
+ }
659
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/recommended-plugins.php"))
660
+ {
661
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/recommended-plugins.php";
662
+ }
663
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
664
+ {
665
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
666
+ }
 
 
 
667
  }
668
+
669
+
670
+ function contact_bank_other_services()
671
  {
672
+ global $wpdb,$current_user,$cb_user_role_permission;
673
+ if (is_super_admin())
674
+ {
675
+ $cb_role = "administrator";
676
+ }
677
+ else
678
+ {
679
+ $cb_role = $wpdb->prefix . "capabilities";
680
+ $current_user->role = array_keys($current_user->$cb_role);
681
+ $cb_role = $current_user->role[0];
682
+ }
683
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
684
+ {
685
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
686
+ }
687
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/other-services.php"))
688
+ {
689
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/other-services.php";
690
+ }
691
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
692
+ {
693
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
694
+ }
 
 
 
695
  }
696
+
697
+ function contact_short_code()
698
  {
699
+ global $wpdb,$current_user,$cb_user_role_permission;
700
+ if (is_super_admin())
701
+ {
702
+ $cb_role = "administrator";
703
+ }
704
+ else
705
+ {
706
+ $cb_role = $wpdb->prefix . "capabilities";
707
+ $current_user->role = array_keys($current_user->$cb_role);
708
+ $cb_role = $current_user->role[0];
709
+ }
710
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
711
+ {
712
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
713
+ }
714
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/shortcode.php"))
715
+ {
716
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/shortcode.php";
717
+ }
718
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
719
+ {
720
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
721
+ }
 
 
 
722
  }
723
+
724
+ function backend_plugin_js_scripts_contact_bank()
725
  {
726
+ wp_enqueue_script("jquery");
727
+ wp_enqueue_script("jquery-ui-sortable");
728
+ wp_enqueue_script("jquery-ui-droppable");
729
+ wp_enqueue_script("jquery-ui-draggable");
730
+ wp_enqueue_script("farbtastic");
731
+ wp_enqueue_script("jquery-ui-dialog");
732
+ wp_enqueue_script("jquery.Tooltip.js", plugins_url("/assets/js/jquery.Tooltip.js",__FILE__));
733
+ wp_enqueue_script("jquery.dataTables.min", plugins_url("/assets/js/jquery.dataTables.min.js",__FILE__));
734
+ wp_enqueue_script("jquery.validate.min", plugins_url("/assets/js/jquery.validate.min.js",__FILE__));
735
+ wp_enqueue_script("bootstrap.js", plugins_url("/assets/js/bootstrap.js",__FILE__));
736
+ wp_enqueue_script("jquery.prettyPhoto.js", plugins_url("/assets/js/jquery.prettyPhoto.js",__FILE__));
 
 
 
737
  }
738
+
739
+
740
+ function frontend_plugin_js_scripts_contact_bank()
741
  {
742
+ wp_enqueue_script("jquery");
743
+ wp_enqueue_script("jquery.Tooltip.js", plugins_url("/assets/js/jquery.Tooltip.js",__FILE__));
744
+ wp_enqueue_script("jquery.validate.min", plugins_url("/assets/js/jquery.validate.min.js",__FILE__));
 
 
 
745
  }
746
+
747
+
748
+ function backend_plugin_css_styles_contact_bank()
749
  {
750
+ wp_enqueue_style("farbtastic");
751
+ wp_enqueue_style("wp-jquery-ui-dialog");
752
+ wp_enqueue_style("stylesheet", plugins_url("/assets/css/stylesheet.css",__FILE__));
753
+ wp_enqueue_style("simple-line-icon", plugins_url("/assets/css/icons/icons.css",__FILE__));
754
+ wp_enqueue_style("system-message", plugins_url("/assets/css/system-message.css",__FILE__));
755
+ wp_enqueue_style("prettyPhoto", plugins_url("/assets/css/prettyPhoto.css",__FILE__));
756
+ wp_enqueue_style("premium-edition.css", plugins_url("/assets/css/premium-edition.css",__FILE__));
757
+ wp_enqueue_style("responsive.css", plugins_url("/assets/css/responsive.css",__FILE__));
758
+ wp_enqueue_style("google-fonts-roboto", "//fonts.googleapis.com/css?family=Roboto Condensed:300|Roboto Condensed:300|Roboto Condensed:300|Roboto Condensed:regular|Roboto Condensed:300");
 
 
 
759
  }
760
+
761
+
762
+ function frontend_plugin_css_styles_contact_bank()
763
  {
764
+ wp_enqueue_style("stylesheet", plugins_url("/assets/css/stylesheet.css",__FILE__));
765
+ wp_enqueue_style("system-message", plugins_url("/assets/css/system-message.css",__FILE__));
 
 
 
 
766
  }
767
+
768
  if(isset($_REQUEST["action"]))
769
  {
770
  switch(esc_attr($_REQUEST["action"]))
771
  {
772
  case "add_contact_form_library":
773
  add_action( "admin_init", "add_contact_form_library");
774
+
775
+ function add_contact_form_library()
776
+ {
777
+ global $wpdb,$current_user,$cb_user_role_permission;
778
+ if (is_super_admin())
779
+ {
780
+ $cb_role = "administrator";
781
+ }
782
+ else
783
+ {
784
+ $cb_role = $wpdb->prefix . "capabilities";
785
+ $current_user->role = array_keys($current_user->$cb_role);
786
+ $cb_role = $current_user->role[0];
787
+ }
788
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_view-class.php"))
789
+ {
790
+ include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_view-class.php";
791
+ }
792
+ }
793
+
 
794
 
795
  break;
796
 
797
  case "frontend_contact_form_library":
798
 
799
  add_action( "admin_init", "frontend_contact_form_library");
800
+
801
+ function frontend_contact_form_library()
802
+ {
803
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_frontend-class.php"))
804
+ {
805
+ include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_frontend-class.php";
806
+ }
807
+ }
808
+
 
809
  break;
810
 
811
  case "email_contact_form_library":
812
 
813
  add_action( "admin_init", "email_contact_form_library");
814
+
815
+ function email_contact_form_library()
816
+ {
817
+ global $wpdb,$current_user,$cb_user_role_permission;
818
+ if (is_super_admin())
819
+ {
820
+ $cb_role = "administrator";
821
+ }
822
+ else
823
+ {
824
+ $cb_role = $wpdb->prefix . "capabilities";
825
+ $current_user->role = array_keys($current_user->$cb_role);
826
+ $cb_role = $current_user->role[0];
827
+ }
828
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_email-class.php"))
829
+ {
830
+ include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_email-class.php";
831
+ }
832
+ }
833
+
 
834
 
835
  break;
836
 
837
  case "email_management_contact_form_library":
838
 
839
  add_action( "admin_init", "email_management_contact_form_library");
840
+
841
+ function email_management_contact_form_library()
842
+ {
843
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_email_management.php"))
844
+ {
845
+ include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_email_management.php";
846
+ }
847
+ }
848
+
 
849
 
850
  break;
851
 
852
  case "frontend_data_contact_library":
853
 
854
  add_action( "admin_init", "frontend_data_contact_library");
855
+
856
+ function frontend_data_contact_library()
857
+ {
858
+ global $wpdb,$current_user,$cb_user_role_permission;
859
+ if (is_super_admin())
860
+ {
861
+ $cb_role = "administrator";
862
+ }
863
+ else
864
+ {
865
+ $cb_role = $wpdb->prefix . "capabilities";
866
+ $current_user->role = array_keys($current_user->$cb_role);
867
+ $cb_role = $current_user->role[0];
868
+ }
869
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_frontend_data_class.php"))
870
+ {
871
+ include CONTACT_BK_PLUGIN_DIR . "/lib/contact_frontend_data_class.php";
872
+ }
873
+ }
874
+
 
875
  break;
876
 
877
  case "show_form_control_data_contact_library":
878
 
879
  add_action( "admin_init", "show_form_control_data_contact_library");
880
+
881
+ function show_form_control_data_contact_library()
882
+ {
883
+ global $wpdb,$current_user,$cb_user_role_permission;
884
+ if (is_super_admin())
885
+ {
886
+ $cb_role = "administrator";
887
+ }
888
+ else
889
+ {
890
+ $cb_role = $wpdb->prefix . "capabilities";
891
+ $current_user->role = array_keys($current_user->$cb_role);
892
+ $cb_role = $current_user->role[0];
893
+ }
894
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_show_form_control_data-class.php"))
895
+ {
896
+ include CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_show_form_control_data-class.php";
897
+ }
898
+ }
899
+
 
900
  break;
901
 
902
  case "layout_settings_contact_library":
903
 
904
  add_action( "admin_init", "layout_settings_contact_library");
905
+
906
+ function layout_settings_contact_library()
907
+ {
908
+ global $wpdb,$current_user,$cb_user_role_permission;
909
+ if (is_super_admin())
910
+ {
911
+ $cb_role = "administrator";
912
+ }
913
+ else
914
+ {
915
+ $cb_role = $wpdb->prefix . "capabilities";
916
+ $current_user->role = array_keys($current_user->$cb_role);
917
+ $cb_role = $current_user->role[0];
918
+ }
919
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_layout_settings-class.php"))
920
+ {
921
+ include CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_layout_settings-class.php";
922
+ }
923
+ }
924
+
 
925
  break;
926
  }
927
  }
931
  * Last Modified : 1.0
932
  * Reasons for change : None
933
  */
934
+ function contact_bank_contact_form()
935
  {
936
+ global $wpdb;
937
+ return $wpdb->prefix . "cb_contact_form";
 
 
 
938
  }
939
+
940
+
941
+ function contact_bank_dynamic_settings_form()
942
  {
943
+ global $wpdb;
944
+ return $wpdb->prefix . "cb_dynamic_settings";
 
 
 
945
  }
946
+
947
+ function create_control_Table()
948
  {
949
+ global $wpdb;
950
+ return $wpdb->prefix . "cb_create_control_form";
 
 
 
951
  }
952
+
953
+ function frontend_controls_data_Table()
954
  {
955
+ global $wpdb;
956
+ return $wpdb->prefix . "cb_frontend_data_table";
 
 
 
957
  }
958
+
959
+ function contact_bank_email_template_admin()
960
  {
961
+ global $wpdb;
962
+ return $wpdb->prefix . "cb_email_template_admin";
 
 
 
963
  }
964
+
965
+ function contact_bank_frontend_forms_Table()
966
  {
967
+ global $wpdb;
968
+ return $wpdb->prefix . "cb_frontend_forms_table";
 
 
 
969
  }
970
+
971
+ function contact_bank_form_settings_Table()
972
  {
973
+ global $wpdb;
974
+ return $wpdb->prefix . "cb_form_settings_table";
 
 
 
975
  }
976
+
977
+ function contact_bank_layout_settings_Table()
978
  {
979
+ global $wpdb;
980
+ return $wpdb->prefix . "cb_layout_settings_table";
 
 
 
981
  }
982
+
983
+ function contact_bank_licensing()
984
  {
985
+ global $wpdb;
986
+ return $wpdb->prefix . "cb_licensing";
 
 
 
987
  }
988
+
989
+ function contact_bank_roles_capability()
990
  {
991
+ global $wpdb;
992
+ return $wpdb->prefix . "cb_roles_capability";
 
 
 
993
  }
994
+
995
+ function contact_bank_short_code($atts)
996
  {
997
+ extract(shortcode_atts(array(
998
+ "form_id" => "",
999
+ "show_title" => "",
1000
+ "show_desc" => "",
1001
+ ), $atts));
1002
+ if(!is_feed())
1003
+ {
1004
+ return extract_short_code($form_id,$show_title,$show_desc);
1005
+ }
 
 
 
1006
  }
1007
+
1008
+ function extract_short_code($form_id,$show_title,$show_desc)
1009
  {
1010
+ ob_start();
1011
+ require CONTACT_BK_PLUGIN_DIR."/frontend_views/contact_bank_forms.php";
1012
+ $contact_bank_output = ob_get_clean();
1013
+ wp_reset_query();
1014
+ return $contact_bank_output;
 
 
 
1015
  }
1016
+
1017
+ function add_contact_bank_icon($meta = TRUE)
1018
  {
1019
+ if (!is_user_logged_in() )
1020
+ {
1021
+ return;
1022
+ }
1023
+ else
1024
+ {
1025
+ global $wp_admin_bar,$wpdb,$current_user;
1026
+ if (is_super_admin())
1027
+ {
1028
+ $cb_role = "administrator";
1029
+ }
1030
+ else
1031
+ {
1032
+ $cb_role = $wpdb->prefix . "capabilities";
1033
+ $current_user->role = array_keys($current_user->$cb_role);
1034
+ $cb_role = $current_user->role[0];
1035
+ }
1036
+
1037
+ switch ($cb_role)
1038
+ {
1039
+ case "administrator":
1040
+ $wp_admin_bar->add_menu( array(
1041
+ "id" => "contact_bank_links",
1042
+ "title" => "<img src=\"".plugins_url("/assets/images/icon.png",__FILE__)."\" width=\"25\" height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Contact Bank" ,
1043
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1044
+ ));
1045
+ $wp_admin_bar->add_menu( array(
1046
+ "parent" => "contact_bank_links",
1047
+ "id" => "cb_dashboard_links",
1048
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1049
+ "title" => __( "Dashboard", "contact-bank") ) /* set the sub-menu name */
1050
+ );
1051
+ $wp_admin_bar->add_menu( array(
1052
+ "parent" => "contact_bank_links",
1053
+ "id" => "other_settings_links",
1054
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_other_settings",
1055
+ "title" => __( "Other Settings", "contact-bank")) /* set the sub-menu name */
1056
+ );
1057
+ $wp_admin_bar->add_menu( array(
1058
+ "parent" => "contact_bank_links",
1059
+ "id" => "short_code_links",
1060
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_short_code",
1061
+ "title" => __( "Short-Codes", "contact-bank")) /* set the sub-menu name */
1062
+ );
1063
+ $wp_admin_bar->add_menu( array(
1064
+ "parent" => "contact_bank_links",
1065
+ "id" => "frontend_data_links",
1066
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_frontend_data",
1067
+ "title" => __( "Form Entries", "contact-bank")) /* set the sub-menu name */
1068
+ );
1069
+ $wp_admin_bar->add_menu( array(
1070
+ "parent" => "contact_bank_links",
1071
+ "id" => "email_links",
1072
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_email",
1073
+ "title" => __( "Email Settings", "contact-bank") ) /* set the sub-menu name */
1074
+ );
1075
+ $wp_admin_bar->add_menu( array(
1076
+ "parent" => "contact_bank_links",
1077
+ "id" => "form_settings_data_links",
1078
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_layout_settings",
1079
+ "title" => __( "Global Settings", "contact-bank")) /* set the sub-menu name */
1080
+ );
1081
+ $wp_admin_bar->add_menu( array(
1082
+ "parent" => "contact_bank_links",
1083
+ "id" => "feature_request_data_links",
1084
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_feature_request",
1085
+ "title" => __( "Feature Requests", "contact-bank")) /* set the sub-menu name */
1086
+ );
1087
+ $wp_admin_bar->add_menu( array(
1088
+ "parent" => "contact_bank_links",
1089
+ "id" => "system_status_data_links",
1090
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_system_status",
1091
+ "title" => __( "System Status", "contact-bank")) /* set the sub-menu name */
1092
+ );
1093
+ $wp_admin_bar->add_menu(array(
1094
+ "parent" => "contact_bank_links",
1095
+ "id" => "contact_bank_recommended_plugins_links",
1096
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_recommended_plugins",
1097
+ "title" => __("Recommendations", "contact-bank"))
1098
+ );
1099
+
1100
+ $wp_admin_bar->add_menu(array(
1101
+ "parent" => "contact_bank_links",
1102
+ "id" => "pro_version_links",
1103
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_pro_version",
1104
+ "title" => __("Premium Editions", "contact-bank"))
1105
+ );
1106
+
1107
+ $wp_admin_bar->add_menu(array(
1108
+ "parent" => "contact_bank_links",
1109
+ "id" => "contact_bank_other_services_links",
1110
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_other_services",
1111
+ "title" => __("Our Other Services", "contact-bank"))
1112
+ );
1113
+ break;
1114
+
1115
+ case "editor":
1116
+ $wp_admin_bar->add_menu( array(
1117
+ "id" => "contact_bank_links",
1118
+ "title" => "<img src=\"".plugins_url("/assets/images/icon.png",__FILE__)."\" width=\"25\" height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Contact Bank" ,
1119
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1120
+ ));
1121
+
1122
+ $wp_admin_bar->add_menu( array(
1123
+ "parent" => "contact_bank_links",
1124
+ "id" => "dashboard_links",
1125
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1126
+ "title" => __( "Dashboard", "contact-bank") ) /* set the sub-menu name */
1127
+ );
1128
+ $wp_admin_bar->add_menu( array(
1129
+ "parent" => "contact_bank_links",
1130
+ "id" => "other_settings_links",
1131
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_other_settings",
1132
+ "title" => __( "Other Settings", "contact-bank")) /* set the sub-menu name */
1133
+ );
1134
+ $wp_admin_bar->add_menu( array(
1135
+ "parent" => "contact_bank_links",
1136
+ "id" => "short_code_links",
1137
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_short_code",
1138
+ "title" => __( "Short-Codes", "contact-bank")) /* set the sub-menu name */
1139
+ );
1140
+ $wp_admin_bar->add_menu( array(
1141
+ "parent" => "contact_bank_links",
1142
+ "id" => "frontend_data_links",
1143
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_frontend_data",
1144
+ "title" => __( "Form Entries", "contact-bank")) /* set the sub-menu name */
1145
+ );
1146
+ $wp_admin_bar->add_menu( array(
1147
+ "parent" => "contact_bank_links",
1148
+ "id" => "email_links",
1149
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_email",
1150
+ "title" => __( "Email Settings", "contact-bank") ) /* set the sub-menu name */
1151
+ );
1152
+ $wp_admin_bar->add_menu( array(
1153
+ "parent" => "contact_bank_links",
1154
+ "id" => "form_settings_data_links",
1155
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_layout_settings",
1156
+ "title" => __( "Global Settings", "contact-bank")) /* set the sub-menu name */
1157
+ );
1158
+ $wp_admin_bar->add_menu( array(
1159
+ "parent" => "contact_bank_links",
1160
+ "id" => "feature_request_data_links",
1161
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_feature_request",
1162
+ "title" => __( "Feature Requests", "contact-bank")) /* set the sub-menu name */
1163
+ );
1164
+
1165
+ $wp_admin_bar->add_menu( array(
1166
+ "parent" => "contact_bank_links",
1167
+ "id" => "system_status_data_links",
1168
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_system_status",
1169
+ "title" => __( "System Status", "contact-bank")) /* set the sub-menu name */
1170
+ );
1171
+ $wp_admin_bar->add_menu(array(
1172
+ "parent" => "contact_bank_links",
1173
+ "id" => "contact_bank_recommended_plugins_links",
1174
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_recommended_plugins",
1175
+ "title" => __("Recommendations", "contact-bank"))
1176
+ );
1177
+
1178
+ $wp_admin_bar->add_menu(array(
1179
+ "parent" => "contact_bank_links",
1180
+ "id" => "pro_version_links",
1181
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_pro_version",
1182
+ "title" => __("Premium Editions", "contact-bank"))
1183
+ );
1184
+
1185
+ $wp_admin_bar->add_menu(array(
1186
+ "parent" => "contact_bank_links",
1187
+ "id" => "contact_bank_other_services_links",
1188
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_other_services",
1189
+ "title" => __("Our Other Services", "contact-bank"))
1190
+ );
1191
+ break;
1192
+
1193
+ case "author":
1194
+ $wp_admin_bar->add_menu( array(
1195
+ "id" => "contact_bank_links",
1196
+ "title" => "<img src=\"".plugins_url("/assets/images/icon.png",__FILE__)."\" width=\"25\" height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Contact Bank" ,
1197
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1198
+ ));
1199
+ $wp_admin_bar->add_menu( array(
1200
+ "parent" => "contact_bank_links",
1201
+ "id" => "dashboard_links",
1202
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1203
+ "title" => __( "Dashboard", "contact-bank") ) /* set the sub-menu name */
1204
+ );
1205
+ $wp_admin_bar->add_menu( array(
1206
+ "parent" => "contact_bank_links",
1207
+ "id" => "other_settings_links",
1208
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_other_settings",
1209
+ "title" => __( "Other Settings", "contact-bank")) /* set the sub-menu name */
1210
+ );
1211
+ $wp_admin_bar->add_menu( array(
1212
+ "parent" => "contact_bank_links",
1213
+ "id" => "short_code_links",
1214
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_short_code",
1215
+ "title" => __( "Short-Codes", "contact-bank")) /* set the sub-menu name */
1216
+ );
1217
+ $wp_admin_bar->add_menu( array(
1218
+ "parent" => "contact_bank_links",
1219
+ "id" => "frontend_data_links",
1220
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_frontend_data",
1221
+ "title" => __( "Form Entries", "contact-bank")) /* set the sub-menu name */
1222
+ );
1223
+ $wp_admin_bar->add_menu( array(
1224
+ "parent" => "contact_bank_links",
1225
+ "id" => "email_links",
1226
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_email",
1227
+ "title" => __( "Email Settings", "contact-bank") ) /* set the sub-menu name */
1228
+ );
1229
+ $wp_admin_bar->add_menu( array(
1230
+ "parent" => "contact_bank_links",
1231
+ "id" => "form_settings_data_links",
1232
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_layout_settings",
1233
+ "title" => __( "Global Settings", "contact-bank")) /* set the sub-menu name */
1234
+ );
1235
+ $wp_admin_bar->add_menu( array(
1236
+ "parent" => "contact_bank_links",
1237
+ "id" => "feature_request_data_links",
1238
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_feature_request",
1239
+ "title" => __( "Feature Requests", "contact-bank")) /* set the sub-menu name */
1240
+ );
1241
+ $wp_admin_bar->add_menu(array(
1242
+ "parent" => "contact_bank_links",
1243
+ "id" => "contact_bank_recommended_plugins_links",
1244
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_recommended_plugins",
1245
+ "title" => __("Recommendations", "contact-bank"))
1246
+ );
1247
+
1248
+ $wp_admin_bar->add_menu(array(
1249
+ "parent" => "contact_bank_links",
1250
+ "id" => "pro_version_links",
1251
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_pro_version",
1252
+ "title" => __("Premium Editions", "contact-bank"))
1253
+ );
1254
+
1255
+ $wp_admin_bar->add_menu(array(
1256
+ "parent" => "contact_bank_links",
1257
+ "id" => "contact_bank_other_services_links",
1258
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_other_services",
1259
+ "title" => __("Our Other Services", "contact-bank"))
1260
+ );
1261
+ break;
1262
+ }
1263
+ }
 
 
 
1264
  }
1265
+
1266
  add_action( "media_buttons_context", "add_contact_shortcode_button", 1);
1267
+
1268
+ function add_contact_shortcode_button($context)
1269
  {
1270
+ add_thickbox();
1271
+ $context .= "<a href=\"#TB_inline?width=300&height=400&inlineId=contact-bank\" class=\"button thickbox\" title=\"" . __("Add Contact Bank Form", "contact-bank") . "\">
1272
+ <span class=\"contact_icon\"></span> Add Contact Bank Form</a>";
1273
+ return $context;
 
 
 
1274
  }
1275
+
1276
  add_action("admin_footer","add_contact_mce_popup");
1277
 
1278
+
1279
+ function add_contact_mce_popup()
1280
  {
1281
+ ?>
1282
+ <?php add_thickbox(); ?>
1283
+ <div id="contact-bank" style="display:none;">
1284
+ <div class="fluid-layout responsive">
1285
+ <div style="padding:20px 0 10px 15px;">
1286
+ <h3 class="label-shortcode"><?php _e("Insert Contact Bank Form", "contact-bank"); ?></h3>
1287
+ <span>
1288
+ <i><?php _e("Select a form below to add it to your post or page.", "contact-bank"); ?></i>
1289
+ </span>
1290
+ </div>
1291
+ <div class="layout-span12 responsive" style="padding:15px 15px 0 0;">
1292
+ <div class="layout-control-group">
1293
+ <label class="custom-layout-label" for="ux_form_name"><?php _e("Form Name", "contact-bank"); ?> : </label>
1294
+ <select id="add_contact_form_id" class="layout-span9">
1295
+ <option value="0"><?php _e("Select a Form", "contact-bank"); ?> </option>
1296
+ <?php
1297
+ global $wpdb;
1298
+ $forms = $wpdb->get_results
1299
+ (
1300
+ "SELECT * FROM " .contact_bank_contact_form()
1301
+ );
1302
+ for($flag = 0;$flag<count($forms);$flag++)
1303
+ {
1304
+ ?>
1305
+ <option value="<?php echo intval($forms[$flag]->form_id); ?>"><?php echo esc_html($forms[$flag]->form_name) ?></option>
1306
+ <?php
1307
+ }
1308
+ ?>
1309
+ </select>
1310
+ </div>
1311
+ <div class="layout-control-group">
1312
+ <label class="custom-layout-label"><?php _e("Show Form Title", "contact-bank"); ?> : </label>
1313
+ <input type="checkbox" checked="checked" name="ux_form_title" id="ux_form_title"/>
1314
+ </div>
1315
+ <div class="layout-control-group">
1316
+ <label class="custom-layout-label"><?php _e("Show Form Description", "contact-bank"); ?> : </label>
1317
+ <input type="checkbox" name="ux_form_desc" id="ux_form_desc"/>
1318
+ </div>
1319
+ <div class="layout-control-group">
1320
+ <label class="custom-layout-label"></label>
1321
+ <input type="button" class="button-primary" value="<?php _e("Insert Form", "contact-bank"); ?>"
1322
+ onclick="Insert_Contact_Form();"/>&nbsp;&nbsp;&nbsp;
1323
+ <a class="button" style="color:#bbb;" href="#"
1324
+ onclick="tb_remove(); return false;"><?php _e("Cancel", "contact-bank"); ?></a>
1325
+ </div>
1326
+ </div>
1327
+ </div>
1328
+ </div>
1329
+ <script type="text/javascript">
1330
+ function Insert_Contact_Form()
1331
+ {
1332
+ var form_id = jQuery("#add_contact_form_id").val();
1333
+ var show_title = jQuery("#ux_form_title").prop("checked");
1334
+ var show_desc = jQuery("#ux_form_desc").prop("checked");
1335
+ if(form_id == 0)
1336
+ {
1337
+ alert("<?php _e("Please choose a Form to insert into Shortcode", "contact-bank") ?>");
1338
+ return;
1339
+ }
1340
+ window.send_to_editor("[contact_bank form_id=" + form_id + " show_title=" + show_title +" show_desc=" + show_desc +"]");
1341
+ }
1342
+ </script>
1343
+ <?php
 
 
 
1344
  }
1345
+
1346
+ function plugin_load_textdomain_contact_bank()
1347
  {
1348
+ load_plugin_textdomain("contact-bank", false, CONTACT_BK_PLUGIN_DIRNAME ."/languages");
 
 
 
 
 
 
1349
  }
 
1350
 
1351
+ add_action("plugins_loaded", "plugin_load_textdomain_contact_bank");
1352
  $version = get_option("contact-bank-version-number");
1353
  if (is_admin() && !request_is_frontend_ajax())
1354
  {
1357
  add_action("admin_init", "plugin_install_script_for_contact_bank");
1358
  }
1359
  }
1360
+
1361
+ function contact_bank_plugin_row($links,$file)
1362
  {
1363
+ if ($file == CONTACT_BK_PLUGIN_BASENAME)
1364
+ {
1365
+ $cpo_row_meta = array(
1366
+ "docs" => "<a href='".esc_url( apply_filters("contact_bank_docs_url","http://tech-banker.com/products/wp-contact-bank/knowledge-base/"))."' title='".esc_attr(__( "View Contact Bank Documentation","contact-bank"))."'>".__("Docs","contact-bank")."</a>",
1367
+ "gopremium" => "<a href='" .esc_url( apply_filters("contact_bank_premium_editions_url", "http://tech-banker.com/products/wp-contact-bank/pricing/"))."' title='".esc_attr(__( "View Contact Bank Premium Editions","contact-bank"))."'>".__("Go for Premium!","contact-bank")."</a>",
1368
+ );
1369
+ return array_merge($links,$cpo_row_meta);
1370
+ }
1371
+ return (array)$links;
 
 
 
1372
  }
1373
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1374
 
1375
+ function request_is_frontend_ajax()
 
 
 
1376
  {
1377
+ $script_filename = isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : '';
1378
+ //Try to figure out if frontend AJAX request... If we are DOING_AJAX; let's look closer
1379
+ if((defined('DOING_AJAX') && DOING_AJAX))
1380
+ {
1381
+ //From wp-includes/functions.php, wp_get_referer() function.
1382
+ //Required to fix: https://core.trac.wordpress.org/ticket/25294
1383
+ $ref = '';
1384
+ if ( ! empty( $_REQUEST['_wp_http_referer'] ) )
1385
+ $ref = wp_unslash( $_REQUEST['_wp_http_referer'] );
1386
+ elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) )
1387
+ $ref = wp_unslash( $_SERVER['HTTP_REFERER'] );
1388
+ //If referer does not contain admin URL and we are using the admin-ajax.php endpoint, this is likely a frontend AJAX request
1389
+ if(((strpos($ref, admin_url()) === false) && (basename($script_filename) === 'admin-ajax.php')))
1390
+ return true;
1391
+ }
1392
+ //If no checks triggered, we end up here - not an AJAX request.
1393
+ return false;
 
 
 
1394
  }
1395
 
1396
+
1397
  add_filter("plugin_row_meta","contact_bank_plugin_row", 10, 2 );
1398
  /*************************************************************************************/
1399
  add_action("admin_bar_menu", "add_contact_bank_icon",100);
1411
  register_activation_hook(__FILE__,"plugin_install_script_for_contact_bank");
1412
  // add_Shortcode Hook called for function contact_bank_short_code for FrontEnd
1413
  add_shortcode("contact_bank", "contact_bank_short_code");
 
 
1414
  // Deactivation Hook called for function deactivation_function_for_contact_bank
1415
  register_deactivation_hook(__FILE__,"deactivation_function_for_contact_bank");
1416
 
1417
  add_action( "network_admin_menu", "create_global_menus_for_contact_bank" );
 
 
1418
 
1419
  add_filter("widget_text", "do_shortcode");
1420
+
1421
+ class Contact_Bank_Widget extends WP_Widget
1422
  {
1423
+ function __construct()
1424
+ {
1425
+ parent::__construct(
1426
+ "Contact_Bank_Widget", // Base ID
1427
+ __("Contact Bank Widget", "contact_bank"), // Name
1428
+ array( "description" => __( "Build Complex, Powerful Contact Forms in Just Seconds.", "contact_bank" ), ) // Args
1429
+ );
1430
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1431
 
1432
+ function form($instance)
1433
+ {
1434
+ $instance = wp_parse_args((array) $instance, array( "title" => "", "form_id" => "0" ) );
1435
+ $title = $instance["title"];
1436
+ global $wpdb;
1437
+ $form_data = $wpdb->get_results
1438
+ (
1439
+ "SELECT * FROM " .contact_bank_contact_form()
1440
+ );
1441
+ ?>
1442
+ <p><label for="<?php echo $this->get_field_id("title"); ?>"> Widget Title: <input class="widefat" id="<?php echo $this->get_field_id("title"); ?>" name="<?php echo $this->get_field_name("title"); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
1443
+ <p><label for="<?php echo $this->get_field_id("form_id"); ?>"><?php _e("Select Form :", "contact-bank"); ?></label>
1444
+ <select size="1" name="<?php echo $this->get_field_name("form_id"); ?>" id="<?php echo $this->get_field_id("form_id"); ?>" class="widefat">
1445
+ <option value="0" ><?php _e("Select Form", "contact-bank"); ?></option>
1446
+ <?php
1447
+ if($form_data)
1448
+ {
1449
+ foreach($form_data as $form)
1450
+ {
1451
+ echo "<option value=\"" . $form->form_id . "\"";
1452
+ if ($form->form_id == $instance["form_id"])
1453
+ echo "selected=\"selected\"";
1454
+ echo ">" . stripslashes(html_entity_decode($form->form_name)) . "</option>" . "\n\t";
1455
+ }
1456
+ }
1457
+ ?>
1458
+ </select>
1459
+ </p>
1460
+ <?php
1461
+ }
1462
+ function update($new_instance, $old_instance)
1463
+ {
1464
+ $instance = $old_instance;
1465
+ $instance["title"] = $new_instance["title"];
1466
+ $instance["form_id"] = (int) $new_instance["form_id"];
1467
+ return $instance;
1468
+ }
1469
+ function widget($args, $instance)
1470
+ {
1471
+ global $wpdb;
1472
+ $form_data = $wpdb->get_var
1473
+ (
1474
+ $wpdb->prepare
1475
+ (
1476
+ "SELECT count(*) FROM " .contact_bank_contact_form() . " WHERE form_id = %d",
1477
+ $instance["form_id"]
1478
+ )
1479
+ );
1480
 
1481
+ extract($args, EXTR_SKIP);
1482
+ echo $before_widget;
1483
+ $title = empty($instance["title"]) ? " " : apply_filters("widget_title", $instance["title"]);
1484
+ if($form_data > 0)
1485
+ {
1486
+ if($instance["form_id"] != 0)
1487
+ {
1488
+ echo $before_title . $title . $after_title;
1489
+ $shortcode_for_contact_bank_form = "[contact_bank form_id=" . $instance["form_id"] . " ]";
1490
+ echo do_shortcode( $shortcode_for_contact_bank_form );
1491
+ echo $after_widget;
1492
+ }
1493
+ }
1494
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1495
  }
1496
+ add_action( "widgets_init", create_function("", "return register_widget(\"Contact_Bank_Widget\");"));
1497
  ?>
frontend_views/contact_bank_forms.php CHANGED
@@ -27,13 +27,13 @@ for($flag=0;$flag<count($form_fields);$flag++)
27
  $wpdb->prepare
28
  (
29
  "SELECT * FROM " .contact_bank_dynamic_settings_form()." WHERE dynamicId = %d",
30
- $form_fields[$flag]->control_id
31
  )
32
  );
33
  for($flag1=0;$flag1<count($control_settings);$flag1++)
34
  {
35
- $column_dynamicId = $form_fields[$flag]->column_dynamicId;
36
- $control_settings_array[$column_dynamicId][$control_settings[$flag1]->dynamic_settings_key] = $control_settings[$flag1]->dynamic_settings_value;
37
  }
38
  }
39
 
@@ -47,7 +47,7 @@ $form_settings = $wpdb->get_results
47
  );
48
  for($flag2=0;$flag2<count($form_settings);$flag2++)
49
  {
50
- $form_settings_array[$form_id][$form_settings[$flag2]->form_message_key] = $form_settings[$flag2]->form_message_value;
51
  }
52
 
53
  $forms_layout_settings = $wpdb->get_results
@@ -60,7 +60,7 @@ $forms_layout_settings = $wpdb->get_results
60
  );
61
  for($flag3=0;$flag3<count($forms_layout_settings);$flag3++)
62
  {
63
- $layout_settings_array[$form_id][$forms_layout_settings[$flag3]->form_settings_key] = $forms_layout_settings[$flag3]->form_settings_value;
64
  }
65
 
66
  $forms_email_settings = $wpdb->get_row
@@ -89,29 +89,29 @@ $rand_value = RAND(10,10000);
89
  }
90
  .label_control
91
  {
92
- font-family: <?php echo $layout_settings_array[$form_id]["label_setting_font_family"]; ?> !important;
93
- color: <?php echo $layout_settings_array[$form_id]["label_setting_font_color"]; ?> !important;
94
  <?php
95
- if($layout_settings_array[$form_id]["label_setting_font_style"] == "italic")
96
  {
97
  ?>
98
- font-style: <?php echo $layout_settings_array[$form_id]["label_setting_font_style"]; ?> !important;
99
  <?php
100
  }
101
  else
102
  {
103
  ?>
104
- font-weight: <?php echo $layout_settings_array[$form_id]["label_setting_font_style"]; ?> !important;
105
  <?php
106
  }
107
- if($layout_settings_array[$form_id]["label_setting_label_position"] == "top")
108
  {
109
  ?>
110
  float: none !important;
111
- text-align: <?php echo $layout_settings_array[$form_id]["label_setting_font_align_left"] == "0" ? "left" : "right"; ?> !important;
112
  <?php
113
  }
114
- else if($layout_settings_array[$form_id]["label_setting_label_position"] == "right")
115
  {
116
  ?>
117
  text-align: right !important;
@@ -120,50 +120,50 @@ $rand_value = RAND(10,10000);
120
  else
121
  {
122
  ?>
123
- text-align: <?php echo $layout_settings_array[$form_id]["label_setting_font_align_left"] == "0" ? "left" : "right"; ?> !important;
124
  <?php
125
  }
126
  ?>
127
- font-size: <?php echo $layout_settings_array[$form_id]["label_setting_font_size"] . "px"; ?> !important;
128
- display: <?php echo $layout_settings_array[$form_id]["label_setting_hide_label"] == "0" ? "inline-block" : "none"; ?> !important;
129
- direction: <?php echo $layout_settings_array[$form_id]["label_setting_text_direction"]; ?> !important;
130
  }
131
  .input_control
132
  {
133
 
134
- font-family: <?php echo $layout_settings_array[$form_id]["input_field_font_family"]; ?> !important;
135
- color: <?php echo $layout_settings_array[$form_id]["input_field_font_color"]; ?> !important;
136
  <?php
137
- if($layout_settings_array[$form_id]["input_field_font_style"] == "italic")
138
  {
139
  ?>
140
- font-style: <?php echo $layout_settings_array[$form_id]["input_field_font_style"]; ?> !important;
141
  <?php
142
  }
143
  else
144
  {
145
  ?>
146
- font-weight: <?php echo $layout_settings_array[$form_id]["input_field_font_style"]; ?> !important;
147
  <?php
148
  }
149
  ?>
150
- background-color: <?php echo $layout_settings_array[$form_id]["input_field_clr_bg_color"]; ?> !important;
151
- font-size: <?php echo $layout_settings_array[$form_id]["input_field_font_size"] . "px"; ?> !important;
152
- border: <?php echo $layout_settings_array[$form_id]["input_field_border_size"] . "px ".$layout_settings_array[$form_id]["input_field_border_style"].$layout_settings_array[$form_id]["input_field_border_color"]; ?> !important;
153
- border-radius: <?php echo $layout_settings_array[$form_id]["input_field_border_radius"] . "px"; ?> !important;
154
- -moz-border-radius: <?php echo $layout_settings_array[$form_id]["input_field_border_radius"] . "px"; ?> !important;
155
- -webkit-border-radius: <?php echo $layout_settings_array[$form_id]["input_field_border_radius"] . "px"; ?> !important;
156
- -khtml-border-radius: <?php echo $layout_settings_array[$form_id]["input_field_border_radius"] . "px"; ?> !important;
157
- -o-border-radius: <?php echo $layout_settings_array[$form_id]["input_field_border_radius"] . "px"; ?> !important;
158
- text-align: <?php echo $layout_settings_array[$form_id]["input_field_rdl_text_align"] == "0" ? "left" : "right"; ?> !important;
159
- direction: <?php echo $layout_settings_array[$form_id]["input_field_text_direction"]; ?> !important;
160
  min-width:250px;
161
  max-width:500px;
162
  }
163
  .layout_according_label_position
164
  {
165
  <?php
166
- if($layout_settings_array[$form_id]["label_setting_label_position"] == "top")
167
  {
168
  ?>
169
  margin-left: 0px !important;
@@ -175,39 +175,39 @@ $rand_value = RAND(10,10000);
175
  .field_description
176
  {
177
  display:block !important;
178
- font-family: <?php echo $layout_settings_array[$form_id]["label_setting_font_family"]; ?> !important;
179
  font-style: italic !important;
180
- color: <?php echo $layout_settings_array[$form_id]["label_setting_font_color"]; ?> !important;
181
  <?php
182
- if($layout_settings_array[$form_id]["label_setting_font_style"] == "italic")
183
  {
184
  ?>
185
- font-style: <?php echo $layout_settings_array[$form_id]["label_setting_font_style"]; ?> !important;
186
  <?php
187
  }
188
  else
189
  {
190
  ?>
191
- font-weight: <?php echo $layout_settings_array[$form_id]["label_setting_font_style"]; ?> !important;
192
  <?php
193
  }
194
  ?>
195
- font-size: <?php echo $layout_settings_array[$form_id]["label_setting_field_size"] . "px"; ?> !important;
196
- text-align: <?php echo $layout_settings_array[$form_id]["label_setting_field_align"]; ?> !important;
197
  }
198
  .btn_submit
199
  {
200
  <?php
201
- if($layout_settings_array[$form_id]["submit_button_font_style"] == "italic")
202
  {
203
  ?>
204
- font-style: <?php echo $layout_settings_array[$form_id]["submit_button_font_style"]; ?> !important;
205
  <?php
206
  }
207
  else
208
  {
209
  ?>
210
- font-weight: <?php echo $layout_settings_array[$form_id]["submit_button_font_style"]; ?> !important;
211
  <?php
212
  }
213
  ?>
@@ -230,35 +230,35 @@ $rand_value = RAND(10,10000);
230
  .success_message
231
  {
232
 
233
- background-color: <?php echo $layout_settings_array[$form_id]["success_msg_bg_color"]; ?> !important;
234
- border: <?php echo "2px Solid ".$layout_settings_array[$form_id]["success_msg_border_color"]; ?> !important;
235
- color: <?php echo $layout_settings_array[$form_id]["success_msg_text_color"]; ?> !important;
236
- text-align: <?php echo $layout_settings_array[$form_id]["success_msg_rdl_text_align"] == "0" ? "left" : "right"; ?> !important;
237
- direction: <?php echo $layout_settings_array[$form_id]["success_msg_text_direction"]; ?> !important;
238
  background: url(<?php echo plugins_url("/assets/images/icons/icon-succes.png" , dirname(__FILE__));?>) no-repeat 1px 8px #EBF9E2;
239
  }
240
  .sucess_message_text
241
  {
242
- font-family: <?php echo $layout_settings_array[$form_id]["success_msg_font_family"]; ?> !important;
243
- font-size: <?php echo $layout_settings_array[$form_id]["success_msg_font_size"] . "px"; ?> !important;
244
  }
245
  label.error_field
246
  {
247
- font-family: <?php echo $layout_settings_array[$form_id]["error_msg_font_family"]; ?> !important;
248
- font-size: <?php echo $layout_settings_array[$form_id]["error_msg_font_size"] . "px"; ?> !important;
249
- background-color: <?php echo $layout_settings_array[$form_id]["error_msg_bg_color"]; ?> !important;
250
- border: <?php echo "2px Solid ".$layout_settings_array[$form_id]["error_msg_border_color"]; ?> !important;
251
- color: <?php echo $layout_settings_array[$form_id]["error_msg_text_color"]; ?> !important;
252
- text-align: <?php echo $layout_settings_array[$form_id]["error_msg_rdl_text_align"] == "0" ? "left" : "right"; ?> !important;
253
- direction: <?php echo $layout_settings_array[$form_id]["error_msg_text_direction"]; ?> !important;
254
  <?php
255
- if($layout_settings_array[$form_id]["label_setting_label_position"] == "left")
256
  {
257
  ?>
258
  margin-left: 10px;
259
  <?php
260
  }
261
- else if($layout_settings_array[$form_id]["label_setting_label_position"] == "right")
262
  {
263
  ?>
264
  margin-right: 10px;
@@ -271,7 +271,7 @@ $rand_value = RAND(10,10000);
271
  <form id="ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>" method="post" action="#">
272
  <div id="form_success_message_frontend_<?php echo $rand_value;?>" class="custom-message success_message" style="display: none;margin-bottom: 10px;">
273
  <span class="sucess_message_text" >
274
- <strong><?php echo $form_settings_array[$form_id]["success_message"]; ?></strong>
275
  </span>
276
  </div>
277
  <div>
@@ -286,7 +286,7 @@ $rand_value = RAND(10,10000);
286
  {
287
  ?>
288
  <div class="layout-control-group">
289
- <span><?php echo $form_settings_array[$form_id]["form_description"]; ?></span>
290
  </div>
291
  <?php
292
  }
@@ -299,8 +299,8 @@ $rand_value = RAND(10,10000);
299
  <div class="layout-control-group">
300
  <label class="label_control layout-control-label">
301
  <?php
302
- _e($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_label_value"], "contact-bank" ) . " :";
303
- if($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_control_required"] == "1")
304
  {
305
  ?>
306
  <span class="error">*</span>
@@ -309,29 +309,29 @@ $rand_value = RAND(10,10000);
309
  ?>
310
  </label>
311
  <?php
312
- switch($form_fields[$flag]->field_id)
313
  {
314
  case 1:
315
  ?>
316
  <div class="layout-controls layout_according_label_position">
317
- <input class="hovertip input_control" type="text" id="ux_txt_control_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" name="ux_txt_control_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>" placeholder="<?php _e($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"], "contact-bank" );?>" data-alpha="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_alpha_filter"];?>" data-alpha_num="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_ux_checkbox_alpha_num_filter"];?>" data-digit="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_digit_filter"];?>" data-strip="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_strip_tag_filter"];?>" data-trim="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_trim_filter"];?>" />
318
- <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
319
  </div>
320
  <?php
321
  break;
322
  case 2:
323
  ?>
324
  <div class="layout-controls layout_according_label_position">
325
- <textarea class="hovertip input_control" id="ux_textarea_control_<?php echo $form_fields[$flag]->column_dynamicId."_". $rand_value; ?>" placeholder="<?php _e($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"], "contact-bank" );?>" name="ux_textarea_control_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" data-alpha="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_alpha_filter"];?>" data-alpha_num="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_ux_checkbox_alpha_num_filter"];?>" data-digit="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_digit_filter"];?>" data-strip="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_strip_tag_filter"];?>" data-trim="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_trim_filter"];?>" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"></textarea>
326
- <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
327
  </div>
328
  <?php
329
  break;
330
  case 3:
331
  ?>
332
  <div class="layout-controls layout_according_label_position">
333
- <input class="hovertip input_control" type="text" id="ux_txt_email_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" name="ux_txt_email_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>" placeholder="<?php _e($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"], "contact-bank" );?>"/>
334
- <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
335
  </div>
336
  <?php
337
  break;
@@ -339,8 +339,8 @@ $rand_value = RAND(10,10000);
339
  $ddl_values = unserialize($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_dropdown_option_val"]);
340
  $ddl_ids = unserialize($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_dropdown_option_id"]);
341
  ?>
342
- <div class="layout-controls layout_according_label_position hovertip" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>">
343
- <select class="input_control" type="select" id="ux_select_default_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" name="ux_select_default_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>">
344
  <option value="<?php echo count($ddl_values) == 0 ? " " : ""; ?>"><?php _e("Select Option", "contact-bank"); ?></option>
345
  <?php
346
  foreach($ddl_ids as $key => $value )
@@ -360,13 +360,13 @@ $rand_value = RAND(10,10000);
360
  if(count($chk_ids) > 0)
361
  {
362
  ?>
363
- <div class="layout-controls layout_according_label_position hovertip" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>">
364
  <?php
365
  foreach($chk_ids as $key => $value )
366
  {
367
  ?>
368
  <label style="margin:0px;vertical-align: middle;" id="chk_id_<?php echo $value; ?>">
369
- <input type="checkbox" id="ux_chk_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_chk[]" value ="<?php echo esc_html($chk_values[$key]); ?>" />
370
  <?php echo $chk_values[$key]; ?>
371
  </label>
372
  <?php
@@ -378,7 +378,7 @@ $rand_value = RAND(10,10000);
378
  else
379
  {
380
  ?>
381
- <div class="layout-controls layout_according_label_position hovertip" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>">
382
  <input type="checkbox" id="ux_chk_control_" />
383
  </div>
384
  <?php
@@ -390,17 +390,17 @@ $rand_value = RAND(10,10000);
390
  if(count($rdl_ids) > 0)
391
  {
392
  ?>
393
- <div class="layout-controls layout_according_label_position hovertip" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>">
394
  <?php
395
  foreach($rdl_ids as $key => $value )
396
  {
397
  if($key == "0")
398
  {
399
- if($layout_settings_array[$form_id]["input_field_rdl_multiple_row"] == "0")
400
  {
401
  ?>
402
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
403
- <input type="radio" checked="checked" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_rdl" value ="<?php echo esc_html($rdl_values[$key]); ?>" />
404
  <?php echo $rdl_values[$key]; ?>
405
  </label>
406
  <br>
@@ -410,7 +410,7 @@ $rand_value = RAND(10,10000);
410
  {
411
  ?>
412
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
413
- <input type="radio" checked="checked" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_rdl" value ="<?php echo esc_html($rdl_values[$key]); ?>" />
414
  <?php echo $rdl_values[$key]; ?>
415
  </label>
416
  <?php
@@ -418,11 +418,11 @@ $rand_value = RAND(10,10000);
418
  }
419
  else
420
  {
421
- if($layout_settings_array[$form_id]["input_field_rdl_multiple_row"] == "0")
422
  {
423
  ?>
424
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
425
- <input type="radio" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_rdl" value ="<?php echo esc_html($rdl_values[$key]); ?>" />
426
  <?php echo $rdl_values[$key]; ?>
427
  </label>
428
  <br>
@@ -432,7 +432,7 @@ $rand_value = RAND(10,10000);
432
  {
433
  ?>
434
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
435
- <input type="radio" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_rdl" value ="<?php echo esc_html($rdl_values[$key]); ?>" />
436
  <?php echo $rdl_values[$key]; ?>
437
  </label>
438
  <?php
@@ -446,7 +446,7 @@ $rand_value = RAND(10,10000);
446
  else
447
  {
448
  ?>
449
- <div class="layout-controls layout_according_label_position hovertip" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>">
450
  <input type="radio" id="ux_rdl_control_" />
451
  </div>
452
  <?php
@@ -466,40 +466,39 @@ $rand_value = RAND(10,10000);
466
  <script type="text/javascript">
467
  var ajaxurl = "<?php echo admin_url("admin-ajax.php"); ?>";
468
  jQuery.extend(jQuery.validator.messages, {
469
- required: "<?php echo $form_settings_array[$form_id]["blank_field_message"];?>",
470
- email: "<?php echo $form_settings_array[$form_id]["incorrect_email_message"];?>"
471
  });
472
- if (typeof(base64_encode) != "function")
 
473
  {
474
- function base64_encode(data)
475
- {
476
- var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
477
- var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
478
- ac = 0,
479
- enc = '',
480
- tmp_arr = [];
481
- if (!data)
482
- {
483
- return data;
484
- }
485
- do
486
- {
487
- o1 = data.charCodeAt(i++);
488
- o2 = data.charCodeAt(i++);
489
- o3 = data.charCodeAt(i++);
490
- bits = o1 << 16 | o2 << 8 | o3;
491
- h1 = bits >> 18 & 0x3f;
492
- h2 = bits >> 12 & 0x3f;
493
- h3 = bits >> 6 & 0x3f;
494
- h4 = bits & 0x3f;
495
- tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
496
- }
497
- while (i < data.length);
498
- enc = tmp_arr.join('');
499
- var r = data.length % 3;
500
- return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
501
- }
502
  }
 
503
  jQuery("#ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>").validate
504
  ({
505
  rules:
@@ -508,27 +507,27 @@ jQuery("#ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>").valid
508
  $dynamic = "";
509
  for($flag4=0;$flag4<count($form_fields);$flag4++)
510
  {
511
- if($control_settings_array[$form_fields[$flag4]->column_dynamicId]["cb_control_required"] == 1)
512
  {
513
- switch($form_fields[$flag4]-> field_id)
514
  {
515
  case 1:
516
- $dynamic .= "ux_txt_control_".$form_fields[$flag4]->column_dynamicId ."_". $rand_value. ":{ required :true }";
517
  break;
518
  case 2:
519
- $dynamic .= "ux_textarea_control_".$form_fields[$flag4]->column_dynamicId ."_". $rand_value. ":{ required :true }";
520
  break;
521
  case 3:
522
- $dynamic .= "ux_txt_email_".$form_fields[$flag4]->column_dynamicId ."_". $rand_value. ":{ required :true,email :true }";
523
  break;
524
  case 4:
525
- $dynamic .= "ux_select_default_".$form_fields[$flag4]->column_dynamicId ."_". $rand_value. ":{ required: true}";
526
  break;
527
  case 5:
528
- $dynamic .= "'".$form_fields[$flag4]->column_dynamicId ."_". $rand_value. "_chk[]'". ":{ required :true }";
529
  break;
530
  case 6:
531
- $dynamic .= "'".$form_fields[$flag4]->column_dynamicId ."_". $rand_value. "_rdl'". ":{ required :true }";
532
  break;
533
 
534
  }
@@ -546,7 +545,7 @@ jQuery("#ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>").valid
546
  {
547
  <?php
548
 
549
- if($layout_settings_array[$form_id]["label_setting_label_position"] == "top")
550
  {
551
  ?>
552
  if(element.attr("type") === "time" || element.attr("type") === "date")
@@ -589,7 +588,7 @@ jQuery("#ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>").valid
589
  var form_id = "<?php echo $form_id ;?>";
590
  jQuery.post(ajaxurl,
591
  {
592
- data: base64_encode(jQuery(form).serialize()),
593
  form_id: form_id,
594
  rand: "<?php echo $rand_value;?>",
595
  param: "frontend_submit_controls",
27
  $wpdb->prepare
28
  (
29
  "SELECT * FROM " .contact_bank_dynamic_settings_form()." WHERE dynamicId = %d",
30
+ intval($form_fields[$flag]->control_id)
31
  )
32
  );
33
  for($flag1=0;$flag1<count($control_settings);$flag1++)
34
  {
35
+ $column_dynamicId = intval($form_fields[$flag]->column_dynamicId);
36
+ $control_settings_array[$column_dynamicId][$control_settings[$flag1]->dynamic_settings_key] = stripcslashes($control_settings[$flag1]->dynamic_settings_value);
37
  }
38
  }
39
 
47
  );
48
  for($flag2=0;$flag2<count($form_settings);$flag2++)
49
  {
50
+ $form_settings_array[$form_id][$form_settings[$flag2]->form_message_key] = esc_html($form_settings[$flag2]->form_message_value);
51
  }
52
 
53
  $forms_layout_settings = $wpdb->get_results
60
  );
61
  for($flag3=0;$flag3<count($forms_layout_settings);$flag3++)
62
  {
63
+ $layout_settings_array[$form_id][$forms_layout_settings[$flag3]->form_settings_key] = esc_html($forms_layout_settings[$flag3]->form_settings_value);
64
  }
65
 
66
  $forms_email_settings = $wpdb->get_row
89
  }
90
  .label_control
91
  {
92
+ font-family: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_family"]); ?> !important;
93
+ color: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_color"]); ?> !important;
94
  <?php
95
+ if(esc_attr($layout_settings_array[$form_id]["label_setting_font_style"]) == "italic")
96
  {
97
  ?>
98
+ font-style: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_style"]); ?> !important;
99
  <?php
100
  }
101
  else
102
  {
103
  ?>
104
+ font-weight: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_style"]); ?> !important;
105
  <?php
106
  }
107
+ if(esc_attr($layout_settings_array[$form_id]["label_setting_label_position"]) == "top")
108
  {
109
  ?>
110
  float: none !important;
111
+ text-align: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_align_left"]) == "0" ? "left" : "right"; ?> !important;
112
  <?php
113
  }
114
+ else if(esc_attr($layout_settings_array[$form_id]["label_setting_label_position"]) == "right")
115
  {
116
  ?>
117
  text-align: right !important;
120
  else
121
  {
122
  ?>
123
+ text-align: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_align_left"]) == "0" ? "left" : "right"; ?> !important;
124
  <?php
125
  }
126
  ?>
127
+ font-size: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_size"]) . "px"; ?> !important;
128
+ display: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_hide_label"]) == "0" ? "inline-block" : "none"; ?> !important;
129
+ direction: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_text_direction"]); ?> !important;
130
  }
131
  .input_control
132
  {
133
 
134
+ font-family: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_font_family"]); ?> !important;
135
+ color: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_font_color"]); ?> !important;
136
  <?php
137
+ if(esc_attr($layout_settings_array[$form_id]["input_field_font_style"]) == "italic")
138
  {
139
  ?>
140
+ font-style: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_font_style"]); ?> !important;
141
  <?php
142
  }
143
  else
144
  {
145
  ?>
146
+ font-weight: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_font_style"]); ?> !important;
147
  <?php
148
  }
149
  ?>
150
+ background-color: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_clr_bg_color"]); ?> !important;
151
+ font-size: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_font_size"]) . "px"; ?> !important;
152
+ border: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_border_size"]) . "px ".$layout_settings_array[$form_id]["input_field_border_style"].$layout_settings_array[$form_id]["input_field_border_color"]; ?> !important;
153
+ border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_border_radius"]) . "px"; ?> !important;
154
+ -moz-border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_border_radius"]) . "px"; ?> !important;
155
+ -webkit-border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_border_radius"]) . "px"; ?> !important;
156
+ -khtml-border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_border_radius"]) . "px"; ?> !important;
157
+ -o-border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_border_radius"]) . "px"; ?> !important;
158
+ text-align: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_rdl_text_align"]) == "0" ? "left" : "right"; ?> !important;
159
+ direction: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_text_direction"]); ?> !important;
160
  min-width:250px;
161
  max-width:500px;
162
  }
163
  .layout_according_label_position
164
  {
165
  <?php
166
+ if(esc_attr($layout_settings_array[$form_id]["label_setting_label_position"]) == "top")
167
  {
168
  ?>
169
  margin-left: 0px !important;
175
  .field_description
176
  {
177
  display:block !important;
178
+ font-family: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_family"]); ?> !important;
179
  font-style: italic !important;
180
+ color: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_color"]); ?> !important;
181
  <?php
182
+ if(esc_attr($layout_settings_array[$form_id]["label_setting_font_style"]) == "italic")
183
  {
184
  ?>
185
+ font-style: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_style"]); ?> !important;
186
  <?php
187
  }
188
  else
189
  {
190
  ?>
191
+ font-weight: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_style"]); ?> !important;
192
  <?php
193
  }
194
  ?>
195
+ font-size: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_field_size"]) . "px"; ?> !important;
196
+ text-align: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_field_align"]); ?> !important;
197
  }
198
  .btn_submit
199
  {
200
  <?php
201
+ if(esc_attr($layout_settings_array[$form_id]["submit_button_font_style"]) == "italic")
202
  {
203
  ?>
204
+ font-style: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_font_style"]); ?> !important;
205
  <?php
206
  }
207
  else
208
  {
209
  ?>
210
+ font-weight: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_font_style"]); ?> !important;
211
  <?php
212
  }
213
  ?>
230
  .success_message
231
  {
232
 
233
+ background-color: <?php echo esc_attr($layout_settings_array[$form_id]["success_msg_bg_color"]); ?> !important;
234
+ border: <?php echo "2px Solid ".esc_attr($layout_settings_array[$form_id]["success_msg_border_color"]); ?> !important;
235
+ color: <?php echo esc_attr($layout_settings_array[$form_id]["success_msg_text_color"]); ?> !important;
236
+ text-align: <?php echo esc_attr($layout_settings_array[$form_id]["success_msg_rdl_text_align"]) == "0" ? "left" : "right"; ?> !important;
237
+ direction: <?php echo esc_attr($layout_settings_array[$form_id]["success_msg_text_direction"]); ?> !important;
238
  background: url(<?php echo plugins_url("/assets/images/icons/icon-succes.png" , dirname(__FILE__));?>) no-repeat 1px 8px #EBF9E2;
239
  }
240
  .sucess_message_text
241
  {
242
+ font-family: <?php echo esc_attr($layout_settings_array[$form_id]["success_msg_font_family"]); ?> !important;
243
+ font-size: <?php echo esc_attr($layout_settings_array[$form_id]["success_msg_font_size"]) . "px"; ?> !important;
244
  }
245
  label.error_field
246
  {
247
+ font-family: <?php echo esc_attr($layout_settings_array[$form_id]["error_msg_font_family"]); ?> !important;
248
+ font-size: <?php echo esc_attr($layout_settings_array[$form_id]["error_msg_font_size"]) . "px"; ?> !important;
249
+ background-color: <?php echo esc_attr($layout_settings_array[$form_id]["error_msg_bg_color"]); ?> !important;
250
+ border: <?php echo "2px Solid ".esc_attr($layout_settings_array[$form_id]["error_msg_border_color"]); ?> !important;
251
+ color: <?php echo esc_attr($layout_settings_array[$form_id]["error_msg_text_color"]); ?> !important;
252
+ text-align: <?php echo esc_attr($layout_settings_array[$form_id]["error_msg_rdl_text_align"]) == "0" ? "left" : "right"; ?> !important;
253
+ direction: <?php echo esc_attr($layout_settings_array[$form_id]["error_msg_text_direction"]); ?> !important;
254
  <?php
255
+ if(esc_attr($layout_settings_array[$form_id]["label_setting_label_position"]) == "left")
256
  {
257
  ?>
258
  margin-left: 10px;
259
  <?php
260
  }
261
+ else if(esc_attr($layout_settings_array[$form_id]["label_setting_label_position"]) == "right")
262
  {
263
  ?>
264
  margin-right: 10px;
271
  <form id="ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>" method="post" action="#">
272
  <div id="form_success_message_frontend_<?php echo $rand_value;?>" class="custom-message success_message" style="display: none;margin-bottom: 10px;">
273
  <span class="sucess_message_text" >
274
+ <strong><?php echo esc_html($form_settings_array[$form_id]["success_message"]); ?></strong>
275
  </span>
276
  </div>
277
  <div>
286
  {
287
  ?>
288
  <div class="layout-control-group">
289
+ <span><?php echo esc_html($form_settings_array[$form_id]["form_description"]); ?></span>
290
  </div>
291
  <?php
292
  }
299
  <div class="layout-control-group">
300
  <label class="label_control layout-control-label">
301
  <?php
302
+ _e(esc_html($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_label_value"]), "contact-bank" ) . " :";
303
+ if(esc_attr($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_control_required"]) == "1")
304
  {
305
  ?>
306
  <span class="error">*</span>
309
  ?>
310
  </label>
311
  <?php
312
+ switch(intval($form_fields[$flag]->field_id))
313
  {
314
  case 1:
315
  ?>
316
  <div class="layout-controls layout_according_label_position">
317
+ <input class="hovertip input_control" type="text" id="ux_txt_control_<?php echo intval($form_fields[$flag]->column_dynamicId) ."_". $rand_value; ?>" name="ux_txt_control_<?php echo intval($form_fields[$flag]->column_dynamicId) ."_". $rand_value; ?>" placeholder="<?php _e(esc_html($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"]), "contact-bank" );?>" />
318
+ <span class="field_description" id="txt_description_"><?php echo esc_html($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]); ?></span>
319
  </div>
320
  <?php
321
  break;
322
  case 2:
323
  ?>
324
  <div class="layout-controls layout_according_label_position">
325
+ <textarea class="hovertip input_control" id="ux_textarea_control_<?php echo intval($form_fields[$flag]->column_dynamicId)."_". $rand_value; ?>" placeholder="<?php _e(esc_html($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"]), "contact-bank" );?>" name="ux_textarea_control_<?php echo intval($form_fields[$flag]->column_dynamicId) ."_". $rand_value; ?>"></textarea>
326
+ <span class="field_description" id="txt_description_"><?php echo esc_html($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]); ?></span>
327
  </div>
328
  <?php
329
  break;
330
  case 3:
331
  ?>
332
  <div class="layout-controls layout_according_label_position">
333
+ <input class="hovertip input_control" type="text" id="ux_txt_email_<?php echo intval($form_fields[$flag]->column_dynamicId) ."_". $rand_value; ?>" name="ux_txt_email_<?php echo intval($form_fields[$flag]->column_dynamicId) ."_". $rand_value; ?>" placeholder="<?php _e(esc_html($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"]), "contact-bank" );?>"/>
334
+ <span class="field_description" id="txt_description_"><?php echo esc_html($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]); ?></span>
335
  </div>
336
  <?php
337
  break;
339
  $ddl_values = unserialize($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_dropdown_option_val"]);
340
  $ddl_ids = unserialize($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_dropdown_option_id"]);
341
  ?>
342
+ <div class="layout-controls layout_according_label_position hovertip" >
343
+ <select class="input_control" type="select" id="ux_select_default_<?php echo intval($form_fields[$flag]->column_dynamicId) ."_". $rand_value; ?>" name="ux_select_default_<?php echo intval($form_fields[$flag]->column_dynamicId) ."_". $rand_value; ?>">
344
  <option value="<?php echo count($ddl_values) == 0 ? " " : ""; ?>"><?php _e("Select Option", "contact-bank"); ?></option>
345
  <?php
346
  foreach($ddl_ids as $key => $value )
360
  if(count($chk_ids) > 0)
361
  {
362
  ?>
363
+ <div class="layout-controls layout_according_label_position hovertip" >
364
  <?php
365
  foreach($chk_ids as $key => $value )
366
  {
367
  ?>
368
  <label style="margin:0px;vertical-align: middle;" id="chk_id_<?php echo $value; ?>">
369
+ <input type="checkbox" id="ux_chk_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo intval($form_fields[$flag]->column_dynamicId) ."_". $rand_value; ?>_chk[]" value ="<?php echo esc_html($chk_values[$key]); ?>" />
370
  <?php echo $chk_values[$key]; ?>
371
  </label>
372
  <?php
378
  else
379
  {
380
  ?>
381
+ <div class="layout-controls layout_according_label_position hovertip">
382
  <input type="checkbox" id="ux_chk_control_" />
383
  </div>
384
  <?php
390
  if(count($rdl_ids) > 0)
391
  {
392
  ?>
393
+ <div class="layout-controls layout_according_label_position hovertip" >
394
  <?php
395
  foreach($rdl_ids as $key => $value )
396
  {
397
  if($key == "0")
398
  {
399
+ if(esc_attr($layout_settings_array[$form_id]["input_field_rdl_multiple_row"]) == "0")
400
  {
401
  ?>
402
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
403
+ <input type="radio" checked="checked" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo intval($form_fields[$flag]->column_dynamicId) ."_". $rand_value; ?>_rdl" value ="<?php echo esc_html($rdl_values[$key]); ?>" />
404
  <?php echo $rdl_values[$key]; ?>
405
  </label>
406
  <br>
410
  {
411
  ?>
412
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
413
+ <input type="radio" checked="checked" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo intval($form_fields[$flag]->column_dynamicId) ."_". $rand_value; ?>_rdl" value ="<?php echo esc_html($rdl_values[$key]); ?>" />
414
  <?php echo $rdl_values[$key]; ?>
415
  </label>
416
  <?php
418
  }
419
  else
420
  {
421
+ if(esc_attr($layout_settings_array[$form_id]["input_field_rdl_multiple_row"]) == "0")
422
  {
423
  ?>
424
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
425
+ <input type="radio" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo intval($form_fields[$flag]->column_dynamicId) ."_". $rand_value; ?>_rdl" value ="<?php echo esc_html($rdl_values[$key]); ?>" />
426
  <?php echo $rdl_values[$key]; ?>
427
  </label>
428
  <br>
432
  {
433
  ?>
434
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
435
+ <input type="radio" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo intval($form_fields[$flag]->column_dynamicId) ."_". $rand_value; ?>_rdl" value ="<?php echo esc_html($rdl_values[$key]); ?>" />
436
  <?php echo $rdl_values[$key]; ?>
437
  </label>
438
  <?php
446
  else
447
  {
448
  ?>
449
+ <div class="layout-controls layout_according_label_position hovertip" >
450
  <input type="radio" id="ux_rdl_control_" />
451
  </div>
452
  <?php
466
  <script type="text/javascript">
467
  var ajaxurl = "<?php echo admin_url("admin-ajax.php"); ?>";
468
  jQuery.extend(jQuery.validator.messages, {
469
+ required: "<?php echo esc_html($form_settings_array[$form_id]["blank_field_message"]);?>",
470
+ email: "<?php echo esc_html($form_settings_array[$form_id]["incorrect_email_message"]);?>"
471
  });
472
+
473
+ function base64_encode_contact_bank(data)
474
  {
475
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
476
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
477
+ ac = 0,
478
+ enc = '',
479
+ tmp_arr = [];
480
+ if (!data)
481
+ {
482
+ return data;
483
+ }
484
+ do
485
+ {
486
+ o1 = data.charCodeAt(i++);
487
+ o2 = data.charCodeAt(i++);
488
+ o3 = data.charCodeAt(i++);
489
+ bits = o1 << 16 | o2 << 8 | o3;
490
+ h1 = bits >> 18 & 0x3f;
491
+ h2 = bits >> 12 & 0x3f;
492
+ h3 = bits >> 6 & 0x3f;
493
+ h4 = bits & 0x3f;
494
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
495
+ }
496
+ while (i < data.length);
497
+ enc = tmp_arr.join('');
498
+ var r = data.length % 3;
499
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
 
 
 
500
  }
501
+
502
  jQuery("#ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>").validate
503
  ({
504
  rules:
507
  $dynamic = "";
508
  for($flag4=0;$flag4<count($form_fields);$flag4++)
509
  {
510
+ if(intval($control_settings_array[$form_fields[$flag4]->column_dynamicId]["cb_control_required"]) == 1)
511
  {
512
+ switch(intval($form_fields[$flag4]-> field_id))
513
  {
514
  case 1:
515
+ $dynamic .= "ux_txt_control_".intval($form_fields[$flag4]->column_dynamicId) ."_". $rand_value. ":{ required :true }";
516
  break;
517
  case 2:
518
+ $dynamic .= "ux_textarea_control_".intval($form_fields[$flag4]->column_dynamicId) ."_". $rand_value. ":{ required :true }";
519
  break;
520
  case 3:
521
+ $dynamic .= "ux_txt_email_".intval($form_fields[$flag4]->column_dynamicId) ."_". $rand_value. ":{ required :true,email :true }";
522
  break;
523
  case 4:
524
+ $dynamic .= "ux_select_default_".intval($form_fields[$flag4]->column_dynamicId) ."_". $rand_value. ":{ required: true}";
525
  break;
526
  case 5:
527
+ $dynamic .= "'".intval($form_fields[$flag4]->column_dynamicId) ."_". $rand_value. "_chk[]'". ":{ required :true }";
528
  break;
529
  case 6:
530
+ $dynamic .= "'".intval($form_fields[$flag4]->column_dynamicId) ."_". $rand_value. "_rdl'". ":{ required :true }";
531
  break;
532
 
533
  }
545
  {
546
  <?php
547
 
548
+ if(esc_attr($layout_settings_array[$form_id]["label_setting_label_position"]) == "top")
549
  {
550
  ?>
551
  if(element.attr("type") === "time" || element.attr("type") === "date")
588
  var form_id = "<?php echo $form_id ;?>";
589
  jQuery.post(ajaxurl,
590
  {
591
+ data: base64_encode_contact_bank(jQuery(form).serialize()),
592
  form_id: form_id,
593
  rand: "<?php echo $rand_value;?>",
594
  param: "frontend_submit_controls",
includes/cb_checkbox.php CHANGED
@@ -44,7 +44,7 @@ else
44
  $form_settings[$dynamicId]["control_type"] = "1";
45
  for($flag = 0; $flag<count($form_data);$flag++)
46
  {
47
- $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
48
  }
49
  }
50
  ?>
@@ -59,7 +59,7 @@ else
59
  <div class="layout-control-group">
60
  <label class="layout-control-label"><?php _e( "Label", "contact-bank" ); ?> :</label>
61
  <div class="layout-controls">
62
- <input type="text" class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);" value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", "contact-bank" ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
63
  </div>
64
  </div>
65
  <div class="layout-control-group">
@@ -68,7 +68,7 @@ else
68
  <?php
69
  if(isset($form_settings[$dynamicId]["cb_control_required"]))
70
  {
71
- if($form_settings[$dynamicId]["cb_control_required"] == "1")
72
  {
73
  ?>
74
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
@@ -81,7 +81,7 @@ else
81
  </label>
82
  <?php
83
  }
84
- else if($form_settings[$dynamicId]["cb_control_required"] == "0")
85
  {
86
  ?>
87
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
@@ -170,7 +170,7 @@ else
170
  <?php
171
  if(isset($form_settings[$dynamicId]["cb_show_email"]))
172
  {
173
- if($form_settings[$dynamicId]["cb_show_email"] == "1")
174
  {
175
  ?>
176
  <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
@@ -204,37 +204,36 @@ else
204
  <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
205
  <script type="text/javascript">
206
  jQuery(".hovertip").tooltip_tip({placement: "left"});
207
- if (typeof(base64_encode) != "function")
208
- {
209
- function base64_encode(data)
210
- {
211
- var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
212
- var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
213
- ac = 0,
214
- enc = '',
215
- tmp_arr = [];
216
- if (!data)
217
- {
218
- return data;
219
- }
220
- do
221
- {
222
- o1 = data.charCodeAt(i++);
223
- o2 = data.charCodeAt(i++);
224
- o3 = data.charCodeAt(i++);
225
- bits = o1 << 16 | o2 << 8 | o3;
226
- h1 = bits >> 18 & 0x3f;
227
- h2 = bits >> 12 & 0x3f;
228
- h3 = bits >> 6 & 0x3f;
229
- h4 = bits & 0x3f;
230
- tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
231
- }
232
- while (i < data.length);
233
- enc = tmp_arr.join('');
234
- var r = data.length % 3;
235
- return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
236
- }
237
- }
238
  var dynamicId = "<?php echo $dynamicId; ?>";
239
  var controlId = "<?php echo $control_id; ?>";
240
  var form_id = "<?php echo $form_id;?>";
@@ -261,7 +260,7 @@ else
261
  });
262
  jQuery.post(ajaxurl,
263
  {
264
- data: base64_encode(jQuery(form).serialize()),
265
  controlId: controlId,
266
  form_id: form_id,
267
  form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
@@ -283,36 +282,33 @@ else
283
  });
284
  }
285
  });
286
- if (typeof(add_chk_options) != "function")
287
- {
288
- function add_chk_options(dynamicId)
289
- {
290
- var ddl_options = jQuery("#chk_options_"+dynamicId).val();
291
- if(ddl_options=="")
292
- {
293
- alert("<?php _e( "Please Fill an Option.", "contact-bank" ); ?>");
294
- }
295
- else
296
- {
297
- var optionsId = Math.floor((Math.random()*10000)+1);
298
- jQuery("#dropdown_ddl_option_"+dynamicId).append("<option value=\""+optionsId+"\">"+ddl_options+"</option>");
299
- jQuery("#bind_dropdown_"+dynamicId).css("display","");
300
- jQuery("#chk_options_"+dynamicId).val("");
301
- }
302
- }
303
- }
304
- if (typeof(delete_ddl_options) != "function")
305
- {
306
- function delete_ddl_options(dynamicId)
307
- {
308
- var value = jQuery("#dropdown_ddl_option_"+dynamicId).val();
309
- jQuery("#dropdown_ddl_option_"+dynamicId+ " option[value=\""+value+"\"]").remove();
310
- if(jQuery("#dropdown_ddl_option_"+dynamicId).val() == null)
311
- {
312
- jQuery("#bind_dropdown_"+dynamicId).css("display","none");
313
- }
314
- }
315
- }
316
  </script>
317
  <?php
318
  }
44
  $form_settings[$dynamicId]["control_type"] = "1";
45
  for($flag = 0; $flag<count($form_data);$flag++)
46
  {
47
+ $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = esc_attr($form_data[$flag]->dynamic_settings_value);
48
  }
49
  }
50
  ?>
59
  <div class="layout-control-group">
60
  <label class="layout-control-label"><?php _e( "Label", "contact-bank" ); ?> :</label>
61
  <div class="layout-controls">
62
+ <input type="text" class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);" value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? esc_html($form_settings[$dynamicId]["cb_label_value"]) : _e( "Untitled", "contact-bank" ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
63
  </div>
64
  </div>
65
  <div class="layout-control-group">
68
  <?php
69
  if(isset($form_settings[$dynamicId]["cb_control_required"]))
70
  {
71
+ if(esc_attr($form_settings[$dynamicId]["cb_control_required"]) == "1")
72
  {
73
  ?>
74
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
81
  </label>
82
  <?php
83
  }
84
+ else if(esc_attr($form_settings[$dynamicId]["cb_control_required"]) == "0")
85
  {
86
  ?>
87
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
170
  <?php
171
  if(isset($form_settings[$dynamicId]["cb_show_email"]))
172
  {
173
+ if(esc_attr($form_settings[$dynamicId]["cb_show_email"]) == "1")
174
  {
175
  ?>
176
  <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
204
  <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
205
  <script type="text/javascript">
206
  jQuery(".hovertip").tooltip_tip({placement: "left"});
207
+
208
+ function base64_encode_contact_bank(data)
209
+ {
210
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
211
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
212
+ ac = 0,
213
+ enc = '',
214
+ tmp_arr = [];
215
+ if (!data)
216
+ {
217
+ return data;
218
+ }
219
+ do
220
+ {
221
+ o1 = data.charCodeAt(i++);
222
+ o2 = data.charCodeAt(i++);
223
+ o3 = data.charCodeAt(i++);
224
+ bits = o1 << 16 | o2 << 8 | o3;
225
+ h1 = bits >> 18 & 0x3f;
226
+ h2 = bits >> 12 & 0x3f;
227
+ h3 = bits >> 6 & 0x3f;
228
+ h4 = bits & 0x3f;
229
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
230
+ }
231
+ while (i < data.length);
232
+ enc = tmp_arr.join('');
233
+ var r = data.length % 3;
234
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
235
+ }
236
+
 
237
  var dynamicId = "<?php echo $dynamicId; ?>";
238
  var controlId = "<?php echo $control_id; ?>";
239
  var form_id = "<?php echo $form_id;?>";
260
  });
261
  jQuery.post(ajaxurl,
262
  {
263
+ data: base64_encode_contact_bank(jQuery(form).serialize()),
264
  controlId: controlId,
265
  form_id: form_id,
266
  form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
282
  });
283
  }
284
  });
285
+
286
+ function add_chk_options(dynamicId)
287
+ {
288
+ var ddl_options = jQuery("#chk_options_"+dynamicId).val();
289
+ if(ddl_options=="")
290
+ {
291
+ alert("<?php _e( "Please Fill an Option.", "contact-bank" ); ?>");
292
+ }
293
+ else
294
+ {
295
+ var optionsId = Math.floor((Math.random()*10000)+1);
296
+ jQuery("#dropdown_ddl_option_"+dynamicId).append("<option value=\""+optionsId+"\">"+ddl_options+"</option>");
297
+ jQuery("#bind_dropdown_"+dynamicId).css("display","");
298
+ jQuery("#chk_options_"+dynamicId).val("");
299
+ }
300
+ }
301
+
302
+ function delete_ddl_options(dynamicId)
303
+ {
304
+ var value = jQuery("#dropdown_ddl_option_"+dynamicId).val();
305
+ jQuery("#dropdown_ddl_option_"+dynamicId+ " option[value=\""+value+"\"]").remove();
306
+ if(jQuery("#dropdown_ddl_option_"+dynamicId).val() == null)
307
+ {
308
+ jQuery("#bind_dropdown_"+dynamicId).css("display","none");
309
+ }
310
+ }
311
+
 
 
 
312
  </script>
313
  <?php
314
  }
includes/cb_dropdown.php CHANGED
@@ -44,7 +44,7 @@ else
44
  $form_settings[$dynamicId]["control_type"] = "1";
45
  for($flag = 0; $flag<count($form_data);$flag++)
46
  {
47
- $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
48
  }
49
  }
50
  ?>
@@ -59,7 +59,7 @@ else
59
  <div class="layout-control-group">
60
  <label class="layout-control-label"><?php _e( "Label", "contact-bank" ); ?> :</label>
61
  <div class="layout-controls">
62
- <input type="text" class="layout-span12" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);" value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", "contact-bank" ); ?>" id="ux_label_text_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Label", "contact-bank" ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
63
  </div>
64
  </div>
65
  <div class="layout-control-group">
@@ -68,7 +68,7 @@ else
68
  <?php
69
  if(isset($form_settings[$dynamicId]["cb_control_required"]))
70
  {
71
- if($form_settings[$dynamicId]["cb_control_required"] == "1")
72
  {
73
  ?>
74
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
@@ -81,7 +81,7 @@ else
81
  </label>
82
  <?php
83
  }
84
- else if($form_settings[$dynamicId]["cb_control_required"] == "0")
85
  {
86
  ?>
87
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
@@ -162,7 +162,7 @@ else
162
  <div class="layout-control-group">
163
  <label class="layout-control-label"><?php _e( "Admin Label", "contact-bank" ); ?> : </label>
164
  <div class="layout-controls">
165
- <input type="text" class="layout-span12" id="ux_admin_label_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Admin Label", "contact-bank" ); ?>" name="ux_admin_label_<?php echo $dynamicId; ?>" value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", "contact-bank" ); ?>"/>
166
  </div>
167
  </div>
168
  <div class="layout-control-group">
@@ -171,7 +171,7 @@ else
171
  <?php
172
  if(isset($form_settings[$dynamicId]["cb_show_email"]))
173
  {
174
- if($form_settings[$dynamicId]["cb_show_email"] == "1")
175
  {
176
  ?>
177
  <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
@@ -205,37 +205,36 @@ else
205
  <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
206
  <script type="text/javascript">
207
  jQuery(".hovertip").tooltip_tip({placement: "left"});
208
- if (typeof(base64_encode) != "function")
209
- {
210
- function base64_encode(data)
211
- {
212
- var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
213
- var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
214
- ac = 0,
215
- enc = '',
216
- tmp_arr = [];
217
- if (!data)
218
- {
219
- return data;
220
- }
221
- do
222
- {
223
- o1 = data.charCodeAt(i++);
224
- o2 = data.charCodeAt(i++);
225
- o3 = data.charCodeAt(i++);
226
- bits = o1 << 16 | o2 << 8 | o3;
227
- h1 = bits >> 18 & 0x3f;
228
- h2 = bits >> 12 & 0x3f;
229
- h3 = bits >> 6 & 0x3f;
230
- h4 = bits & 0x3f;
231
- tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
232
- }
233
- while (i < data.length);
234
- enc = tmp_arr.join('');
235
- var r = data.length % 3;
236
- return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
237
- }
238
- }
239
  var dynamicId = "<?php echo $dynamicId; ?>";
240
  var controlId = "<?php echo $control_id; ?>";
241
  var form_id = "<?php echo $form_id;?>";
@@ -254,7 +253,7 @@ else
254
  });
255
  jQuery.post(ajaxurl,
256
  {
257
- data: base64_encode(jQuery(form).serialize()),
258
  controlId: controlId,
259
  form_id: form_id,
260
  form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
@@ -276,36 +275,33 @@ else
276
  });
277
  }
278
  });
279
- if (typeof(add_ddl_options) != "function")
280
- {
281
- function add_ddl_options(dynamicId)
282
- {
283
- var ddl_options = jQuery("#ddl_options_"+dynamicId).val();
284
- if(ddl_options=="")
285
- {
286
- alert("<?php _e( "Please Fill an Option.", "contact-bank" ); ?>");
287
- }
288
- else
289
- {
290
- var optionsId = Math.floor((Math.random()*10000)+1);
291
- jQuery("#dropdown_ddl_option_"+dynamicId).append("<option value=\""+optionsId+"\">"+ddl_options+"</option>");
292
- jQuery("#bind_dropdown_"+dynamicId).css("display","");
293
- jQuery("#ddl_options_"+dynamicId).val("");
294
- }
295
- }
296
- }
297
- if (typeof(delete_ddl_options) != "function")
298
- {
299
- function delete_ddl_options(dynamicId)
300
- {
301
- var value = jQuery("#dropdown_ddl_option_"+dynamicId).val();
302
- jQuery("#dropdown_ddl_option_"+dynamicId+ " option[value=\""+value+"\"]").remove();
303
- if(jQuery("#dropdown_ddl_option_"+dynamicId).val() == null)
304
- {
305
- jQuery("#bind_dropdown_"+dynamicId).css("display","none");
306
- }
307
- }
308
- }
309
  </script>
310
  <?php
311
  }
44
  $form_settings[$dynamicId]["control_type"] = "1";
45
  for($flag = 0; $flag<count($form_data);$flag++)
46
  {
47
+ $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = esc_html($form_data[$flag]->dynamic_settings_value);
48
  }
49
  }
50
  ?>
59
  <div class="layout-control-group">
60
  <label class="layout-control-label"><?php _e( "Label", "contact-bank" ); ?> :</label>
61
  <div class="layout-controls">
62
+ <input type="text" class="layout-span12" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);" value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? esc_attr($form_settings[$dynamicId]["cb_label_value"]) : _e( "Untitled", "contact-bank" ); ?>" id="ux_label_text_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Label", "contact-bank" ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
63
  </div>
64
  </div>
65
  <div class="layout-control-group">
68
  <?php
69
  if(isset($form_settings[$dynamicId]["cb_control_required"]))
70
  {
71
+ if(esc_attr($form_settings[$dynamicId]["cb_control_required"]) == "1")
72
  {
73
  ?>
74
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
81
  </label>
82
  <?php
83
  }
84
+ else if(esc_attr($form_settings[$dynamicId]["cb_control_required"]) == "0")
85
  {
86
  ?>
87
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
162
  <div class="layout-control-group">
163
  <label class="layout-control-label"><?php _e( "Admin Label", "contact-bank" ); ?> : </label>
164
  <div class="layout-controls">
165
+ <input type="text" class="layout-span12" id="ux_admin_label_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Admin Label", "contact-bank" ); ?>" name="ux_admin_label_<?php echo $dynamicId; ?>" value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? esc_attr($form_settings[$dynamicId]["cb_admin_label"]) : _e( "Untitled", "contact-bank" ); ?>"/>
166
  </div>
167
  </div>
168
  <div class="layout-control-group">
171
  <?php
172
  if(isset($form_settings[$dynamicId]["cb_show_email"]))
173
  {
174
+ if(esc_attr($form_settings[$dynamicId]["cb_show_email"]) == "1")
175
  {
176
  ?>
177
  <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
205
  <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
206
  <script type="text/javascript">
207
  jQuery(".hovertip").tooltip_tip({placement: "left"});
208
+
209
+ function base64_encode_contact_bank(data)
210
+ {
211
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
212
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
213
+ ac = 0,
214
+ enc = '',
215
+ tmp_arr = [];
216
+ if (!data)
217
+ {
218
+ return data;
219
+ }
220
+ do
221
+ {
222
+ o1 = data.charCodeAt(i++);
223
+ o2 = data.charCodeAt(i++);
224
+ o3 = data.charCodeAt(i++);
225
+ bits = o1 << 16 | o2 << 8 | o3;
226
+ h1 = bits >> 18 & 0x3f;
227
+ h2 = bits >> 12 & 0x3f;
228
+ h3 = bits >> 6 & 0x3f;
229
+ h4 = bits & 0x3f;
230
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
231
+ }
232
+ while (i < data.length);
233
+ enc = tmp_arr.join('');
234
+ var r = data.length % 3;
235
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
236
+ }
237
+
 
238
  var dynamicId = "<?php echo $dynamicId; ?>";
239
  var controlId = "<?php echo $control_id; ?>";
240
  var form_id = "<?php echo $form_id;?>";
253
  });
254
  jQuery.post(ajaxurl,
255
  {
256
+ data: base64_encode_contact_bank(jQuery(form).serialize()),
257
  controlId: controlId,
258
  form_id: form_id,
259
  form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
275
  });
276
  }
277
  });
278
+
279
+ function add_ddl_options(dynamicId)
280
+ {
281
+ var ddl_options = jQuery("#ddl_options_"+dynamicId).val();
282
+ if(ddl_options=="")
283
+ {
284
+ alert("<?php _e( "Please Fill an Option.", "contact-bank" ); ?>");
285
+ }
286
+ else
287
+ {
288
+ var optionsId = Math.floor((Math.random()*10000)+1);
289
+ jQuery("#dropdown_ddl_option_"+dynamicId).append("<option value=\""+optionsId+"\">"+ddl_options+"</option>");
290
+ jQuery("#bind_dropdown_"+dynamicId).css("display","");
291
+ jQuery("#ddl_options_"+dynamicId).val("");
292
+ }
293
+ }
294
+
295
+ function delete_ddl_options(dynamicId)
296
+ {
297
+ var value = jQuery("#dropdown_ddl_option_"+dynamicId).val();
298
+ jQuery("#dropdown_ddl_option_"+dynamicId+ " option[value=\""+value+"\"]").remove();
299
+ if(jQuery("#dropdown_ddl_option_"+dynamicId).val() == null)
300
+ {
301
+ jQuery("#bind_dropdown_"+dynamicId).css("display","none");
302
+ }
303
+ }
304
+
 
 
 
305
  </script>
306
  <?php
307
  }
includes/cb_email.php CHANGED
@@ -60,7 +60,7 @@ else
60
  <label class="layout-control-label"><?php _e( "Label", "contact-bank" ); ?> :</label>
61
  <div class="layout-controls">
62
  <input type="text" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);"
63
- value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", "contact-bank" ); ?>"
64
  class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Label", "contact-bank" ); ?>"
65
  name="ux_label_text_<?php echo $dynamicId; ?>"/>
66
  </div>
@@ -70,7 +70,7 @@ else
70
  <div class="layout-controls">
71
  <textarea class="layout-span12" id="ux_description_control_<?php echo $dynamicId; ?>"
72
  placeholder="<?php _e( "Enter Description", "contact-bank" ); ?>"
73
- name="ux_description_control_<?php echo $dynamicId; ?>" ><?php echo isset($form_settings[$dynamicId]["cb_description"]) ? $form_settings[$dynamicId]["cb_description"] : ""; ?></textarea>
74
  </div>
75
  </div>
76
  <div class="layout-control-group">
@@ -79,7 +79,7 @@ else
79
  <?php
80
  if(isset($form_settings[$dynamicId]["cb_control_required"]))
81
  {
82
- if($form_settings[$dynamicId]["cb_control_required"] == "1")
83
  {
84
  ?>
85
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
@@ -94,7 +94,7 @@ else
94
  </label>
95
  <?php
96
  }
97
- else if($form_settings[$dynamicId]["cb_control_required"] == "0")
98
  {
99
  ?>
100
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
@@ -143,14 +143,14 @@ else
143
  <input type="text" class="layout-span12" id="ux_default_value_<?php echo $dynamicId; ?>"
144
  placeholder="<?php _e( "Enter Place Holder", "contact-bank" ); ?>"
145
  name="ux_default_value_<?php echo $dynamicId; ?>"
146
- value="<?php echo isset($form_settings[$dynamicId]["cb_default_txt_val"]) ? $form_settings[$dynamicId]["cb_default_txt_val"] : ""; ?>"/>
147
  </div>
148
  </div>
149
  <div class="layout-control-group">
150
  <label class="layout-control-label"><?php _e( "Admin Label", "contact-bank" ); ?> : </label>
151
  <div class="layout-controls">
152
  <input type="text" class="layout-span12"
153
- value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", "contact-bank" ); ?>"
154
  id="ux_admin_label_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Admin Label", "contact-bank" ); ?>"
155
  name="ux_admin_label_<?php echo $dynamicId; ?>" />
156
  </div>
@@ -161,7 +161,7 @@ else
161
  <?php
162
  if(isset($form_settings[$dynamicId]["cb_show_email"]))
163
  {
164
- if($form_settings[$dynamicId]["cb_show_email"] == "1")
165
  {
166
  ?>
167
  <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
@@ -198,9 +198,8 @@ else
198
  <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
199
  <script type="text/javascript">
200
  jQuery(".hovertip").tooltip_tip({placement: "left"});
201
- if (typeof(base64_encode) != "function")
202
- {
203
- function base64_encode(data)
204
  {
205
  var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
206
  var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
@@ -228,7 +227,7 @@ else
228
  var r = data.length % 3;
229
  return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
230
  }
231
- }
232
  var dynamicId = "<?php echo $dynamicId; ?>";
233
  var controlId = "<?php echo $control_id; ?>";
234
  var form_id = "<?php echo $form_id;?>";
@@ -238,7 +237,7 @@ else
238
  {
239
  jQuery.post(ajaxurl,
240
  {
241
- data: base64_encode(jQuery(form).serialize()),
242
  controlId: controlId,
243
  form_id: form_id,
244
  form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
60
  <label class="layout-control-label"><?php _e( "Label", "contact-bank" ); ?> :</label>
61
  <div class="layout-controls">
62
  <input type="text" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);"
63
+ value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? esc_attr($form_settings[$dynamicId]["cb_label_value"]) : _e( "Untitled", "contact-bank" ); ?>"
64
  class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Label", "contact-bank" ); ?>"
65
  name="ux_label_text_<?php echo $dynamicId; ?>"/>
66
  </div>
70
  <div class="layout-controls">
71
  <textarea class="layout-span12" id="ux_description_control_<?php echo $dynamicId; ?>"
72
  placeholder="<?php _e( "Enter Description", "contact-bank" ); ?>"
73
+ name="ux_description_control_<?php echo $dynamicId; ?>" ><?php echo isset($form_settings[$dynamicId]["cb_description"]) ? esc_attr($form_settings[$dynamicId]["cb_description"]) : ""; ?></textarea>
74
  </div>
75
  </div>
76
  <div class="layout-control-group">
79
  <?php
80
  if(isset($form_settings[$dynamicId]["cb_control_required"]))
81
  {
82
+ if(esc_attr($form_settings[$dynamicId]["cb_control_required"]) == "1")
83
  {
84
  ?>
85
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
94
  </label>
95
  <?php
96
  }
97
+ else if(esc_attr($form_settings[$dynamicId]["cb_control_required"]) == "0")
98
  {
99
  ?>
100
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
143
  <input type="text" class="layout-span12" id="ux_default_value_<?php echo $dynamicId; ?>"
144
  placeholder="<?php _e( "Enter Place Holder", "contact-bank" ); ?>"
145
  name="ux_default_value_<?php echo $dynamicId; ?>"
146
+ value="<?php echo isset($form_settings[$dynamicId]["cb_default_txt_val"]) ? esc_attr($form_settings[$dynamicId]["cb_default_txt_val"]) : ""; ?>"/>
147
  </div>
148
  </div>
149
  <div class="layout-control-group">
150
  <label class="layout-control-label"><?php _e( "Admin Label", "contact-bank" ); ?> : </label>
151
  <div class="layout-controls">
152
  <input type="text" class="layout-span12"
153
+ value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? esc_attr($form_settings[$dynamicId]["cb_admin_label"]) : _e( "Untitled", "contact-bank" ); ?>"
154
  id="ux_admin_label_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Admin Label", "contact-bank" ); ?>"
155
  name="ux_admin_label_<?php echo $dynamicId; ?>" />
156
  </div>
161
  <?php
162
  if(isset($form_settings[$dynamicId]["cb_show_email"]))
163
  {
164
+ if(esc_attr($form_settings[$dynamicId]["cb_show_email"]) == "1")
165
  {
166
  ?>
167
  <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
198
  <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
199
  <script type="text/javascript">
200
  jQuery(".hovertip").tooltip_tip({placement: "left"});
201
+
202
+ function base64_encode_contact_bank(data)
 
203
  {
204
  var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
205
  var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
227
  var r = data.length % 3;
228
  return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
229
  }
230
+
231
  var dynamicId = "<?php echo $dynamicId; ?>";
232
  var controlId = "<?php echo $control_id; ?>";
233
  var form_id = "<?php echo $form_id;?>";
237
  {
238
  jQuery.post(ajaxurl,
239
  {
240
+ data: base64_encode_contact_bank(jQuery(form).serialize()),
241
  controlId: controlId,
242
  form_id: form_id,
243
  form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
includes/cb_multiple.php CHANGED
@@ -44,7 +44,7 @@ else
44
  $form_settings[$dynamicId]["control_type"] = $control_id;
45
  for($flag = 0; $flag<count($form_data);$flag++)
46
  {
47
- $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
48
  }
49
  }
50
  ?>
@@ -61,7 +61,7 @@ else
61
  <div class="layout-controls">
62
  <input type="text" class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>"
63
  onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);"
64
- value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", "contact-bank" ); ?>"
65
  placeholder="<?php _e( "Enter Label", "contact-bank" ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
66
  </div>
67
  </div>
@@ -71,7 +71,7 @@ else
71
  <?php
72
  if(isset($form_settings[$dynamicId]["cb_control_required"]))
73
  {
74
- if($form_settings[$dynamicId]["cb_control_required"] == "1")
75
  {
76
  ?>
77
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
@@ -86,7 +86,7 @@ else
86
  </label>
87
  <?php
88
  }
89
- else if($form_settings[$dynamicId]["cb_control_required"] == "0")
90
  {
91
  ?>
92
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
@@ -181,7 +181,7 @@ else
181
  <div class="layout-controls">
182
  <input type="text" class="layout-span12" id="ux_admin_label_<?php echo $dynamicId; ?>"
183
  name="ux_admin_label_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Admin Label", "contact-bank" ); ?>"
184
- value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", "contact-bank" ); ?>"/>
185
  </div>
186
  </div>
187
  <div class="layout-control-group">
@@ -190,7 +190,7 @@ else
190
  <?php
191
  if(isset($form_settings[$dynamicId]["cb_show_email"]))
192
  {
193
- if($form_settings[$dynamicId]["cb_show_email"] == "1")
194
  {
195
  ?>
196
  <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
@@ -227,37 +227,35 @@ else
227
  <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
228
  <script type="text/javascript">
229
  jQuery(".hovertip").tooltip_tip({placement: "left"});
230
- if (typeof(base64_encode) != "function")
231
- {
232
- function base64_encode(data)
233
- {
234
- var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
235
- var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
236
- ac = 0,
237
- enc = '',
238
- tmp_arr = [];
239
- if (!data)
240
- {
241
- return data;
242
- }
243
- do
244
- {
245
- o1 = data.charCodeAt(i++);
246
- o2 = data.charCodeAt(i++);
247
- o3 = data.charCodeAt(i++);
248
- bits = o1 << 16 | o2 << 8 | o3;
249
- h1 = bits >> 18 & 0x3f;
250
- h2 = bits >> 12 & 0x3f;
251
- h3 = bits >> 6 & 0x3f;
252
- h4 = bits & 0x3f;
253
- tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
254
- }
255
- while (i < data.length);
256
- enc = tmp_arr.join('');
257
- var r = data.length % 3;
258
- return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
259
- }
260
- }
261
  var dynamicId = "<?php echo $dynamicId; ?>";
262
  var controlId = "<?php echo $control_id; ?>";
263
  var form_id = "<?php echo $form_id;?>";
@@ -285,7 +283,7 @@ else
285
  });
286
  jQuery.post(ajaxurl,
287
  {
288
- data: base64_encode(jQuery(form).serialize()),
289
  controlId: controlId,
290
  form_id: form_id,
291
  form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
@@ -307,36 +305,33 @@ else
307
  });
308
  }
309
  });
310
- if (typeof(add_rdl_options) != "function")
311
- {
312
- function add_rdl_options(dynamicId)
313
- {
314
- var ddl_options = jQuery("#radio_options_"+dynamicId).val();
315
- if(ddl_options=="")
316
- {
317
- alert("<?php _e( "Please Fill an Option.", "contact-bank" ); ?>");
318
- }
319
- else
320
- {
321
- var optionsId = Math.floor((Math.random()*10000)+1);
322
- jQuery("#dropdown_ddl_option_"+dynamicId).append("<option value=\""+optionsId+"\">"+ddl_options+"</option>");
323
- jQuery("#bind_dropdown_"+dynamicId).css("display","");
324
- jQuery("#radio_options_"+dynamicId).val("");
325
- }
326
- }
327
- }
328
- if (typeof(delete_rdl_options) != "function")
329
- {
330
- function delete_rdl_options(dynamicId)
331
- {
332
- var value = jQuery("#dropdown_ddl_option_"+dynamicId).val();
333
- jQuery("#dropdown_ddl_option_"+dynamicId+ " option[value=\""+value+"\"]").remove();
334
- if(jQuery("#dropdown_ddl_option_"+dynamicId).val() == null)
335
- {
336
- jQuery("#bind_dropdown_"+dynamicId).css("display","none");
337
- }
338
- }
339
- }
340
  </script>
341
  <?php
342
  }
44
  $form_settings[$dynamicId]["control_type"] = $control_id;
45
  for($flag = 0; $flag<count($form_data);$flag++)
46
  {
47
+ $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = esc_attr($form_data[$flag]->dynamic_settings_value);
48
  }
49
  }
50
  ?>
61
  <div class="layout-controls">
62
  <input type="text" class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>"
63
  onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);"
64
+ value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? esc_attr($form_settings[$dynamicId]["cb_label_value"]) : _e( "Untitled", "contact-bank" ); ?>"
65
  placeholder="<?php _e( "Enter Label", "contact-bank" ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
66
  </div>
67
  </div>
71
  <?php
72
  if(isset($form_settings[$dynamicId]["cb_control_required"]))
73
  {
74
+ if(esc_attr($form_settings[$dynamicId]["cb_control_required"]) == "1")
75
  {
76
  ?>
77
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
86
  </label>
87
  <?php
88
  }
89
+ else if(esc_attr($form_settings[$dynamicId]["cb_control_required"]) == "0")
90
  {
91
  ?>
92
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
181
  <div class="layout-controls">
182
  <input type="text" class="layout-span12" id="ux_admin_label_<?php echo $dynamicId; ?>"
183
  name="ux_admin_label_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Admin Label", "contact-bank" ); ?>"
184
+ value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? esc_attr($form_settings[$dynamicId]["cb_admin_label"]) : _e( "Untitled", "contact-bank" ); ?>"/>
185
  </div>
186
  </div>
187
  <div class="layout-control-group">
190
  <?php
191
  if(isset($form_settings[$dynamicId]["cb_show_email"]))
192
  {
193
+ if(esc_attr($form_settings[$dynamicId]["cb_show_email"]) == "1")
194
  {
195
  ?>
196
  <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
227
  <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
228
  <script type="text/javascript">
229
  jQuery(".hovertip").tooltip_tip({placement: "left"});
230
+ function base64_encode_contact_bank(data)
231
+ {
232
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
233
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
234
+ ac = 0,
235
+ enc = '',
236
+ tmp_arr = [];
237
+ if (!data)
238
+ {
239
+ return data;
240
+ }
241
+ do
242
+ {
243
+ o1 = data.charCodeAt(i++);
244
+ o2 = data.charCodeAt(i++);
245
+ o3 = data.charCodeAt(i++);
246
+ bits = o1 << 16 | o2 << 8 | o3;
247
+ h1 = bits >> 18 & 0x3f;
248
+ h2 = bits >> 12 & 0x3f;
249
+ h3 = bits >> 6 & 0x3f;
250
+ h4 = bits & 0x3f;
251
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
252
+ }
253
+ while (i < data.length);
254
+ enc = tmp_arr.join('');
255
+ var r = data.length % 3;
256
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
257
+ }
258
+
 
 
259
  var dynamicId = "<?php echo $dynamicId; ?>";
260
  var controlId = "<?php echo $control_id; ?>";
261
  var form_id = "<?php echo $form_id;?>";
283
  });
284
  jQuery.post(ajaxurl,
285
  {
286
+ data: base64_encode_contact_bank(jQuery(form).serialize()),
287
  controlId: controlId,
288
  form_id: form_id,
289
  form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
305
  });
306
  }
307
  });
308
+
309
+ function add_rdl_options(dynamicId)
310
+ {
311
+ var ddl_options = jQuery("#radio_options_"+dynamicId).val();
312
+ if(ddl_options=="")
313
+ {
314
+ alert("<?php _e( "Please Fill an Option.", "contact-bank" ); ?>");
315
+ }
316
+ else
317
+ {
318
+ var optionsId = Math.floor((Math.random()*10000)+1);
319
+ jQuery("#dropdown_ddl_option_"+dynamicId).append("<option value=\""+optionsId+"\">"+ddl_options+"</option>");
320
+ jQuery("#bind_dropdown_"+dynamicId).css("display","");
321
+ jQuery("#radio_options_"+dynamicId).val("");
322
+ }
323
+ }
324
+
325
+ function delete_rdl_options(dynamicId)
326
+ {
327
+ var value = jQuery("#dropdown_ddl_option_"+dynamicId).val();
328
+ jQuery("#dropdown_ddl_option_"+dynamicId+ " option[value=\""+value+"\"]").remove();
329
+ if(jQuery("#dropdown_ddl_option_"+dynamicId).val() == null)
330
+ {
331
+ jQuery("#bind_dropdown_"+dynamicId).css("display","none");
332
+ }
333
+ }
334
+
 
 
 
335
  </script>
336
  <?php
337
  }
includes/cb_text.php CHANGED
@@ -44,7 +44,7 @@ else
44
  $form_settings[$dynamicId]["control_type"] = "1";
45
  for($flag = 0; $flag<count($form_data);$flag++)
46
  {
47
- $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
48
  }
49
  }
50
  ?>
@@ -60,7 +60,7 @@ else
60
  <label class="layout-control-label"><?php _e( "Label", "contact-bank" ); ?> :</label>
61
  <div class="layout-controls">
62
  <input type="text" class="layout-span12" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);"
63
- value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", "contact-bank" ); ?>"
64
  id="ux_label_text_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Label", "contact-bank" ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
65
  </div>
66
  </div>
@@ -69,7 +69,7 @@ else
69
  <div class="layout-controls">
70
  <textarea id="ux_description_control_<?php echo $dynamicId; ?>" class="layout-span12"
71
  placeholder="<?php _e( "Enter Description", "contact-bank" ); ?>"
72
- name="ux_description_control_<?php echo $dynamicId; ?>"><?php echo isset($form_settings[$dynamicId]["cb_description"]) ? $form_settings[$dynamicId]["cb_description"] : ""; ?></textarea>
73
  </div>
74
  </div>
75
  <div class="layout-control-group">
@@ -78,7 +78,7 @@ else
78
  <?php
79
  if(isset($form_settings[$dynamicId]["cb_control_required"]))
80
  {
81
- if($form_settings[$dynamicId]["cb_control_required"] == "1")
82
  {
83
  ?>
84
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
@@ -93,7 +93,7 @@ else
93
  </label>
94
  <?php
95
  }
96
- else if($form_settings[$dynamicId]["cb_control_required"] == "0")
97
  {
98
  ?>
99
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
@@ -142,14 +142,14 @@ else
142
  <input type="text" class="layout-span12" id="ux_default_value_<?php echo $dynamicId; ?>"
143
  placeholder="<?php _e("Enter Place Holder", "contact-bank" ); ?>"
144
  name="ux_default_value_<?php echo $dynamicId; ?>"
145
- value="<?php echo isset($form_settings[$dynamicId]["cb_default_txt_val"]) ? $form_settings[$dynamicId]["cb_default_txt_val"] : ""; ?>"/>
146
  </div>
147
  </div>
148
  <div class="layout-control-group">
149
  <label class="layout-control-label"><?php _e( "Admin Label", "contact-bank" ); ?> :</label>
150
  <div class="layout-controls">
151
  <input type="text" placeholder="<?php _e( "Enter Admin Label", "contact-bank" ); ?>"
152
- value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", "contact-bank" ); ?>"
153
  class="layout-span12" id="ux_admin_label_<?php echo $dynamicId; ?>" name="ux_admin_label_<?php echo $dynamicId; ?>"/>
154
  </div>
155
  </div>
@@ -159,7 +159,7 @@ else
159
  <?php
160
  if(isset($form_settings[$dynamicId]["cb_show_email"]))
161
  {
162
- if($form_settings[$dynamicId]["cb_show_email"] == "1")
163
  {
164
  ?>
165
  <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
@@ -227,37 +227,36 @@ else
227
  jQuery("#ux_checkbox_digit_filter").attr("disabled","disabled");
228
  jQuery("#ux_checkbox_strip_tag_filter").attr("disabled","disabled");
229
  jQuery("#ux_checkbox_trim_filter").attr("disabled","disabled");
230
- if (typeof(base64_encode) != "function")
231
- {
232
- function base64_encode(data)
233
- {
234
- var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
235
- var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
236
- ac = 0,
237
- enc = '',
238
- tmp_arr = [];
239
- if (!data)
240
- {
241
- return data;
242
- }
243
- do
244
- {
245
- o1 = data.charCodeAt(i++);
246
- o2 = data.charCodeAt(i++);
247
- o3 = data.charCodeAt(i++);
248
- bits = o1 << 16 | o2 << 8 | o3;
249
- h1 = bits >> 18 & 0x3f;
250
- h2 = bits >> 12 & 0x3f;
251
- h3 = bits >> 6 & 0x3f;
252
- h4 = bits & 0x3f;
253
- tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
254
- }
255
- while (i < data.length);
256
- enc = tmp_arr.join('');
257
- var r = data.length % 3;
258
- return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
259
- }
260
- }
261
  var dynamicId = "<?php echo $dynamicId; ?>";
262
  var controlId = "<?php echo $control_id; ?>";
263
  var form_id = "<?php echo $form_id;?>";
@@ -267,7 +266,7 @@ else
267
  {
268
  jQuery.post(ajaxurl,
269
  {
270
- data: base64_encode(jQuery(form).serialize()),
271
  controlId: controlId,
272
  form_id: form_id,
273
  form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
44
  $form_settings[$dynamicId]["control_type"] = "1";
45
  for($flag = 0; $flag<count($form_data);$flag++)
46
  {
47
+ $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = esc_attr($form_data[$flag]->dynamic_settings_value);
48
  }
49
  }
50
  ?>
60
  <label class="layout-control-label"><?php _e( "Label", "contact-bank" ); ?> :</label>
61
  <div class="layout-controls">
62
  <input type="text" class="layout-span12" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);"
63
+ value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? esc_attr($form_settings[$dynamicId]["cb_label_value"]) : _e( "Untitled", "contact-bank" ); ?>"
64
  id="ux_label_text_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Label", "contact-bank" ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
65
  </div>
66
  </div>
69
  <div class="layout-controls">
70
  <textarea id="ux_description_control_<?php echo $dynamicId; ?>" class="layout-span12"
71
  placeholder="<?php _e( "Enter Description", "contact-bank" ); ?>"
72
+ name="ux_description_control_<?php echo $dynamicId; ?>"><?php echo isset($form_settings[$dynamicId]["cb_description"]) ? esc_attr($form_settings[$dynamicId]["cb_description"]) : ""; ?></textarea>
73
  </div>
74
  </div>
75
  <div class="layout-control-group">
78
  <?php
79
  if(isset($form_settings[$dynamicId]["cb_control_required"]))
80
  {
81
+ if(esc_attr($form_settings[$dynamicId]["cb_control_required"]) == "1")
82
  {
83
  ?>
84
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
93
  </label>
94
  <?php
95
  }
96
+ else if(esc_attr($form_settings[$dynamicId]["cb_control_required"]) == "0")
97
  {
98
  ?>
99
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
142
  <input type="text" class="layout-span12" id="ux_default_value_<?php echo $dynamicId; ?>"
143
  placeholder="<?php _e("Enter Place Holder", "contact-bank" ); ?>"
144
  name="ux_default_value_<?php echo $dynamicId; ?>"
145
+ value="<?php echo isset($form_settings[$dynamicId]["cb_default_txt_val"]) ? esc_attr($form_settings[$dynamicId]["cb_default_txt_val"]) : ""; ?>"/>
146
  </div>
147
  </div>
148
  <div class="layout-control-group">
149
  <label class="layout-control-label"><?php _e( "Admin Label", "contact-bank" ); ?> :</label>
150
  <div class="layout-controls">
151
  <input type="text" placeholder="<?php _e( "Enter Admin Label", "contact-bank" ); ?>"
152
+ value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? esc_attr($form_settings[$dynamicId]["cb_admin_label"]) : _e( "Untitled", "contact-bank" ); ?>"
153
  class="layout-span12" id="ux_admin_label_<?php echo $dynamicId; ?>" name="ux_admin_label_<?php echo $dynamicId; ?>"/>
154
  </div>
155
  </div>
159
  <?php
160
  if(isset($form_settings[$dynamicId]["cb_show_email"]))
161
  {
162
+ if(esc_attr($form_settings[$dynamicId]["cb_show_email"]) == "1")
163
  {
164
  ?>
165
  <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
227
  jQuery("#ux_checkbox_digit_filter").attr("disabled","disabled");
228
  jQuery("#ux_checkbox_strip_tag_filter").attr("disabled","disabled");
229
  jQuery("#ux_checkbox_trim_filter").attr("disabled","disabled");
230
+
231
+ function base64_encode_contact_bank(data)
232
+ {
233
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
234
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
235
+ ac = 0,
236
+ enc = '',
237
+ tmp_arr = [];
238
+ if (!data)
239
+ {
240
+ return data;
241
+ }
242
+ do
243
+ {
244
+ o1 = data.charCodeAt(i++);
245
+ o2 = data.charCodeAt(i++);
246
+ o3 = data.charCodeAt(i++);
247
+ bits = o1 << 16 | o2 << 8 | o3;
248
+ h1 = bits >> 18 & 0x3f;
249
+ h2 = bits >> 12 & 0x3f;
250
+ h3 = bits >> 6 & 0x3f;
251
+ h4 = bits & 0x3f;
252
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
253
+ }
254
+ while (i < data.length);
255
+ enc = tmp_arr.join('');
256
+ var r = data.length % 3;
257
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
258
+ }
259
+
 
260
  var dynamicId = "<?php echo $dynamicId; ?>";
261
  var controlId = "<?php echo $control_id; ?>";
262
  var form_id = "<?php echo $form_id;?>";
266
  {
267
  jQuery.post(ajaxurl,
268
  {
269
+ data: base64_encode_contact_bank(jQuery(form).serialize()),
270
  controlId: controlId,
271
  form_id: form_id,
272
  form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
includes/cb_textarea.php CHANGED
@@ -43,7 +43,7 @@ else
43
  $form_settings[$dynamicId]["control_type"] = "1";
44
  for($flag = 0; $flag < count($form_data); $flag++)
45
  {
46
- $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
47
  }
48
  }
49
  ?>
@@ -58,7 +58,7 @@ else
58
  <div class="layout-control-group">
59
  <label class="layout-control-label"><?php _e( "Label", "contact-bank" ); ?> :</label>
60
  <div class="layout-controls">
61
- <input value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", "contact-bank" ); ?>"
62
  onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);" placeholder="<?php _e( "Enter label", "contact-bank");?>"
63
  type="text" class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
64
  </div>
@@ -68,7 +68,7 @@ else
68
  <div class="layout-controls">
69
  <textarea placeholder="<?php _e( "Enter Description", "contact-bank");?>"
70
  class="layout-span12" id="ux_description_control_<?php echo $dynamicId; ?>"
71
- name="ux_description_control_<?php echo $dynamicId; ?>" ><?php echo isset($form_settings[$dynamicId]["cb_description"]) ? $form_settings[$dynamicId]["cb_description"] : ""; ?></textarea>
72
  </div>
73
  </div>
74
  <div class="layout-control-group">
@@ -77,7 +77,7 @@ else
77
  <?php
78
  if(isset($form_settings[$dynamicId]["cb_control_required"]))
79
  {
80
- if($form_settings[$dynamicId]["cb_control_required"] == "1")
81
  {
82
  ?>
83
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
@@ -92,7 +92,7 @@ else
92
  </label>
93
  <?php
94
  }
95
- else if($form_settings[$dynamicId]["cb_control_required"] == "0")
96
  {
97
  ?>
98
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
@@ -140,13 +140,13 @@ else
140
  <div class="layout-controls">
141
  <input placeholder="<?php _e( "Enter Place Holder", "contact-bank");?>" class="layout-span12"
142
  type="text" id="ux_default_value_<?php echo $dynamicId; ?>" name="ux_default_value_<?php echo $dynamicId; ?>"
143
- value="<?php echo isset($form_settings[$dynamicId]["cb_default_txt_val"]) ? $form_settings[$dynamicId]["cb_default_txt_val"] : ""; ?>"/>
144
  </div>
145
  </div>
146
  <div class="layout-control-group">
147
  <label class="layout-control-label"><?php _e( "Admin Label", "contact-bank" ); ?> : </label>
148
  <div class="layout-controls">
149
- <input value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", "contact-bank" ); ?>"
150
  placeholder="<?php _e( "Enter Admin Label", "contact-bank");?>" class="layout-span12" type="text" id="ux_admin_label_<?php echo $dynamicId; ?>" name="ux_admin_label_<?php echo $dynamicId; ?>" />
151
  </div>
152
  </div>
@@ -156,7 +156,7 @@ else
156
  <?php
157
  if(isset($form_settings[$dynamicId]["cb_show_email"]))
158
  {
159
- if($form_settings[$dynamicId]["cb_show_email"] == "1")
160
  {
161
  ?>
162
  <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
@@ -214,37 +214,36 @@ else
214
  <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
215
  <script type="text/javascript">
216
  jQuery(".hovertip").tooltip_tip({placement: "left"});
217
- if (typeof(base64_encode) != "function")
218
- {
219
- function base64_encode(data)
220
- {
221
- var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
222
- var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
223
- ac = 0,
224
- enc = '',
225
- tmp_arr = [];
226
- if (!data)
227
- {
228
- return data;
229
- }
230
- do
231
- {
232
- o1 = data.charCodeAt(i++);
233
- o2 = data.charCodeAt(i++);
234
- o3 = data.charCodeAt(i++);
235
- bits = o1 << 16 | o2 << 8 | o3;
236
- h1 = bits >> 18 & 0x3f;
237
- h2 = bits >> 12 & 0x3f;
238
- h3 = bits >> 6 & 0x3f;
239
- h4 = bits & 0x3f;
240
- tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
241
- }
242
- while (i < data.length);
243
- enc = tmp_arr.join('');
244
- var r = data.length % 3;
245
- return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
246
- }
247
- }
248
  var dynamicId = "<?php echo $dynamicId; ?>";
249
  var controlId = "<?php echo $control_id; ?>";
250
  jQuery("#ux_frm_text_area_control").validate
@@ -253,7 +252,7 @@ else
253
  {
254
  jQuery.post(ajaxurl,
255
  {
256
- data: base64_encode(jQuery(form).serialize()),
257
  controlId: controlId,
258
  form_id: form_id,
259
  form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
43
  $form_settings[$dynamicId]["control_type"] = "1";
44
  for($flag = 0; $flag < count($form_data); $flag++)
45
  {
46
+ $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = esc_attr($form_data[$flag]->dynamic_settings_value);
47
  }
48
  }
49
  ?>
58
  <div class="layout-control-group">
59
  <label class="layout-control-label"><?php _e( "Label", "contact-bank" ); ?> :</label>
60
  <div class="layout-controls">
61
+ <input value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? esc_attr($form_settings[$dynamicId]["cb_label_value"]) : _e( "Untitled", "contact-bank" ); ?>"
62
  onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);" placeholder="<?php _e( "Enter label", "contact-bank");?>"
63
  type="text" class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
64
  </div>
68
  <div class="layout-controls">
69
  <textarea placeholder="<?php _e( "Enter Description", "contact-bank");?>"
70
  class="layout-span12" id="ux_description_control_<?php echo $dynamicId; ?>"
71
+ name="ux_description_control_<?php echo $dynamicId; ?>" ><?php echo isset($form_settings[$dynamicId]["cb_description"]) ? esc_attr($form_settings[$dynamicId]["cb_description"]) : ""; ?></textarea>
72
  </div>
73
  </div>
74
  <div class="layout-control-group">
77
  <?php
78
  if(isset($form_settings[$dynamicId]["cb_control_required"]))
79
  {
80
+ if(esc_attr($form_settings[$dynamicId]["cb_control_required"]) == "1")
81
  {
82
  ?>
83
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
92
  </label>
93
  <?php
94
  }
95
+ else if(esc_attr($form_settings[$dynamicId]["cb_control_required"]) == "0")
96
  {
97
  ?>
98
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
140
  <div class="layout-controls">
141
  <input placeholder="<?php _e( "Enter Place Holder", "contact-bank");?>" class="layout-span12"
142
  type="text" id="ux_default_value_<?php echo $dynamicId; ?>" name="ux_default_value_<?php echo $dynamicId; ?>"
143
+ value="<?php echo isset($form_settings[$dynamicId]["cb_default_txt_val"]) ? esc_attr($form_settings[$dynamicId]["cb_default_txt_val"]) : ""; ?>"/>
144
  </div>
145
  </div>
146
  <div class="layout-control-group">
147
  <label class="layout-control-label"><?php _e( "Admin Label", "contact-bank" ); ?> : </label>
148
  <div class="layout-controls">
149
+ <input value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? esc_attr($form_settings[$dynamicId]["cb_admin_label"]) : _e( "Untitled", "contact-bank" ); ?>"
150
  placeholder="<?php _e( "Enter Admin Label", "contact-bank");?>" class="layout-span12" type="text" id="ux_admin_label_<?php echo $dynamicId; ?>" name="ux_admin_label_<?php echo $dynamicId; ?>" />
151
  </div>
152
  </div>
156
  <?php
157
  if(isset($form_settings[$dynamicId]["cb_show_email"]))
158
  {
159
+ if(esc_attr($form_settings[$dynamicId]["cb_show_email"]) == "1")
160
  {
161
  ?>
162
  <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
214
  <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
215
  <script type="text/javascript">
216
  jQuery(".hovertip").tooltip_tip({placement: "left"});
217
+
218
+ function base64_encode_contact_bank(data)
219
+ {
220
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
221
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
222
+ ac = 0,
223
+ enc = '',
224
+ tmp_arr = [];
225
+ if (!data)
226
+ {
227
+ return data;
228
+ }
229
+ do
230
+ {
231
+ o1 = data.charCodeAt(i++);
232
+ o2 = data.charCodeAt(i++);
233
+ o3 = data.charCodeAt(i++);
234
+ bits = o1 << 16 | o2 << 8 | o3;
235
+ h1 = bits >> 18 & 0x3f;
236
+ h2 = bits >> 12 & 0x3f;
237
+ h3 = bits >> 6 & 0x3f;
238
+ h4 = bits & 0x3f;
239
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
240
+ }
241
+ while (i < data.length);
242
+ enc = tmp_arr.join('');
243
+ var r = data.length % 3;
244
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
245
+ }
246
+
 
247
  var dynamicId = "<?php echo $dynamicId; ?>";
248
  var controlId = "<?php echo $control_id; ?>";
249
  jQuery("#ux_frm_text_area_control").validate
252
  {
253
  jQuery.post(ajaxurl,
254
  {
255
+ data: base64_encode_contact_bank(jQuery(form).serialize()),
256
  controlId: controlId,
257
  form_id: form_id,
258
  form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
lib/contact_bank_email-class.php CHANGED
@@ -45,30 +45,30 @@ else
45
  {
46
  case "administrator":
47
  ?>
48
- <a href="admin.php?page=add_contact_email_settings&email_id=<?php echo $email_settings[$flag]->email_id;?>&form_id=<?php echo $form_id ?>" class="btn hovertip" data-original-title="<?php _e("Edit Email Settings", "contact-bank")?>">
49
  <i class="icon-custom-pencil"></i>
50
  </a>
51
- <a herf="#" onclick="delete_email_settings(<?php echo $email_settings[$flag]->email_id;?>)" class="btn hovertip" data-original-title="<?php _e("Delete Email Settings", "contact-bank")?>">
52
  <i class="icon-custom-trash"></i>
53
  </a>
54
  <?php
55
  break;
56
  case "editor":
57
  ?>
58
- <a href="admin.php?page=add_contact_email_settings&email_id=<?php echo $email_settings[$flag]->email_id;?>&form_id=<?php echo $form_id ?>" class="btn hovertip" data-original-title="<?php _e("Edit Email Settings", "contact-bank")?>">
59
  <i class="icon-custom-pencil"></i>
60
  </a>
61
- <a herf="#" onclick="delete_email_settings(<?php echo $email_settings[$flag]->email_id;?>)" class="btn hovertip" data-original-title="<?php _e("Delete Email Settings", "contact-bank")?>">
62
  <i class="icon-custom-trash"></i>
63
  </a>
64
  <?php
65
  break;
66
  case "author":
67
  ?>
68
- <a href="admin.php?page=add_contact_email_settings&email_id=<?php echo $email_settings[$flag]->email_id;?>&form_id=<?php echo $form_id ?>" class="btn hovertip" data-original-title="<?php _e("Edit Email Settings", "contact-bank")?>">
69
  <i class="icon-custom-pencil"></i>
70
  </a>
71
- <a herf="#" onclick="delete_email_settings(<?php echo $email_settings[$flag]->email_id;?>)" class="btn hovertip" data-original-title="<?php _e("Delete Email Settings", "contact-bank")?>">
72
  <i class="icon-custom-trash"></i>
73
  </a>
74
  <?php
45
  {
46
  case "administrator":
47
  ?>
48
+ <a href="admin.php?page=add_contact_email_settings&email_id=<?php echo intval($email_settings[$flag]->email_id);?>&form_id=<?php echo $form_id ?>" class="btn hovertip" data-original-title="<?php _e("Edit Email Settings", "contact-bank")?>">
49
  <i class="icon-custom-pencil"></i>
50
  </a>
51
+ <a herf="#" onclick="delete_email_settings(<?php echo intval($email_settings[$flag]->email_id);?>)" class="btn hovertip" data-original-title="<?php _e("Delete Email Settings", "contact-bank")?>">
52
  <i class="icon-custom-trash"></i>
53
  </a>
54
  <?php
55
  break;
56
  case "editor":
57
  ?>
58
+ <a href="admin.php?page=add_contact_email_settings&email_id=<?php echo intval($email_settings[$flag]->email_id);?>&form_id=<?php echo $form_id ?>" class="btn hovertip" data-original-title="<?php _e("Edit Email Settings", "contact-bank")?>">
59
  <i class="icon-custom-pencil"></i>
60
  </a>
61
+ <a herf="#" onclick="delete_email_settings(<?php echo intval($email_settings[$flag]->email_id);?>)" class="btn hovertip" data-original-title="<?php _e("Delete Email Settings", "contact-bank")?>">
62
  <i class="icon-custom-trash"></i>
63
  </a>
64
  <?php
65
  break;
66
  case "author":
67
  ?>
68
+ <a href="admin.php?page=add_contact_email_settings&email_id=<?php echo intval($email_settings[$flag]->email_id);?>&form_id=<?php echo $form_id ?>" class="btn hovertip" data-original-title="<?php _e("Edit Email Settings", "contact-bank")?>">
69
  <i class="icon-custom-pencil"></i>
70
  </a>
71
+ <a herf="#" onclick="delete_email_settings(<?php echo intval($email_settings[$flag]->email_id);?>)" class="btn hovertip" data-original-title="<?php _e("Delete Email Settings", "contact-bank")?>">
72
  <i class="icon-custom-trash"></i>
73
  </a>
74
  <?php
lib/contact_bank_email_management.php CHANGED
@@ -28,32 +28,32 @@ if(isset($_REQUEST["param"]))
28
  for($flag=0;$flag<count($email_content); $flag++)
29
  {
30
  $email_exits = "";
31
- $email_to = $email_content[$flag]->email_to;
32
  $email_from = htmlspecialchars_decode($email_content[$flag]->email_from);
33
  $messageTxt = htmlspecialchars_decode($email_content[$flag]->body_content);
34
  $email_subject = htmlspecialchars_decode($email_content[$flag]->subject, ENT_QUOTES);
35
  $email_from_name = htmlspecialchars_decode($email_content[$flag]->from_name, ENT_QUOTES);
36
- $email_reply_to = $email_content[$flag]->reply_to;
37
- $email_cc = $email_content[$flag]->cc;
38
- $email_bcc = $email_content[$flag]->bcc;
39
  for($flag1=0;$flag1<count($frontend_control_value);$flag1++)
40
  {
41
  $dynamicId = $frontend_control_value[$flag1]->dynamic_control_id;
42
- $email_to = str_replace("[control_".$dynamicId."]",$frontend_control_value[$flag1]->dynamic_frontend_value, $email_to);
43
- $email_from = str_replace("[control_".$dynamicId."]",$frontend_control_value[$flag1]->dynamic_frontend_value, $email_from);
44
- $email_subject = str_replace("[control_".$dynamicId."]",$frontend_control_value[$flag1]->dynamic_frontend_value, $email_subject);
45
- $email_from_name = str_replace("[control_".$dynamicId."]",$frontend_control_value[$flag1]->dynamic_frontend_value, $email_from_name);
46
- $email_reply_to = str_replace("[control_".$dynamicId."]",$frontend_control_value[$flag1]->dynamic_frontend_value, $email_reply_to);
47
- $email_cc = str_replace("[control_".$dynamicId."]",$frontend_control_value[$flag1]->dynamic_frontend_value, $email_cc);
48
- $email_bcc = str_replace("[control_".$dynamicId."]",$frontend_control_value[$flag1]->dynamic_frontend_value, $email_bcc);
49
  if($frontend_control_value[$flag1]->field_Id == 5)
50
  {
51
- $chk_options = str_replace("-",", ", $frontend_control_value[$flag1]->dynamic_frontend_value);
52
  $messageTxt = str_replace("[control_".$dynamicId."]",$chk_options, $messageTxt);
53
  }
54
  else
55
  {
56
- $messageTxt = str_replace("[control_".$dynamicId."]",$frontend_control_value[$flag1]->dynamic_frontend_value, $messageTxt);
57
  }
58
  }
59
  $body_content = "";
28
  for($flag=0;$flag<count($email_content); $flag++)
29
  {
30
  $email_exits = "";
31
+ $email_to = esc_html($email_content[$flag]->email_to);
32
  $email_from = htmlspecialchars_decode($email_content[$flag]->email_from);
33
  $messageTxt = htmlspecialchars_decode($email_content[$flag]->body_content);
34
  $email_subject = htmlspecialchars_decode($email_content[$flag]->subject, ENT_QUOTES);
35
  $email_from_name = htmlspecialchars_decode($email_content[$flag]->from_name, ENT_QUOTES);
36
+ $email_reply_to = esc_html($email_content[$flag]->reply_to);
37
+ $email_cc = esc_html($email_content[$flag]->cc);
38
+ $email_bcc = esc_html($email_content[$flag]->bcc);
39
  for($flag1=0;$flag1<count($frontend_control_value);$flag1++)
40
  {
41
  $dynamicId = $frontend_control_value[$flag1]->dynamic_control_id;
42
+ $email_to = str_replace("[control_".$dynamicId."]",esc_html($frontend_control_value[$flag1]->dynamic_frontend_value), $email_to);
43
+ $email_from = str_replace("[control_".$dynamicId."]",esc_html($frontend_control_value[$flag1]->dynamic_frontend_value), $email_from);
44
+ $email_subject = str_replace("[control_".$dynamicId."]",esc_html($frontend_control_value[$flag1]->dynamic_frontend_value), $email_subject);
45
+ $email_from_name = str_replace("[control_".$dynamicId."]",esc_html($frontend_control_value[$flag1]->dynamic_frontend_value), $email_from_name);
46
+ $email_reply_to = str_replace("[control_".$dynamicId."]",esc_html($frontend_control_value[$flag1]->dynamic_frontend_value), $email_reply_to);
47
+ $email_cc = str_replace("[control_".$dynamicId."]",esc_html($frontend_control_value[$flag1]->dynamic_frontend_value), $email_cc);
48
+ $email_bcc = str_replace("[control_".$dynamicId."]",esc_html($frontend_control_value[$flag1]->dynamic_frontend_value), $email_bcc);
49
  if($frontend_control_value[$flag1]->field_Id == 5)
50
  {
51
+ $chk_options = str_replace("-",", ", esc_html($frontend_control_value[$flag1]->dynamic_frontend_value));
52
  $messageTxt = str_replace("[control_".$dynamicId."]",$chk_options, $messageTxt);
53
  }
54
  else
55
  {
56
+ $messageTxt = str_replace("[control_".$dynamicId."]",esc_html($frontend_control_value[$flag1]->dynamic_frontend_value), $messageTxt);
57
  }
58
  }
59
  $body_content = "";
lib/contact_bank_frontend-class.php CHANGED
@@ -37,9 +37,9 @@ if(isset($_REQUEST["param"]))
37
  );
38
  for($flag = 0;$flag<count($fields);$flag++)
39
  {
40
- $field_id = $fields[$flag]->field_id;
41
- $dynamicId = $fields[$flag]->column_dynamicId;
42
- $control_dynamicId = $fields[$flag]->control_id;
43
  switch($field_id)
44
  {
45
  case 1:
37
  );
38
  for($flag = 0;$flag<count($fields);$flag++)
39
  {
40
+ $field_id = intval($fields[$flag]->field_id);
41
+ $dynamicId = intval($fields[$flag]->column_dynamicId);
42
+ $control_dynamicId = intval($fields[$flag]->control_id);
43
  switch($field_id)
44
  {
45
  case 1:
lib/contact_bank_layout_settings-class.php CHANGED
@@ -35,7 +35,7 @@ else
35
  );
36
  for($flag = 0; $flag < count($form_settings_controls);$flag++)
37
  {
38
- $layout_settings[$form_settings_controls[$flag]->form_settings_key] = $form_settings_controls[$flag]->form_settings_value;
39
  }
40
  echo json_encode($layout_settings);
41
  die();
35
  );
36
  for($flag = 0; $flag < count($form_settings_controls);$flag++)
37
  {
38
+ $layout_settings[$form_settings_controls[$flag]->form_settings_key] = esc_html($form_settings_controls[$flag]->form_settings_value);
39
  }
40
  echo json_encode($layout_settings);
41
  die();
lib/contact_bank_show_form_control_data-class.php CHANGED
@@ -50,15 +50,15 @@ else
50
  $form_settings[$dynamicId]["control_id"] = intval($control_id);
51
  for($flag = 0; $flag<count($form_data);$flag++)
52
  {
53
- if($form_data[$flag]->dynamic_settings_key == "cb_dropdown_option_id" || $form_data[$flag]->dynamic_settings_key == "cb_dropdown_option_val"
54
- || $form_data[$flag]->dynamic_settings_key == "cb_checkbox_option_id" || $form_data[$flag]->dynamic_settings_key == "cb_checkbox_option_val"
55
- || $form_data[$flag]->dynamic_settings_key == "cb_radio_option_id" || $form_data[$flag]->dynamic_settings_key == "cb_radio_option_val")
56
  {
57
  $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = unserialize($form_data[$flag]->dynamic_settings_value);
58
  }
59
  else
60
- {
61
- $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
62
  }
63
  }
64
  }
50
  $form_settings[$dynamicId]["control_id"] = intval($control_id);
51
  for($flag = 0; $flag<count($form_data);$flag++)
52
  {
53
+ if(esc_attr($form_data[$flag]->dynamic_settings_key) == "cb_dropdown_option_id" || esc_attr($form_data[$flag]->dynamic_settings_key) == "cb_dropdown_option_val"
54
+ || esc_attr($form_data[$flag]->dynamic_settings_key) == "cb_checkbox_option_id" || esc_attr($form_data[$flag]->dynamic_settings_key) == "cb_checkbox_option_val"
55
+ || esc_attr($form_data[$flag]->dynamic_settings_key) == "cb_radio_option_id" || esc_attr($form_data[$flag]->dynamic_settings_key) == "cb_radio_option_val")
56
  {
57
  $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = unserialize($form_data[$flag]->dynamic_settings_value);
58
  }
59
  else
60
+ {
61
+ $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = esc_html($form_data[$flag]->dynamic_settings_value);
62
  }
63
  }
64
  }
lib/contact_frontend_data_class.php CHANGED
@@ -45,7 +45,7 @@ else
45
  $wpdb->prepare
46
  (
47
  "SELECT dynamic_settings_value FROM " .contact_bank_dynamic_settings_form()." WHERE dynamicId = %d AND dynamic_settings_key = %s",
48
- $form_data[$flag]->control_id,
49
  "cb_label_value"
50
  )
51
  );
@@ -79,9 +79,9 @@ else
79
  $wpdb->prepare
80
  (
81
  "SELECT dynamic_frontend_value FROM " .frontend_controls_data_Table()." WHERE dynamic_control_id = %d AND form_id = %d AND form_submit_id = %d",
82
- $form_data[$flag2]->control_id,
83
  $form_id,
84
- $form_submit_count[$flag1]->submit_id
85
  )
86
  );
87
  if($form_data[$flag2]->field_id == 5)
45
  $wpdb->prepare
46
  (
47
  "SELECT dynamic_settings_value FROM " .contact_bank_dynamic_settings_form()." WHERE dynamicId = %d AND dynamic_settings_key = %s",
48
+ intval($form_data[$flag]->control_id),
49
  "cb_label_value"
50
  )
51
  );
79
  $wpdb->prepare
80
  (
81
  "SELECT dynamic_frontend_value FROM " .frontend_controls_data_Table()." WHERE dynamic_control_id = %d AND form_id = %d AND form_submit_id = %d",
82
+ intval($form_data[$flag2]->control_id),
83
  $form_id,
84
+ intval($form_submit_count[$flag1]->submit_id)
85
  )
86
  );
87
  if($form_data[$flag2]->field_id == 5)
lib/contact_view-class.php CHANGED
@@ -21,33 +21,32 @@ else
21
  {
22
  if(isset($_REQUEST["param"]))
23
  {
24
- if(!class_exists("class_plugin_info_contact_bank"))
25
- {
26
- class class_plugin_info_contact_bank
27
- {
28
- function get_plugin_info()
29
- {
30
- $active_plugins = (array)get_option("active_plugins", array());
31
- if (is_multisite())
32
- $active_plugins = array_merge($active_plugins, get_site_option("active_sitewide_plugins", array()));
33
- $plugins = array();
34
- if(count($active_plugins) > 0)
35
- {
36
- $get_plugins = array();
37
- foreach ($active_plugins as $plugin)
38
- {
39
- $plugin_data = @get_plugin_data(WP_PLUGIN_DIR . "/" . $plugin);
40
 
41
- $get_plugins["plugin_name"] = strip_tags($plugin_data["Name"]);
42
- $get_plugins["plugin_author"] = strip_tags($plugin_data["Author"]);
43
- $get_plugins["plugin_version"] = strip_tags($plugin_data["Version"]);
44
- array_push($plugins,$get_plugins);
45
- }
46
- return $plugins;
47
- }
48
- }
49
- }
50
- }
51
  switch(esc_attr($_REQUEST["param"]))
52
  {
53
  case "wizard_contact" :
@@ -57,12 +56,9 @@ else
57
  update_option("contact-bank-wizard", $type);
58
  if($type == "opt_in")
59
  {
60
- $class_plugin_info_contact_bank = new class_plugin_info_contact_bank();
61
  global $wp_version;
62
-
63
- $url = tech_banker_stats_url."/wp-admin/admin-ajax.php";
64
-
65
-
66
  $theme_details = array();
67
  if($wp_version >= 3.4)
68
  {
@@ -79,8 +75,6 @@ else
79
  $plugin_stat_data["event"] = "activate";
80
  $plugin_stat_data["domain_url"] = site_url();
81
  $plugin_stat_data["wp_language"] = defined("WPLANG") && WPLANG ? WPLANG : get_locale();
82
-
83
-
84
  $plugin_stat_data["email"] = get_option("admin_email");
85
  $plugin_stat_data["wp_version"] = $wp_version;
86
  $plugin_stat_data["php_version"] = esc_html(phpversion());
@@ -89,45 +83,26 @@ else
89
  $plugin_stat_data["operating_system"] = PHP_OS ." (".PHP_INT_SIZE * 8 .") BIT";
90
  $plugin_stat_data["php_memory_limit"] = ini_get("memory_limit") ? ini_get("memory_limit") : "N/A";
91
  $plugin_stat_data["extensions"] = get_loaded_extensions();
92
- $plugin_stat_data["plugins"] = $class_plugin_info_contact_bank->get_plugin_info();
93
  $plugin_stat_data["themes"] = $theme_details;
94
-
95
- if(function_exists("curl_init"))
96
- {
97
- $ch = curl_init();
98
- curl_setopt($ch, CURLOPT_URL, $url);
99
- curl_setopt($ch, CURLOPT_POST, 1);
100
- curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json"));
101
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
102
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
103
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
104
- curl_setopt($ch, CURLOPT_POSTFIELDS,
105
- http_build_query(array( "data" => serialize($plugin_stat_data), "site_id" => get_option("contact_bank_site_id") !="" ? get_option("contact_bank_site_id") : "", "action"=>"plugin_analysis_data")));
106
- $result = curl_exec($ch);
107
- update_option("contact_bank_site_id",$result);
108
- curl_close($ch);
109
- }
110
- else
111
  {
112
- $response = wp_safe_remote_post($url, array
113
- (
114
- "method" => "POST",
115
- "timeout" => 45,
116
- "redirection" => 5,
117
- "httpversion" => "1.0",
118
- "blocking" => true,
119
- "headers" => array(),
120
- "body" => array( "data" => serialize($plugin_stat_data), "site_id" => get_option("contact_bank_site_id") != "" ? get_option("contact_bank_site_id") : "","action"=>"plugin_analysis_data")
121
- ));
122
- if(!is_wp_error($response))
123
- {
124
- $response["body"] != "" ? update_option("contact_bank_site_id", $response["body"]) : "";
125
- }
126
- else
127
- {
128
- update_option("contact_bank_site_id", "error");
129
- }
130
  }
 
131
  }
132
  }
133
  break;
@@ -169,12 +144,12 @@ else
169
  $form_id
170
  )
171
  );
172
- $sql = "";
173
  if(count($control_id) != 0)
174
  {
175
  for($flag =0;$flag<count($control_id);$flag++)
176
  {
177
- $dynamic_Id = $control_id[$flag]->control_id;
178
  $sql[] = $dynamic_Id;
179
  }
180
  $wpdb->query
@@ -366,16 +341,16 @@ else
366
  $wpdb->prepare
367
  (
368
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
369
- $fields_created[$flag]->dynamicId
370
  )
371
  );
372
  if($show_in_email == "0")
373
  {
374
- $controls .= "<strong>".$fields_created[$flag]->dynamic_settings_value ."</strong>: ". "[control_".$fields_created[$flag]->dynamicId."] <br>";
375
  }
376
  if($fields_created[$flag]->field_id == 3)
377
  {
378
- $email_dynamicId = $fields_created[$flag]->dynamicId;
379
  }
380
  }
381
  $body_message = "Hello Admin,<br><br>
@@ -1025,10 +1000,9 @@ else
1025
 
1026
  break;
1027
 
1028
- case "contact_plugin_updates":
1029
-
1030
- $contact_updates = isset($_REQUEST["contact_updates"]) ? intval($_REQUEST["contact_updates"]) : 0;
1031
- update_option("contact-bank-automatic_update",$contact_updates);
1032
 
1033
  break;
1034
  }
21
  {
22
  if(isset($_REQUEST["param"]))
23
  {
24
+
25
+ class class_installed_plugin_info_contact_bank
26
+ {
27
+ function get_plugin_info()
28
+ {
29
+ $active_plugins = (array)get_option("active_plugins", array());
30
+ if (is_multisite())
31
+ $active_plugins = array_merge($active_plugins, get_site_option("active_sitewide_plugins", array()));
32
+ $plugins = array();
33
+ if(count($active_plugins) > 0)
34
+ {
35
+ $get_plugins = array();
36
+ foreach ($active_plugins as $plugin)
37
+ {
38
+ $plugin_data = @get_plugin_data(WP_PLUGIN_DIR . "/" . $plugin);
 
39
 
40
+ $get_plugins["plugin_name"] = strip_tags($plugin_data["Name"]);
41
+ $get_plugins["plugin_author"] = strip_tags($plugin_data["Author"]);
42
+ $get_plugins["plugin_version"] = strip_tags($plugin_data["Version"]);
43
+ array_push($plugins,$get_plugins);
44
+ }
45
+ return $plugins;
46
+ }
47
+ }
48
+ }
49
+
50
  switch(esc_attr($_REQUEST["param"]))
51
  {
52
  case "wizard_contact" :
56
  update_option("contact-bank-wizard", $type);
57
  if($type == "opt_in")
58
  {
59
+ $class_installed_plugin_info_contact_bank = new class_installed_plugin_info_contact_bank();
60
  global $wp_version;
61
+
 
 
 
62
  $theme_details = array();
63
  if($wp_version >= 3.4)
64
  {
75
  $plugin_stat_data["event"] = "activate";
76
  $plugin_stat_data["domain_url"] = site_url();
77
  $plugin_stat_data["wp_language"] = defined("WPLANG") && WPLANG ? WPLANG : get_locale();
 
 
78
  $plugin_stat_data["email"] = get_option("admin_email");
79
  $plugin_stat_data["wp_version"] = $wp_version;
80
  $plugin_stat_data["php_version"] = esc_html(phpversion());
83
  $plugin_stat_data["operating_system"] = PHP_OS ." (".PHP_INT_SIZE * 8 .") BIT";
84
  $plugin_stat_data["php_memory_limit"] = ini_get("memory_limit") ? ini_get("memory_limit") : "N/A";
85
  $plugin_stat_data["extensions"] = get_loaded_extensions();
86
+ $plugin_stat_data["plugins"] = $class_installed_plugin_info_contact_bank->get_plugin_info();
87
  $plugin_stat_data["themes"] = $theme_details;
88
+ $url = tech_banker_stats_url. "/wp-admin/admin-ajax.php";
89
+ $response = wp_safe_remote_post($url, array
90
+ (
91
+ "method" => "POST",
92
+ "timeout" => 45,
93
+ "redirection" => 5,
94
+ "httpversion" => "1.0",
95
+ "blocking" => true,
96
+ "headers" => array(),
97
+ "body" => array( "data" => serialize($plugin_stat_data), "site_id" => get_option("contact_bank_site_id") != "" ? get_option("contact_bank_site_id") : "","action"=>"plugin_analysis_data")
98
+ ));
99
+
100
+ if(!is_wp_error($response))
 
 
 
 
101
  {
102
+
103
+ $response["body"] != "" ? update_option("contact_bank_site_id", $response["body"]) : "";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  }
105
+
106
  }
107
  }
108
  break;
144
  $form_id
145
  )
146
  );
147
+ $sql = array();
148
  if(count($control_id) != 0)
149
  {
150
  for($flag =0;$flag<count($control_id);$flag++)
151
  {
152
+ $dynamic_Id = intval($control_id[$flag]->control_id);
153
  $sql[] = $dynamic_Id;
154
  }
155
  $wpdb->query
341
  $wpdb->prepare
342
  (
343
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
344
+ intval($fields_created[$flag]->dynamicId)
345
  )
346
  );
347
  if($show_in_email == "0")
348
  {
349
+ $controls .= "<strong>".esc_attr($fields_created[$flag]->dynamic_settings_value) ."</strong>: ". "[control_".intval($fields_created[$flag]->dynamicId)."] <br>";
350
  }
351
  if($fields_created[$flag]->field_id == 3)
352
  {
353
+ $email_dynamicId = intval($fields_created[$flag]->dynamicId);
354
  }
355
  }
356
  $body_message = "Hello Admin,<br><br>
1000
 
1001
  break;
1002
 
1003
+ case "contact_plugin_remove_tables":
1004
+ $contact_remove_tables = isset($_REQUEST["contact_remove_tables"]) ? intval($_REQUEST["contact_remove_tables"]) : 0;
1005
+ update_option("contact-bank-remove-tables",$contact_remove_tables);
 
1006
 
1007
  break;
1008
  }
lib/install-script.php CHANGED
@@ -18,169 +18,149 @@ if (!current_user_can($cb_user_role_permission))
18
  }
19
  else
20
  {
21
- if(!function_exists("create_table_contact_bank_forms"))
22
- {
23
- function create_table_contact_bank_forms()
24
- {
25
- $sql = 'CREATE TABLE ' . contact_bank_contact_form() . '(
26
- form_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
27
- form_name VARCHAR(200) NOT NULL,
28
- PRIMARY KEY (form_id)
29
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
30
- dbDelta($sql);
31
 
32
- }
33
- }
34
- if(!function_exists("create_table_contact_bank_dynamic_settings"))
35
- {
36
- function create_table_contact_bank_dynamic_settings()
37
- {
38
- $sql = 'CREATE TABLE ' . contact_bank_dynamic_settings_form() . '(
39
- dynamic_settings_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
40
- dynamicId INTEGER(10) NOT NULL,
41
- dynamic_settings_key VARCHAR(100) NOT NULL,
42
- dynamic_settings_value TEXT NOT NULL,
43
- PRIMARY KEY (dynamic_settings_id)
44
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
45
- dbDelta($sql);
46
- }
47
- }
48
- if(!function_exists("create_table_contact_bank_controls"))
49
- {
50
- function create_table_contact_bank_controls()
51
- {
52
- $sql = 'CREATE TABLE '.create_control_Table(). '(
53
- control_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
54
- field_id INTEGER(50) NOT NULL,
55
- form_id INTEGER(10) NOT NULL,
56
- column_dynamicId INTEGER(10) NOT NULL,
57
- sorting_order INTEGER(10) NOT NULL,
58
- PRIMARY KEY(control_id)
59
- )ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
60
- dbDelta($sql);
61
- }
62
- }
63
 
64
- if(!function_exists("create_table_front_end_data"))
65
- {
66
- function create_table_front_end_data()
67
- {
68
- $sql = 'CREATE TABLE ' . frontend_controls_data_Table() . '(
69
- id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
70
- form_id INTEGER(10) NOT NULL,
71
- field_Id INTEGER(10) NOT NULL,
72
- dynamic_control_id INTEGER(10) NOT NULL,
73
- dynamic_frontend_value TEXT NOT NULL,
74
- form_submit_id INTEGER(10) NOT NULL,
75
- PRIMARY KEY (id)
76
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
77
- dbDelta($sql);
78
- }
79
- }
80
- if(!function_exists("create_table_contact_bank_email_templates"))
81
- {
82
- function create_table_contact_bank_email_templates()
83
- {
84
- $sql = 'CREATE TABLE ' . contact_bank_email_template_admin() . '(
85
- email_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
86
- email_to VARCHAR(100) NOT NULL,
87
- email_from VARCHAR(100) NOT NULL,
88
- body_content TEXT NOT NULL,
89
- subject VARCHAR(400) NOT NULL,
90
- send_to INTEGER(1) NOT NULL,
91
- form_id INTEGER(10) NOT NULL,
92
- from_name VARCHAR(200) NOT NULL,
93
- reply_to VARCHAR(200) NOT NULL,
94
- cc VARCHAR(200) NOT NULL,
95
- bcc VARCHAR(200) NOT NULL,
96
- name VARCHAR(100) NOT NULL,
97
- PRIMARY KEY (email_id)
98
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
99
- dbDelta($sql);
100
- }
101
- }
102
- if(!function_exists("create_table_contact_bank_front_end_forms"))
103
- {
104
- function create_table_contact_bank_front_end_forms()
105
- {
106
- $sql = 'CREATE TABLE ' . contact_bank_frontend_forms_Table() . '(
107
- id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
108
- form_id INTEGER(10) NOT NULL,
109
- submit_id INTEGER(10) NOT NULL,
110
- PRIMARY KEY (id)
111
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
112
- dbDelta($sql);
113
- }
114
- }
115
- if(!function_exists("create_contact_bank_layout_settings"))
116
- {
117
- function create_contact_bank_layout_settings()
118
- {
119
- $sql = 'CREATE TABLE ' . contact_bank_layout_settings_Table() . '(
120
- id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
121
- form_id INTEGER(10) NOT NULL,
122
- form_settings_key VARCHAR(200) NOT NULL,
123
- form_settings_value VARCHAR(200) NOT NULL,
124
- PRIMARY KEY (id)
125
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
126
- dbDelta($sql);
127
- }
128
- }
129
- if(!function_exists("create_contact_bank_form_settings"))
130
- {
131
- function create_contact_bank_form_settings()
132
- {
133
- $sql = 'CREATE TABLE ' . contact_bank_form_settings_Table() . '(
134
- id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
135
- form_id INTEGER(10) NOT NULL,
136
- form_message_key VARCHAR(200) NOT NULL,
137
- form_message_value TEXT NOT NULL,
138
- PRIMARY KEY (id)
139
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
140
- dbDelta($sql);
141
- }
142
- }
143
- if(!function_exists("create_cb_table_licensing"))
144
- {
145
- function create_cb_table_licensing()
146
- {
147
- global $wpdb;
148
- $sql = "CREATE TABLE " . contact_bank_licensing() . "(
149
- licensing_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
150
- version VARCHAR(10) NOT NULL,
151
- type VARCHAR(100) NOT NULL,
152
- url TEXT NOT NULL,
153
- api_key TEXT NOT NULL,
154
- order_id VARCHAR(100) NOT NULL,
155
- PRIMARY KEY (licensing_id)
156
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
157
- dbDelta($sql);
158
 
159
- $wpdb->query
160
- (
161
- $wpdb->prepare
162
- (
163
- "INSERT INTO " . contact_bank_licensing() . "(version, type, url) VALUES(%s, %s, %s)",
164
- "2.1.0",
165
- "Contact Bank",
166
- "" . site_url() . ""
167
- )
168
- );
169
- }
170
- }
171
- if(!function_exists("create_table_roles_capability"))
172
- {
173
- function create_table_roles_capability()
174
- {
175
- $sql = 'CREATE TABLE ' . contact_bank_roles_capability() . '(
176
- id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
177
- roles_capability_key VARCHAR(200) NOT NULL,
178
- roles_capability_value VARCHAR(200) NOT NULL,
179
- PRIMARY KEY (id)
180
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
181
- dbDelta($sql);
182
- }
183
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  global $wpdb;
185
  require_once(ABSPATH . "wp-admin/includes/upgrade.php");
186
  update_option("contact-bank-updation-check-url","http://tech-banker.com/wp-admin/admin-ajax.php");
@@ -214,8 +194,8 @@ else
214
  $wpdb->prepare
215
  (
216
  "INSERT INTO " . contact_bank_contact_form() . "(form_id, form_name) VALUES(%d, %s)",
217
- $contact_forms[$flag]->form_id,
218
- $contact_forms[$flag]->form_name
219
  )
220
  );
221
  $wpdb->query
@@ -223,9 +203,9 @@ else
223
  $wpdb->prepare
224
  (
225
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
226
- $contact_forms[$flag]->form_id,
227
  "redirect",
228
- $contact_forms[$flag]->chk_url
229
  )
230
  );
231
  $wpdb->query
@@ -233,9 +213,9 @@ else
233
  $wpdb->prepare
234
  (
235
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
236
- $contact_forms[$flag]->form_id,
237
  "redirect_url",
238
- $contact_forms[$flag]->redirect_url
239
  )
240
  );
241
  $wpdb->query
@@ -243,9 +223,9 @@ else
243
  $wpdb->prepare
244
  (
245
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
246
- $contact_forms[$flag]->form_id,
247
  "success_message",
248
- $contact_forms[$flag]->success_message
249
  )
250
  );
251
  $wpdb->query
@@ -253,7 +233,7 @@ else
253
  $wpdb->prepare
254
  (
255
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
256
- $contact_forms[$flag]->form_id,
257
  "blank_field_message",
258
  "Required field must not be blank"
259
  )
@@ -263,7 +243,7 @@ else
263
  $wpdb->prepare
264
  (
265
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
266
- $contact_forms[$flag]->form_id,
267
  "incorrect_email_message",
268
  "Please enter a valid email address"
269
  )
@@ -273,7 +253,7 @@ else
273
  $wpdb->prepare
274
  (
275
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
276
- $contact_forms[$flag]->form_id,
277
  "form_description",
278
  ""
279
  )
@@ -306,10 +286,10 @@ else
306
  (
307
  "INSERT INTO " . create_control_Table() . "(field_id,form_id,
308
  column_dynamicId, sorting_order) VALUES(%d, %d, %d, %d)",
309
- $contact_forms_controls[$flag]->field_id,
310
- $contact_forms_controls[$flag]->form_id,
311
- $contact_forms_controls[$flag]->column_dynamicId,
312
- $contact_forms_controls[$flag]->sorting_order
313
  )
314
  );
315
  }
@@ -348,7 +328,7 @@ else
348
  (
349
  "INSERT INTO ". contact_bank_dynamic_settings_form() ."(dynamicId,dynamic_settings_key,
350
  dynamic_settings_value)VALUES(%d, %s, %s)",
351
- $contact_forms_email_dynamic_settings[$flag]->control_id,
352
  "cb_default_txt_val",
353
  ""
354
  )
@@ -406,8 +386,8 @@ else
406
  (
407
  "INSERT INTO " . contact_bank_dynamic_settings_form() . "(dynamicId,
408
  dynamic_settings_key,dynamic_settings_value) VALUES(%d, %s, %s)",
409
- $contact_forms_dynamic_settings[$flag]->control_id,
410
- $contact_forms_dynamic_settings[$flag]->dynamic_settings_key,
411
  array_search($contact_forms_dynamic_settings[$flag]->dynamic_settings_key,$settings_keys_multiple_options)
412
  ? serialize(explode(";",$contact_forms_dynamic_settings[$flag]->dynamic_settings_value)) : $contact_forms_dynamic_settings[$flag]->dynamic_settings_value
413
  )
@@ -444,18 +424,18 @@ else
444
  "INSERT INTO " . contact_bank_email_template_admin() . "(email_id, email_to, email_from,
445
  body_content, subject, send_to, form_id, from_name, reply_to, cc, bcc, name) VALUES(%d, %s,
446
  %s, %s, %s, %d, %d, %s, %s, %s, %s, %s)",
447
- $contact_forms_emails[$flag]->email_id,
448
- $contact_forms_emails[$flag]->email_to,
449
- $contact_forms_emails[$flag]->email_from,
450
- $contact_forms_emails[$flag]->body_content,
451
- $contact_forms_emails[$flag]->subject,
452
- isset($contact_forms_emails[$flag]->send_to) ? $contact_forms_emails[$flag]->send_to : "",
453
- $contact_forms_emails[$flag]->form_id,
454
- isset($contact_forms_emails[$flag]->from_name) ? $contact_forms_emails[$flag]->from_name : "",
455
- isset($contact_forms_emails[$flag]->reply_to) ? $contact_forms_emails[$flag]->reply_to : "",
456
- isset($contact_forms_emails[$flag]->cc) ? $contact_forms_emails[$flag]->cc : "",
457
- isset($contact_forms_emails[$flag]->bcc) ? $contact_forms_emails[$flag]->bcc : "",
458
- isset($contact_forms_emails[$flag]->name) ? $contact_forms_emails[$flag]->name : ""
459
  )
460
  );
461
  }
@@ -485,8 +465,8 @@ else
485
  $wpdb->prepare
486
  (
487
  "INSERT INTO ". contact_bank_frontend_forms_Table() ."(form_id,submit_id)VALUES(%d, %d)",
488
- $contact_front_end_forms[$flag]->form_id,
489
- $contact_front_end_forms[$flag]->submit_id
490
  )
491
  );
492
  }
@@ -516,11 +496,11 @@ else
516
  (
517
  "INSERT INTO ". frontend_controls_data_Table() ."(form_id,field_Id,dynamic_control_id,
518
  dynamic_frontend_value,form_submit_id)VALUES(%d, %d, %d, %s, %d)",
519
- $contact_front_end_forms_data[$flag]->form_id,
520
- $contact_front_end_forms_data[$flag]->field_Id,
521
- $contact_front_end_forms_data[$flag]->control_id,
522
- $contact_front_end_forms_data[$flag]->dynamic_frontend_value,
523
- $contact_front_end_forms_data[$flag]->form_submit_id
524
  )
525
  );
526
  }
@@ -990,16 +970,16 @@ else
990
  $wpdb->prepare
991
  (
992
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
993
- $fields_created[$flag]->dynamicId
994
  )
995
  );
996
  if($show_in_email == "0")
997
  {
998
  $controls .= "<strong>".$fields_created[$flag]->dynamic_settings_value ."</strong>: ". "[control_".$fields_created[$flag]->dynamicId."] <br>";
999
  }
1000
- if($fields_created[$flag]->field_id == 3)
1001
  {
1002
- $email_dynamicId = $fields_created[$flag]->dynamicId;
1003
  }
1004
  }
1005
  $email_name = "Admin Notification";
@@ -1118,9 +1098,9 @@ else
1118
  $wpdb->prepare
1119
  (
1120
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
1121
- $contact_forms_settings_table[$flag]->form_id,
1122
- $contact_forms_settings_table[$flag]->form_message_key,
1123
- $contact_forms_settings_table[$flag]->form_message_value
1124
  )
1125
  );
1126
  }
@@ -1131,7 +1111,7 @@ else
1131
  $wpdb->prepare
1132
  (
1133
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
1134
- $contact_forms_count[$flag]->form_id,
1135
  "form_description",
1136
  ""
1137
  )
@@ -1176,6 +1156,9 @@ else
1176
  }
1177
  }
1178
  update_option("contact-bank-version-number","2.1");
1179
- update_option("contact-bank-automatic_update", "0");
 
 
 
1180
  }
1181
  ?>
18
  }
19
  else
20
  {
21
+
22
+ function create_table_contact_bank_forms()
23
+ {
24
+ $sql = 'CREATE TABLE ' . contact_bank_contact_form() . '(
25
+ form_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
26
+ form_name VARCHAR(200) NOT NULL,
27
+ PRIMARY KEY (form_id)
28
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
29
+ dbDelta($sql);
 
30
 
31
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
+ function create_table_contact_bank_dynamic_settings()
34
+ {
35
+ $sql = 'CREATE TABLE ' . contact_bank_dynamic_settings_form() . '(
36
+ dynamic_settings_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
37
+ dynamicId INTEGER(10) NOT NULL,
38
+ dynamic_settings_key VARCHAR(100) NOT NULL,
39
+ dynamic_settings_value TEXT NOT NULL,
40
+ PRIMARY KEY (dynamic_settings_id)
41
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
42
+ dbDelta($sql);
43
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
+ function create_table_contact_bank_controls()
46
+ {
47
+ $sql = 'CREATE TABLE '.create_control_Table(). '(
48
+ control_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
49
+ field_id INTEGER(50) NOT NULL,
50
+ form_id INTEGER(10) NOT NULL,
51
+ column_dynamicId INTEGER(10) NOT NULL,
52
+ sorting_order INTEGER(10) NOT NULL,
53
+ PRIMARY KEY(control_id)
54
+ )ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
55
+ dbDelta($sql);
56
+ }
57
+
58
+ function create_table_front_end_data()
59
+ {
60
+ $sql = 'CREATE TABLE ' . frontend_controls_data_Table() . '(
61
+ id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
62
+ form_id INTEGER(10) NOT NULL,
63
+ field_Id INTEGER(10) NOT NULL,
64
+ dynamic_control_id INTEGER(10) NOT NULL,
65
+ dynamic_frontend_value TEXT NOT NULL,
66
+ form_submit_id INTEGER(10) NOT NULL,
67
+ PRIMARY KEY (id)
68
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
69
+ dbDelta($sql);
70
+ }
71
+
72
+ function create_table_contact_bank_email_templates()
73
+ {
74
+ $sql = 'CREATE TABLE ' . contact_bank_email_template_admin() . '(
75
+ email_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
76
+ email_to VARCHAR(100) NOT NULL,
77
+ email_from VARCHAR(100) NOT NULL,
78
+ body_content TEXT NOT NULL,
79
+ subject VARCHAR(400) NOT NULL,
80
+ send_to INTEGER(1) NOT NULL,
81
+ form_id INTEGER(10) NOT NULL,
82
+ from_name VARCHAR(200) NOT NULL,
83
+ reply_to VARCHAR(200) NOT NULL,
84
+ cc VARCHAR(200) NOT NULL,
85
+ bcc VARCHAR(200) NOT NULL,
86
+ name VARCHAR(100) NOT NULL,
87
+ PRIMARY KEY (email_id)
88
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
89
+ dbDelta($sql);
90
+ }
91
+
92
+ function create_table_contact_bank_front_end_forms()
93
+ {
94
+ $sql = 'CREATE TABLE ' . contact_bank_frontend_forms_Table() . '(
95
+ id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
96
+ form_id INTEGER(10) NOT NULL,
97
+ submit_id INTEGER(10) NOT NULL,
98
+ PRIMARY KEY (id)
99
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
100
+ dbDelta($sql);
101
+ }
102
+
103
+ function create_contact_bank_layout_settings()
104
+ {
105
+ $sql = 'CREATE TABLE ' . contact_bank_layout_settings_Table() . '(
106
+ id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
107
+ form_id INTEGER(10) NOT NULL,
108
+ form_settings_key VARCHAR(200) NOT NULL,
109
+ form_settings_value VARCHAR(200) NOT NULL,
110
+ PRIMARY KEY (id)
111
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
112
+ dbDelta($sql);
113
+ }
114
+
115
+ function create_contact_bank_form_settings()
116
+ {
117
+ $sql = 'CREATE TABLE ' . contact_bank_form_settings_Table() . '(
118
+ id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
119
+ form_id INTEGER(10) NOT NULL,
120
+ form_message_key VARCHAR(200) NOT NULL,
121
+ form_message_value TEXT NOT NULL,
122
+ PRIMARY KEY (id)
123
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
124
+ dbDelta($sql);
125
+ }
126
+
127
+ function create_cb_table_licensing()
128
+ {
129
+ global $wpdb;
130
+ $sql = "CREATE TABLE " . contact_bank_licensing() . "(
131
+ licensing_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
132
+ version VARCHAR(10) NOT NULL,
133
+ type VARCHAR(100) NOT NULL,
134
+ url TEXT NOT NULL,
135
+ api_key TEXT NOT NULL,
136
+ order_id VARCHAR(100) NOT NULL,
137
+ PRIMARY KEY (licensing_id)
138
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
139
+ dbDelta($sql);
140
+
141
+ $wpdb->query
142
+ (
143
+ $wpdb->prepare
144
+ (
145
+ "INSERT INTO " . contact_bank_licensing() . "(version, type, url) VALUES(%s, %s, %s)",
146
+ "2.1.0",
147
+ "Contact Bank",
148
+ "" . site_url() . ""
149
+ )
150
+ );
151
+ }
152
+
153
+ function create_table_roles_capability()
154
+ {
155
+ $sql = 'CREATE TABLE ' . contact_bank_roles_capability() . '(
156
+ id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
157
+ roles_capability_key VARCHAR(200) NOT NULL,
158
+ roles_capability_value VARCHAR(200) NOT NULL,
159
+ PRIMARY KEY (id)
160
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
161
+ dbDelta($sql);
162
+ }
163
+
164
  global $wpdb;
165
  require_once(ABSPATH . "wp-admin/includes/upgrade.php");
166
  update_option("contact-bank-updation-check-url","http://tech-banker.com/wp-admin/admin-ajax.php");
194
  $wpdb->prepare
195
  (
196
  "INSERT INTO " . contact_bank_contact_form() . "(form_id, form_name) VALUES(%d, %s)",
197
+ intval($contact_forms[$flag]->form_id),
198
+ esc_html($contact_forms[$flag]->form_name)
199
  )
200
  );
201
  $wpdb->query
203
  $wpdb->prepare
204
  (
205
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
206
+ intval($contact_forms[$flag]->form_id),
207
  "redirect",
208
+ esc_html($contact_forms[$flag]->chk_url)
209
  )
210
  );
211
  $wpdb->query
213
  $wpdb->prepare
214
  (
215
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
216
+ intval($contact_forms[$flag]->form_id),
217
  "redirect_url",
218
+ esc_html($contact_forms[$flag]->redirect_url)
219
  )
220
  );
221
  $wpdb->query
223
  $wpdb->prepare
224
  (
225
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
226
+ intval($contact_forms[$flag]->form_id),
227
  "success_message",
228
+ esc_html($contact_forms[$flag]->success_message)
229
  )
230
  );
231
  $wpdb->query
233
  $wpdb->prepare
234
  (
235
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
236
+ intval($contact_forms[$flag]->form_id),
237
  "blank_field_message",
238
  "Required field must not be blank"
239
  )
243
  $wpdb->prepare
244
  (
245
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
246
+ intval($contact_forms[$flag]->form_id),
247
  "incorrect_email_message",
248
  "Please enter a valid email address"
249
  )
253
  $wpdb->prepare
254
  (
255
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
256
+ intval($contact_forms[$flag]->form_id),
257
  "form_description",
258
  ""
259
  )
286
  (
287
  "INSERT INTO " . create_control_Table() . "(field_id,form_id,
288
  column_dynamicId, sorting_order) VALUES(%d, %d, %d, %d)",
289
+ intval($contact_forms_controls[$flag]->field_id),
290
+ intval($contact_forms_controls[$flag]->form_id),
291
+ intval($contact_forms_controls[$flag]->column_dynamicId),
292
+ intval($contact_forms_controls[$flag]->sorting_order)
293
  )
294
  );
295
  }
328
  (
329
  "INSERT INTO ". contact_bank_dynamic_settings_form() ."(dynamicId,dynamic_settings_key,
330
  dynamic_settings_value)VALUES(%d, %s, %s)",
331
+ intval($contact_forms_email_dynamic_settings[$flag]->control_id),
332
  "cb_default_txt_val",
333
  ""
334
  )
386
  (
387
  "INSERT INTO " . contact_bank_dynamic_settings_form() . "(dynamicId,
388
  dynamic_settings_key,dynamic_settings_value) VALUES(%d, %s, %s)",
389
+ intval($contact_forms_dynamic_settings[$flag]->control_id),
390
+ esc_attr($contact_forms_dynamic_settings[$flag]->dynamic_settings_key),
391
  array_search($contact_forms_dynamic_settings[$flag]->dynamic_settings_key,$settings_keys_multiple_options)
392
  ? serialize(explode(";",$contact_forms_dynamic_settings[$flag]->dynamic_settings_value)) : $contact_forms_dynamic_settings[$flag]->dynamic_settings_value
393
  )
424
  "INSERT INTO " . contact_bank_email_template_admin() . "(email_id, email_to, email_from,
425
  body_content, subject, send_to, form_id, from_name, reply_to, cc, bcc, name) VALUES(%d, %s,
426
  %s, %s, %s, %d, %d, %s, %s, %s, %s, %s)",
427
+ intval($contact_forms_emails[$flag]->email_id),
428
+ esc_html($contact_forms_emails[$flag]->email_to),
429
+ esc_html($contact_forms_emails[$flag]->email_from),
430
+ esc_html($contact_forms_emails[$flag]->body_content),
431
+ esc_html($contact_forms_emails[$flag]->subject),
432
+ isset($contact_forms_emails[$flag]->send_to) ? esc_html($contact_forms_emails[$flag]->send_to) : "",
433
+ intval($contact_forms_emails[$flag]->form_id),
434
+ isset($contact_forms_emails[$flag]->from_name) ? esc_html($contact_forms_emails[$flag]->from_name) : "",
435
+ isset($contact_forms_emails[$flag]->reply_to) ? esc_html($contact_forms_emails[$flag]->reply_to) : "",
436
+ isset($contact_forms_emails[$flag]->cc) ? esc_html($contact_forms_emails[$flag]->cc) : "",
437
+ isset($contact_forms_emails[$flag]->bcc) ? esc_html($contact_forms_emails[$flag]->bcc) : "",
438
+ isset($contact_forms_emails[$flag]->name) ? esc_html($contact_forms_emails[$flag]->name) : ""
439
  )
440
  );
441
  }
465
  $wpdb->prepare
466
  (
467
  "INSERT INTO ". contact_bank_frontend_forms_Table() ."(form_id,submit_id)VALUES(%d, %d)",
468
+ intval($contact_front_end_forms[$flag]->form_id),
469
+ intval($contact_front_end_forms[$flag]->submit_id)
470
  )
471
  );
472
  }
496
  (
497
  "INSERT INTO ". frontend_controls_data_Table() ."(form_id,field_Id,dynamic_control_id,
498
  dynamic_frontend_value,form_submit_id)VALUES(%d, %d, %d, %s, %d)",
499
+ intval($contact_front_end_forms_data[$flag]->form_id),
500
+ intval($contact_front_end_forms_data[$flag]->field_Id),
501
+ intval($contact_front_end_forms_data[$flag]->control_id),
502
+ esc_html($contact_front_end_forms_data[$flag]->dynamic_frontend_value),
503
+ intval($contact_front_end_forms_data[$flag]->form_submit_id)
504
  )
505
  );
506
  }
970
  $wpdb->prepare
971
  (
972
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
973
+ intval($fields_created[$flag]->dynamicId)
974
  )
975
  );
976
  if($show_in_email == "0")
977
  {
978
  $controls .= "<strong>".$fields_created[$flag]->dynamic_settings_value ."</strong>: ". "[control_".$fields_created[$flag]->dynamicId."] <br>";
979
  }
980
+ if(intval($fields_created[$flag]->field_id) == 3)
981
  {
982
+ $email_dynamicId = intval($fields_created[$flag]->dynamicId);
983
  }
984
  }
985
  $email_name = "Admin Notification";
1098
  $wpdb->prepare
1099
  (
1100
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
1101
+ intval($contact_forms_settings_table[$flag]->form_id),
1102
+ esc_attr($contact_forms_settings_table[$flag]->form_message_key),
1103
+ esc_html($contact_forms_settings_table[$flag]->form_message_value)
1104
  )
1105
  );
1106
  }
1111
  $wpdb->prepare
1112
  (
1113
  "INSERT INTO ". contact_bank_form_settings_Table() ."(form_id,form_message_key,form_message_value)VALUES(%d, %s, %s)",
1114
+ intval($contact_forms_count[$flag]->form_id),
1115
  "form_description",
1116
  ""
1117
  )
1156
  }
1157
  }
1158
  update_option("contact-bank-version-number","2.1");
1159
+ if(get_option("contact-bank-remove-tables") == "")
1160
+ {
1161
+ update_option("contact-bank-remove-tables", "0");
1162
+ }
1163
  }
1164
  ?>
lib/uninstall-script.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
- if(!defined("ABSPATH")) exit; //exit if accessed directly
3
- global $wpdb;
4
- $sql = "DROP TABLE " .contact_bank_contact_form();
5
- $wpdb->query($sql);
6
-
7
- $sql = "DROP TABLE " .create_control_Table();
8
- $wpdb->query($sql);
9
-
10
- $sql = "DROP TABLE " .contact_bank_dynamic_settings_form();
11
- $wpdb->query($sql);
12
-
13
- $sql = "DROP TABLE " .contact_bank_email_template_admin();
14
- $wpdb->query($sql);
15
-
16
- $sql = "DROP TABLE " .frontend_controls_data_Table();
17
- $wpdb->query($sql);
18
-
19
- $sql = "DROP TABLE " .contact_bank_frontend_forms_Table();
20
- $wpdb->query($sql);
21
-
22
- $sql = "DROP TABLE " .contact_bank_form_settings_Table();
23
- $wpdb->query($sql);
24
-
25
- $sql = "DROP TABLE " .contact_bank_layout_settings_Table();
26
- $wpdb->query($sql);
27
-
28
- $sql = "DROP TABLE " .contact_bank_licensing();
29
- $wpdb->query($sql);
30
-
31
- $sql = "DROP TABLE " .contact_bank_roles_capability();
32
- $wpdb->query($sql);
33
-
34
- delete_option("contact-bank-info-popup");
35
- delete_option("contact-bank-version-number");
36
- delete_option("contact-bank-automatic_update");
37
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -547,6 +547,15 @@ In order to set Short code for a Form, you need to follow these steps :
547
 
548
  == Changelog ==
549
 
 
 
 
 
 
 
 
 
 
550
  = 2.1.37 =
551
 
552
  * Code Removed from Skip Action Hook on Wizard Page
547
 
548
  == Changelog ==
549
 
550
+ = 2.1.38 =
551
+
552
+ * FIX: Proper Sanitization, Escaping, Validation of all Post Calls
553
+ * FIX: Removal of all function_exists, class_exists, typeof from all the files.
554
+ * FIX: Uninstall File moved to root folder and changes done as per wordpress guidelines.
555
+ * FIX: Error Reporting in file Removed
556
+ * FIX: Auto Updates Removed
557
+ * FIX: Curl Calls Removed
558
+
559
  = 2.1.37 =
560
 
561
  * Code Removed from Skip Action Hook on Wizard Page
uninstall.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('WP_UNINSTALL_PLUGIN')) {
3
+ die;
4
+ }
5
+ if (!current_user_can("manage_options")) {
6
+ return;
7
+ } else {
8
+ global $wpdb;
9
+ $contact_bank_remove_table_uninstall = get_option("contact-bank-remove-tables");
10
+ if($contact_bank_remove_table_uninstall == "1")
11
+ {
12
+ $wpdb->query("DROP TABLE IF EXISTS " .$wpdb->prefix ."cb_contact_form");
13
+ $wpdb->query("DROP TABLE IF EXISTS " .$wpdb->prefix ."cb_create_control_form");
14
+ $wpdb->query("DROP TABLE IF EXISTS " .$wpdb->prefix ."cb_dynamic_settings");
15
+ $wpdb->query("DROP TABLE IF EXISTS " .$wpdb->prefix ."cb_email_template_admin");
16
+ $wpdb->query("DROP TABLE IF EXISTS " .$wpdb->prefix ."cb_frontend_data_table");
17
+ $wpdb->query("DROP TABLE IF EXISTS " .$wpdb->prefix ."cb_frontend_forms_table");
18
+ $wpdb->query("DROP TABLE IF EXISTS " .$wpdb->prefix ."cb_form_settings_table");
19
+ $wpdb->query("DROP TABLE IF EXISTS " .$wpdb->prefix ."cb_layout_settings_table");
20
+ $wpdb->query("DROP TABLE IF EXISTS " .$wpdb->prefix ."cb_licensing");
21
+ $wpdb->query("DROP TABLE IF EXISTS " .$wpdb->prefix ."cb_roles_capability");
22
+
23
+ delete_option("contact-bank-info-popup");
24
+ delete_option("contact-bank-wizard");
25
+ delete_option("contact_bank_site_id");
26
+ delete_option("contact-bank-version-number");
27
+ delete_option("contact-bank-remove-tables");
28
+ }
29
+ }
30
+ ?>
views/add_contact_email.php CHANGED
@@ -88,7 +88,7 @@ else
88
  <span class="error_field">*</span>
89
  </label>
90
  <div class="layout-controls">
91
- <input type="text" class="layout-span12" id="ux_txt_name" name="ux_txt_name" value="<?php echo isset($email_data->name) ? $email_data->name : ""; ?>" placeholder="<?php _e( "Enter Name", "contact-bank" ); ?>"/>
92
  </div>
93
  </div>
94
  </div>
@@ -98,7 +98,7 @@ else
98
  <?php
99
  if(isset($email_data->send_to))
100
  {
101
- if($email_data->send_to == "0")
102
  {
103
  ?>
104
  <div class="layout-controls" style="padding-top:5px;">
@@ -141,7 +141,7 @@ else
141
  <span class="error_field">*</span>
142
  </label>
143
  <div class="layout-controls">
144
- <input type="text" class="layout-span12" id="ux_txt_email" name="ux_txt_email" value="<?php echo isset($email_data->email_to) ? $email_data->email_to : ""; ?>" placeholder="<?php _e( "Enter Email ", "contact-bank" ); ?>"/>
145
  </div>
146
  </div>
147
  <div class="layout-control-group" id="div_field" style="display: none;">
@@ -149,7 +149,7 @@ else
149
  <span class="error_field">*</span>
150
  </label>
151
  <div class="layout-controls">
152
- <input type="text" class="layout-span8" id="ux_txt_send_to_field" name="ux_txt_send_to_field" value="<?php echo isset($email_data->email_to) ? $email_data->email_to : ""; ?>" placeholder="<?php _e( "Enter Field ", "contact-bank" ); ?>"/>
153
  <select class="layout-span4" id="ux_ddl_send_to_field" name="ux_ddl_send_to_field" style="float: right;" onchange="append_control_shortcode('ux_ddl_send_to_field','ux_txt_send_to_field');">
154
  <option value=""><?php _e("Select a field", "contact-bank");?></option>
155
  <?php
@@ -160,14 +160,14 @@ else
160
  $wpdb->prepare
161
  (
162
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
163
- $fields_controls[$flag]->dynamicId
164
  )
165
  );
166
  if($show_in_email == "0")
167
  {
168
  $option_values = htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value);
169
  ?>
170
- <option value="<?php echo $fields_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
171
  <?php
172
  }
173
  }
@@ -182,7 +182,7 @@ else
182
  <span class="error_field">*</span>
183
  </label>
184
  <div class="layout-controls">
185
- <input type="text" class="layout-span8" id="ux_txt_from_name" name="ux_txt_from_name" value="<?php echo isset($email_data->from_name) ? $email_data->from_name : ""; ?>" placeholder="<?php _e( "Enter from name ", "contact-bank" ); ?>"/>
186
  <select class="layout-span4" id="ux_ddl_from_name" name="ux_ddl_from_name" style=" float: right; " onchange="append_control_shortcode('ux_ddl_from_name','ux_txt_from_name');">
187
  <option value=""><?php _e("Select a field", "contact-bank");?></option>
188
  <?php
@@ -193,14 +193,14 @@ else
193
  $wpdb->prepare
194
  (
195
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
196
- $fields_controls[$flag]->dynamicId
197
  )
198
  );
199
  if($show_in_email == "0")
200
  {
201
  $option_values = htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value);
202
  ?>
203
- <option value="<?php echo $fields_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
204
  <?php
205
  }
206
  }
@@ -215,7 +215,7 @@ else
215
  <span class="error_field" >*</span>
216
  </label>
217
  <div class="layout-controls">
218
- <input type="text" class="layout-span8" id="ux_txt_from_email" name="ux_txt_from_email" value="<?php echo isset($email_data->email_from) ? $email_data->email_from : ""; ?>" placeholder="<?php _e( "Enter from email", "contact-bank" ); ?>"/>
219
  <select class="layout-span4" id="ux_ddl_from_email" name="ux_ddl_from_email" style=" float: right;" onchange="append_control_shortcode(this.id,'ux_txt_from_email');">
220
  <option value=""><?php _e("Select a field", "contact-bank");?></option>
221
  <?php
@@ -226,14 +226,14 @@ else
226
  $wpdb->prepare
227
  (
228
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
229
- $fields_email_controls[$flag]->dynamicId
230
  )
231
  );
232
  if($show_in_email == "0")
233
  {
234
  $option_values = htmlspecialchars_decode($fields_email_controls[$flag]->dynamic_settings_value);
235
  ?>
236
- <option value="<?php echo $fields_email_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
237
  <?php
238
  }
239
  }
@@ -246,7 +246,7 @@ else
246
  <div class="layout-control-group">
247
  <label class="layout-control-label"><?php _e( "Reply To", "contact-bank" ); ?> :</label>
248
  <div class="layout-controls">
249
- <input type="text" class="layout-span8" id="ux_txt_reply_to" name="ux_txt_reply_to" value="<?php echo isset($email_data->reply_to) ? $email_data->reply_to : ""; ?>" placeholder="<?php _e( "Enter Email", "contact-bank" ); ?>"/>
250
  <select class="layout-span4" id="ux_ddl_reply_to" name="ux_ddl_reply_to" style=" float: right;" onchange="append_control_shortcode('ux_ddl_reply_to','ux_txt_reply_to');">
251
  <option value=""><?php _e("Select a field", "contact-bank");?></option>
252
  <?php
@@ -257,14 +257,14 @@ else
257
  $wpdb->prepare
258
  (
259
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
260
- $fields_email_controls[$flag]->dynamicId
261
  )
262
  );
263
  if($show_in_email == "0")
264
  {
265
  $option_values = htmlspecialchars_decode($fields_email_controls[$flag]->dynamic_settings_value);
266
  ?>
267
- <option value="<?php echo $fields_email_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
268
  <?php
269
  }
270
  }
@@ -277,7 +277,7 @@ else
277
  <div class="layout-control-group">
278
  <label class="layout-control-label"><?php _e( "CC", "contact-bank" ); ?> :</label>
279
  <div class="layout-controls">
280
- <input type="text" class="layout-span8" id="ux_txt_cc" name="ux_txt_cc" value="<?php echo isset($email_data->cc) ? $email_data->cc : ""; ?>" placeholder="<?php _e( "Enter CC Email ", "contact-bank" ); ?>"/>
281
  <select class="layout-span4" id="ux_ddl_cc" name="ux_ddl_cc" style=" float: right;" onchange="append_control_shortcode('ux_ddl_cc','ux_txt_cc');">
282
  <option value=""><?php _e("Select a field", "contact-bank");?></option>
283
  <?php
@@ -288,14 +288,14 @@ else
288
  $wpdb->prepare
289
  (
290
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
291
- $fields_email_controls[$flag]->dynamicId
292
  )
293
  );
294
  if($show_in_email == "0")
295
  {
296
  $option_values = htmlspecialchars_decode($fields_email_controls[$flag]->dynamic_settings_value);
297
  ?>
298
- <option value="<?php echo $fields_email_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
299
  <?php
300
  }
301
  }
@@ -308,7 +308,7 @@ else
308
  <div class="layout-control-group">
309
  <label class="layout-control-label"><?php _e( "BCC", "contact-bank" ); ?> :</label>
310
  <div class="layout-controls">
311
- <input type="text" class="layout-span8" id="ux_txt_bcc" name="ux_txt_bcc" value="<?php echo isset($email_data->bcc) ? $email_data->bcc : ""; ?>" placeholder="<?php _e( "Enter Bcc Email", "contact-bank" ); ?>"/>
312
  <select class="layout-span4" id="ux_ddl_bcc" name="ux_ddl_bcc" style=" float: right;" onchange="append_control_shortcode('ux_ddl_bcc','ux_txt_bcc');">
313
  <option value=""><?php _e("Select a field", "contact-bank");?></option>
314
  <?php
@@ -319,14 +319,14 @@ else
319
  $wpdb->prepare
320
  (
321
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
322
- $fields_email_controls[$flag]->dynamicId
323
  )
324
  );
325
  if($show_in_email == "0")
326
  {
327
  $option_values = htmlspecialchars_decode($fields_email_controls[$flag]->dynamic_settings_value);
328
  ?>
329
- <option value="<?php echo $fields_email_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
330
  <?php
331
  }
332
  }
@@ -341,7 +341,7 @@ else
341
  <span class="error_field">*</span>
342
  </label>
343
  <div class="layout-controls">
344
- <input type="text" class="layout-span8" id="ux_txt_subject" name="ux_txt_subject" value="<?php echo isset($email_data->subject) ? $email_data->subject : ""; ?>" placeholder="<?php _e( "Enter Subject", "contact-bank" ); ?>"/>
345
  <select class="layout-span4" id="ux_ddl_subject" name="ux_ddl_subject" style=" float: right;" onchange="append_control_shortcode('ux_ddl_subject','ux_txt_subject');">
346
  <option value=""><?php _e("Select a field", "contact-bank");?></option>
347
  <?php
@@ -352,14 +352,14 @@ else
352
  $wpdb->prepare
353
  (
354
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
355
- $fields_controls[$flag]->dynamicId
356
  )
357
  );
358
  if($show_in_email == "0")
359
  {
360
  $option_values = htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value);
361
  ?>
362
- <option value="<?php echo $fields_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
363
  <?php
364
  }
365
  }
@@ -390,14 +390,14 @@ else
390
  $wpdb->prepare
391
  (
392
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
393
- $fields_controls[$flag]->dynamicId
394
  )
395
  );
396
  if($show_in_email == "0")
397
  {
398
  $option_values = htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value);
399
  ?>
400
- <option value="<?php echo $fields_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
401
  <?php
402
  }
403
  }
@@ -421,9 +421,7 @@ else
421
  </div>
422
  </form>
423
  <script type="text/javascript">
424
- if (typeof(base64_encode) != "function")
425
- {
426
- function base64_encode(data)
427
  {
428
  var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
429
  var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
@@ -451,7 +449,7 @@ else
451
  var r = data.length % 3;
452
  return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
453
  }
454
- }
455
  jQuery("#ux_frm_add_email").validate
456
  ({
457
  rules:
@@ -514,7 +512,7 @@ else
514
  }
515
  jQuery.post(ajaxurl,
516
  {
517
- data: base64_encode(jQuery(form).serialize()),
518
  email_id: email_id,
519
  form_id: form_id,
520
  param: "insert_email_controls",
@@ -530,62 +528,57 @@ else
530
  });
531
  }
532
  });
533
- if (typeof(show_send_to_div) != "function")
534
- {
535
- function show_send_to_div()
536
- {
537
- var ux_rdl_email = jQuery("#ux_rdl_email").prop("checked");
538
- if(ux_rdl_email == true)
539
- {
540
- jQuery("#div_field").css("display","none");
541
- jQuery("#div_email").css("display","block");
542
- }
543
- else
544
- {
545
- jQuery("#div_email").css("display","none");
546
- jQuery("#div_field").css("display","block");
547
- }
548
- }
549
- }
550
- if (typeof(append_control_shortcode) != "function")
551
- {
552
- function append_control_shortcode(ddl_id,input_id)
553
- {
554
- var dynamicId = jQuery("#"+ddl_id).val();
555
- var label = jQuery("#"+ddl_id+" option:selected").text();
556
- if(dynamicId != "")
557
- {
558
- var selected_fields = jQuery("#"+input_id).val();
559
- var fields_shortCodes = selected_fields +"[control_"+dynamicId+"]";
560
- jQuery("#"+input_id).val(fields_shortCodes);
561
- jQuery("#"+ddl_id).val("");
562
- }
563
- }
564
- }
565
- if (typeof(append_add_control_shortcode) != "function")
566
- {
567
- function append_add_control_shortcode(ddl_id)
568
- {
569
- var dynamicId = jQuery("#"+ddl_id).val();
570
- var label = jQuery("#"+ddl_id+" option:selected").text();
571
- if(dynamicId != "")
572
- {
573
- if (jQuery("#wp-uxEmailTemplate-wrap").hasClass("tmce-active"))
574
- {
575
- var selected_fields = tinyMCE.get("uxEmailTemplate").getContent();
576
- var fields_shortCodes = "<strong>"+selected_fields+label +"</strong> : [control_"+dynamicId+"]<br />";
577
- tinyMCE.get("uxEmailTemplate").setContent(fields_shortCodes);
578
- }
579
- else
580
- {
581
- var selected_fields = jQuery("#uxEmailTemplate").val();
582
- var fields_shortCodes = selected_fields+label +" : [control_"+dynamicId+"]<br />";
583
- jQuery("#uxEmailTemplate").val(fields_shortCodes);
584
- }
585
- jQuery("#"+ddl_id).val("");
586
- }
587
- }
588
- }
589
  jQuery(document).ready(function()
590
  {
591
  show_send_to_div();
88
  <span class="error_field">*</span>
89
  </label>
90
  <div class="layout-controls">
91
+ <input type="text" class="layout-span12" id="ux_txt_name" name="ux_txt_name" value="<?php echo isset($email_data->name) ? esc_attr($email_data->name) : ""; ?>" placeholder="<?php _e( "Enter Name", "contact-bank" ); ?>"/>
92
  </div>
93
  </div>
94
  </div>
98
  <?php
99
  if(isset($email_data->send_to))
100
  {
101
+ if(esc_attr($email_data->send_to) == "0")
102
  {
103
  ?>
104
  <div class="layout-controls" style="padding-top:5px;">
141
  <span class="error_field">*</span>
142
  </label>
143
  <div class="layout-controls">
144
+ <input type="text" class="layout-span12" id="ux_txt_email" name="ux_txt_email" value="<?php echo isset($email_data->email_to) ? esc_attr($email_data->email_to) : ""; ?>" placeholder="<?php _e( "Enter Email ", "contact-bank" ); ?>"/>
145
  </div>
146
  </div>
147
  <div class="layout-control-group" id="div_field" style="display: none;">
149
  <span class="error_field">*</span>
150
  </label>
151
  <div class="layout-controls">
152
+ <input type="text" class="layout-span8" id="ux_txt_send_to_field" name="ux_txt_send_to_field" value="<?php echo isset($email_data->email_to) ? esc_attr($email_data->email_to) : ""; ?>" placeholder="<?php _e( "Enter Field ", "contact-bank" ); ?>"/>
153
  <select class="layout-span4" id="ux_ddl_send_to_field" name="ux_ddl_send_to_field" style="float: right;" onchange="append_control_shortcode('ux_ddl_send_to_field','ux_txt_send_to_field');">
154
  <option value=""><?php _e("Select a field", "contact-bank");?></option>
155
  <?php
160
  $wpdb->prepare
161
  (
162
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
163
+ intval($fields_controls[$flag]->dynamicId)
164
  )
165
  );
166
  if($show_in_email == "0")
167
  {
168
  $option_values = htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value);
169
  ?>
170
+ <option value="<?php echo intval($fields_controls[$flag]->dynamicId);?>"><?php echo $option_values;?></option>
171
  <?php
172
  }
173
  }
182
  <span class="error_field">*</span>
183
  </label>
184
  <div class="layout-controls">
185
+ <input type="text" class="layout-span8" id="ux_txt_from_name" name="ux_txt_from_name" value="<?php echo isset($email_data->from_name) ? esc_attr($email_data->from_name) : ""; ?>" placeholder="<?php _e( "Enter from name ", "contact-bank" ); ?>"/>
186
  <select class="layout-span4" id="ux_ddl_from_name" name="ux_ddl_from_name" style=" float: right; " onchange="append_control_shortcode('ux_ddl_from_name','ux_txt_from_name');">
187
  <option value=""><?php _e("Select a field", "contact-bank");?></option>
188
  <?php
193
  $wpdb->prepare
194
  (
195
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
196
+ intval($fields_controls[$flag]->dynamicId)
197
  )
198
  );
199
  if($show_in_email == "0")
200
  {
201
  $option_values = htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value);
202
  ?>
203
+ <option value="<?php echo intval($fields_controls[$flag]->dynamicId);?>"><?php echo $option_values;?></option>
204
  <?php
205
  }
206
  }
215
  <span class="error_field" >*</span>
216
  </label>
217
  <div class="layout-controls">
218
+ <input type="text" class="layout-span8" id="ux_txt_from_email" name="ux_txt_from_email" value="<?php echo isset($email_data->email_from) ? esc_attr($email_data->email_from) : ""; ?>" placeholder="<?php _e( "Enter from email", "contact-bank" ); ?>"/>
219
  <select class="layout-span4" id="ux_ddl_from_email" name="ux_ddl_from_email" style=" float: right;" onchange="append_control_shortcode(this.id,'ux_txt_from_email');">
220
  <option value=""><?php _e("Select a field", "contact-bank");?></option>
221
  <?php
226
  $wpdb->prepare
227
  (
228
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
229
+ intval($fields_email_controls[$flag]->dynamicId)
230
  )
231
  );
232
  if($show_in_email == "0")
233
  {
234
  $option_values = htmlspecialchars_decode($fields_email_controls[$flag]->dynamic_settings_value);
235
  ?>
236
+ <option value="<?php echo intval($fields_email_controls[$flag]->dynamicId);?>"><?php echo $option_values;?></option>
237
  <?php
238
  }
239
  }
246
  <div class="layout-control-group">
247
  <label class="layout-control-label"><?php _e( "Reply To", "contact-bank" ); ?> :</label>
248
  <div class="layout-controls">
249
+ <input type="text" class="layout-span8" id="ux_txt_reply_to" name="ux_txt_reply_to" value="<?php echo isset($email_data->reply_to) ? esc_attr($email_data->reply_to) : ""; ?>" placeholder="<?php _e( "Enter Email", "contact-bank" ); ?>"/>
250
  <select class="layout-span4" id="ux_ddl_reply_to" name="ux_ddl_reply_to" style=" float: right;" onchange="append_control_shortcode('ux_ddl_reply_to','ux_txt_reply_to');">
251
  <option value=""><?php _e("Select a field", "contact-bank");?></option>
252
  <?php
257
  $wpdb->prepare
258
  (
259
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
260
+ intval($fields_email_controls[$flag]->dynamicId)
261
  )
262
  );
263
  if($show_in_email == "0")
264
  {
265
  $option_values = htmlspecialchars_decode($fields_email_controls[$flag]->dynamic_settings_value);
266
  ?>
267
+ <option value="<?php echo intval($fields_email_controls[$flag]->dynamicId);?>"><?php echo $option_values;?></option>
268
  <?php
269
  }
270
  }
277
  <div class="layout-control-group">
278
  <label class="layout-control-label"><?php _e( "CC", "contact-bank" ); ?> :</label>
279
  <div class="layout-controls">
280
+ <input type="text" class="layout-span8" id="ux_txt_cc" name="ux_txt_cc" value="<?php echo isset($email_data->cc) ? esc_attr($email_data->cc) : ""; ?>" placeholder="<?php _e( "Enter CC Email ", "contact-bank" ); ?>"/>
281
  <select class="layout-span4" id="ux_ddl_cc" name="ux_ddl_cc" style=" float: right;" onchange="append_control_shortcode('ux_ddl_cc','ux_txt_cc');">
282
  <option value=""><?php _e("Select a field", "contact-bank");?></option>
283
  <?php
288
  $wpdb->prepare
289
  (
290
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
291
+ intval($fields_email_controls[$flag]->dynamicId)
292
  )
293
  );
294
  if($show_in_email == "0")
295
  {
296
  $option_values = htmlspecialchars_decode($fields_email_controls[$flag]->dynamic_settings_value);
297
  ?>
298
+ <option value="<?php echo intval($fields_email_controls[$flag]->dynamicId);?>"><?php echo $option_values;?></option>
299
  <?php
300
  }
301
  }
308
  <div class="layout-control-group">
309
  <label class="layout-control-label"><?php _e( "BCC", "contact-bank" ); ?> :</label>
310
  <div class="layout-controls">
311
+ <input type="text" class="layout-span8" id="ux_txt_bcc" name="ux_txt_bcc" value="<?php echo isset($email_data->bcc) ? esc_attr($email_data->bcc) : ""; ?>" placeholder="<?php _e( "Enter Bcc Email", "contact-bank" ); ?>"/>
312
  <select class="layout-span4" id="ux_ddl_bcc" name="ux_ddl_bcc" style=" float: right;" onchange="append_control_shortcode('ux_ddl_bcc','ux_txt_bcc');">
313
  <option value=""><?php _e("Select a field", "contact-bank");?></option>
314
  <?php
319
  $wpdb->prepare
320
  (
321
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
322
+ intval($fields_email_controls[$flag]->dynamicId)
323
  )
324
  );
325
  if($show_in_email == "0")
326
  {
327
  $option_values = htmlspecialchars_decode($fields_email_controls[$flag]->dynamic_settings_value);
328
  ?>
329
+ <option value="<?php echo intval($fields_email_controls[$flag]->dynamicId);?>"><?php echo $option_values;?></option>
330
  <?php
331
  }
332
  }
341
  <span class="error_field">*</span>
342
  </label>
343
  <div class="layout-controls">
344
+ <input type="text" class="layout-span8" id="ux_txt_subject" name="ux_txt_subject" value="<?php echo isset($email_data->subject) ? esc_attr($email_data->subject) : ""; ?>" placeholder="<?php _e( "Enter Subject", "contact-bank" ); ?>"/>
345
  <select class="layout-span4" id="ux_ddl_subject" name="ux_ddl_subject" style=" float: right;" onchange="append_control_shortcode('ux_ddl_subject','ux_txt_subject');">
346
  <option value=""><?php _e("Select a field", "contact-bank");?></option>
347
  <?php
352
  $wpdb->prepare
353
  (
354
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
355
+ intval($fields_controls[$flag]->dynamicId)
356
  )
357
  );
358
  if($show_in_email == "0")
359
  {
360
  $option_values = htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value);
361
  ?>
362
+ <option value="<?php echo intval($fields_controls[$flag]->dynamicId);?>"><?php echo $option_values;?></option>
363
  <?php
364
  }
365
  }
390
  $wpdb->prepare
391
  (
392
  "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
393
+ intval($fields_controls[$flag]->dynamicId)
394
  )
395
  );
396
  if($show_in_email == "0")
397
  {
398
  $option_values = htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value);
399
  ?>
400
+ <option value="<?php echo intval($fields_controls[$flag]->dynamicId);?>"><?php echo $option_values;?></option>
401
  <?php
402
  }
403
  }
421
  </div>
422
  </form>
423
  <script type="text/javascript">
424
+ function base64_encode_contact_bank(data)
 
 
425
  {
426
  var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
427
  var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
449
  var r = data.length % 3;
450
  return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
451
  }
452
+
453
  jQuery("#ux_frm_add_email").validate
454
  ({
455
  rules:
512
  }
513
  jQuery.post(ajaxurl,
514
  {
515
+ data: base64_encode_contact_bank(jQuery(form).serialize()),
516
  email_id: email_id,
517
  form_id: form_id,
518
  param: "insert_email_controls",
528
  });
529
  }
530
  });
531
+
532
+ function show_send_to_div()
533
+ {
534
+ var ux_rdl_email = jQuery("#ux_rdl_email").prop("checked");
535
+ if(ux_rdl_email == true)
536
+ {
537
+ jQuery("#div_field").css("display","none");
538
+ jQuery("#div_email").css("display","block");
539
+ }
540
+ else
541
+ {
542
+ jQuery("#div_email").css("display","none");
543
+ jQuery("#div_field").css("display","block");
544
+ }
545
+ }
546
+
547
+ function append_control_shortcode(ddl_id,input_id)
548
+ {
549
+ var dynamicId = jQuery("#"+ddl_id).val();
550
+ var label = jQuery("#"+ddl_id+" option:selected").text();
551
+ if(dynamicId != "")
552
+ {
553
+ var selected_fields = jQuery("#"+input_id).val();
554
+ var fields_shortCodes = selected_fields +"[control_"+dynamicId+"]";
555
+ jQuery("#"+input_id).val(fields_shortCodes);
556
+ jQuery("#"+ddl_id).val("");
557
+ }
558
+ }
559
+
560
+ function append_add_control_shortcode(ddl_id)
561
+ {
562
+ var dynamicId = jQuery("#"+ddl_id).val();
563
+ var label = jQuery("#"+ddl_id+" option:selected").text();
564
+ if(dynamicId != "")
565
+ {
566
+ if (jQuery("#wp-uxEmailTemplate-wrap").hasClass("tmce-active"))
567
+ {
568
+ var selected_fields = tinyMCE.get("uxEmailTemplate").getContent();
569
+ var fields_shortCodes = "<strong>"+selected_fields+label +"</strong> : [control_"+dynamicId+"]<br />";
570
+ tinyMCE.get("uxEmailTemplate").setContent(fields_shortCodes);
571
+ }
572
+ else
573
+ {
574
+ var selected_fields = jQuery("#uxEmailTemplate").val();
575
+ var fields_shortCodes = selected_fields+label +" : [control_"+dynamicId+"]<br />";
576
+ jQuery("#uxEmailTemplate").val(fields_shortCodes);
577
+ }
578
+ jQuery("#"+ddl_id).val("");
579
+ }
580
+ }
581
+
 
 
 
 
 
582
  jQuery(document).ready(function()
583
  {
584
  show_send_to_div();
views/automatic-plugin-update.php DELETED
@@ -1,64 +0,0 @@
1
- <?php
2
- if(!defined("ABSPATH")) exit; //exit if accessed directly
3
- switch($cb_role)
4
- {
5
- case "administrator":
6
- $cb_user_role_permission = "manage_options";
7
- break;
8
- case "editor":
9
- $cb_user_role_permission = "publish_pages";
10
- break;
11
- case "author":
12
- $cb_user_role_permission = "publish_posts";
13
- break;
14
- }
15
- if (!current_user_can($cb_user_role_permission))
16
- {
17
- return;
18
- }
19
- else
20
- {
21
- ?>
22
- <form id="frm_auto_update" class="layout-form">
23
- <div id="poststuff" style="width: 99% !important;">
24
- <div id="post-body" class="metabox-holder">
25
- <div id="postbox-container-2" class="postbox-container">
26
- <div id="advanced" class="meta-box-sortables">
27
- <div id="contact_bank_get_started" class="postbox" >
28
- <h3 class="hndle"><span><?php _e("Plugin Updates", "contact-bank"); ?></span></h3>
29
- <div class="inside">
30
- <div id="ux_dashboard" class="contact_bank_layout">
31
- <div class="layout-control-group" style="margin: 10px 0 0 0 ;">
32
- <label class="layout-control-label"><?php _e("Plugin Updates", "contact-bank"); ?> :</label>
33
- <div class="layout-controls-radio">
34
- <?php $contact_updates = get_option("contact-bank-automatic_update");?>
35
- <input type="radio" name="ux_contact_update" id="ux_enable_update" onclick="contact_bank_autoupdate(this);" <?php echo $contact_updates == "1" ? "checked=\"checked\"" : "";?> value="1"><label style="vertical-align: baseline;"><?php _e("Enable", "contact-bank"); ?></label>
36
- <input type="radio" name="ux_contact_update" id="ux_disable_update" onclick="contact_bank_autoupdate(this);" <?php echo $contact_updates == "0" ? "checked=\"checked\"" : "";?> style="margin-left: 10px;" value="0"><label style="vertical-align: baseline;"><?php _e("Disable", "contact-bank"); ?></label>
37
- </div>
38
- </div>
39
- <div class="layout-control-group" style="margin:10px 0 10px 0 ;">
40
- <strong><i>This feature allows the plugin to update itself automatically when a new version is available on WordPress Repository.<br/>This allows to stay updated to the latest features. If you would like to disable automatic updates, choose the disable option above.</i></strong>
41
- </div>
42
- </div>
43
- </div>
44
- </div>
45
- </div>
46
- </div>
47
- </div>
48
- </div>
49
- </form>
50
- <script type="text/javascript">
51
- if (typeof(contact_bank_autoupdate) != "function")
52
- {
53
- function contact_bank_autoupdate(control)
54
- {
55
- var contact_updates = jQuery(control).val();
56
- jQuery.post(ajaxurl, "contact_updates="+contact_updates+"&param=contact_plugin_updates&action=add_contact_form_library", function(data)
57
- {
58
- });
59
- }
60
- }
61
- </script>
62
- <?php
63
- }
64
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/contact_bank_form_preview.php CHANGED
@@ -18,7 +18,7 @@ if (!current_user_can($cb_user_role_permission))
18
  }
19
  else
20
  {
21
- $form_id = isset($_REQUEST["form_id"]) ?intval($_REQUEST["form_id"]) : 0;
22
  $control_settings_array = array();
23
  $form_settings_array = array();
24
  $layout_settings_array = array();
@@ -45,13 +45,13 @@ else
45
  $wpdb->prepare
46
  (
47
  "SELECT * FROM " .contact_bank_dynamic_settings_form()." WHERE dynamicId = %d",
48
- $form_fields[$flag]->control_id
49
  )
50
  );
51
  for($flag1=0;$flag1<count($control_settings);$flag1++)
52
  {
53
- $column_dynamicId = $form_fields[$flag]->column_dynamicId;
54
- $control_settings_array[$column_dynamicId][$control_settings[$flag1]->dynamic_settings_key] = $control_settings[$flag1]->dynamic_settings_value;
55
  }
56
  }
57
 
@@ -65,7 +65,7 @@ else
65
  );
66
  for($flag2=0;$flag2<count($form_settings);$flag2++)
67
  {
68
- $form_settings_array[$form_id][$form_settings[$flag2]->form_message_key] = $form_settings[$flag2]->form_message_value;
69
  }
70
 
71
  $forms_layout_settings = $wpdb->get_results
@@ -78,7 +78,7 @@ else
78
  );
79
  for($flag3=0;$flag3<count($forms_layout_settings);$flag3++)
80
  {
81
- $layout_settings_array[$form_id][$forms_layout_settings[$flag3]->form_settings_key] = $forms_layout_settings[$flag3]->form_settings_value;
82
  }
83
 
84
  $forms_email_settings = $wpdb->get_row
@@ -105,29 +105,29 @@ else
105
  }
106
  .label_control
107
  {
108
- font-family: <?php echo $layout_settings_array[$form_id]["label_setting_font_family"]; ?> !important;
109
- color: <?php echo $layout_settings_array[$form_id]["label_setting_font_color"]; ?> !important;
110
  <?php
111
- if($layout_settings_array[$form_id]["label_setting_font_style"] == "italic")
112
  {
113
  ?>
114
- font-style: <?php echo $layout_settings_array[$form_id]["label_setting_font_style"]; ?> !important;
115
  <?php
116
  }
117
  else
118
  {
119
  ?>
120
- font-weight: <?php echo $layout_settings_array[$form_id]["label_setting_font_style"]; ?> !important;
121
  <?php
122
  }
123
- if($layout_settings_array[$form_id]["label_setting_label_position"] == "top")
124
  {
125
  ?>
126
  float: none !important;
127
  text-align: <?php echo $layout_settings_array[$form_id]["label_setting_font_align_left"] == "0" ? "left" : "right"; ?> !important;
128
  <?php
129
  }
130
- else if($layout_settings_array[$form_id]["label_setting_label_position"] == "right")
131
  {
132
  ?>
133
  text-align: right !important;
@@ -136,47 +136,47 @@ else
136
  else
137
  {
138
  ?>
139
- text-align: <?php echo $layout_settings_array[$form_id]["label_setting_font_align_left"] == "0" ? "left" : "right"; ?> !important;
140
  <?php
141
  }
142
  ?>
143
- font-size: <?php echo $layout_settings_array[$form_id]["label_setting_font_size"] . "px"; ?> !important;
144
- display: <?php echo $layout_settings_array[$form_id]["label_setting_hide_label"] == "0" ? "inline-block" : "none"; ?> !important;
145
- direction: <?php echo $layout_settings_array[$form_id]["label_setting_text_direction"]; ?> !important;
146
  }
147
  .input_control
148
  {
149
- font-family: <?php echo $layout_settings_array[$form_id]["input_field_font_family"]; ?> !important;
150
- color: <?php echo $layout_settings_array[$form_id]["input_field_font_color"]; ?> !important;
151
  <?php
152
- if($layout_settings_array[$form_id]["input_field_font_style"] == "italic")
153
  {
154
  ?>
155
- font-style: <?php echo $layout_settings_array[$form_id]["input_field_font_style"]; ?> !important;
156
  <?php
157
  }
158
  else
159
  {
160
  ?>
161
- font-weight: <?php echo $layout_settings_array[$form_id]["input_field_font_style"]; ?> !important;
162
  <?php
163
  }
164
  ?>
165
- background-color: <?php echo $layout_settings_array[$form_id]["input_field_clr_bg_color"]; ?> !important;
166
- font-size: <?php echo $layout_settings_array[$form_id]["input_field_font_size"] . "px"; ?> !important;
167
- border: <?php echo $layout_settings_array[$form_id]["input_field_border_size"] . "px ".$layout_settings_array[$form_id]["input_field_border_style"].$layout_settings_array[$form_id]["input_field_border_color"]; ?> !important;
168
- border-radius: <?php echo $layout_settings_array[$form_id]["input_field_border_radius"] . "px"; ?> !important;
169
- -moz-border-radius: <?php echo $layout_settings_array[$form_id]["input_field_border_radius"] . "px"; ?> !important;
170
- -webkit-border-radius: <?php echo $layout_settings_array[$form_id]["input_field_border_radius"] . "px"; ?> !important;
171
- -khtml-border-radius: <?php echo $layout_settings_array[$form_id]["input_field_border_radius"] . "px"; ?> !important;
172
- -o-border-radius: <?php echo $layout_settings_array[$form_id]["input_field_border_radius"] . "px"; ?> !important;
173
- text-align: <?php echo $layout_settings_array[$form_id]["input_field_rdl_text_align"] == "0" ? "left" : "right"; ?> !important;
174
- direction: <?php echo $layout_settings_array[$form_id]["input_field_text_direction"]; ?> !important;
175
  }
176
  .layout_according_label_position
177
  {
178
  <?php
179
- if($layout_settings_array[$form_id]["label_setting_label_position"] == "top")
180
  {
181
  ?>
182
  margin-left: 0px !important;
@@ -186,92 +186,92 @@ else
186
  }
187
  .field_description
188
  {
189
- font-family: <?php echo $layout_settings_array[$form_id]["label_setting_font_family"]; ?> !important;
190
  font-style: italic !important;
191
- color: <?php echo $layout_settings_array[$form_id]["label_setting_font_color"]; ?> !important;
192
  <?php
193
- if($layout_settings_array[$form_id]["label_setting_font_style"] == "italic")
194
  {
195
  ?>
196
- font-style: <?php echo $layout_settings_array[$form_id]["label_setting_font_style"]; ?> !important;
197
  <?php
198
  }
199
  else
200
  {
201
  ?>
202
- font-weight: <?php echo $layout_settings_array[$form_id]["label_setting_font_style"]; ?> !important;
203
  <?php
204
  }
205
  ?>
206
- font-size: <?php echo $layout_settings_array[$form_id]["label_setting_field_size"] . "px"; ?> !important;
207
- text-align: <?php echo $layout_settings_array[$form_id]["label_setting_field_align"]; ?> !important;
208
  }
209
  .btn_submit
210
  {
211
  <?php
212
- if($layout_settings_array[$form_id]["submit_button_font_style"] == "italic")
213
  {
214
  ?>
215
- font-style: <?php echo $layout_settings_array[$form_id]["submit_button_font_style"]; ?> !important;
216
  <?php
217
  }
218
  else
219
  {
220
  ?>
221
- font-weight: <?php echo $layout_settings_array[$form_id]["submit_button_font_style"]; ?> !important;
222
  <?php
223
  }
224
  ?>
225
- font-family: <?php echo $layout_settings_array[$form_id]["submit_button_font_family"]; ?> !important;
226
- font-size: <?php echo $layout_settings_array[$form_id]["submit_button_font_size"] . "px"; ?> !important;
227
- width: <?php echo $layout_settings_array[$form_id]["submit_button_button_width"] . "px"; ?> !important;
228
- background-color: <?php echo $layout_settings_array[$form_id]["submit_button_bg_color"]; ?> !important;
229
- color: <?php echo $layout_settings_array[$form_id]["submit_button_text_color"]; ?> !important;
230
- border: <?php echo $layout_settings_array[$form_id]["submit_button_border_size"] . "px Solid".$layout_settings_array[$form_id]["submit_button_border_color"]; ?> !important;
231
- border-radius: <?php echo $layout_settings_array[$form_id]["submit_button_border_radius"] . "px"; ?> !important;
232
- -moz-border-radius: <?php echo $layout_settings_array[$form_id]["submit_button_border_radius"] . "px"; ?> !important;
233
- -webkit-border-radius: <?php echo $layout_settings_array[$form_id]["submit_button_border_radius"] . "px"; ?> !important;
234
- -khtml-border-radius: <?php echo $layout_settings_array[$form_id]["submit_button_border_radius"] . "px"; ?> !important;
235
- -o-border-radius: <?php echo $layout_settings_array[$form_id]["submit_button_border_radius"] . "px"; ?> !important;
236
- text-align: <?php echo $layout_settings_array[$form_id]["submit_button_rdl_text_align"] == "0" ? "left" : "right"; ?> !important;
237
- direction: <?php echo $layout_settings_array[$form_id]["submit_button_text_direction"]; ?> !important;
238
  }
239
  .btn_submit:hover
240
  {
241
- background-color: <?php echo $layout_settings_array[$form_id]["submit_button_hover_bg_color"]; ?> !important;
242
  }
243
  .success_message
244
  {
245
 
246
- background-color: <?php echo $layout_settings_array[$form_id]["success_msg_bg_color"]; ?> !important;
247
- border: <?php echo "2px Solid ".$layout_settings_array[$form_id]["success_msg_border_color"]; ?> !important;
248
- color: <?php echo $layout_settings_array[$form_id]["success_msg_text_color"]; ?> !important;
249
- text-align: <?php echo $layout_settings_array[$form_id]["success_msg_rdl_text_align"] == "0" ? "left" : "right"; ?> !important;
250
- direction: <?php echo $layout_settings_array[$form_id]["success_msg_text_direction"]; ?> !important;
251
  background: url(<?php echo plugins_url("/assets/images/icons/icon-succes.png" , dirname(__FILE__)); ?>) no-repeat 1px 8px #EBF9E2;
252
  }
253
  .sucess_message_text
254
  {
255
- font-family: <?php echo $layout_settings_array[$form_id]["success_msg_font_family"]; ?> !important;
256
- font-size: <?php echo $layout_settings_array[$form_id]["success_msg_font_size"] . "px"; ?> !important;
257
  }
258
  label.error_field
259
  {
260
- font-family: <?php echo $layout_settings_array[$form_id]["error_msg_font_family"]; ?> !important;
261
- font-size: <?php echo $layout_settings_array[$form_id]["error_msg_font_size"] . "px"; ?> !important;
262
- background-color: <?php echo $layout_settings_array[$form_id]["error_msg_bg_color"]; ?> !important;
263
- border: <?php echo "2px Solid ".$layout_settings_array[$form_id]["error_msg_border_color"]; ?> !important;
264
- color: <?php echo $layout_settings_array[$form_id]["error_msg_text_color"]; ?> !important;
265
- text-align: <?php echo $layout_settings_array[$form_id]["error_msg_rdl_text_align"] == "0" ? "left" : "right"; ?> !important;
266
- direction: <?php echo $layout_settings_array[$form_id]["error_msg_text_direction"]; ?> !important;
267
  <?php
268
- if($layout_settings_array[$form_id]["label_setting_label_position"] == "left")
269
  {
270
  ?>
271
  margin-left: 10px;
272
  <?php
273
  }
274
- else if($layout_settings_array[$form_id]["label_setting_label_position"] == "right")
275
  {
276
  ?>
277
  margin-right: 10px;
@@ -295,7 +295,7 @@ else
295
  <div class="separator-doubled"></div>
296
  <div id="form_success_message_frontend" class="custom-message success_message" style="display: none;margin-bottom: 10px;">
297
  <span class="sucess_message_text" >
298
- <strong><?php echo $form_settings_array[$form_id]["success_message"]; ?></strong>
299
  </span>
300
  </div>
301
  <div class="fluid-layout">
@@ -305,7 +305,7 @@ else
305
  <h4><?php echo $form_name ;?></h4>
306
  </div>
307
  <div style="margin-left: 15px;" class="layout-control-group">
308
- <span class="<?php echo $layout_settings_array[$form_id]["input_field_input_size"]; ?>"><?php echo $form_settings_array[$form_id]["form_description"]; ?></span>
309
  </div>
310
  <?php
311
  for($flag=0;$flag<count($form_fields);$flag++)
@@ -315,8 +315,8 @@ else
315
  <div class="layout-control-group">
316
  <label class="label_control layout-control-label">
317
  <?php
318
- echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_label_value"] . " :";
319
- if($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_control_required"] == "1")
320
  {
321
  ?>
322
  <span class="error">*</span>
@@ -325,58 +325,43 @@ else
325
  ?>
326
  </label>
327
  <?php
328
- switch($form_fields[$flag]->field_id)
329
  {
330
 
331
  case 1:
332
  ?>
333
  <div class="layout-controls layout_according_label_position">
334
- <input class="hovertip input_control <?php echo $layout_settings_array[$form_id]["input_field_input_size"]; ?>"
335
- type="text" id="ux_txt_control_<?php echo $form_fields[$flag]->column_dynamicId; ?>"
336
- name="ux_txt_control_<?php echo $form_fields[$flag]->column_dynamicId; ?>"
337
- data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"
338
- placeholder="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"];?>"
339
- data-alpha="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_alpha_filter"];?>"
340
- data-alpha_num="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_ux_checkbox_alpha_num_filter"];?>"
341
- data-digit="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_digit_filter"];?>"
342
- data-strip="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_strip_tag_filter"];?>"
343
- data-trim="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_trim_filter"];?>"
344
-
345
  onfocus="prevent_paste(this.id);"/>
346
  <br/>
347
- <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
348
  </div>
349
  <?php
350
  break;
351
  case 2:
352
  ?>
353
  <div class="layout-controls layout_according_label_position">
354
- <textarea class="hovertip input_control <?php echo $layout_settings_array[$form_id]["input_field_input_size"]; ?>" id="ux_textarea_control_<?php echo $form_fields[$flag]->column_dynamicId; ?>"
355
- placeholder="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"];?>" name="ux_textarea_control_<?php echo $form_fields[$flag]->column_dynamicId; ?>"
356
- onfocus="prevent_paste(this.id);"
357
- data-alpha="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_alpha_filter"];?>"
358
- data-alpha_num="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_ux_checkbox_alpha_num_filter"];?>"
359
- data-digit="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_digit_filter"];?>"
360
- data-strip="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_strip_tag_filter"];?>"
361
- data-trim="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_trim_filter"];?>"
362
-
363
- data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"></textarea>
364
  <br/>
365
- <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
366
  </div>
367
  <?php
368
  break;
369
  case 3:
370
  ?>
371
  <div class="layout-controls layout_according_label_position">
372
- <input class="hovertip input_control <?php echo $layout_settings_array[$form_id]["input_field_input_size"]; ?>"
373
- type="text" id="ux_txt_email_<?php echo $form_fields[$flag]->column_dynamicId; ?>"
374
- name="ux_txt_email_<?php echo $form_fields[$flag]->column_dynamicId; ?>"
375
- data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"
376
- placeholder="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"];?>"
377
  onfocus="prevent_paste(this.id);"/>
378
  <br/>
379
- <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
380
  </div>
381
  <?php
382
  break;
@@ -386,9 +371,9 @@ else
386
  ?>
387
 
388
  <div class="layout-controls layout_according_label_position">
389
- <select class="hovertip input_control <?php echo $layout_settings_array[$form_id]["input_field_input_size"]; ?>" type="select" id="ux_select_default_<?php echo $form_fields[$flag]->column_dynamicId; ?>"
390
- data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"
391
- name="ux_select_default_<?php echo $form_fields[$flag]->column_dynamicId; ?>">
392
  <option value=""><?php _e("Select Option", "contact-bank"); ?></option>
393
  <?php
394
  foreach($ddl_ids as $key => $value )
@@ -415,8 +400,8 @@ else
415
  ?>
416
 
417
  <input type="checkbox" class="hovertip" id="ux_chk_control_<?php echo $value; ?>"
418
- data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"
419
- name="<?php echo $form_fields[$flag]->column_dynamicId; ?>_chk[]"
420
  value ="<?php echo $chk_values[$key]; ?>" />
421
  <label style="margin:0px;vertical-align: middle;" id="chk_id_<?php echo $value; ?>">
422
  <?php echo $chk_values[$key]; ?>
@@ -447,12 +432,12 @@ else
447
  <?php
448
  foreach($rdl_ids as $key => $value )
449
  {
450
- if($layout_settings_array[$form_id]["input_field_rdl_multiple_row"] == "0")
451
  {
452
  ?>
453
  <input type="radio" class="hovertip" id="ux_rdl_control_<?php echo $value; ?>"
454
- name="<?php echo $form_fields[$flag]->column_dynamicId; ?>_rdl"
455
- data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"
456
  value ="<?php echo $rdl_values[$key]; ?>" />
457
  <label style="margin:0px;vertical-align: middle;" id="rdl_id_<?php echo $value; ?>">
458
  <?php echo $rdl_values[$key]; ?>
@@ -464,8 +449,8 @@ else
464
  ?>
465
 
466
  <input type="radio" class="hovertip" id="ux_rdl_control_<?php echo $value; ?>"
467
- name="<?php echo $form_fields[$flag]->column_dynamicId; ?>_rdl"
468
- data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"
469
  value ="<?php echo $rdl_values[$key]; ?>" />
470
  <label style="margin:0px;vertical-align: middle;" id="rdl_id_<?php echo $value; ?>">
471
  <?php echo $rdl_values[$key]; ?>
@@ -510,16 +495,13 @@ else
510
  </div>
511
 
512
  <script type="text/javascript">
513
- if (typeof(base64_encode) != "function")
514
- {
515
- function prevent_paste(control_id)
516
- {
517
- jQuery("#"+control_id).live("paste",function(e)
518
- {
519
- e.preventDefault();
520
- });
521
- }
522
- }
523
  </script>
524
  <?php
525
  }
18
  }
19
  else
20
  {
21
+ $form_id = isset($_REQUEST["form_id"]) ? intval($_REQUEST["form_id"]) : 0;
22
  $control_settings_array = array();
23
  $form_settings_array = array();
24
  $layout_settings_array = array();
45
  $wpdb->prepare
46
  (
47
  "SELECT * FROM " .contact_bank_dynamic_settings_form()." WHERE dynamicId = %d",
48
+ intval($form_fields[$flag]->control_id)
49
  )
50
  );
51
  for($flag1=0;$flag1<count($control_settings);$flag1++)
52
  {
53
+ $column_dynamicId = intval($form_fields[$flag]->column_dynamicId);
54
+ $control_settings_array[$column_dynamicId][$control_settings[$flag1]->dynamic_settings_key] = stripcslashes($control_settings[$flag1]->dynamic_settings_value);
55
  }
56
  }
57
 
65
  );
66
  for($flag2=0;$flag2<count($form_settings);$flag2++)
67
  {
68
+ $form_settings_array[$form_id][$form_settings[$flag2]->form_message_key] = esc_html($form_settings[$flag2]->form_message_value);
69
  }
70
 
71
  $forms_layout_settings = $wpdb->get_results
78
  );
79
  for($flag3=0;$flag3<count($forms_layout_settings);$flag3++)
80
  {
81
+ $layout_settings_array[$form_id][$forms_layout_settings[$flag3]->form_settings_key] = esc_html($forms_layout_settings[$flag3]->form_settings_value);
82
  }
83
 
84
  $forms_email_settings = $wpdb->get_row
105
  }
106
  .label_control
107
  {
108
+ font-family: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_family"]); ?> !important;
109
+ color: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_color"]); ?> !important;
110
  <?php
111
+ if(esc_attr($layout_settings_array[$form_id]["label_setting_font_style"]) == "italic")
112
  {
113
  ?>
114
+ font-style: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_style"]); ?> !important;
115
  <?php
116
  }
117
  else
118
  {
119
  ?>
120
+ font-weight: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_style"]); ?> !important;
121
  <?php
122
  }
123
+ if(esc_attr($layout_settings_array[$form_id]["label_setting_label_position"]) == "top")
124
  {
125
  ?>
126
  float: none !important;
127
  text-align: <?php echo $layout_settings_array[$form_id]["label_setting_font_align_left"] == "0" ? "left" : "right"; ?> !important;
128
  <?php
129
  }
130
+ else if(esc_attr($layout_settings_array[$form_id]["label_setting_label_position"]) == "right")
131
  {
132
  ?>
133
  text-align: right !important;
136
  else
137
  {
138
  ?>
139
+ text-align: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_align_left"]) == "0" ? "left" : "right"; ?> !important;
140
  <?php
141
  }
142
  ?>
143
+ font-size: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_size"]) . "px"; ?> !important;
144
+ display: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_hide_label"]) == "0" ? "inline-block" : "none"; ?> !important;
145
+ direction: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_text_direction"]); ?> !important;
146
  }
147
  .input_control
148
  {
149
+ font-family: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_font_family"]); ?> !important;
150
+ color: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_font_color"]); ?> !important;
151
  <?php
152
+ if(esc_attr($layout_settings_array[$form_id]["input_field_font_style"]) == "italic")
153
  {
154
  ?>
155
+ font-style: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_font_style"]); ?> !important;
156
  <?php
157
  }
158
  else
159
  {
160
  ?>
161
+ font-weight: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_font_style"]); ?> !important;
162
  <?php
163
  }
164
  ?>
165
+ background-color: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_clr_bg_color"]); ?> !important;
166
+ font-size: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_font_size"]) . "px"; ?> !important;
167
+ border: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_border_size"]) . "px ".esc_attr($layout_settings_array[$form_id]["input_field_border_style"]).esc_attr($layout_settings_array[$form_id]["input_field_border_color"]); ?> !important;
168
+ border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_border_radius"]) . "px"; ?> !important;
169
+ -moz-border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_border_radius"]) . "px"; ?> !important;
170
+ -webkit-border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_border_radius"]) . "px"; ?> !important;
171
+ -khtml-border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_border_radius"]) . "px"; ?> !important;
172
+ -o-border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_border_radius"]) . "px"; ?> !important;
173
+ text-align: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_rdl_text_align"]) == "0" ? "left" : "right"; ?> !important;
174
+ direction: <?php echo esc_attr($layout_settings_array[$form_id]["input_field_text_direction"]); ?> !important;
175
  }
176
  .layout_according_label_position
177
  {
178
  <?php
179
+ if(esc_attr($layout_settings_array[$form_id]["label_setting_label_position"]) == "top")
180
  {
181
  ?>
182
  margin-left: 0px !important;
186
  }
187
  .field_description
188
  {
189
+ font-family: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_family"]); ?> !important;
190
  font-style: italic !important;
191
+ color: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_color"]); ?> !important;
192
  <?php
193
+ if(esc_attr($layout_settings_array[$form_id]["label_setting_font_style"]) == "italic")
194
  {
195
  ?>
196
+ font-style: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_style"]); ?> !important;
197
  <?php
198
  }
199
  else
200
  {
201
  ?>
202
+ font-weight: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_font_style"]); ?> !important;
203
  <?php
204
  }
205
  ?>
206
+ font-size: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_field_size"]) . "px"; ?> !important;
207
+ text-align: <?php echo esc_attr($layout_settings_array[$form_id]["label_setting_field_align"]); ?> !important;
208
  }
209
  .btn_submit
210
  {
211
  <?php
212
+ if(esc_attr($layout_settings_array[$form_id]["submit_button_font_style"]) == "italic")
213
  {
214
  ?>
215
+ font-style: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_font_style"]); ?> !important;
216
  <?php
217
  }
218
  else
219
  {
220
  ?>
221
+ font-weight: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_font_style"]); ?> !important;
222
  <?php
223
  }
224
  ?>
225
+ font-family: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_font_family"]); ?> !important;
226
+ font-size: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_font_size"]) . "px"; ?> !important;
227
+ width: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_button_width"]) . "px"; ?> !important;
228
+ background-color: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_bg_color"]); ?> !important;
229
+ color: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_text_color"]); ?> !important;
230
+ border: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_border_size"]) . "px Solid".esc_attr($layout_settings_array[$form_id]["submit_button_border_color"]); ?> !important;
231
+ border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_border_radius"]) . "px"; ?> !important;
232
+ -moz-border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_border_radius"]) . "px"; ?> !important;
233
+ -webkit-border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_border_radius"]) . "px"; ?> !important;
234
+ -khtml-border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_border_radius"]) . "px"; ?> !important;
235
+ -o-border-radius: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_border_radius"]) . "px"; ?> !important;
236
+ text-align: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_rdl_text_align"]) == "0" ? "left" : "right"; ?> !important;
237
+ direction: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_text_direction"]); ?> !important;
238
  }
239
  .btn_submit:hover
240
  {
241
+ background-color: <?php echo esc_attr($layout_settings_array[$form_id]["submit_button_hover_bg_color"]); ?> !important;
242
  }
243
  .success_message
244
  {
245
 
246
+ background-color: <?php echo esc_attr($layout_settings_array[$form_id]["success_msg_bg_color"]); ?> !important;
247
+ border: <?php echo "2px Solid ".esc_attr($layout_settings_array[$form_id]["success_msg_border_color"]); ?> !important;
248
+ color: <?php echo esc_attr($layout_settings_array[$form_id]["success_msg_text_color"]); ?> !important;
249
+ text-align: <?php echo esc_attr($layout_settings_array[$form_id]["success_msg_rdl_text_align"]) == "0" ? "left" : "right"; ?> !important;
250
+ direction: <?php echo esc_attr($layout_settings_array[$form_id]["success_msg_text_direction"]); ?> !important;
251
  background: url(<?php echo plugins_url("/assets/images/icons/icon-succes.png" , dirname(__FILE__)); ?>) no-repeat 1px 8px #EBF9E2;
252
  }
253
  .sucess_message_text
254
  {
255
+ font-family: <?php echo esc_attr($layout_settings_array[$form_id]["success_msg_font_family"]); ?> !important;
256
+ font-size: <?php echo esc_attr($layout_settings_array[$form_id]["success_msg_font_size"]) . "px"; ?> !important;
257
  }
258
  label.error_field
259
  {
260
+ font-family: <?php echo esc_attr($layout_settings_array[$form_id]["error_msg_font_family"]); ?> !important;
261
+ font-size: <?php echo esc_attr($layout_settings_array[$form_id]["error_msg_font_size"]) . "px"; ?> !important;
262
+ background-color: <?php echo esc_attr($layout_settings_array[$form_id]["error_msg_bg_color"]); ?> !important;
263
+ border: <?php echo "2px Solid ".esc_attr($layout_settings_array[$form_id]["error_msg_border_color"]); ?> !important;
264
+ color: <?php echo esc_attr($layout_settings_array[$form_id]["error_msg_text_color"]); ?> !important;
265
+ text-align: <?php echo esc_attr($layout_settings_array[$form_id]["error_msg_rdl_text_align"]) == "0" ? "left" : "right"; ?> !important;
266
+ direction: <?php echo esc_attr($layout_settings_array[$form_id]["error_msg_text_direction"]); ?> !important;
267
  <?php
268
+ if(esc_attr($layout_settings_array[$form_id]["label_setting_label_position"]) == "left")
269
  {
270
  ?>
271
  margin-left: 10px;
272
  <?php
273
  }
274
+ else if(esc_attr($layout_settings_array[$form_id]["label_setting_label_position"]) == "right")
275
  {
276
  ?>
277
  margin-right: 10px;
295
  <div class="separator-doubled"></div>
296
  <div id="form_success_message_frontend" class="custom-message success_message" style="display: none;margin-bottom: 10px;">
297
  <span class="sucess_message_text" >
298
+ <strong><?php echo esc_attr($form_settings_array[$form_id]["success_message"]); ?></strong>
299
  </span>
300
  </div>
301
  <div class="fluid-layout">
305
  <h4><?php echo $form_name ;?></h4>
306
  </div>
307
  <div style="margin-left: 15px;" class="layout-control-group">
308
+ <span class="<?php echo esc_attr($layout_settings_array[$form_id]["input_field_input_size"]); ?>"><?php echo esc_html($form_settings_array[$form_id]["form_description"]); ?></span>
309
  </div>
310
  <?php
311
  for($flag=0;$flag<count($form_fields);$flag++)
315
  <div class="layout-control-group">
316
  <label class="label_control layout-control-label">
317
  <?php
318
+ echo esc_attr($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_label_value"]) . " :";
319
+ if(esc_attr($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_control_required"]) == "1")
320
  {
321
  ?>
322
  <span class="error">*</span>
325
  ?>
326
  </label>
327
  <?php
328
+ switch(intval($form_fields[$flag]->field_id))
329
  {
330
 
331
  case 1:
332
  ?>
333
  <div class="layout-controls layout_according_label_position">
334
+ <input class="hovertip input_control <?php echo esc_attr($layout_settings_array[$form_id]["input_field_input_size"]); ?>"
335
+ type="text" id="ux_txt_control_<?php echo intval($form_fields[$flag]->column_dynamicId); ?>"
336
+ name="ux_txt_control_<?php echo intval($form_fields[$flag]->column_dynamicId); ?>"
337
+ placeholder="<?php echo esc_attr($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"]);?>"
 
 
 
 
 
 
 
338
  onfocus="prevent_paste(this.id);"/>
339
  <br/>
340
+ <span class="field_description" id="txt_description_"><?php echo esc_html($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]); ?></span>
341
  </div>
342
  <?php
343
  break;
344
  case 2:
345
  ?>
346
  <div class="layout-controls layout_according_label_position">
347
+ <textarea class="hovertip input_control <?php echo esc_attr($layout_settings_array[$form_id]["input_field_input_size"]); ?>" id="ux_textarea_control_<?php echo intval($form_fields[$flag]->column_dynamicId); ?>"
348
+ placeholder="<?php echo esc_html($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"]);?>" name="ux_textarea_control_<?php echo intval($form_fields[$flag]->column_dynamicId); ?>"
349
+ onfocus="prevent_paste(this.id);"></textarea>
 
 
 
 
 
 
 
350
  <br/>
351
+ <span class="field_description" id="txt_description_"><?php echo esc_html($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]); ?></span>
352
  </div>
353
  <?php
354
  break;
355
  case 3:
356
  ?>
357
  <div class="layout-controls layout_according_label_position">
358
+ <input class="hovertip input_control <?php echo esc_attr($layout_settings_array[$form_id]["input_field_input_size"]); ?>"
359
+ type="text" id="ux_txt_email_<?php echo intval($form_fields[$flag]->column_dynamicId); ?>"
360
+ name="ux_txt_email_<?php echo intval($form_fields[$flag]->column_dynamicId); ?>"
361
+ placeholder="<?php echo esc_attr($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"]);?>"
 
362
  onfocus="prevent_paste(this.id);"/>
363
  <br/>
364
+ <span class="field_description" id="txt_description_"><?php echo esc_html($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]); ?></span>
365
  </div>
366
  <?php
367
  break;
371
  ?>
372
 
373
  <div class="layout-controls layout_according_label_position">
374
+ <select class="hovertip input_control <?php echo esc_attr($layout_settings_array[$form_id]["input_field_input_size"]); ?>" type="select" id="ux_select_default_<?php echo intval($form_fields[$flag]->column_dynamicId); ?>"
375
+
376
+ name="ux_select_default_<?php echo intval($form_fields[$flag]->column_dynamicId); ?>">
377
  <option value=""><?php _e("Select Option", "contact-bank"); ?></option>
378
  <?php
379
  foreach($ddl_ids as $key => $value )
400
  ?>
401
 
402
  <input type="checkbox" class="hovertip" id="ux_chk_control_<?php echo $value; ?>"
403
+
404
+ name="<?php echo intval($form_fields[$flag]->column_dynamicId); ?>_chk[]"
405
  value ="<?php echo $chk_values[$key]; ?>" />
406
  <label style="margin:0px;vertical-align: middle;" id="chk_id_<?php echo $value; ?>">
407
  <?php echo $chk_values[$key]; ?>
432
  <?php
433
  foreach($rdl_ids as $key => $value )
434
  {
435
+ if(esc_attr($layout_settings_array[$form_id]["input_field_rdl_multiple_row"]) == "0")
436
  {
437
  ?>
438
  <input type="radio" class="hovertip" id="ux_rdl_control_<?php echo $value; ?>"
439
+ name="<?php echo intval($form_fields[$flag]->column_dynamicId); ?>_rdl"
440
+
441
  value ="<?php echo $rdl_values[$key]; ?>" />
442
  <label style="margin:0px;vertical-align: middle;" id="rdl_id_<?php echo $value; ?>">
443
  <?php echo $rdl_values[$key]; ?>
449
  ?>
450
 
451
  <input type="radio" class="hovertip" id="ux_rdl_control_<?php echo $value; ?>"
452
+ name="<?php echo intval($form_fields[$flag]->column_dynamicId); ?>_rdl"
453
+
454
  value ="<?php echo $rdl_values[$key]; ?>" />
455
  <label style="margin:0px;vertical-align: middle;" id="rdl_id_<?php echo $value; ?>">
456
  <?php echo $rdl_values[$key]; ?>
495
  </div>
496
 
497
  <script type="text/javascript">
498
+ function prevent_paste(control_id)
499
+ {
500
+ jQuery("#"+control_id).live("paste",function(e)
501
+ {
502
+ e.preventDefault();
503
+ });
504
+ }
 
 
 
505
  </script>
506
  <?php
507
  }
views/contact_bank_layout_settings.php CHANGED
@@ -59,13 +59,13 @@ else
59
  if(isset($_REQUEST["form_id"]) && intval($_REQUEST["form_id"]) == $forms[$flag]->form_id)
60
  {
61
  ?>
62
- <option value="<?php echo $forms[$flag]->form_id ;?>" selected="selected"><?php echo $forms[$flag]->form_name ;?></option>
63
  <?php
64
  }
65
  else
66
  {
67
  ?>
68
- <option value="<?php echo $forms[$flag]->form_id ;?>"><?php echo $forms[$flag]->form_name ;?></option>
69
  <?php
70
  }
71
  }
@@ -940,125 +940,96 @@ else
940
  </div>
941
  </form>
942
  <script type="text/javascript">
943
- if (typeof(ux_button_pro_version) != "function")
 
944
  {
945
- function ux_button_pro_version()
946
- {
947
- alert("<?php _e( "These Features are only available in Premium Editions!", "contact-bank" ); ?>");
948
- }
949
  }
950
- if (typeof(ux_clr_font_color_label_setting) != "function")
 
951
  {
952
- function ux_clr_font_color_label_setting()
953
- {
954
- jQuery("#clr_font_color").farbtastic("#ux_clr_font_color").slideDown();
955
- jQuery("#ux_clr_font_color").focus();
956
- }
957
  }
958
- if (typeof(ux_clr_font_color_input_settings) != "function")
 
959
  {
960
- function ux_clr_font_color_input_settings()
961
- {
962
- jQuery("#clr_text_color").farbtastic("#ux_clr_text_color_input_field").slideDown();
963
- jQuery("#ux_clr_text_color_input_field").focus();
964
- }
965
  }
966
- if (typeof(ux_clr_border_color_input_settings) != "function")
 
967
  {
968
- function ux_clr_border_color_input_settings()
969
- {
970
- jQuery("#clr_border_color").farbtastic("#ux_clr_border_color_input_field").slideDown();
971
- jQuery("#ux_clr_border_color_input_field").focus();
972
- }
973
  }
974
- if (typeof(ux_clr_BG_color_input_settings) != "function")
 
975
  {
976
- function ux_clr_BG_color_input_settings()
977
- {
978
- jQuery("#clr_bg_color").farbtastic("#ux_clr_bg_color_input_field").slideDown();
979
- jQuery("#ux_clr_bg_color_input_field").focus();
980
- }
981
  }
982
- if (typeof(ux_clr_BG_color_submit_btn_settings) != "function")
 
983
  {
984
- function ux_clr_BG_color_submit_btn_settings()
985
- {
986
- jQuery("#clr_bg_color_submit_button").farbtastic("#ux_clr_bg_color_submit_button").slideDown();
987
- jQuery("#ux_clr_bg_color_submit_button").focus();
988
- }
989
  }
990
- if (typeof(ux_clr_hover_BG_color_submit_btn_settings) != "function")
 
991
  {
992
- function ux_clr_hover_BG_color_submit_btn_settings()
993
- {
994
- jQuery("#clr_hover_bg_color_submit_button").farbtastic("#ux_clr_hover_bg_color_submit_button").slideDown();
995
- jQuery("#ux_clr_hover_bg_color_submit_button").focus();
996
- }
997
  }
998
- if (typeof(ux_clr_text_color_submit_btn_settings) != "function")
 
999
  {
1000
- function ux_clr_text_color_submit_btn_settings()
1001
- {
1002
- jQuery("#clr_text_color_submit_button").farbtastic("#ux_clr_text_color_submit_button").slideDown();
1003
- jQuery("#ux_clr_text_color_submit_button").focus();
1004
- }
1005
  }
1006
- if (typeof(ux_clr_hover_border_color_submit_btn_settings) != "function")
 
1007
  {
1008
- function ux_clr_hover_border_color_submit_btn_settings()
1009
- {
1010
- jQuery("#clr_border_color_submit_button").farbtastic("#ux_clr_border_color_submit_button").slideDown();
1011
- jQuery("#ux_clr_border_color_submit_button").focus();
1012
- }
1013
  }
1014
- if (typeof(ux_clr_bg_color_sucess_msg_settings) != "function")
 
1015
  {
1016
- function ux_clr_bg_color_sucess_msg_settings()
1017
- {
1018
- jQuery("#clr_bg_color_success_msg").farbtastic("#ux_clr_bg_color_success_msg").slideDown();
1019
- jQuery("#ux_clr_bg_color_success_msg").focus();
1020
- }
1021
  }
1022
- if (typeof(ux_clr_border_color_sucess_msg_settings) != "function")
 
1023
  {
1024
- function ux_clr_border_color_sucess_msg_settings()
1025
- {
1026
- jQuery("#clr_border_color_success_msg").farbtastic("#ux_clr_border_color_success_msg").slideDown();
1027
- jQuery("#ux_clr_border_color_success_msg").focus();
1028
- }
1029
  }
1030
- if (typeof(ux_clr_text_color_sucess_msg_settings) != "function")
 
1031
  {
1032
- function ux_clr_text_color_sucess_msg_settings()
1033
- {
1034
- jQuery("#clr_text_color_success_msg").farbtastic("#ux_clr_text_color_success_msg").slideDown();
1035
- jQuery("#ux_clr_text_color_success_msg").focus();
1036
- }
1037
  }
1038
- if (typeof(ux_clr_BG_color_error_msg_settings) != "function")
 
1039
  {
1040
- function ux_clr_BG_color_error_msg_settings()
1041
- {
1042
- jQuery("#clr_bg_color_error_msg").farbtastic("#ux_clr_bg_color_error_msg").slideDown();
1043
- jQuery("#ux_clr_bg_color_error_msg").focus();
1044
- }
1045
  }
1046
- if (typeof(ux_clr_border_color_error_msg_settings) != "function")
 
1047
  {
1048
- function ux_clr_border_color_error_msg_settings()
1049
- {
1050
- jQuery("#clr_border_color_error_msg").farbtastic("#ux_clr_border_color_error_msg").slideDown();
1051
- jQuery("#ux_clr_border_color_error_msg").focus();
1052
- }
1053
  }
1054
- if (typeof(ux_clr_text_color_error_msg_settings) != "function")
 
1055
  {
1056
- function ux_clr_text_color_error_msg_settings()
1057
- {
1058
- jQuery("#clr_text_color_error_msg").farbtastic("#ux_clr_text_color_error_msg").slideDown();
1059
- jQuery("#ux_clr_text_color_error_msg").focus();
1060
- }
1061
  }
 
1062
  jQuery("#ux_clr_font_color").blur(function(){jQuery("#clr_font_color").slideUp()});
1063
  jQuery("#ux_clr_text_color_input_field").blur(function(){jQuery("#clr_text_color").slideUp()});
1064
  jQuery("#ux_clr_border_color_input_field").blur(function(){jQuery("#clr_border_color").slideUp()});
@@ -1074,111 +1045,108 @@ jQuery("#ux_clr_bg_color_error_msg").blur(function(){jQuery("#clr_bg_color_error
1074
  jQuery("#ux_clr_border_color_error_msg").blur(function(){jQuery("#clr_border_color_error_msg").slideUp()});
1075
  jQuery("#ux_clr_text_color_error_msg").blur(function(){jQuery("#clr_text_color_error_msg").slideUp()});
1076
 
1077
- if (typeof(OnlyNumbers) != "function")
 
1078
  {
1079
- function OnlyNumbers(e) ///////////////////////////////////allow only digits
1080
- {
1081
- var regex = new RegExp("^[0-9 \b]*$");
1082
- var str = String.fromCharCode(!e.charCode ? e.which : e.charCode);
1083
- if (regex.test(str)) {
1084
- return true;
1085
- }
1086
- e.preventDefault();
1087
- return false;
1088
- }
1089
  }
1090
- if (typeof(select_form_layout) != "function")
 
1091
  {
1092
- function select_form_layout()
1093
- {
1094
- var form_id = jQuery("#ux_ddl_select_form").val();
1095
- jQuery.post(ajaxurl, "form_id="+form_id+"&param=fetch_control_values&action=layout_settings_contact_library", function(data)
1096
- {
1097
- if(data != "undefined")
1098
- {
1099
- var dataJson = jQuery.parseJSON(data);
1100
- jQuery("#ux_ddl_font_family").val(dataJson.label_setting_font_family);
1101
- jQuery("#ux_clr_font_color").val(dataJson.label_setting_font_color);
1102
- jQuery("#ux_clr_font_color").css("background-color",dataJson.label_setting_font_color);
1103
- jQuery("#ux_clr_font_color").css("color","#ffffff");
1104
- jQuery("#ux_ddl_font_style").val(dataJson.label_setting_font_style);
1105
- jQuery("#ux_txt_font_size").val(dataJson.label_setting_font_size);
1106
- dataJson.label_setting_font_align_left == "0" ? jQuery("#ux_rdl_font_align_left").attr("checked","checked") : jQuery("#ux_rdl_font_align_right").attr("checked","checked") ;
1107
- jQuery("#ux_ddl_label_position").val(dataJson.label_setting_label_position);
1108
- jQuery("#ux_ddl_field_size").val(dataJson.label_setting_field_size);
1109
- jQuery("#ux_ddl_field_align").val(dataJson.label_setting_field_align);
1110
- dataJson.label_setting_hide_label == "1" ? jQuery("#ux_chk_hide_label").attr("checked","checked") : jQuery("#ux_chk_hide_label").removeAttr("checked");
1111
- jQuery("#ux_ddl_direction").val(dataJson.label_setting_text_direction);
1112
- jQuery("#ux_ddl_font_family_input_field").val(dataJson.input_field_font_family);
1113
- jQuery("#ux_clr_text_color_input_field").val(dataJson.input_field_font_color);
1114
- jQuery("#ux_clr_text_color_input_field").css("background-color",dataJson.input_field_font_color);
1115
- jQuery("#ux_clr_text_color_input_field").css("color","#ffffff");
1116
- jQuery("#ux_ddl_font_style_input_field").val(dataJson.input_field_font_style);
1117
- jQuery("#ux_txt_font_size_input_field").val(dataJson.input_field_font_size);
1118
- jQuery("#ux_txt_border_radius_input_field").val(dataJson.input_field_border_radius);
1119
- jQuery("#ux_clr_border_color_input_field").val(dataJson.input_field_border_color);
1120
- jQuery("#ux_clr_border_color_input_field").css("background-color",dataJson.input_field_border_color);
1121
- jQuery("#ux_clr_border_color_input_field").css("color","#ffffff");
1122
- jQuery("#ux_txt_border_size_input_field").val(dataJson.input_field_border_size);
1123
- jQuery("#ux_ddl_border_style_input_field").val(dataJson.input_field_border_style);
1124
- jQuery("#ux_clr_bg_color_input_field").val(dataJson.input_field_clr_bg_color);
1125
- jQuery("#ux_clr_bg_color_input_field").css("background-color",dataJson.input_field_clr_bg_color);
1126
- jQuery("#ux_clr_bg_color_input_field").css("color","#000000");
1127
- dataJson.input_field_rdl_multiple_row == "0" ? jQuery("#ux_rdl_multiple_row_input_field").attr("checked","checked") : jQuery("#ux_rdl_single_row_input_field").attr("checked","checked");
1128
- dataJson.input_field_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_input_field").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_input_field").attr("checked","checked") ;
1129
- jQuery("#ux_ddl_input_field_direction").val(dataJson.input_field_text_direction);
1130
- jQuery("#ux_input_size_input_field").val(dataJson.input_field_input_size);
1131
- jQuery("#ux_ddl_font_family_submit_button").val(dataJson.submit_button_font_family);
1132
- jQuery("#ux_txt_text_submit_button").val(dataJson.submit_button_text);
1133
- jQuery("#ux_ddl_font_style_submit_button").val(dataJson.submit_button_font_style);
1134
- jQuery("#ux_ddl_font_size_submit_button").val(dataJson.submit_button_font_size);
1135
- jQuery("#ux_txt_button_width_submit_button").val(dataJson.submit_button_button_width);
1136
- jQuery("#ux_clr_bg_color_submit_button").val(dataJson.submit_button_bg_color);
1137
- jQuery("#ux_clr_bg_color_submit_button").css("background-color",dataJson.submit_button_bg_color);
1138
- jQuery("#ux_clr_bg_color_submit_button").css("color","#ffffff");
1139
- jQuery("#ux_clr_hover_bg_color_submit_button").val(dataJson.submit_button_hover_bg_color);
1140
- jQuery("#ux_clr_hover_bg_color_submit_button").css("background-color",dataJson.submit_button_hover_bg_color);
1141
- jQuery("#ux_clr_hover_bg_color_submit_button").css("color","#ffffff");
1142
- jQuery("#ux_clr_text_color_submit_button").val(dataJson.submit_button_text_color);
1143
- jQuery("#ux_clr_text_color_submit_button").css("background-color",dataJson.submit_button_text_color);
1144
- jQuery("#ux_clr_text_color_submit_button").css("color","#000000");
1145
- jQuery("#ux_clr_border_color_submit_button").val(dataJson.submit_button_border_color);
1146
- jQuery("#ux_clr_border_color_submit_button").css("background-color",dataJson.submit_button_border_color);
1147
- jQuery("#ux_clr_border_color_submit_button").css("color","#ffffff");
1148
- jQuery("#ux_clr_border_size_submit_button").val(dataJson.submit_button_border_size);
1149
- jQuery("#ux_txt_border_radius_submit_button").val(dataJson.submit_button_border_radius);
1150
- dataJson.submit_button_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_submit_button").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_submit_button").attr("checked","checked") ;
1151
- jQuery("#ux_ddl_submit_button_direction").val(dataJson.submit_button_text_direction);
1152
- jQuery("#ux_ddl_font_family_success_msg").val(dataJson.success_msg_font_family);
1153
- jQuery("#ux_ddl_font_size_success_msg").val(dataJson.success_msg_font_size);
1154
- jQuery("#ux_clr_bg_color_success_msg").val(dataJson.success_msg_bg_color);
1155
- jQuery("#ux_clr_bg_color_success_msg").css("background-color",dataJson.success_msg_bg_color);
1156
- jQuery("#ux_clr_bg_color_success_msg").css("color","#ffffff");
1157
- jQuery("#ux_clr_border_color_success_msg").val(dataJson.success_msg_border_color);
1158
- jQuery("#ux_clr_border_color_success_msg").css("background-color",dataJson.success_msg_border_color);
1159
- jQuery("#ux_clr_border_color_success_msg").css("color","#ffffff");
1160
- jQuery("#ux_clr_text_color_success_msg").val(dataJson.success_msg_text_color);
1161
- jQuery("#ux_clr_text_color_success_msg").css("background-color",dataJson.success_msg_text_color);
1162
- jQuery("#ux_clr_text_color_success_msg").css("color","#ffffff");
1163
- dataJson.success_msg_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_success_msg").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_success_msg").attr("checked","checked") ;
1164
- jQuery("#ux_ddl_success_msg_direction").val(dataJson.success_msg_text_direction);
1165
- jQuery("#ux_ddl_font_family_error_msg").val(dataJson.error_msg_font_family);
1166
- jQuery("#ux_ddl_font_size_error_msg").val(dataJson.error_msg_font_size);
1167
- jQuery("#ux_clr_bg_color_error_msg").val(dataJson.error_msg_bg_color);
1168
- jQuery("#ux_clr_bg_color_error_msg").css("background-color",dataJson.error_msg_bg_color);
1169
- jQuery("#ux_clr_bg_color_error_msg").css("color","#ffffff");
1170
- jQuery("#ux_clr_border_color_error_msg").val(dataJson.error_msg_border_color);
1171
- jQuery("#ux_clr_border_color_error_msg").css("background-color",dataJson.error_msg_border_color);
1172
- jQuery("#ux_clr_border_color_error_msg").css("color","#ffffff");
1173
- jQuery("#ux_clr_text_color_error_msg").val(dataJson.error_msg_text_color);
1174
- jQuery("#ux_clr_text_color_error_msg").css("background-color",dataJson.error_msg_text_color);
1175
- jQuery("#ux_clr_text_color_error_msg").css("color","#ffffff");
1176
- dataJson.error_msg_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_error_msg").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_error_msg").attr("checked","checked") ;
1177
- jQuery("#ux_ddl_error_msg_direction").val(dataJson.error_msg_text_direction);
1178
- }
1179
- });
1180
- }
1181
- }
1182
 
1183
  jQuery(document).ready(function()
1184
  {
@@ -1189,11 +1157,11 @@ jQuery(document).ready(function()
1189
  var form_id = "<?php echo intval($_REQUEST["form_id"]);?>";
1190
  <?php
1191
  }
1192
- else
1193
- {
1194
  ?>
1195
  var form_id = "0";
1196
- <?php
1197
  }
1198
  ?>
1199
  if(form_id > 0)
59
  if(isset($_REQUEST["form_id"]) && intval($_REQUEST["form_id"]) == $forms[$flag]->form_id)
60
  {
61
  ?>
62
+ <option value="<?php echo intval($forms[$flag]->form_id) ;?>" selected="selected"><?php echo esc_html($forms[$flag]->form_name) ;?></option>
63
  <?php
64
  }
65
  else
66
  {
67
  ?>
68
+ <option value="<?php echo intval($forms[$flag]->form_id) ;?>"><?php echo esc_html($forms[$flag]->form_name) ;?></option>
69
  <?php
70
  }
71
  }
940
  </div>
941
  </form>
942
  <script type="text/javascript">
943
+
944
+ function ux_button_pro_version()
945
  {
946
+ alert("<?php _e( "These Features are only available in Premium Editions!", "contact-bank" ); ?>");
 
 
 
947
  }
948
+
949
+ function ux_clr_font_color_label_setting()
950
  {
951
+ jQuery("#clr_font_color").farbtastic("#ux_clr_font_color").slideDown();
952
+ jQuery("#ux_clr_font_color").focus();
 
 
 
953
  }
954
+
955
+ function ux_clr_font_color_input_settings()
956
  {
957
+ jQuery("#clr_text_color").farbtastic("#ux_clr_text_color_input_field").slideDown();
958
+ jQuery("#ux_clr_text_color_input_field").focus();
 
 
 
959
  }
960
+
961
+ function ux_clr_border_color_input_settings()
962
  {
963
+ jQuery("#clr_border_color").farbtastic("#ux_clr_border_color_input_field").slideDown();
964
+ jQuery("#ux_clr_border_color_input_field").focus();
 
 
 
965
  }
966
+
967
+ function ux_clr_BG_color_input_settings()
968
  {
969
+ jQuery("#clr_bg_color").farbtastic("#ux_clr_bg_color_input_field").slideDown();
970
+ jQuery("#ux_clr_bg_color_input_field").focus();
 
 
 
971
  }
972
+
973
+ function ux_clr_BG_color_submit_btn_settings()
974
  {
975
+ jQuery("#clr_bg_color_submit_button").farbtastic("#ux_clr_bg_color_submit_button").slideDown();
976
+ jQuery("#ux_clr_bg_color_submit_button").focus();
 
 
 
977
  }
978
+
979
+ function ux_clr_hover_BG_color_submit_btn_settings()
980
  {
981
+ jQuery("#clr_hover_bg_color_submit_button").farbtastic("#ux_clr_hover_bg_color_submit_button").slideDown();
982
+ jQuery("#ux_clr_hover_bg_color_submit_button").focus();
 
 
 
983
  }
984
+
985
+ function ux_clr_text_color_submit_btn_settings()
986
  {
987
+ jQuery("#clr_text_color_submit_button").farbtastic("#ux_clr_text_color_submit_button").slideDown();
988
+ jQuery("#ux_clr_text_color_submit_button").focus();
 
 
 
989
  }
990
+
991
+ function ux_clr_hover_border_color_submit_btn_settings()
992
  {
993
+ jQuery("#clr_border_color_submit_button").farbtastic("#ux_clr_border_color_submit_button").slideDown();
994
+ jQuery("#ux_clr_border_color_submit_button").focus();
 
 
 
995
  }
996
+
997
+ function ux_clr_bg_color_sucess_msg_settings()
998
  {
999
+ jQuery("#clr_bg_color_success_msg").farbtastic("#ux_clr_bg_color_success_msg").slideDown();
1000
+ jQuery("#ux_clr_bg_color_success_msg").focus();
 
 
 
1001
  }
1002
+
1003
+ function ux_clr_border_color_sucess_msg_settings()
1004
  {
1005
+ jQuery("#clr_border_color_success_msg").farbtastic("#ux_clr_border_color_success_msg").slideDown();
1006
+ jQuery("#ux_clr_border_color_success_msg").focus();
 
 
 
1007
  }
1008
+
1009
+ function ux_clr_text_color_sucess_msg_settings()
1010
  {
1011
+ jQuery("#clr_text_color_success_msg").farbtastic("#ux_clr_text_color_success_msg").slideDown();
1012
+ jQuery("#ux_clr_text_color_success_msg").focus();
 
 
 
1013
  }
1014
+
1015
+ function ux_clr_BG_color_error_msg_settings()
1016
  {
1017
+ jQuery("#clr_bg_color_error_msg").farbtastic("#ux_clr_bg_color_error_msg").slideDown();
1018
+ jQuery("#ux_clr_bg_color_error_msg").focus();
 
 
 
1019
  }
1020
+
1021
+ function ux_clr_border_color_error_msg_settings()
1022
  {
1023
+ jQuery("#clr_border_color_error_msg").farbtastic("#ux_clr_border_color_error_msg").slideDown();
1024
+ jQuery("#ux_clr_border_color_error_msg").focus();
 
 
 
1025
  }
1026
+
1027
+ function ux_clr_text_color_error_msg_settings()
1028
  {
1029
+ jQuery("#clr_text_color_error_msg").farbtastic("#ux_clr_text_color_error_msg").slideDown();
1030
+ jQuery("#ux_clr_text_color_error_msg").focus();
 
 
 
1031
  }
1032
+
1033
  jQuery("#ux_clr_font_color").blur(function(){jQuery("#clr_font_color").slideUp()});
1034
  jQuery("#ux_clr_text_color_input_field").blur(function(){jQuery("#clr_text_color").slideUp()});
1035
  jQuery("#ux_clr_border_color_input_field").blur(function(){jQuery("#clr_border_color").slideUp()});
1045
  jQuery("#ux_clr_border_color_error_msg").blur(function(){jQuery("#clr_border_color_error_msg").slideUp()});
1046
  jQuery("#ux_clr_text_color_error_msg").blur(function(){jQuery("#clr_text_color_error_msg").slideUp()});
1047
 
1048
+
1049
+ function OnlyNumbers(e) ///////////////////////////////////allow only digits
1050
  {
1051
+ var regex = new RegExp("^[0-9 \b]*$");
1052
+ var str = String.fromCharCode(!e.charCode ? e.which : e.charCode);
1053
+ if (regex.test(str)) {
1054
+ return true;
1055
+ }
1056
+ e.preventDefault();
1057
+ return false;
 
 
 
1058
  }
1059
+
1060
+ function select_form_layout()
1061
  {
1062
+ var form_id = jQuery("#ux_ddl_select_form").val();
1063
+ jQuery.post(ajaxurl, "form_id="+form_id+"&param=fetch_control_values&action=layout_settings_contact_library", function(data)
1064
+ {
1065
+ if(data != "undefined")
1066
+ {
1067
+ var dataJson = jQuery.parseJSON(data);
1068
+ jQuery("#ux_ddl_font_family").val(dataJson.label_setting_font_family);
1069
+ jQuery("#ux_clr_font_color").val(dataJson.label_setting_font_color);
1070
+ jQuery("#ux_clr_font_color").css("background-color",dataJson.label_setting_font_color);
1071
+ jQuery("#ux_clr_font_color").css("color","#ffffff");
1072
+ jQuery("#ux_ddl_font_style").val(dataJson.label_setting_font_style);
1073
+ jQuery("#ux_txt_font_size").val(dataJson.label_setting_font_size);
1074
+ dataJson.label_setting_font_align_left == "0" ? jQuery("#ux_rdl_font_align_left").attr("checked","checked") : jQuery("#ux_rdl_font_align_right").attr("checked","checked") ;
1075
+ jQuery("#ux_ddl_label_position").val(dataJson.label_setting_label_position);
1076
+ jQuery("#ux_ddl_field_size").val(dataJson.label_setting_field_size);
1077
+ jQuery("#ux_ddl_field_align").val(dataJson.label_setting_field_align);
1078
+ dataJson.label_setting_hide_label == "1" ? jQuery("#ux_chk_hide_label").attr("checked","checked") : jQuery("#ux_chk_hide_label").removeAttr("checked");
1079
+ jQuery("#ux_ddl_direction").val(dataJson.label_setting_text_direction);
1080
+ jQuery("#ux_ddl_font_family_input_field").val(dataJson.input_field_font_family);
1081
+ jQuery("#ux_clr_text_color_input_field").val(dataJson.input_field_font_color);
1082
+ jQuery("#ux_clr_text_color_input_field").css("background-color",dataJson.input_field_font_color);
1083
+ jQuery("#ux_clr_text_color_input_field").css("color","#ffffff");
1084
+ jQuery("#ux_ddl_font_style_input_field").val(dataJson.input_field_font_style);
1085
+ jQuery("#ux_txt_font_size_input_field").val(dataJson.input_field_font_size);
1086
+ jQuery("#ux_txt_border_radius_input_field").val(dataJson.input_field_border_radius);
1087
+ jQuery("#ux_clr_border_color_input_field").val(dataJson.input_field_border_color);
1088
+ jQuery("#ux_clr_border_color_input_field").css("background-color",dataJson.input_field_border_color);
1089
+ jQuery("#ux_clr_border_color_input_field").css("color","#ffffff");
1090
+ jQuery("#ux_txt_border_size_input_field").val(dataJson.input_field_border_size);
1091
+ jQuery("#ux_ddl_border_style_input_field").val(dataJson.input_field_border_style);
1092
+ jQuery("#ux_clr_bg_color_input_field").val(dataJson.input_field_clr_bg_color);
1093
+ jQuery("#ux_clr_bg_color_input_field").css("background-color",dataJson.input_field_clr_bg_color);
1094
+ jQuery("#ux_clr_bg_color_input_field").css("color","#000000");
1095
+ dataJson.input_field_rdl_multiple_row == "0" ? jQuery("#ux_rdl_multiple_row_input_field").attr("checked","checked") : jQuery("#ux_rdl_single_row_input_field").attr("checked","checked");
1096
+ dataJson.input_field_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_input_field").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_input_field").attr("checked","checked") ;
1097
+ jQuery("#ux_ddl_input_field_direction").val(dataJson.input_field_text_direction);
1098
+ jQuery("#ux_input_size_input_field").val(dataJson.input_field_input_size);
1099
+ jQuery("#ux_ddl_font_family_submit_button").val(dataJson.submit_button_font_family);
1100
+ jQuery("#ux_txt_text_submit_button").val(dataJson.submit_button_text);
1101
+ jQuery("#ux_ddl_font_style_submit_button").val(dataJson.submit_button_font_style);
1102
+ jQuery("#ux_ddl_font_size_submit_button").val(dataJson.submit_button_font_size);
1103
+ jQuery("#ux_txt_button_width_submit_button").val(dataJson.submit_button_button_width);
1104
+ jQuery("#ux_clr_bg_color_submit_button").val(dataJson.submit_button_bg_color);
1105
+ jQuery("#ux_clr_bg_color_submit_button").css("background-color",dataJson.submit_button_bg_color);
1106
+ jQuery("#ux_clr_bg_color_submit_button").css("color","#ffffff");
1107
+ jQuery("#ux_clr_hover_bg_color_submit_button").val(dataJson.submit_button_hover_bg_color);
1108
+ jQuery("#ux_clr_hover_bg_color_submit_button").css("background-color",dataJson.submit_button_hover_bg_color);
1109
+ jQuery("#ux_clr_hover_bg_color_submit_button").css("color","#ffffff");
1110
+ jQuery("#ux_clr_text_color_submit_button").val(dataJson.submit_button_text_color);
1111
+ jQuery("#ux_clr_text_color_submit_button").css("background-color",dataJson.submit_button_text_color);
1112
+ jQuery("#ux_clr_text_color_submit_button").css("color","#000000");
1113
+ jQuery("#ux_clr_border_color_submit_button").val(dataJson.submit_button_border_color);
1114
+ jQuery("#ux_clr_border_color_submit_button").css("background-color",dataJson.submit_button_border_color);
1115
+ jQuery("#ux_clr_border_color_submit_button").css("color","#ffffff");
1116
+ jQuery("#ux_clr_border_size_submit_button").val(dataJson.submit_button_border_size);
1117
+ jQuery("#ux_txt_border_radius_submit_button").val(dataJson.submit_button_border_radius);
1118
+ dataJson.submit_button_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_submit_button").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_submit_button").attr("checked","checked") ;
1119
+ jQuery("#ux_ddl_submit_button_direction").val(dataJson.submit_button_text_direction);
1120
+ jQuery("#ux_ddl_font_family_success_msg").val(dataJson.success_msg_font_family);
1121
+ jQuery("#ux_ddl_font_size_success_msg").val(dataJson.success_msg_font_size);
1122
+ jQuery("#ux_clr_bg_color_success_msg").val(dataJson.success_msg_bg_color);
1123
+ jQuery("#ux_clr_bg_color_success_msg").css("background-color",dataJson.success_msg_bg_color);
1124
+ jQuery("#ux_clr_bg_color_success_msg").css("color","#ffffff");
1125
+ jQuery("#ux_clr_border_color_success_msg").val(dataJson.success_msg_border_color);
1126
+ jQuery("#ux_clr_border_color_success_msg").css("background-color",dataJson.success_msg_border_color);
1127
+ jQuery("#ux_clr_border_color_success_msg").css("color","#ffffff");
1128
+ jQuery("#ux_clr_text_color_success_msg").val(dataJson.success_msg_text_color);
1129
+ jQuery("#ux_clr_text_color_success_msg").css("background-color",dataJson.success_msg_text_color);
1130
+ jQuery("#ux_clr_text_color_success_msg").css("color","#ffffff");
1131
+ dataJson.success_msg_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_success_msg").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_success_msg").attr("checked","checked") ;
1132
+ jQuery("#ux_ddl_success_msg_direction").val(dataJson.success_msg_text_direction);
1133
+ jQuery("#ux_ddl_font_family_error_msg").val(dataJson.error_msg_font_family);
1134
+ jQuery("#ux_ddl_font_size_error_msg").val(dataJson.error_msg_font_size);
1135
+ jQuery("#ux_clr_bg_color_error_msg").val(dataJson.error_msg_bg_color);
1136
+ jQuery("#ux_clr_bg_color_error_msg").css("background-color",dataJson.error_msg_bg_color);
1137
+ jQuery("#ux_clr_bg_color_error_msg").css("color","#ffffff");
1138
+ jQuery("#ux_clr_border_color_error_msg").val(dataJson.error_msg_border_color);
1139
+ jQuery("#ux_clr_border_color_error_msg").css("background-color",dataJson.error_msg_border_color);
1140
+ jQuery("#ux_clr_border_color_error_msg").css("color","#ffffff");
1141
+ jQuery("#ux_clr_text_color_error_msg").val(dataJson.error_msg_text_color);
1142
+ jQuery("#ux_clr_text_color_error_msg").css("background-color",dataJson.error_msg_text_color);
1143
+ jQuery("#ux_clr_text_color_error_msg").css("color","#ffffff");
1144
+ dataJson.error_msg_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_error_msg").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_error_msg").attr("checked","checked") ;
1145
+ jQuery("#ux_ddl_error_msg_direction").val(dataJson.error_msg_text_direction);
1146
+ }
1147
+ });
1148
+ }
1149
+
 
 
1150
 
1151
  jQuery(document).ready(function()
1152
  {
1157
  var form_id = "<?php echo intval($_REQUEST["form_id"]);?>";
1158
  <?php
1159
  }
1160
+ else
1161
+ {
1162
  ?>
1163
  var form_id = "0";
1164
+ <?php
1165
  }
1166
  ?>
1167
  if(form_id > 0)
views/contact_email_settings.php CHANGED
@@ -53,16 +53,16 @@ else
53
  <?php
54
  for($flag=0;$flag<count($forms);$flag++)
55
  {
56
- if(isset($_REQUEST["form_id"]) && intval($_REQUEST["form_id"]) == $forms[$flag]->form_id )
57
  {
58
  ?>
59
- <option value="<?php echo $forms[$flag]->form_id ;?>" selected="selected"><?php echo $forms[$flag]->form_name ;?></option>
60
  <?php
61
  }
62
  else
63
  {
64
  ?>
65
- <option value="<?php echo $forms[$flag]->form_id ;?>"><?php echo $forms[$flag]->form_name ;?></option>
66
  <?php
67
  }
68
 
@@ -117,72 +117,68 @@ jQuery(document).ready(function()
117
  });
118
 
119
  jQuery(".fluid-layout .table thead th").css("vertical-align","top");
120
- if (typeof(select_form) != "function")
 
121
  {
122
- function select_form()
123
- {
124
- var form_id = jQuery("#ux_ddl_select_form").val();
125
- if(form_id != 0)
126
- {
127
- jQuery.post(ajaxurl, "form_id="+form_id+"&param=email_settings&action=email_contact_form_library", function(data)
128
- {
129
- var oTable = jQuery("#data-table-email-settings").dataTable();
130
- oTable.fnDestroy();
131
- jQuery("#ux_email_settings_postback").empty();
132
- jQuery("#ux_email_settings_postback").append(data);
133
 
134
- oTable.fnDraw();
135
- });
136
- }
137
- else
138
- {
139
- jQuery("#ux_email_settings_postback").empty();
140
- oTable = jQuery("#data-table-email-settings").dataTable
141
- ({
142
- "bJQueryUI": false,
143
- "bAutoWidth": true,
144
- "bPaginate": false,
145
- "bDestroy": true,
146
- "sDom": "<\"datatable-header\"fl>t<\"datatable-footer\"ip>",
147
- "oLanguage":
148
- {
149
- "sLengthMenu": "<span>Show entries:</span> _MENU_"
150
- },
151
- "aaSorting": [[ 0, "asc" ]]
152
- });
153
- oTable.fnClearTable();
154
- }
155
- }
156
  }
157
- if (typeof(delete_email_settings) != "function")
 
 
158
  {
159
- function delete_email_settings(email_id)
160
- {
161
- var checkstr = confirm("<?php _e( "Are you sure, you want to delete this Email Setting?", "contact-bank" ); ?>");
162
- if(checkstr == true)
163
- {
164
- jQuery.post(ajaxurl, "email_id="+email_id+"&param=delete_email_settings&action=email_contact_form_library", function(data)
165
- {
166
- location.reload();
167
- });
168
- }
169
- }
170
  }
171
- if (typeof(add_new_settings) != "function")
 
172
  {
173
- function add_new_settings()
174
- {
175
- var form_id = jQuery("#ux_ddl_select_form").val();
176
- if(form_id != 0)
177
- {
178
- window.location.href = "admin.php?page=add_contact_email_settings&form_id="+form_id;
179
- }
180
- else
181
- {
182
- alert("<?php _e( "Please select the Form first.", "contact-bank" ); ?>");
183
- }
184
- }
185
  }
 
186
  </script>
187
  <?php
188
  }
53
  <?php
54
  for($flag=0;$flag<count($forms);$flag++)
55
  {
56
+ if(isset($_REQUEST["form_id"]) && intval($_REQUEST["form_id"]) == intval($forms[$flag]->form_id) )
57
  {
58
  ?>
59
+ <option value="<?php echo intval($forms[$flag]->form_id) ;?>" selected="selected"><?php echo esc_html($forms[$flag]->form_name) ;?></option>
60
  <?php
61
  }
62
  else
63
  {
64
  ?>
65
+ <option value="<?php echo intval( $forms[$flag]->form_id) ;?>"><?php echo esc_html($forms[$flag]->form_name) ;?></option>
66
  <?php
67
  }
68
 
117
  });
118
 
119
  jQuery(".fluid-layout .table thead th").css("vertical-align","top");
120
+
121
+ function select_form()
122
  {
123
+ var form_id = jQuery("#ux_ddl_select_form").val();
124
+ if(form_id != 0)
125
+ {
126
+ jQuery.post(ajaxurl, "form_id="+form_id+"&param=email_settings&action=email_contact_form_library", function(data)
127
+ {
128
+ var oTable = jQuery("#data-table-email-settings").dataTable();
129
+ oTable.fnDestroy();
130
+ jQuery("#ux_email_settings_postback").empty();
131
+ jQuery("#ux_email_settings_postback").append(data);
 
 
132
 
133
+ oTable.fnDraw();
134
+ });
135
+ }
136
+ else
137
+ {
138
+ jQuery("#ux_email_settings_postback").empty();
139
+ oTable = jQuery("#data-table-email-settings").dataTable
140
+ ({
141
+ "bJQueryUI": false,
142
+ "bAutoWidth": true,
143
+ "bPaginate": false,
144
+ "bDestroy": true,
145
+ "sDom": "<\"datatable-header\"fl>t<\"datatable-footer\"ip>",
146
+ "oLanguage":
147
+ {
148
+ "sLengthMenu": "<span>Show entries:</span> _MENU_"
149
+ },
150
+ "aaSorting": [[ 0, "asc" ]]
151
+ });
152
+ oTable.fnClearTable();
153
+ }
 
154
  }
155
+
156
+
157
+ function delete_email_settings(email_id)
158
  {
159
+ var checkstr = confirm("<?php _e( "Are you sure, you want to delete this Email Setting?", "contact-bank" ); ?>");
160
+ if(checkstr == true)
161
+ {
162
+ jQuery.post(ajaxurl, "email_id="+email_id+"&param=delete_email_settings&action=email_contact_form_library", function(data)
163
+ {
164
+ location.reload();
165
+ });
166
+ }
 
 
 
167
  }
168
+
169
+ function add_new_settings()
170
  {
171
+ var form_id = jQuery("#ux_ddl_select_form").val();
172
+ if(form_id != 0)
173
+ {
174
+ window.location.href = "admin.php?page=add_contact_email_settings&form_id="+form_id;
175
+ }
176
+ else
177
+ {
178
+ alert("<?php _e( "Please select the Form first.", "contact-bank" ); ?>");
179
+ }
 
 
 
180
  }
181
+
182
  </script>
183
  <?php
184
  }
views/contact_frontend_data.php CHANGED
@@ -59,13 +59,13 @@ else
59
  if(isset($_REQUEST["form_id"]) && intval($_REQUEST["form_id"]) == $form_data[$flag]->form_id)
60
  {
61
  ?>
62
- <option value="<?php echo $form_data[$flag]->form_id ;?>" selected="selected"><?php echo $form_data[$flag]->form_name ;?></option>
63
  <?php
64
  }
65
  else
66
  {
67
  ?>
68
- <option value="<?php echo $form_data[$flag]->form_id ;?>"><?php echo $form_data[$flag]->form_name ;?></option>
69
  <?php
70
  }
71
  }
@@ -91,41 +91,40 @@ else
91
  jQuery(document).ready(function()
92
  {
93
  select_form_id();
94
- if (typeof(exportTableToCSV) != "function")
95
- {
96
  function exportTableToCSV(table, filename)
97
  {
98
- var rows = table.find('tr:has(td)'),
99
  csv = "";
100
- tmpColDelim = String.fromCharCode(11),
101
- tmpRowDelim = String.fromCharCode(0),
102
- colDelim = '","',
103
- rowDelim = '"\r\n"',
104
- csv = '"' + rows.map(function (i, row) {
105
- var row = jQuery(row),
106
- cols = row.find('td');
107
- return cols.map(function (j, col) {
108
- var col = jQuery(col),
109
- text = col.text();
110
 
111
- return text.replace('"', '""');
112
 
113
- }).get().join(tmpColDelim);
114
 
115
- }).get().join(tmpRowDelim)
116
 
117
- .split(tmpRowDelim).join(rowDelim)
118
- .split(tmpColDelim).join(colDelim) + '"',
119
- csvData = 'data:application/csv;charset=utf-8,' + encodeURIComponent(csv);
120
 
121
- jQuery(this)
122
- .attr({
123
- 'download': filename,
124
- 'href': csvData,
125
- 'target': '_blank'
126
- });
127
- }
128
- }
129
  jQuery("#export").on('click', function (event)
130
  {
131
  var form_id = jQuery("#select_form").val();
@@ -141,47 +140,37 @@ jQuery(document).ready(function()
141
 
142
 
143
  });
144
- if (typeof(select_form_id) != "function")
 
145
  {
146
- function select_form_id()
147
- {
148
- var form_id = jQuery("#select_form").val();
149
- if(form_id != 0)
150
- {
151
- jQuery.post(ajaxurl, "form_id="+form_id+"&param=frontend_form_data&action=frontend_data_contact_library", function(data)
152
- {
153
- if(jQuery('#data-table-frontend').length > 0)
154
- {
155
- oTable = jQuery('#data-table-frontend').dataTable();
156
- oTable.fnDestroy();
157
- jQuery("#ux_frontend_data_postback").empty();
158
 
159
- jQuery("#ux_frontend_data_postback").append(data);
160
- jQuery(".fluid-layout .table thead th").css('vertical-align','top');
161
- oTable.fnDraw();
162
- }
163
- else
164
- {
165
- jQuery("#ux_frontend_data_postback").append(data);
166
- jQuery(".fluid-layout .table thead th").css('vertical-align','top');
167
- }
168
- });
169
- }
170
- }
171
  }
172
- if (typeof(delete_form_entry) != "function")
 
173
  {
174
- function delete_form_entry()
175
- {
176
- alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
177
- }
178
  }
179
-
180
-
181
-
182
-
183
-
184
-
185
  </script>
186
  <?php
187
  }
59
  if(isset($_REQUEST["form_id"]) && intval($_REQUEST["form_id"]) == $form_data[$flag]->form_id)
60
  {
61
  ?>
62
+ <option value="<?php echo intval($form_data[$flag]->form_id) ;?>" selected="selected"><?php echo esc_html($form_data[$flag]->form_name) ;?></option>
63
  <?php
64
  }
65
  else
66
  {
67
  ?>
68
+ <option value="<?php echo intval($form_data[$flag]->form_id) ;?>"><?php echo esc_html($form_data[$flag]->form_name) ;?></option>
69
  <?php
70
  }
71
  }
91
  jQuery(document).ready(function()
92
  {
93
  select_form_id();
94
+
 
95
  function exportTableToCSV(table, filename)
96
  {
97
+ var rows = table.find('tr:has(td)'),
98
  csv = "";
99
+ tmpColDelim = String.fromCharCode(11),
100
+ tmpRowDelim = String.fromCharCode(0),
101
+ colDelim = '","',
102
+ rowDelim = '"\r\n"',
103
+ csv = '"' + rows.map(function (i, row) {
104
+ var row = jQuery(row),
105
+ cols = row.find('td');
106
+ return cols.map(function (j, col) {
107
+ var col = jQuery(col),
108
+ text = col.text();
109
 
110
+ return text.replace('"', '""');
111
 
112
+ }).get().join(tmpColDelim);
113
 
114
+ }).get().join(tmpRowDelim)
115
 
116
+ .split(tmpRowDelim).join(rowDelim)
117
+ .split(tmpColDelim).join(colDelim) + '"',
118
+ csvData = 'data:application/csv;charset=utf-8,' + encodeURIComponent(csv);
119
 
120
+ jQuery(this)
121
+ .attr({
122
+ 'download': filename,
123
+ 'href': csvData,
124
+ 'target': '_blank'
125
+ });
126
+ }
127
+
128
  jQuery("#export").on('click', function (event)
129
  {
130
  var form_id = jQuery("#select_form").val();
140
 
141
 
142
  });
143
+
144
+ function select_form_id()
145
  {
146
+ var form_id = jQuery("#select_form").val();
147
+ if(form_id != 0)
148
+ {
149
+ jQuery.post(ajaxurl, "form_id="+form_id+"&param=frontend_form_data&action=frontend_data_contact_library", function(data)
150
+ {
151
+ if(jQuery('#data-table-frontend').length > 0)
152
+ {
153
+ oTable = jQuery('#data-table-frontend').dataTable();
154
+ oTable.fnDestroy();
155
+ jQuery("#ux_frontend_data_postback").empty();
 
 
156
 
157
+ jQuery("#ux_frontend_data_postback").append(data);
158
+ jQuery(".fluid-layout .table thead th").css('vertical-align','top');
159
+ oTable.fnDraw();
160
+ }
161
+ else
162
+ {
163
+ jQuery("#ux_frontend_data_postback").append(data);
164
+ jQuery(".fluid-layout .table thead th").css('vertical-align','top');
165
+ }
166
+ });
167
+ }
 
168
  }
169
+
170
+ function delete_form_entry()
171
  {
172
+ alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
 
 
 
173
  }
 
 
 
 
 
 
174
  </script>
175
  <?php
176
  }
views/contact_view.php CHANGED
@@ -25,7 +25,7 @@ else
25
  "SELECT count(form_id) FROM ". contact_bank_contact_form()
26
  );
27
 
28
- if($count_forms < 2)
29
  {
30
  $last_form_id = $wpdb->get_var
31
  (
@@ -231,7 +231,7 @@ else
231
  );
232
  for($flag = 0; $flag<count($form_data);$flag++)
233
  {
234
- $form_settings[$form_id][$form_data[$flag]->form_message_key] = $form_data[$flag]->form_message_value;
235
  }
236
  $form_name = $wpdb->get_var
237
  (
@@ -328,7 +328,7 @@ else
328
  <?php
329
  if(isset($form_settings[$form_id]["redirect"]))
330
  {
331
- if($form_settings[$form_id]["redirect"] == "0")
332
  {
333
  ?>
334
  <input type="radio" id="ux_rdl_page" checked="checked" name="ux_rdl_redirect"
@@ -383,7 +383,7 @@ else
383
  if(isset($form_settings[$form_id]["redirect_url"]))
384
  {
385
  $permalink = get_permalink( $publish_pages[$flag]->ID);
386
- if($permalink == $form_settings[$form_id]["redirect_url"])
387
  {
388
  ?>
389
  <option selected="selected" value="<?php echo $permalink ; ?>"><?php echo $publish_pages[$flag]->post_name; ?></option>
@@ -392,7 +392,7 @@ else
392
  else
393
  {
394
  ?>
395
- <option value="<?php echo $permalink ; ?>"><?php echo $publish_pages[$flag]->post_name; ?></option>
396
  <?php
397
  }
398
  }
@@ -400,7 +400,7 @@ else
400
  {
401
  $permalink = get_permalink( $publish_pages[$flag]->ID);
402
  ?>
403
- <option value="<?php echo $permalink ; ?>"><?php echo $publish_pages[$flag]->post_name; ?></option>
404
  <?php
405
  }
406
  }
@@ -414,7 +414,7 @@ else
414
  </label>
415
  <div class="layout-controls">
416
  <input type="text" name="ux_txt_redirect_url" class="layout-span7" id="ux_txt_redirect_url"
417
- value="<?php echo isset($form_settings[$form_id]["redirect_url"])? $form_settings[$form_id]["redirect_url"]
418
  : ""; ?>"
419
  placeholder="<?php _e("Enter Redirect URL", "contact-bank"); ?>"/>
420
  </div>
@@ -542,37 +542,36 @@ jQuery(document).ready(function()
542
  allow_resize: true
543
  });
544
  });
545
- if (typeof(base64_encode) != "function")
 
546
  {
547
- function base64_encode(data)
548
- {
549
- var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
550
- var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
551
- ac = 0,
552
- enc = '',
553
- tmp_arr = [];
554
- if (!data)
555
- {
556
- return data;
557
- }
558
- do
559
- {
560
- o1 = data.charCodeAt(i++);
561
- o2 = data.charCodeAt(i++);
562
- o3 = data.charCodeAt(i++);
563
- bits = o1 << 16 | o2 << 8 | o3;
564
- h1 = bits >> 18 & 0x3f;
565
- h2 = bits >> 12 & 0x3f;
566
- h3 = bits >> 6 & 0x3f;
567
- h4 = bits & 0x3f;
568
- tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
569
- }
570
- while (i < data.length);
571
- enc = tmp_arr.join('');
572
- var r = data.length % 3;
573
- return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
574
- }
575
- }
576
  jQuery("#ux_dynamic_form_submit").validate
577
  ({
578
  rules:
@@ -598,7 +597,7 @@ jQuery("#ux_dynamic_form_submit").validate
598
  var form_id = "<?php echo $form_id; ?>";
599
  jQuery.post(ajaxurl,
600
  {
601
- form_settings: base64_encode(jQuery("#ux_dynamic_form_submit").serialize()),
602
  form_id: form_id,
603
  array_delete_form_controls: JSON.stringify(array_delete_form_controls),
604
  param: "submit_form_messages_settings",
25
  "SELECT count(form_id) FROM ". contact_bank_contact_form()
26
  );
27
 
28
+ if($count_forms < 2)
29
  {
30
  $last_form_id = $wpdb->get_var
31
  (
231
  );
232
  for($flag = 0; $flag<count($form_data);$flag++)
233
  {
234
+ $form_settings[$form_id][$form_data[$flag]->form_message_key] = esc_html($form_data[$flag]->form_message_value);
235
  }
236
  $form_name = $wpdb->get_var
237
  (
328
  <?php
329
  if(isset($form_settings[$form_id]["redirect"]))
330
  {
331
+ if(esc_attr($form_settings[$form_id]["redirect"]) == "0")
332
  {
333
  ?>
334
  <input type="radio" id="ux_rdl_page" checked="checked" name="ux_rdl_redirect"
383
  if(isset($form_settings[$form_id]["redirect_url"]))
384
  {
385
  $permalink = get_permalink( $publish_pages[$flag]->ID);
386
+ if($permalink == esc_attr($form_settings[$form_id]["redirect_url"]))
387
  {
388
  ?>
389
  <option selected="selected" value="<?php echo $permalink ; ?>"><?php echo $publish_pages[$flag]->post_name; ?></option>
392
  else
393
  {
394
  ?>
395
+ <option value="<?php echo $permalink ; ?>"><?php echo esc_attr($publish_pages[$flag]->post_name); ?></option>
396
  <?php
397
  }
398
  }
400
  {
401
  $permalink = get_permalink( $publish_pages[$flag]->ID);
402
  ?>
403
+ <option value="<?php echo $permalink ; ?>"><?php echo esc_attr($publish_pages[$flag]->post_name); ?></option>
404
  <?php
405
  }
406
  }
414
  </label>
415
  <div class="layout-controls">
416
  <input type="text" name="ux_txt_redirect_url" class="layout-span7" id="ux_txt_redirect_url"
417
+ value="<?php echo isset($form_settings[$form_id]["redirect_url"])? esc_attr($form_settings[$form_id]["redirect_url"])
418
  : ""; ?>"
419
  placeholder="<?php _e("Enter Redirect URL", "contact-bank"); ?>"/>
420
  </div>
542
  allow_resize: true
543
  });
544
  });
545
+
546
+ function base64_encode_contact_bank(data)
547
  {
548
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
549
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
550
+ ac = 0,
551
+ enc = '',
552
+ tmp_arr = [];
553
+ if (!data)
554
+ {
555
+ return data;
556
+ }
557
+ do
558
+ {
559
+ o1 = data.charCodeAt(i++);
560
+ o2 = data.charCodeAt(i++);
561
+ o3 = data.charCodeAt(i++);
562
+ bits = o1 << 16 | o2 << 8 | o3;
563
+ h1 = bits >> 18 & 0x3f;
564
+ h2 = bits >> 12 & 0x3f;
565
+ h3 = bits >> 6 & 0x3f;
566
+ h4 = bits & 0x3f;
567
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
568
+ }
569
+ while (i < data.length);
570
+ enc = tmp_arr.join('');
571
+ var r = data.length % 3;
572
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
573
+ }
574
+
 
 
575
  jQuery("#ux_dynamic_form_submit").validate
576
  ({
577
  rules:
597
  var form_id = "<?php echo $form_id; ?>";
598
  jQuery.post(ajaxurl,
599
  {
600
+ form_settings: base64_encode_contact_bank(jQuery("#ux_dynamic_form_submit").serialize()),
601
  form_id: form_id,
602
  array_delete_form_controls: JSON.stringify(array_delete_form_controls),
603
  param: "submit_form_messages_settings",
views/dashboard.php CHANGED
@@ -23,7 +23,7 @@ else
23
  (
24
  "SELECT form_id FROM " .contact_bank_contact_form(). " order by form_id desc limit 1"
25
  );
26
- $contact_id = count($last_form_id) == 0 ? 1 : $last_form_id + 1;
27
  ?>
28
  <form id="frmdashboard" class="layout-form">
29
  <div id="poststuff" style="width: 99% !important;">
@@ -40,7 +40,7 @@ else
40
  (
41
  "SELECT count(form_id) FROM ".contact_bank_contact_form()
42
  );
43
- if($form_count < 2)
44
  {
45
  ?>
46
  <a class="btn btn-info"
@@ -86,47 +86,47 @@ else
86
  (
87
  " SELECT count(" . contact_bank_contact_form() . ".form_id) FROM " . contact_bank_contact_form() . " JOIN ". create_control_Table() . " ON " . create_control_Table() .".form_id = ".contact_bank_contact_form().
88
  ".form_id WHERE " . contact_bank_contact_form() . ".form_id = %d",
89
- $form_data[$flag]->form_id
90
  )
91
  );
92
  ?>
93
  <tr>
94
  <td>
95
- <?php echo $form_data[$flag]->form_name; ?>
96
  </td>
97
  <td>
98
- <?php echo "[contact_bank form_id=" . $form_data[$flag]->form_id . "]"; ?>
99
  </td>
100
  <td>
101
- <?php echo $total_control;?>
102
  </td>
103
  <td>
104
- <a href="admin.php?page=contact_bank&form_id=<?php echo $form_data[$flag]->form_id; ?>"
105
  class="btn hovertip"
106
  data-original-title="<?php _e("Edit Form", "contact-bank") ?>">
107
  <i class="icon-custom-pencil"></i>
108
  </a>
109
- <a href="admin.php?page=contact_layout_settings&form_id=<?php echo $form_data[$flag]->form_id; ?>"
110
  class="btn hovertip"
111
  data-original-title="<?php _e("Global Settings", "contact-bank") ?>">
112
  <i class="icon-custom-wrench"></i>
113
  </a>
114
- <a href="admin.php?page=contact_email&form_id=<?php echo $form_data[$flag]->form_id; ?>"
115
  class="btn hovertip"
116
  data-original-title="<?php _e("Email Settings", "contact-bank") ?>">
117
  <i class="icon-custom-envelope"></i>
118
  </a>
119
- <a href="admin.php?page=contact_frontend_data&form_id=<?php echo $form_data[$flag]->form_id; ?>"
120
  class="btn hovertip"
121
  data-original-title="<?php _e("Form Entries", "contact-bank") ?>">
122
  <i class="icon-custom-grid"></i>
123
  </a>
124
- <a href="admin.php?page=form_preview&form_id=<?php echo $form_data[$flag]->form_id; ?>"
125
  class="btn hovertip"
126
  data-original-title="<?php _e("Form Preview", "contact-bank") ?>">
127
  <i class="icon-custom-eye"></i>
128
  </a>
129
- <a herf="#" onclick="delete_form(<?php echo $form_data[$flag]->form_id; ?>);"
130
  class="btn hovertip"
131
  data-original-title="<?php _e("Delete Form", "contact-bank") ?>">
132
  <i class="icon-custom-trash"></i>
@@ -180,48 +180,39 @@ else
180
  { "bSortable": false, "aTargets": [2] }
181
  ]
182
  });
183
- if (typeof(delete_form) != "function")
184
- {
185
- function delete_form(form_Id)
186
- {
187
- var check_str = confirm("<?php _e( "Are you sure, you want to delete this Form?", "contact-bank" ); ?>");
188
- if (check_str == true)
189
- {
190
- jQuery.post(ajaxurl, "id=" + form_Id + "&param=delete_form&action=add_contact_form_library", function (data)
191
- {
192
- location.reload();
193
- });
194
- }
195
- }
196
- }
197
- if (typeof(delete_forms) != "function")
198
- {
199
- function delete_forms() {
200
- var checkstr = confirm("<?php _e( "Are you sure, you want to delete all Forms?", "contact-bank" ); ?>");
201
- if (checkstr == true)
202
- {
203
- jQuery.post(ajaxurl, "param=delete_forms&action=add_contact_form_library", function (data) {
204
- location.reload();
205
- });
206
- }
207
- }
208
- }
209
- if (typeof(restore_factory_settings) != "function")
210
- {
211
- function restore_factory_settings() {
212
- alert("<?php _e("This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
213
- }
214
- }
215
- if (typeof(close_popup) != "function")
216
- {
217
- function close_popup()
218
- {
219
- jQuery( "#contact_bank_popup" ).dialog( "close" );
220
- jQuery.post(ajaxurl, "param=update_option&action=add_new_album_library", function()
221
- {
222
- });
223
- }
224
- }
225
  </script>
226
  <?php
227
  }
23
  (
24
  "SELECT form_id FROM " .contact_bank_contact_form(). " order by form_id desc limit 1"
25
  );
26
+ $contact_id = count(intval($last_form_id)) == 0 ? 1 : intval($last_form_id) + 1;
27
  ?>
28
  <form id="frmdashboard" class="layout-form">
29
  <div id="poststuff" style="width: 99% !important;">
40
  (
41
  "SELECT count(form_id) FROM ".contact_bank_contact_form()
42
  );
43
+ if(intval($form_count) < 2)
44
  {
45
  ?>
46
  <a class="btn btn-info"
86
  (
87
  " SELECT count(" . contact_bank_contact_form() . ".form_id) FROM " . contact_bank_contact_form() . " JOIN ". create_control_Table() . " ON " . create_control_Table() .".form_id = ".contact_bank_contact_form().
88
  ".form_id WHERE " . contact_bank_contact_form() . ".form_id = %d",
89
+ intval($form_data[$flag]->form_id)
90
  )
91
  );
92
  ?>
93
  <tr>
94
  <td>
95
+ <?php echo esc_html($form_data[$flag]->form_name); ?>
96
  </td>
97
  <td>
98
+ <?php echo "[contact_bank form_id=" . intval($form_data[$flag]->form_id) . "]"; ?>
99
  </td>
100
  <td>
101
+ <?php echo intval($total_control);?>
102
  </td>
103
  <td>
104
+ <a href="admin.php?page=contact_bank&form_id=<?php echo intval($form_data[$flag]->form_id); ?>"
105
  class="btn hovertip"
106
  data-original-title="<?php _e("Edit Form", "contact-bank") ?>">
107
  <i class="icon-custom-pencil"></i>
108
  </a>
109
+ <a href="admin.php?page=contact_layout_settings&form_id=<?php echo intval($form_data[$flag]->form_id); ?>"
110
  class="btn hovertip"
111
  data-original-title="<?php _e("Global Settings", "contact-bank") ?>">
112
  <i class="icon-custom-wrench"></i>
113
  </a>
114
+ <a href="admin.php?page=contact_email&form_id=<?php echo intval($form_data[$flag]->form_id); ?>"
115
  class="btn hovertip"
116
  data-original-title="<?php _e("Email Settings", "contact-bank") ?>">
117
  <i class="icon-custom-envelope"></i>
118
  </a>
119
+ <a href="admin.php?page=contact_frontend_data&form_id=<?php echo intval($form_data[$flag]->form_id); ?>"
120
  class="btn hovertip"
121
  data-original-title="<?php _e("Form Entries", "contact-bank") ?>">
122
  <i class="icon-custom-grid"></i>
123
  </a>
124
+ <a href="admin.php?page=form_preview&form_id=<?php echo intval($form_data[$flag]->form_id); ?>"
125
  class="btn hovertip"
126
  data-original-title="<?php _e("Form Preview", "contact-bank") ?>">
127
  <i class="icon-custom-eye"></i>
128
  </a>
129
+ <a herf="#" onclick="delete_form(<?php echo intval($form_data[$flag]->form_id); ?>);"
130
  class="btn hovertip"
131
  data-original-title="<?php _e("Delete Form", "contact-bank") ?>">
132
  <i class="icon-custom-trash"></i>
180
  { "bSortable": false, "aTargets": [2] }
181
  ]
182
  });
183
+ function delete_form(form_Id)
184
+ {
185
+ var check_str = confirm("<?php _e( "Are you sure, you want to delete this Form?", "contact-bank" ); ?>");
186
+ if (check_str == true)
187
+ {
188
+ jQuery.post(ajaxurl, "id=" + form_Id + "&param=delete_form&action=add_contact_form_library", function (data)
189
+ {
190
+ location.reload();
191
+ });
192
+ }
193
+ }
194
+
195
+ function delete_forms() {
196
+ var checkstr = confirm("<?php _e( "Are you sure, you want to delete all Forms?", "contact-bank" ); ?>");
197
+ if (checkstr == true)
198
+ {
199
+ jQuery.post(ajaxurl, "param=delete_forms&action=add_contact_form_library", function (data) {
200
+ location.reload();
201
+ });
202
+ }
203
+ }
204
+
205
+ function restore_factory_settings() {
206
+ alert("<?php _e("This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
207
+ }
208
+
209
+ function close_popup()
210
+ {
211
+ jQuery( "#contact_bank_popup" ).dialog( "close" );
212
+ jQuery.post(ajaxurl, "param=update_option&action=add_new_album_library", function()
213
+ {
214
+ });
215
+ }
 
 
 
 
 
 
 
 
 
216
  </script>
217
  <?php
218
  }
views/header.php CHANGED
@@ -180,12 +180,5 @@ else
180
  </div>
181
  <?php
182
  }
183
- ?>
184
- <div class="custom-message red" style="display: block;margin-top:10px;">
185
- <span>
186
- <strong>You are only allowed to add 2 Forms. Kindly purchase Premium Editions for full access.</strong>
187
- </span>
188
- </div>
189
- <?php
190
  }
191
  ?>
180
  </div>
181
  <?php
182
  }
 
 
 
 
 
 
 
183
  }
184
  ?>
views/includes_common_after.php CHANGED
@@ -62,419 +62,410 @@ else
62
  });
63
  show_url_control();
64
  });
65
- if (typeof(enter_admin_label) != "function")
66
- {
67
- function enter_admin_label(dynamicId)
68
- {
69
- var ux_label = jQuery("#ux_label_text_"+dynamicId).val();
70
- jQuery("#ux_admin_label_"+dynamicId).val(ux_label);
71
- }
72
- }
73
- if (typeof(delete_textbox) != "function")
74
- {
75
- function delete_textbox(dynamicId,control_type,control_id)
76
- {
77
- array_delete_form_controls.push(control_id);
78
- jQuery("#div_"+dynamicId+"_"+control_type).remove();
79
- }
80
- }
81
- if (typeof(add_settings) != "function")
82
- {
83
- function add_settings(dynamicId,field_type)
84
- {
85
- jQuery.post(ajaxurl, "form_id="+form_id+"&dynamicId="+dynamicId+"&field_type="+field_type+"&param=add_settings_div&action=add_contact_form_library", function(data)
86
- {
87
- jQuery("#setting_controls_postback").html(data);
88
- show_Popup();
89
- });
90
- }
91
- }
92
- if (typeof(show_Popup) != "function")
93
- {
94
- function show_Popup()
95
- {
96
- jQuery(".black_overlay").css("display","block");
97
- jQuery(".white_content").css("display","block");
98
- var windowHeight = window.innerHeight - 200;
99
- var windowWidth = window.innerWidth - 200;
100
- var anchor = jQuery("<a class=\"closeButtonLightbox\" onclick=\"CloseLightbox();\"></a>");
101
- jQuery("#setting_controls_postback").append(anchor);
102
- var lightboxHeight = jQuery("#setting_controls_postback").height();
103
- var lightboxWidth = jQuery("#setting_controls_postback").width();
104
- var proposedTop = (window.innerHeight - lightboxHeight - 40) / 2 ;
105
- var proposedLeft = (window.innerWidth - lightboxWidth - 40) / 2 ;
106
- jQuery("#setting_controls_postback").css("top",proposedTop + "px");
107
- jQuery("#setting_controls_postback").css("left",proposedLeft + "px");
108
- jQuery("#setting_controls_postback").fadeIn(200);
109
- }
110
- }
111
- if (typeof(CloseLightbox) != "function")
112
- {
113
- function CloseLightbox()
114
- {
115
- jQuery("#setting_controls_postback").css("display","none");
116
- jQuery(".black_overlay").css("display","none");
117
- jQuery("#fade").fadeOut(200);
118
- }
119
- }
120
- if (typeof(show_url_control) != "function")
121
- {
122
- function show_url_control()
123
- {
124
- if(jQuery("#ux_rdl_page").prop("checked") == true)
125
- {
126
- jQuery("#div_url").hide();
127
- jQuery("#div_page").show();
128
- }
129
- else
130
- {
131
- jQuery("#div_page").hide();
132
- jQuery("#div_url").show();
133
- }
134
- }
135
- }
136
- if (typeof(create_control) != "function")
137
- {
138
- function create_control(control_type,dynamicId,type)
139
- {
140
- dynamicId = typeof dynamicId !== "undefined" ? dynamicId : Math.floor((Math.random()*100000)+1);
141
- switch(parseInt(control_type))
142
- {
143
- case 1:
144
- jQuery("#div_1_1").clone(false).attr("id","div_"+dynamicId+"_1").appendTo("#left_block");
145
- jQuery("#div_"+dynamicId+"_1").children("label").attr("id","control_label_"+dynamicId);
146
- jQuery("#div_"+dynamicId+"_1").children("div").attr("id","show_tooltip"+dynamicId);
147
- jQuery("#show_tooltip"+dynamicId ).children("input[type=\"text\"]").attr("id","ux_txt_textbox_control_"+dynamicId);
148
- jQuery("#show_tooltip"+dynamicId ).children("input[type=\"text\"]").attr("name","ux_txt_textbox_control_"+dynamicId);
149
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
150
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",1)");
151
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
152
- jQuery("#show_tooltip"+dynamicId).children("span").attr("id","txt_description_"+dynamicId);
153
- jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_text_control_tooltip_"+dynamicId).css("display","none");
154
- jQuery("#show_tooltip"+dynamicId).children("div:eq(1)").attr("id","ux_text_control_placeholder_"+dynamicId).css("display","none");
155
- jQuery("#div_"+dynamicId+"_1").attr("style","display:block");
156
- jQuery(".hovertip").tooltip_tip({placement: "left"});
157
- if(typeof type == "undefined")
158
- {
159
- jQuery.post(ajaxurl,
160
- {
161
- ux_hd_textbox_dynamic_id: dynamicId,
162
- form_id: form_id,
163
- events: "add",
164
- param: "save_text_control",
165
- action: "add_contact_form_library",
166
- },
167
- function(data)
168
- {
169
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",1,"+data+");");
170
- });
171
- }
172
- else
173
- {
174
- jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
175
- {
176
- var bind_data = JSON.parse(data);
177
- jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
178
- jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
179
- jQuery("#ux_text_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
180
- jQuery("#ux_text_control_placeholder_"+dynamicId).html(bind_data[dynamicId].cb_default_txt_val);
181
- jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_text_control_tooltip_"+dynamicId).text());
182
- jQuery("#ux_txt_textbox_control_"+dynamicId).attr("placeholder",jQuery("#ux_text_control_placeholder_"+dynamicId).text());
183
- if(bind_data[dynamicId].cb_control_required == "1")
184
- {
185
- jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
186
- }
187
- var control_id = bind_data[dynamicId].control_id;
188
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
189
- });
190
- }
191
- break;
192
- case 2:
193
- jQuery("#div_2_2").clone(false).attr("id","div_"+dynamicId+"_2").appendTo("#left_block");
194
- jQuery("#div_"+dynamicId+"_2").children("label").attr("id","control_label_"+dynamicId);
195
- jQuery("#div_"+dynamicId+"_2").children("div").attr("id","show_tooltip"+dynamicId);
196
- jQuery("#show_tooltip"+dynamicId ).children("textarea[type=\"textarea\"]").attr("id","ux_textarea_control_"+dynamicId);
197
- jQuery("#show_tooltip"+dynamicId ).children("textarea[type=\"textarea\"]").attr("name","ux_textarea_control_"+dynamicId);
198
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
199
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",2)");
200
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
201
- jQuery("#show_tooltip"+dynamicId).children("span").attr("id","txt_description_"+dynamicId);
202
- jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_txtarea_control_tooltip_"+dynamicId).css("display","none");
203
- jQuery("#show_tooltip"+dynamicId).children("div:eq(1)").attr("id","ux_txtarea_control_placeholder_"+dynamicId).css("display","none");
204
- jQuery("#div_"+dynamicId+"_2").attr("style","display:block");
205
- jQuery(".hovertip").tooltip_tip({placement: "left"});
206
- if(typeof type == "undefined")
207
- {
208
- jQuery.post(ajaxurl,
209
- {
210
- ux_hd_textbox_dynamic_id: dynamicId,
211
- form_id: form_id,
212
- events: "add",
213
- param: "save_textarea_control",
214
- action: "add_contact_form_library",
215
- },
216
- function(data)
217
- {
218
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",2,"+data+");");
219
- });
220
- }
221
- else
222
- {
223
- jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
224
- {
225
- var bind_data = JSON.parse(data);
226
- jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
227
- jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
228
- jQuery("#ux_txtarea_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
229
- jQuery("#ux_txtarea_control_placeholder_"+dynamicId).html(bind_data[dynamicId].cb_default_txt_val);
230
- jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_txtarea_control_tooltip_"+dynamicId).text());
231
- jQuery("#ux_textarea_control_"+dynamicId).attr("placeholder",jQuery("#ux_txtarea_control_placeholder_"+dynamicId).text());
232
- if(bind_data[dynamicId].cb_control_required == "1")
233
- {
234
- jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
235
- }
236
- var control_id = bind_data[dynamicId].control_id;
237
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
238
- });
239
- }
240
- break;
241
- case 3:
242
- jQuery("#div_3_3").clone(false).attr("id","div_"+dynamicId+"_3").appendTo("#left_block");
243
- jQuery("#div_"+dynamicId+"_3").children("label").attr("id","control_label_"+dynamicId);
244
- jQuery("#div_"+dynamicId+"_3").children("div").attr("id","show_tooltip"+dynamicId);
245
- jQuery("#show_tooltip"+dynamicId).children("input[type=\"text\"]").attr("id","ux_txt_email_"+dynamicId);
246
- jQuery("#show_tooltip"+dynamicId).children("input[type=\"text\"]").attr("name","ux_txt_email_"+dynamicId);
247
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
248
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",3)");
249
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
250
- jQuery("#show_tooltip"+dynamicId).children("span").attr("id","txt_description_"+dynamicId);
251
- jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_email_control_tooltip_"+dynamicId).css("display","none");
252
- jQuery("#show_tooltip"+dynamicId).children("div:eq(1)").attr("id","ux_email_control_placeholder_"+dynamicId).css("display","none");
253
- jQuery("#div_"+dynamicId+"_3").attr("style","display:block");
254
- jQuery(".hovertip").tooltip_tip({placement: "left"});
255
- if(typeof type == "undefined")
256
- {
257
- jQuery.post(ajaxurl,
258
- {
259
- ux_hd_textbox_dynamic_id: dynamicId,
260
- form_id: form_id,
261
- events: "add",
262
- param: "save_email_control",
263
- action: "add_contact_form_library",
264
- },
265
- function(data)
266
- {
267
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",3,"+data+");");
268
- });
269
- }
270
- else
271
- {
272
- jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
273
- {
274
- var bind_data = JSON.parse(data);
275
- jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
276
- jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
277
- jQuery("#ux_email_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
278
- jQuery("#ux_email_control_placeholder_"+dynamicId).html(bind_data[dynamicId].cb_default_txt_val);
279
- jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_email_control_tooltip_"+dynamicId).text());
280
- jQuery("#ux_txt_email_"+dynamicId).attr("placeholder",jQuery("#ux_email_control_placeholder_"+dynamicId).text());
281
- if(bind_data[dynamicId].cb_control_required == "1")
282
- {
283
- jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
284
- }
285
- var control_id = bind_data[dynamicId].control_id;
286
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
287
- });
288
- }
289
- break;
290
- case 4:
291
- jQuery("#div_4_4").clone(false).attr("id","div_"+dynamicId+"_4").appendTo("#left_block");
292
- jQuery("#div_"+dynamicId+"_4").children("label").attr("id","control_label_"+dynamicId);
293
- jQuery("#div_"+dynamicId+"_4").children("div").attr("id","show_tooltip"+dynamicId);
294
- jQuery("#show_tooltip"+dynamicId ).children("select[type=\"select\"]").attr("id","ux_ddl_select_control"+dynamicId);
295
- jQuery("#show_tooltip"+dynamicId ).children("select[type=\"select\"]").attr("name","ux_ddl_select_control"+dynamicId);
296
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
297
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",4)");
298
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
299
- jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_ddl_control_tooltip_"+dynamicId).css("display","none");
300
- jQuery("#div_"+dynamicId+"_4").attr("style","display:block");
301
- jQuery(".hovertip").tooltip_tip({placement: "left"});
302
- if(typeof type == "undefined")
303
- {
304
- jQuery.post(ajaxurl,
305
- {
306
- ux_hd_textbox_dynamic_id: dynamicId,
307
- form_id: form_id,
308
- events: "add",
309
- param: "save_drop_down_control",
310
- action: "add_contact_form_library",
311
- },
312
- function(data)
313
- {
314
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",4,"+data+");");
315
- });
316
- }
317
- else
318
- {
319
- jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
320
- {
321
- var bind_data = JSON.parse(data);
322
- jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
323
- jQuery("#ux_ddl_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
324
- jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_ddl_control_tooltip_"+dynamicId).text());
325
- if(bind_data[dynamicId].cb_control_required == "1")
326
- {
327
- jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
328
- }
329
- var bind_data_list = bind_data[dynamicId].cb_dropdown_option_id;
330
- for(var flag = 0; flag<bind_data_list.length;flag++)
331
- {
332
- jQuery("#ux_ddl_select_control"+dynamicId).append("<option value=\""+bind_data_list[flag]+"\">"+bind_data[dynamicId].cb_dropdown_option_val[flag]+"</option>");
333
- }
334
- var control_id = bind_data[dynamicId].control_id;
335
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
336
- });
337
- }
338
- break;
339
- case 5:
340
- jQuery("#div_5_5").clone(false).attr("id","div_"+dynamicId+"_5").appendTo("#left_block");
341
- jQuery("#div_"+dynamicId+"_5").children("label").attr("id","control_label_"+dynamicId);
342
- jQuery("#div_"+dynamicId+"_5").children("div").attr("id","post_back_checkbox_"+dynamicId);
343
- jQuery("#post_back_checkbox_"+dynamicId).children("div").attr("id","show_tooltip"+dynamicId);
344
- jQuery("#show_tooltip"+dynamicId ).children("input[type=\"checkbox\"]").attr("id","ux_chk_checkbox_control_"+dynamicId);
345
- jQuery("#show_tooltip"+dynamicId ).children("input[type=\"checkbox\"]").attr("name","ux_chk_checkbox_control_"+dynamicId);
346
- jQuery("#show_tooltip"+dynamicId ).children("span").attr("id","add_chk_options_here_"+dynamicId);
347
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
348
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",5)");
349
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
350
- jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_chk_control_tooltip_"+dynamicId).css("display","none");
351
- jQuery("#div_"+dynamicId+"_5").attr("style","display:block");
352
- jQuery(".hovertip").tooltip_tip({placement: "left"});
353
- if(typeof type == "undefined")
354
- {
355
- jQuery.post(ajaxurl,
356
- {
357
- ux_hd_textbox_dynamic_id: dynamicId,
358
- form_id: form_id,
359
- events: "add",
360
- param: "save_check_box_control",
361
- action: "add_contact_form_library",
362
- },
363
- function(data)
364
- {
365
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",5,"+data+");");
366
- });
367
- }
368
- else
369
- {
370
- jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
371
- {
372
- var bind_data = JSON.parse(data);
373
- jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
374
- jQuery("#ux_chk_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
375
- jQuery("#post_back_checkbox_"+dynamicId).attr("data-original-title",jQuery("#ux_chk_control_tooltip_"+dynamicId).text());
376
- if(bind_data[dynamicId].cb_control_required == "1")
377
- {
378
- jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
379
- }
380
- var bind_chk_list = bind_data[dynamicId].cb_checkbox_option_id;
381
- for(var flag = 0; flag<bind_chk_list.length;flag++)
382
- {
383
- jQuery("#ux_chk_checkbox_control_"+dynamicId).hide();
384
- jQuery("#add_chk_options_here_"+dynamicId).append("<span id=\"input_id_"+bind_chk_list[flag]+"\"><input id=\"ux_chk_checkbox_control_"+bind_chk_list[flag]+"\" name=\"ux_chk_checkbox_control_"+bind_chk_list[flag]+"\" type=\"checkbox\"/><label class=\"rdl\">"+bind_data[dynamicId].cb_checkbox_option_val[flag]+"</label></span>");
385
- }
386
- var control_id = bind_data[dynamicId].control_id;
387
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
388
- });
389
- }
390
- break;
391
- case 6:
392
- jQuery("#div_6_6").clone(false).attr("id","div_"+dynamicId+"_6").appendTo("#left_block");
393
- jQuery("#div_"+dynamicId+"_6").children("label").attr("id","control_label_"+dynamicId);
394
- jQuery("#div_"+dynamicId+"_6").children("div").attr("id","post_back_radio_button_"+dynamicId);
395
- jQuery("#post_back_radio_button_"+dynamicId).children("div").attr("id","show_tooltip"+dynamicId);
396
- jQuery("#show_tooltip"+dynamicId ).children("input[type=\"radio\"]").attr("id","ux_radio_button_control_"+dynamicId);
397
- jQuery("#show_tooltip"+dynamicId ).children("input[type=\"radio\"]").attr("name","ux_radio_button_control_"+dynamicId);
398
- jQuery("#show_tooltip"+dynamicId ).children("span").attr("id","add_radio_options_here_"+dynamicId);
399
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
400
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",6)");
401
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
402
- jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_rdl_control_tooltip_"+dynamicId).css("display","none");
403
- jQuery("#div_"+dynamicId+"_6").attr("style","display:block");
404
- jQuery(".hovertip").tooltip_tip({placement: "left"});
405
- if(typeof type == "undefined")
406
- {
407
- jQuery.post(ajaxurl,
408
- {
409
- ux_hd_textbox_dynamic_id: dynamicId,
410
- form_id: form_id,
411
- events: "add",
412
- param: "save_multiple_control",
413
- action: "add_contact_form_library",
414
- },
415
- function(data)
416
- {
417
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",6,"+data+");");
418
- });
419
- }
420
- else
421
- {
422
- jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
423
- {
424
- var bind_data = JSON.parse(data);
425
- jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
426
- jQuery("#ux_rdl_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
427
- jQuery("#post_back_radio_button_"+dynamicId).attr("data-original-title",jQuery("#ux_rdl_control_tooltip_"+dynamicId).text());
428
- if(bind_data[dynamicId].cb_control_required == "1")
429
- {
430
- jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
431
- }
432
- var bind_rdl_list = bind_data[dynamicId].cb_radio_option_id;
433
- for(var flag = 0; flag<bind_rdl_list.length;flag++)
434
- {
435
- jQuery("#ux_radio_button_control_"+dynamicId).hide();
436
- jQuery("#add_radio_options_here_"+dynamicId).append("<span id=\"input_id_"+bind_rdl_list[flag]+"\"><input id=\"ux_radio_button_control_"+bind_rdl_list[flag]+"\" name=\"ux_radio"+dynamicId+"\" type=\"radio\"/><label class=\"rdl\">"+bind_data[dynamicId].cb_radio_option_val[flag]+"</label></span>");
437
- if(flag == 0)
438
- {
439
- jQuery("#ux_radio_button_control_"+bind_rdl_list[flag]).attr("checked","checked");
440
- }
441
- }
442
- var control_id = bind_data[dynamicId].control_id;
443
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
444
- });
445
- }
446
- break;
447
- case 7:
448
- alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
449
- break;
450
- case 8:
451
- alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
452
- break;
453
- case 9:
454
- alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
455
- break;
456
- case 10:
457
- alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
458
- break;
459
- case 11:
460
- alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
461
- break;
462
- case 12:
463
- alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
464
- break;
465
- case 13:
466
- alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
467
- break;
468
- case 15:
469
- alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
470
- break;
471
- case 16:
472
- alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
473
- break;
474
- }
475
- }
476
- }
477
- <?php
478
  $form_data = $wpdb->get_results
479
  (
480
  $wpdb->prepare
@@ -486,20 +477,19 @@ else
486
  for($flag = 0; $flag < count($form_data);$flag++)
487
  {
488
  ?>
489
- create_control(<?php echo $form_data[$flag]->field_id;?>,<?php echo $form_data[$flag]->column_dynamicId;?>,"edit");
490
  <?php
491
  }
492
  ?>
493
- if (typeof(prevent_paste) != "function")
494
- {
495
- function prevent_paste(control_id)
496
- {
497
- jQuery("#"+control_id).live("paste",function(e)
498
- {
499
- e.preventDefault();
500
- });
501
- }
502
- }
503
  </script>
504
  <?php
505
  }
62
  });
63
  show_url_control();
64
  });
65
+
66
+ function enter_admin_label(dynamicId)
67
+ {
68
+ var ux_label = jQuery("#ux_label_text_"+dynamicId).val();
69
+ jQuery("#ux_admin_label_"+dynamicId).val(ux_label);
70
+ }
71
+
72
+ function delete_textbox(dynamicId,control_type,control_id)
73
+ {
74
+ array_delete_form_controls.push(control_id);
75
+ jQuery("#div_"+dynamicId+"_"+control_type).remove();
76
+ }
77
+
78
+ function add_settings(dynamicId,field_type)
79
+ {
80
+ jQuery.post(ajaxurl, "form_id="+form_id+"&dynamicId="+dynamicId+"&field_type="+field_type+"&param=add_settings_div&action=add_contact_form_library", function(data)
81
+ {
82
+ jQuery("#setting_controls_postback").html(data);
83
+ show_Popup();
84
+ });
85
+ }
86
+
87
+ function show_Popup()
88
+ {
89
+ jQuery(".black_overlay").css("display","block");
90
+ jQuery(".white_content").css("display","block");
91
+ var windowHeight = window.innerHeight - 200;
92
+ var windowWidth = window.innerWidth - 200;
93
+ var anchor = jQuery("<a class=\"closeButtonLightbox\" onclick=\"CloseLightbox();\"></a>");
94
+ jQuery("#setting_controls_postback").append(anchor);
95
+ var lightboxHeight = jQuery("#setting_controls_postback").height();
96
+ var lightboxWidth = jQuery("#setting_controls_postback").width();
97
+ var proposedTop = (window.innerHeight - lightboxHeight - 40) / 2 ;
98
+ var proposedLeft = (window.innerWidth - lightboxWidth - 40) / 2 ;
99
+ jQuery("#setting_controls_postback").css("top",proposedTop + "px");
100
+ jQuery("#setting_controls_postback").css("left",proposedLeft + "px");
101
+ jQuery("#setting_controls_postback").fadeIn(200);
102
+ }
103
+
104
+ function CloseLightbox()
105
+ {
106
+ jQuery("#setting_controls_postback").css("display","none");
107
+ jQuery(".black_overlay").css("display","none");
108
+ jQuery("#fade").fadeOut(200);
109
+ }
110
+
111
+ function show_url_control()
112
+ {
113
+ if(jQuery("#ux_rdl_page").prop("checked") == true)
114
+ {
115
+ jQuery("#div_url").hide();
116
+ jQuery("#div_page").show();
117
+ }
118
+ else
119
+ {
120
+ jQuery("#div_page").hide();
121
+ jQuery("#div_url").show();
122
+ }
123
+ }
124
+
125
+ function create_control(control_type,dynamicId,type)
126
+ {
127
+
128
+ dynamicId = typeof dynamicId !== "undefined" ? dynamicId : Math.floor((Math.random()*100000)+1);
129
+
130
+ switch(parseInt(control_type))
131
+ {
132
+ case 1:
133
+ jQuery("#div_1_1").clone(false).attr("id","div_"+dynamicId+"_1").appendTo("#left_block");
134
+ jQuery("#div_"+dynamicId+"_1").children("label").attr("id","control_label_"+dynamicId);
135
+ jQuery("#div_"+dynamicId+"_1").children("div").attr("id","show_tooltip"+dynamicId);
136
+ jQuery("#show_tooltip"+dynamicId ).children("input[type=\"text\"]").attr("id","ux_txt_textbox_control_"+dynamicId);
137
+ jQuery("#show_tooltip"+dynamicId ).children("input[type=\"text\"]").attr("name","ux_txt_textbox_control_"+dynamicId);
138
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
139
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",1)");
140
+ jQuery("#show_tooltip"+dynamicId).children("a:eq(1)").attr("id","anchor_del_"+dynamicId);
141
+ jQuery("#show_tooltip"+dynamicId).children("span").attr("id","txt_description_"+dynamicId);
142
+ jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_text_control_tooltip_"+dynamicId).css("display","none");
143
+ jQuery("#show_tooltip"+dynamicId).children("div:eq(1)").attr("id","ux_text_control_placeholder_"+dynamicId).css("display","none");
144
+ jQuery("#div_"+dynamicId+"_1").attr("style","display:block");
145
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
146
+
147
+ if(typeof type == "undefined")
148
+ {
149
+ jQuery.post(ajaxurl,
150
+ {
151
+ ux_hd_textbox_dynamic_id: dynamicId,
152
+ form_id: form_id,
153
+ events: "add",
154
+ param: "save_text_control",
155
+ action: "add_contact_form_library",
156
+ },
157
+ function(data)
158
+ {
159
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",1,"+data+");");
160
+ });
161
+ }
162
+ else
163
+ {
164
+ jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
165
+ {
166
+ var bind_data = JSON.parse(data);
167
+
168
+ jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
169
+ jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
170
+ jQuery("#ux_text_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
171
+ jQuery("#ux_text_control_placeholder_"+dynamicId).html(bind_data[dynamicId].cb_default_txt_val);
172
+ jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_text_control_tooltip_"+dynamicId).text());
173
+ jQuery("#ux_txt_textbox_control_"+dynamicId).attr("placeholder",jQuery("#ux_text_control_placeholder_"+dynamicId).text());
174
+ if(bind_data[dynamicId].cb_control_required == "1")
175
+ {
176
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
177
+ }
178
+ var control_id = bind_data[dynamicId].control_id;
179
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
180
+ });
181
+ }
182
+ break;
183
+ case 2:
184
+ jQuery("#div_2_2").clone(false).attr("id","div_"+dynamicId+"_2").appendTo("#left_block");
185
+ jQuery("#div_"+dynamicId+"_2").children("label").attr("id","control_label_"+dynamicId);
186
+ jQuery("#div_"+dynamicId+"_2").children("div").attr("id","show_tooltip"+dynamicId);
187
+ jQuery("#show_tooltip"+dynamicId ).children("textarea[type=\"textarea\"]").attr("id","ux_textarea_control_"+dynamicId);
188
+ jQuery("#show_tooltip"+dynamicId ).children("textarea[type=\"textarea\"]").attr("name","ux_textarea_control_"+dynamicId);
189
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
190
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",2)");
191
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
192
+ jQuery("#show_tooltip"+dynamicId).children("span").attr("id","txt_description_"+dynamicId);
193
+ jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_txtarea_control_tooltip_"+dynamicId).css("display","none");
194
+ jQuery("#show_tooltip"+dynamicId).children("div:eq(1)").attr("id","ux_txtarea_control_placeholder_"+dynamicId).css("display","none");
195
+ jQuery("#div_"+dynamicId+"_2").attr("style","display:block");
196
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
197
+ if(typeof type == "undefined")
198
+ {
199
+ jQuery.post(ajaxurl,
200
+ {
201
+ ux_hd_textbox_dynamic_id: dynamicId,
202
+ form_id: form_id,
203
+ events: "add",
204
+ param: "save_textarea_control",
205
+ action: "add_contact_form_library",
206
+ },
207
+ function(data)
208
+ {
209
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",2,"+data+");");
210
+ });
211
+ }
212
+ else
213
+ {
214
+ jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
215
+ {
216
+ var bind_data = JSON.parse(data);
217
+ jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
218
+ jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
219
+ jQuery("#ux_txtarea_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
220
+ jQuery("#ux_txtarea_control_placeholder_"+dynamicId).html(bind_data[dynamicId].cb_default_txt_val);
221
+ jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_txtarea_control_tooltip_"+dynamicId).text());
222
+ jQuery("#ux_textarea_control_"+dynamicId).attr("placeholder",jQuery("#ux_txtarea_control_placeholder_"+dynamicId).text());
223
+ if(bind_data[dynamicId].cb_control_required == "1")
224
+ {
225
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
226
+ }
227
+ var control_id = bind_data[dynamicId].control_id;
228
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
229
+ });
230
+ }
231
+ break;
232
+ case 3:
233
+ jQuery("#div_3_3").clone(false).attr("id","div_"+dynamicId+"_3").appendTo("#left_block");
234
+ jQuery("#div_"+dynamicId+"_3").children("label").attr("id","control_label_"+dynamicId);
235
+ jQuery("#div_"+dynamicId+"_3").children("div").attr("id","show_tooltip"+dynamicId);
236
+ jQuery("#show_tooltip"+dynamicId).children("input[type=\"text\"]").attr("id","ux_txt_email_"+dynamicId);
237
+ jQuery("#show_tooltip"+dynamicId).children("input[type=\"text\"]").attr("name","ux_txt_email_"+dynamicId);
238
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
239
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",3)");
240
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
241
+ jQuery("#show_tooltip"+dynamicId).children("span").attr("id","txt_description_"+dynamicId);
242
+ jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_email_control_tooltip_"+dynamicId).css("display","none");
243
+ jQuery("#show_tooltip"+dynamicId).children("div:eq(1)").attr("id","ux_email_control_placeholder_"+dynamicId).css("display","none");
244
+ jQuery("#div_"+dynamicId+"_3").attr("style","display:block");
245
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
246
+ if(typeof type == "undefined")
247
+ {
248
+ jQuery.post(ajaxurl,
249
+ {
250
+ ux_hd_textbox_dynamic_id: dynamicId,
251
+ form_id: form_id,
252
+ events: "add",
253
+ param: "save_email_control",
254
+ action: "add_contact_form_library",
255
+ },
256
+ function(data)
257
+ {
258
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",3,"+data+");");
259
+ });
260
+ }
261
+ else
262
+ {
263
+ jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
264
+ {
265
+ var bind_data = JSON.parse(data);
266
+ jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
267
+ jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
268
+ jQuery("#ux_email_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
269
+ jQuery("#ux_email_control_placeholder_"+dynamicId).html(bind_data[dynamicId].cb_default_txt_val);
270
+ jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_email_control_tooltip_"+dynamicId).text());
271
+ jQuery("#ux_txt_email_"+dynamicId).attr("placeholder",jQuery("#ux_email_control_placeholder_"+dynamicId).text());
272
+ if(bind_data[dynamicId].cb_control_required == "1")
273
+ {
274
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
275
+ }
276
+ var control_id = bind_data[dynamicId].control_id;
277
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
278
+ });
279
+ }
280
+ break;
281
+ case 4:
282
+ jQuery("#div_4_4").clone(false).attr("id","div_"+dynamicId+"_4").appendTo("#left_block");
283
+ jQuery("#div_"+dynamicId+"_4").children("label").attr("id","control_label_"+dynamicId);
284
+ jQuery("#div_"+dynamicId+"_4").children("div").attr("id","show_tooltip"+dynamicId);
285
+ jQuery("#show_tooltip"+dynamicId ).children("select[type=\"select\"]").attr("id","ux_ddl_select_control"+dynamicId);
286
+ jQuery("#show_tooltip"+dynamicId ).children("select[type=\"select\"]").attr("name","ux_ddl_select_control"+dynamicId);
287
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
288
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",4)");
289
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
290
+ jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_ddl_control_tooltip_"+dynamicId).css("display","none");
291
+ jQuery("#div_"+dynamicId+"_4").attr("style","display:block");
292
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
293
+ if(typeof type == "undefined")
294
+ {
295
+ jQuery.post(ajaxurl,
296
+ {
297
+ ux_hd_textbox_dynamic_id: dynamicId,
298
+ form_id: form_id,
299
+ events: "add",
300
+ param: "save_drop_down_control",
301
+ action: "add_contact_form_library",
302
+ },
303
+ function(data)
304
+ {
305
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",4,"+data+");");
306
+ });
307
+ }
308
+ else
309
+ {
310
+ jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
311
+ {
312
+ var bind_data = JSON.parse(data);
313
+ jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
314
+ jQuery("#ux_ddl_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
315
+ jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_ddl_control_tooltip_"+dynamicId).text());
316
+ if(bind_data[dynamicId].cb_control_required == "1")
317
+ {
318
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
319
+ }
320
+ var bind_data_list = bind_data[dynamicId].cb_dropdown_option_id;
321
+ for(var flag = 0; flag<bind_data_list.length;flag++)
322
+ {
323
+ jQuery("#ux_ddl_select_control"+dynamicId).append("<option value=\""+bind_data_list[flag]+"\">"+bind_data[dynamicId].cb_dropdown_option_val[flag]+"</option>");
324
+ }
325
+ var control_id = bind_data[dynamicId].control_id;
326
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
327
+ });
328
+ }
329
+ break;
330
+ case 5:
331
+ jQuery("#div_5_5").clone(false).attr("id","div_"+dynamicId+"_5").appendTo("#left_block");
332
+ jQuery("#div_"+dynamicId+"_5").children("label").attr("id","control_label_"+dynamicId);
333
+ jQuery("#div_"+dynamicId+"_5").children("div").attr("id","post_back_checkbox_"+dynamicId);
334
+ jQuery("#post_back_checkbox_"+dynamicId).children("div").attr("id","show_tooltip"+dynamicId);
335
+ jQuery("#show_tooltip"+dynamicId ).children("input[type=\"checkbox\"]").attr("id","ux_chk_checkbox_control_"+dynamicId);
336
+ jQuery("#show_tooltip"+dynamicId ).children("input[type=\"checkbox\"]").attr("name","ux_chk_checkbox_control_"+dynamicId);
337
+ jQuery("#show_tooltip"+dynamicId ).children("span").attr("id","add_chk_options_here_"+dynamicId);
338
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
339
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",5)");
340
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
341
+ jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_chk_control_tooltip_"+dynamicId).css("display","none");
342
+ jQuery("#div_"+dynamicId+"_5").attr("style","display:block");
343
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
344
+ if(typeof type == "undefined")
345
+ {
346
+ jQuery.post(ajaxurl,
347
+ {
348
+ ux_hd_textbox_dynamic_id: dynamicId,
349
+ form_id: form_id,
350
+ events: "add",
351
+ param: "save_check_box_control",
352
+ action: "add_contact_form_library",
353
+ },
354
+ function(data)
355
+ {
356
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",5,"+data+");");
357
+ });
358
+ }
359
+ else
360
+ {
361
+ jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
362
+ {
363
+ var bind_data = JSON.parse(data);
364
+ jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
365
+ jQuery("#ux_chk_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
366
+ jQuery("#post_back_checkbox_"+dynamicId).attr("data-original-title",jQuery("#ux_chk_control_tooltip_"+dynamicId).text());
367
+ if(bind_data[dynamicId].cb_control_required == "1")
368
+ {
369
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
370
+ }
371
+ var bind_chk_list = bind_data[dynamicId].cb_checkbox_option_id;
372
+ for(var flag = 0; flag<bind_chk_list.length;flag++)
373
+ {
374
+ jQuery("#ux_chk_checkbox_control_"+dynamicId).hide();
375
+ jQuery("#add_chk_options_here_"+dynamicId).append("<span id=\"input_id_"+bind_chk_list[flag]+"\"><input id=\"ux_chk_checkbox_control_"+bind_chk_list[flag]+"\" name=\"ux_chk_checkbox_control_"+bind_chk_list[flag]+"\" type=\"checkbox\"/><label class=\"rdl\">"+bind_data[dynamicId].cb_checkbox_option_val[flag]+"</label></span>");
376
+ }
377
+ var control_id = bind_data[dynamicId].control_id;
378
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
379
+ });
380
+ }
381
+ break;
382
+ case 6:
383
+ jQuery("#div_6_6").clone(false).attr("id","div_"+dynamicId+"_6").appendTo("#left_block");
384
+ jQuery("#div_"+dynamicId+"_6").children("label").attr("id","control_label_"+dynamicId);
385
+ jQuery("#div_"+dynamicId+"_6").children("div").attr("id","post_back_radio_button_"+dynamicId);
386
+ jQuery("#post_back_radio_button_"+dynamicId).children("div").attr("id","show_tooltip"+dynamicId);
387
+ jQuery("#show_tooltip"+dynamicId ).children("input[type=\"radio\"]").attr("id","ux_radio_button_control_"+dynamicId);
388
+ jQuery("#show_tooltip"+dynamicId ).children("input[type=\"radio\"]").attr("name","ux_radio_button_control_"+dynamicId);
389
+ jQuery("#show_tooltip"+dynamicId ).children("span").attr("id","add_radio_options_here_"+dynamicId);
390
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
391
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",6)");
392
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
393
+ jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_rdl_control_tooltip_"+dynamicId).css("display","none");
394
+ jQuery("#div_"+dynamicId+"_6").attr("style","display:block");
395
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
396
+ if(typeof type == "undefined")
397
+ {
398
+ jQuery.post(ajaxurl,
399
+ {
400
+ ux_hd_textbox_dynamic_id: dynamicId,
401
+ form_id: form_id,
402
+ events: "add",
403
+ param: "save_multiple_control",
404
+ action: "add_contact_form_library",
405
+ },
406
+ function(data)
407
+ {
408
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",6,"+data+");");
409
+ });
410
+ }
411
+ else
412
+ {
413
+ jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
414
+ {
415
+ var bind_data = JSON.parse(data);
416
+ jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
417
+ jQuery("#ux_rdl_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
418
+ jQuery("#post_back_radio_button_"+dynamicId).attr("data-original-title",jQuery("#ux_rdl_control_tooltip_"+dynamicId).text());
419
+ if(bind_data[dynamicId].cb_control_required == "1")
420
+ {
421
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
422
+ }
423
+ var bind_rdl_list = bind_data[dynamicId].cb_radio_option_id;
424
+ for(var flag = 0; flag<bind_rdl_list.length;flag++)
425
+ {
426
+ jQuery("#ux_radio_button_control_"+dynamicId).hide();
427
+ jQuery("#add_radio_options_here_"+dynamicId).append("<span id=\"input_id_"+bind_rdl_list[flag]+"\"><input id=\"ux_radio_button_control_"+bind_rdl_list[flag]+"\" name=\"ux_radio"+dynamicId+"\" type=\"radio\"/><label class=\"rdl\">"+bind_data[dynamicId].cb_radio_option_val[flag]+"</label></span>");
428
+ if(flag == 0)
429
+ {
430
+ jQuery("#ux_radio_button_control_"+bind_rdl_list[flag]).attr("checked","checked");
431
+ }
432
+ }
433
+ var control_id = bind_data[dynamicId].control_id;
434
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
435
+ });
436
+ }
437
+ break;
438
+ case 7:
439
+ alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
440
+ break;
441
+ case 8:
442
+ alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
443
+ break;
444
+ case 9:
445
+ alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
446
+ break;
447
+ case 10:
448
+ alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
449
+ break;
450
+ case 11:
451
+ alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
452
+ break;
453
+ case 12:
454
+ alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
455
+ break;
456
+ case 13:
457
+ alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
458
+ break;
459
+ case 15:
460
+ alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
461
+ break;
462
+ case 16:
463
+ alert("<?php _e( "This Feature is only available in Premium Editions!", "contact-bank" ); ?>");
464
+ break;
465
+ }
466
+ }
467
+
468
+ <?php
 
 
 
 
 
 
 
 
 
469
  $form_data = $wpdb->get_results
470
  (
471
  $wpdb->prepare
477
  for($flag = 0; $flag < count($form_data);$flag++)
478
  {
479
  ?>
480
+ create_control(<?php echo intval($form_data[$flag]->field_id);?>,<?php echo intval($form_data[$flag]->column_dynamicId);?>,"edit");
481
  <?php
482
  }
483
  ?>
484
+
485
+ function prevent_paste(control_id)
486
+ {
487
+ jQuery("#"+control_id).live("paste",function(e)
488
+ {
489
+ e.preventDefault();
490
+ });
491
+ }
492
+
 
493
  </script>
494
  <?php
495
  }
views/other-settings.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(!defined("ABSPATH")) exit; //exit if accessed directly
3
+ switch($cb_role)
4
+ {
5
+ case "administrator":
6
+ $cb_user_role_permission = "manage_options";
7
+ break;
8
+ case "editor":
9
+ $cb_user_role_permission = "publish_pages";
10
+ break;
11
+ case "author":
12
+ $cb_user_role_permission = "publish_posts";
13
+ break;
14
+ }
15
+ if (!current_user_can($cb_user_role_permission))
16
+ {
17
+ return;
18
+ }
19
+ else
20
+ {
21
+ ?>
22
+ <form id="frm_other_settings" class="layout-form">
23
+ <div id="poststuff" style="width: 99% !important;">
24
+ <div id="post-body" class="metabox-holder">
25
+ <div id="postbox-container-2" class="postbox-container">
26
+ <div id="advanced" class="meta-box-sortables">
27
+ <div id="contact_bank_get_started" class="postbox" >
28
+ <h3 class="hndle"><span><?php _e("Other Settings", "contact-bank"); ?></span></h3>
29
+ <div class="inside">
30
+ <div id="ux_dashboard" class="contact_bank_layout">
31
+ <div class="layout-control-group" style="margin: 10px 0 0 0 ;">
32
+ <label class="layout-control-label" style="width: 170px !important;"><?php _e("Remove Tables at Uninstall", "contact-bank"); ?> :</label>
33
+ <div class="layout-controls-radio">
34
+ <?php $other_settings = get_option("contact-bank-remove-tables");?>
35
+ <input type="radio" name="ux_contact_remove_tables" id="ux_enable_remove_tables" onclick="contact_bank_other_settings(this);" <?php echo $other_settings == "1" ? "checked=\"checked\"" : "";?> value="1"><label style="vertical-align: baseline;"><?php _e("Enable", "contact-bank"); ?></label>
36
+ <input type="radio" name="ux_contact_remove_tables" id="ux_disable_remove_tables" onclick="contact_bank_other_settings(this);" <?php echo $other_settings == "0" ? "checked=\"checked\"" : "";?> style="margin-left: 10px;" value="0"><label style="vertical-align: baseline;"><?php _e("Disable", "contact-bank"); ?></label>
37
+ </div>
38
+ </div>
39
+ <div class="layout-control-group" style="margin:10px 0 10px 0 ;">
40
+ <strong><i>If you would like to remove tables during uninstallation of plugin then you would need to choose enable or vice versa</i></strong>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ </form>
50
+ <script type="text/javascript">
51
+ function contact_bank_other_settings(control)
52
+ {
53
+ var contact_remove_tables = jQuery(control).val();
54
+ jQuery.post(ajaxurl, "contact_remove_tables="+contact_remove_tables+"&param=contact_plugin_remove_tables&action=add_contact_form_library", function(data)
55
+ {
56
+ });
57
+ }
58
+
59
+ </script>
60
+ <?php
61
+ }
62
+ ?>
views/wizard.php CHANGED
@@ -32,9 +32,10 @@ else
32
  <div class="fluid-layout">
33
  <div class="layout-span12 textalign">
34
  <p>Hi there!</p>
35
- <p>Don't ever miss an important opportunity to opt in for Latest Features &amp; Security Updates as well as non-sensitive diagnostic tracking.</p>
36
- <p>If you're not ready to Opt-In, that's ok too!</p>
37
- <p><strong>Contact Bank will still work fine.</strong></p>
 
38
  </div>
39
  </div>
40
  <div class="fluid-layout">
@@ -110,39 +111,35 @@ else
110
  </div>
111
  </div>
112
  <script type="text/javascript">
113
- if(typeof(show_hide_details_contact_bank) != "function")
114
- {
115
- function show_hide_details_contact_bank()
116
- {
117
- if(jQuery("#ux_div_wizard_set_up").hasClass("wizard-set-up"))
118
- {
119
- jQuery("#ux_div_wizard_set_up").css("display","none");
120
- jQuery("#ux_div_wizard_set_up").removeClass("wizard-set-up");
121
- }
122
- else
123
- {
124
- jQuery("#ux_div_wizard_set_up").css("display","block");
125
- jQuery("#ux_div_wizard_set_up").addClass("wizard-set-up");
126
- }
127
- }
128
- }
129
- if(typeof(plugin_stats) != "function")
130
- {
131
- function plugin_stats(type)
132
- {
133
- jQuery.post(ajaxurl,
134
- {
135
- type: type,
136
- param: "wizard_contact",
137
- action: "add_contact_form_library",
138
- _wp_nonce: "<?php echo $contact_bank_check_status; ?>"
139
- },
140
- function(data)
141
- {
142
- window.location.href = "admin.php?page=contact_dashboard";
143
- });
144
- }
145
- }
146
  </script>
147
  <?php
148
  }
32
  <div class="fluid-layout">
33
  <div class="layout-span12 textalign">
34
  <p>Hi there!</p>
35
+ <p>Don't ever miss an opportunity to opt in for Email Notifications / Announcements about exciting New Features and Update Releases.</p>
36
+ <p>Contribute in helping us making our plugin compatible with most plugins and themes by allowing to share non-sensitive information about your website.</p>
37
+ <p>If you're not ready to Opt-In, that's ok too!</p>
38
+ <p><strong>Contact Bank will still work fine.</strong></p>
39
  </div>
40
  </div>
41
  <div class="fluid-layout">
111
  </div>
112
  </div>
113
  <script type="text/javascript">
114
+
115
+ function show_hide_details_contact_bank()
116
+ {
117
+ if(jQuery("#ux_div_wizard_set_up").hasClass("wizard-set-up"))
118
+ {
119
+ jQuery("#ux_div_wizard_set_up").css("display","none");
120
+ jQuery("#ux_div_wizard_set_up").removeClass("wizard-set-up");
121
+ }
122
+ else
123
+ {
124
+ jQuery("#ux_div_wizard_set_up").css("display","block");
125
+ jQuery("#ux_div_wizard_set_up").addClass("wizard-set-up");
126
+ }
127
+ }
128
+
129
+ function plugin_stats(type)
130
+ {
131
+ jQuery.post(ajaxurl,
132
+ {
133
+ type: type,
134
+ param: "wizard_contact",
135
+ action: "add_contact_form_library",
136
+ _wp_nonce: "<?php echo $contact_bank_check_status; ?>"
137
+ },
138
+ function(data)
139
+ {
140
+ window.location.href = "admin.php?page=contact_dashboard";
141
+ });
142
+ }
 
 
 
 
143
  </script>
144
  <?php
145
  }