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 | 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 +1262 -1535
- frontend_views/contact_bank_forms.php +123 -124
- includes/cb_checkbox.php +63 -67
- includes/cb_dropdown.php +64 -68
- includes/cb_email.php +11 -12
- includes/cb_multiple.php +63 -68
- includes/cb_text.php +39 -40
- includes/cb_textarea.php +39 -40
- lib/contact_bank_email-class.php +6 -6
- lib/contact_bank_email_management.php +13 -13
- lib/contact_bank_frontend-class.php +3 -3
- lib/contact_bank_layout_settings-class.php +1 -1
- lib/contact_bank_show_form_control_data-class.php +5 -5
- lib/contact_frontend_data_class.php +3 -3
- lib/contact_view-class.php +52 -78
- lib/install-script.php +188 -205
- lib/uninstall-script.php +0 -37
- readme.txt +9 -0
- uninstall.php +30 -0
- views/add_contact_email.php +80 -87
- views/automatic-plugin-update.php +0 -64
- views/contact_bank_form_preview.php +109 -127
- views/contact_bank_layout_settings.php +164 -196
- views/contact_email_settings.php +58 -62
- views/contact_frontend_data.php +54 -65
- views/contact_view.php +37 -38
- views/dashboard.php +45 -54
- views/header.php +0 -7
- views/includes_common_after.php +414 -424
- views/other-settings.php +62 -0
- views/wizard.php +33 -36
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.
|
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.
|
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 |
-
|
|
|
55 |
{
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
}
|
88 |
-
}
|
89 |
-
}
|
90 |
}
|
91 |
|
|
|
92 |
/*************************************************************************************/
|
93 |
|
94 |
-
|
|
|
95 |
{
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
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 |
-
|
213 |
{
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
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 |
-
|
|
|
307 |
{
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
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 |
-
|
|
|
419 |
{
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
|
448 |
-
}
|
449 |
-
}
|
450 |
}
|
451 |
-
|
|
|
|
|
452 |
{
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
|
477 |
-
}
|
478 |
-
}
|
479 |
}
|
480 |
|
481 |
-
|
|
|
482 |
{
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/wizard.php";
|
499 |
-
}
|
500 |
-
}
|
501 |
}
|
502 |
|
503 |
-
|
|
|
|
|
504 |
{
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
|
529 |
-
}
|
530 |
-
}
|
531 |
}
|
532 |
-
|
|
|
|
|
533 |
{
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
|
558 |
-
}
|
559 |
-
}
|
560 |
}
|
561 |
-
|
562 |
-
|
563 |
function contact_email()
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
}
|
589 |
}
|
590 |
-
|
|
|
|
|
591 |
{
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
|
616 |
-
}
|
617 |
-
}
|
618 |
}
|
619 |
-
|
|
|
|
|
620 |
{
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
|
645 |
-
}
|
646 |
-
}
|
647 |
}
|
648 |
-
|
|
|
|
|
649 |
{
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
|
674 |
-
}
|
675 |
-
}
|
676 |
}
|
677 |
-
|
|
|
678 |
{
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
|
703 |
-
}
|
704 |
-
}
|
705 |
}
|
706 |
-
|
|
|
|
|
707 |
{
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
|
732 |
-
}
|
733 |
-
}
|
734 |
}
|
735 |
-
|
|
|
|
|
736 |
{
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
|
761 |
-
}
|
762 |
-
}
|
763 |
}
|
764 |
-
|
|
|
|
|
765 |
{
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
|
790 |
-
}
|
791 |
-
}
|
792 |
}
|
793 |
-
|
|
|
|
|
794 |
{
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
|
819 |
-
}
|
820 |
-
}
|
821 |
}
|
822 |
-
|
|
|
|
|
823 |
{
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
|
848 |
-
}
|
849 |
-
}
|
850 |
}
|
851 |
-
|
|
|
852 |
{
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
|
877 |
-
}
|
878 |
-
}
|
879 |
}
|
880 |
-
|
|
|
881 |
{
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
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 |
-
|
|
|
|
|
898 |
{
|
899 |
-
|
900 |
-
|
901 |
-
|
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 |
-
|
|
|
|
|
907 |
{
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
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 |
-
|
|
|
|
|
922 |
{
|
923 |
-
|
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 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
}
|
957 |
|
958 |
break;
|
959 |
|
960 |
case "frontend_contact_form_library":
|
961 |
|
962 |
add_action( "admin_init", "frontend_contact_form_library");
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
}
|
973 |
break;
|
974 |
|
975 |
case "email_contact_form_library":
|
976 |
|
977 |
add_action( "admin_init", "email_contact_form_library");
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
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 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
}
|
1015 |
|
1016 |
break;
|
1017 |
|
1018 |
case "frontend_data_contact_library":
|
1019 |
|
1020 |
add_action( "admin_init", "frontend_data_contact_library");
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
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 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
}
|
1068 |
break;
|
1069 |
|
1070 |
case "layout_settings_contact_library":
|
1071 |
|
1072 |
add_action( "admin_init", "layout_settings_contact_library");
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
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 |
-
|
1104 |
{
|
1105 |
-
|
1106 |
-
|
1107 |
-
global $wpdb;
|
1108 |
-
return $wpdb->prefix . "cb_contact_form";
|
1109 |
-
}
|
1110 |
}
|
1111 |
-
|
|
|
|
|
1112 |
{
|
1113 |
-
|
1114 |
-
|
1115 |
-
global $wpdb;
|
1116 |
-
return $wpdb->prefix . "cb_dynamic_settings";
|
1117 |
-
}
|
1118 |
}
|
1119 |
-
|
|
|
1120 |
{
|
1121 |
-
|
1122 |
-
|
1123 |
-
global $wpdb;
|
1124 |
-
return $wpdb->prefix . "cb_create_control_form";
|
1125 |
-
}
|
1126 |
}
|
1127 |
-
|
|
|
1128 |
{
|
1129 |
-
|
1130 |
-
|
1131 |
-
global $wpdb;
|
1132 |
-
return $wpdb->prefix . "cb_frontend_data_table";
|
1133 |
-
}
|
1134 |
}
|
1135 |
-
|
|
|
1136 |
{
|
1137 |
-
|
1138 |
-
|
1139 |
-
global $wpdb;
|
1140 |
-
return $wpdb->prefix . "cb_email_template_admin";
|
1141 |
-
}
|
1142 |
}
|
1143 |
-
|
|
|
1144 |
{
|
1145 |
-
|
1146 |
-
|
1147 |
-
global $wpdb;
|
1148 |
-
return $wpdb->prefix . "cb_frontend_forms_table";
|
1149 |
-
}
|
1150 |
}
|
1151 |
-
|
|
|
1152 |
{
|
1153 |
-
|
1154 |
-
|
1155 |
-
global $wpdb;
|
1156 |
-
return $wpdb->prefix . "cb_form_settings_table";
|
1157 |
-
}
|
1158 |
}
|
1159 |
-
|
|
|
1160 |
{
|
1161 |
-
|
1162 |
-
|
1163 |
-
global $wpdb;
|
1164 |
-
return $wpdb->prefix . "cb_layout_settings_table";
|
1165 |
-
}
|
1166 |
}
|
1167 |
-
|
|
|
1168 |
{
|
1169 |
-
|
1170 |
-
|
1171 |
-
global $wpdb;
|
1172 |
-
return $wpdb->prefix . "cb_licensing";
|
1173 |
-
}
|
1174 |
}
|
1175 |
-
|
|
|
1176 |
{
|
1177 |
-
|
1178 |
-
|
1179 |
-
global $wpdb;
|
1180 |
-
return $wpdb->prefix . "cb_roles_capability";
|
1181 |
-
}
|
1182 |
}
|
1183 |
-
|
|
|
1184 |
{
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
return extract_short_code($form_id,$show_title,$show_desc);
|
1195 |
-
}
|
1196 |
-
}
|
1197 |
}
|
1198 |
-
|
|
|
1199 |
{
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
wp_reset_query();
|
1206 |
-
return $contact_bank_output;
|
1207 |
-
}
|
1208 |
}
|
1209 |
-
|
|
|
1210 |
{
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
}
|
1457 |
-
}
|
1458 |
-
}
|
1459 |
}
|
|
|
1460 |
add_action( "media_buttons_context", "add_contact_shortcode_button", 1);
|
1461 |
-
|
|
|
1462 |
{
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
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 |
-
|
|
|
1474 |
{
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
|
1490 |
-
|
1491 |
-
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
|
1503 |
-
|
1504 |
-
|
1505 |
-
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
-
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
</script>
|
1539 |
-
<?php
|
1540 |
-
}
|
1541 |
}
|
1542 |
-
|
|
|
1543 |
{
|
1544 |
-
|
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 |
-
|
|
|
1563 |
{
|
1564 |
-
|
1565 |
-
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
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 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
-
|
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 |
-
|
|
|
1654 |
{
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
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 |
-
|
1733 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1734 |
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
1742 |
-
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
}
|
1747 |
-
|
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();"/>
|
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 "
|
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 "
|
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; ?>"
|
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; ?>"
|
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; ?>"
|
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"
|
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"
|
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"
|
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"
|
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"
|
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 |
-
|
|
|
473 |
{
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
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_"
|
517 |
break;
|
518 |
case 2:
|
519 |
-
$dynamic .= "ux_textarea_control_"
|
520 |
break;
|
521 |
case 3:
|
522 |
-
$dynamic .= "ux_txt_email_"
|
523 |
break;
|
524 |
case 4:
|
525 |
-
$dynamic .= "ux_select_default_"
|
526 |
break;
|
527 |
case 5:
|
528 |
-
$dynamic .= "'"
|
529 |
break;
|
530 |
case 6:
|
531 |
-
$dynamic .= "'"
|
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:
|
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 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
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:
|
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 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
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 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
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:
|
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 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
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 |
-
|
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:
|
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 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
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:
|
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 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
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 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
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:
|
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 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
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:
|
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."]"
|
43 |
-
$email_from = str_replace("[control_".$dynamicId."]"
|
44 |
-
$email_subject = str_replace("[control_".$dynamicId."]"
|
45 |
-
$email_from_name = str_replace("[control_".$dynamicId."]"
|
46 |
-
$email_reply_to = str_replace("[control_".$dynamicId."]"
|
47 |
-
$email_cc = str_replace("[control_".$dynamicId."]"
|
48 |
-
$email_bcc = str_replace("[control_".$dynamicId."]"
|
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."]"
|
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 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
$plugin_data = @get_plugin_data(WP_PLUGIN_DIR . "/" . $plugin);
|
40 |
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
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 |
-
|
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"] = $
|
93 |
$plugin_stat_data["themes"] = $theme_details;
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
update_option("contact_bank_site_id",$result);
|
108 |
-
curl_close($ch);
|
109 |
-
}
|
110 |
-
else
|
111 |
{
|
112 |
-
|
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>"
|
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 "
|
1029 |
-
|
1030 |
-
|
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 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
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 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
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 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
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 |
-
|
|
|
|
|
|
|
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 |
-
|
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:
|
518 |
email_id: email_id,
|
519 |
form_id: form_id,
|
520 |
param: "insert_email_controls",
|
@@ -530,62 +528,57 @@ else
|
|
530 |
});
|
531 |
}
|
532 |
});
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
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+"¶m=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 "
|
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"
|
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 "
|
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 "
|
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 |
-
|
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 |
-
|
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 |
-
|
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 |
-
|
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 |
-
|
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 |
-
|
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 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
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 |
-
|
|
|
944 |
{
|
945 |
-
|
946 |
-
{
|
947 |
-
alert("<?php _e( "These Features are only available in Premium Editions!", "contact-bank" ); ?>");
|
948 |
-
}
|
949 |
}
|
950 |
-
|
|
|
951 |
{
|
952 |
-
|
953 |
-
|
954 |
-
jQuery("#clr_font_color").farbtastic("#ux_clr_font_color").slideDown();
|
955 |
-
jQuery("#ux_clr_font_color").focus();
|
956 |
-
}
|
957 |
}
|
958 |
-
|
|
|
959 |
{
|
960 |
-
|
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 |
-
|
|
|
967 |
{
|
968 |
-
|
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 |
-
|
|
|
975 |
{
|
976 |
-
|
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 |
-
|
|
|
983 |
{
|
984 |
-
|
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 |
-
|
|
|
991 |
{
|
992 |
-
|
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 |
-
|
|
|
999 |
{
|
1000 |
-
|
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 |
-
|
|
|
1007 |
{
|
1008 |
-
|
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 |
-
|
|
|
1015 |
{
|
1016 |
-
|
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 |
-
|
|
|
1023 |
{
|
1024 |
-
|
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 |
-
|
|
|
1031 |
{
|
1032 |
-
|
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 |
-
|
|
|
1039 |
{
|
1040 |
-
|
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 |
-
|
|
|
1047 |
{
|
1048 |
-
|
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 |
-
|
|
|
1055 |
{
|
1056 |
-
|
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 |
-
|
|
|
1078 |
{
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
e.preventDefault();
|
1087 |
-
return false;
|
1088 |
-
}
|
1089 |
}
|
1090 |
-
|
|
|
1091 |
{
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
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+"¶m=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 |
-
|
|
|
121 |
{
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
jQuery("#ux_email_settings_postback").empty();
|
132 |
-
jQuery("#ux_email_settings_postback").append(data);
|
133 |
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
}
|
156 |
}
|
157 |
-
|
|
|
|
|
158 |
{
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
});
|
168 |
-
}
|
169 |
-
}
|
170 |
}
|
171 |
-
|
|
|
172 |
{
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
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+"¶m=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+"¶m=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 |
-
|
95 |
-
{
|
96 |
function exportTableToCSV(table, filename)
|
97 |
{
|
98 |
-
|
99 |
csv = "";
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
|
111 |
-
|
112 |
|
113 |
-
|
114 |
|
115 |
-
|
116 |
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
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 |
-
|
|
|
145 |
{
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
oTable.fnDestroy();
|
157 |
-
jQuery("#ux_frontend_data_postback").empty();
|
158 |
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
}
|
171 |
}
|
172 |
-
|
|
|
173 |
{
|
174 |
-
|
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+"¶m=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 |
-
|
|
|
546 |
{
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
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:
|
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 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
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 + "¶m=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 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
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 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
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+"¶m=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+"¶m=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+"¶m=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+"¶m=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+"¶m=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+"¶m=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+"¶m=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+"¶m=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 |
-
|
36 |
-
|
37 |
-
|
|
|
38 |
</div>
|
39 |
</div>
|
40 |
<div class="fluid-layout">
|
@@ -110,39 +111,35 @@ else
|
|
110 |
</div>
|
111 |
</div>
|
112 |
<script type="text/javascript">
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
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 |
}
|