Version Description
- Reduces the form creation process. It redirects the user to the form settings after creating the form.
- It is possible to close and open the settings sections to make form editing easier.
Download this release
Release Info
Developer | codepeople |
Plugin | Calculated Fields Form |
Version | 1.1.97 |
Comparing to | |
See all releases |
Code changes from version 1.1.96 to 1.1.97
- README.txt +7 -8
- changelog.txt +5 -0
- cp_calculatedfieldsf_free.php +2 -2
- css/style.css +10 -1
- inc/cpcff_admin_int.inc.php +12 -11
- inc/cpcff_admin_int_list.inc.php +11 -6
- inc/cpcff_main.inc.php +33 -0
- js/fbuilder-pro-admin.jquery.js +14 -1
- js/fbuilder-pro-public.jquery.js +1 -1
README.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://cff.dwbooster.com
|
|
4 |
Tags: form,quote form,contact form,form builder,calculator,calculated,quote calculator,forms,form editor,advanced forms,payment calculator,payment,recurring payment,quote,fields,calculated field,price calculator,email,form design,paypal,equation editor,formula,equation,quote calculator,post,posts,plugin,widget,admin,sidebar,images,image,page,shortcode,products form,woocommerce,addons,layout,session,post,cookie,get,webhook,Dropbox,pdf,language
|
5 |
Requires at least: 3.0.5
|
6 |
Tested up to: 6.0
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -965,6 +965,11 @@ A: Please, follow the steps below:
|
|
965 |
|
966 |
== Changelog ==
|
967 |
|
|
|
|
|
|
|
|
|
|
|
968 |
= 1.1.96 =
|
969 |
|
970 |
* Fixes a conflict with the latest update of The Events Calendar plugin.
|
@@ -1015,10 +1020,4 @@ A: Please, follow the steps below:
|
|
1015 |
= 1.1.88 =
|
1016 |
|
1017 |
* Modifies the method of loading the admin resources to fix a conflict with third-party website builders.
|
1018 |
-
* Modifies the Stripe add-on (Platinum version).
|
1019 |
-
|
1020 |
-
= 1.1.87 =
|
1021 |
-
|
1022 |
-
* Improves the plugin behavior by escaping all field attributes.
|
1023 |
-
* Solves a warning in the CFF WooCommerce add-on (Developer and Platinum versions).
|
1024 |
-
* Fixes a conflict in the CFF - Analytics add-on (Platinum version).
|
4 |
Tags: form,quote form,contact form,form builder,calculator,calculated,quote calculator,forms,form editor,advanced forms,payment calculator,payment,recurring payment,quote,fields,calculated field,price calculator,email,form design,paypal,equation editor,formula,equation,quote calculator,post,posts,plugin,widget,admin,sidebar,images,image,page,shortcode,products form,woocommerce,addons,layout,session,post,cookie,get,webhook,Dropbox,pdf,language
|
5 |
Requires at least: 3.0.5
|
6 |
Tested up to: 6.0
|
7 |
+
Stable tag: 1.1.97
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
965 |
|
966 |
== Changelog ==
|
967 |
|
968 |
+
= 1.1.97 =
|
969 |
+
|
970 |
+
* Reduces the form creation process. It redirects the user to the form settings after creating the form.
|
971 |
+
* It is possible to close and open the settings sections to make form editing easier.
|
972 |
+
|
973 |
= 1.1.96 =
|
974 |
|
975 |
* Fixes a conflict with the latest update of The Events Calendar plugin.
|
1020 |
= 1.1.88 =
|
1021 |
|
1022 |
* Modifies the method of loading the admin resources to fix a conflict with third-party website builders.
|
1023 |
+
* Modifies the Stripe add-on (Platinum version).
|
|
|
|
|
|
|
|
|
|
|
|
changelog.txt
CHANGED
@@ -1,5 +1,10 @@
|
|
1 |
== Changelog ==
|
2 |
|
|
|
|
|
|
|
|
|
|
|
3 |
= 1.1.96 =
|
4 |
|
5 |
* Fixes a conflict with the latest update of The Events Calendar plugin.
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 1.1.97 =
|
4 |
+
|
5 |
+
* Reduces the form creation process. It redirects the user to the form settings after creating the form.
|
6 |
+
* It is possible to close and open the settings sections to make form editing easier.
|
7 |
+
|
8 |
= 1.1.96 =
|
9 |
|
10 |
* Fixes a conflict with the latest update of The Events Calendar plugin.
|
cp_calculatedfieldsf_free.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Calculated Fields Form
|
4 |
Plugin URI: https://cff.dwbooster.com
|
5 |
Description: Create forms with field values calculated based in other form field values.
|
6 |
-
Version: 1.1.
|
7 |
Text Domain: calculated-fields-form
|
8 |
Author: CodePeople
|
9 |
Author URI: https://cff.dwbooster.com
|
@@ -16,7 +16,7 @@ if(!defined('WP_DEBUG') || true != WP_DEBUG)
|
|
16 |
}
|
17 |
|
18 |
// Defining main constants
|
19 |
-
define('CP_CALCULATEDFIELDSF_VERSION', '1.1.
|
20 |
define('CP_CALCULATEDFIELDSF_MAIN_FILE_PATH', __FILE__ );
|
21 |
define('CP_CALCULATEDFIELDSF_BASE_PATH', dirname( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
|
22 |
define('CP_CALCULATEDFIELDSF_BASE_NAME', plugin_basename( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
|
3 |
Plugin Name: Calculated Fields Form
|
4 |
Plugin URI: https://cff.dwbooster.com
|
5 |
Description: Create forms with field values calculated based in other form field values.
|
6 |
+
Version: 1.1.97
|
7 |
Text Domain: calculated-fields-form
|
8 |
Author: CodePeople
|
9 |
Author URI: https://cff.dwbooster.com
|
16 |
}
|
17 |
|
18 |
// Defining main constants
|
19 |
+
define('CP_CALCULATEDFIELDSF_VERSION', '1.1.97' );
|
20 |
define('CP_CALCULATEDFIELDSF_MAIN_FILE_PATH', __FILE__ );
|
21 |
define('CP_CALCULATEDFIELDSF_BASE_PATH', dirname( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
|
22 |
define('CP_CALCULATEDFIELDSF_BASE_NAME', plugin_basename( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
|
css/style.css
CHANGED
@@ -243,6 +243,14 @@ textarea {resize: none}
|
|
243 |
#fbuilder span.uh{display:block;font-size:80%;clear:both}
|
244 |
#fbuilder .section_break{border-top:1px dotted #555;clear:both}
|
245 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
/* TABS */
|
247 |
.form-builder #tabs{height:650px;width:100%;overflow:hidden;position:relative;}
|
248 |
.form-builder #tabs-1,
|
@@ -363,7 +371,8 @@ a.helpfbuilder{font-size:80%;text-decoration:underline;color:#00f;cursor:pointer
|
|
363 |
}
|
364 |
|
365 |
.metabox_disabled_section{cursor:pointer !important;}
|
366 |
-
.metabox_disabled_section * {color:#bfbdbd91 !important;
|
|
|
367 |
.metabox_disabled_section #captchaimg{opacity:0.3;}
|
368 |
|
369 |
.cff-addons-category{display:inline-block;font-weight:bold;text-transform:capitalize;border-bottom:1px solid #eee;margin-bottom:10px;padding-bottom:5px;}
|
243 |
#fbuilder span.uh{display:block;font-size:80%;clear:both}
|
244 |
#fbuilder .section_break{border-top:1px dotted #555;clear:both}
|
245 |
|
246 |
+
/* METABOX */
|
247 |
+
.cff-metabox .hndle{cursor:pointer !important;}
|
248 |
+
.cff-metabox .hndle::before{display:inline-block;padding-left:10px;padding-right:10px;}
|
249 |
+
.cff-metabox.cff-metabox-closed .hndle::before{content:"\276F";}
|
250 |
+
.cff-metabox.cff-metabox-opened .hndle::before{content:"\276F";transform:rotate(90deg);}
|
251 |
+
.cff-metabox.cff-metabox-closed{background-color:#F6F6F6;}
|
252 |
+
.cff-metabox.cff-metabox-closed .inside{display:none;}
|
253 |
+
|
254 |
/* TABS */
|
255 |
.form-builder #tabs{height:650px;width:100%;overflow:hidden;position:relative;}
|
256 |
.form-builder #tabs-1,
|
371 |
}
|
372 |
|
373 |
.metabox_disabled_section{cursor:pointer !important;}
|
374 |
+
.metabox_disabled_section * {color:#bfbdbd91 !important;}
|
375 |
+
.metabox_disabled_section .inside * {color:#bfbdbd91 !important;pointer-events: none !important;}
|
376 |
.metabox_disabled_section #captchaimg{opacity:0.3;}
|
377 |
|
378 |
.cff-addons-category{display:inline-block;font-weight:bold;text-transform:capitalize;border-bottom:1px solid #eee;margin-bottom:10px;padding-bottom:5px;}
|
inc/cpcff_admin_int.inc.php
CHANGED
@@ -118,6 +118,7 @@ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
|
|
118 |
<link href="<?php print esc_attr(plugins_url('/vendors/jquery-ui/jquery-ui.min.css', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH)); ?>" type="text/css" rel="stylesheet" property="stylesheet" />
|
119 |
<pre style="display:none;">
|
120 |
<script type="text/javascript">
|
|
|
121 |
try
|
122 |
{
|
123 |
function calculatedFieldsFormReady()
|
@@ -183,7 +184,7 @@ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
|
|
183 |
stop: function(){$calculatedfieldsfQuery('.ctrlsColumn .itemForm').removeClass('button-primary');}
|
184 |
});
|
185 |
|
186 |
-
jQuery(".metabox_disabled_section")
|
187 |
.click( function(){
|
188 |
if(confirm("<?php _e( 'These features aren\'t available in this version. Do you want to open the plugin\'s page to check other versions?', 'calculated-fields-form' ); ?>"))
|
189 |
document.location = 'https://cff.dwbooster.com/';
|
@@ -254,7 +255,7 @@ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
|
|
254 |
<a href="#metabox_email_copy_to_user"><?php _e('Email copy to user', 'calculated-fields-form'); ?></a> |
|
255 |
<a href="#metabox_captcha_settings"><?php _e('Captcha settings', 'calculated-fields-form'); ?></a>
|
256 |
</div>
|
257 |
-
<div id="metabox_define_texts" class="postbox" >
|
258 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Define Texts', 'calculated-fields-form' ); ?></span></h3>
|
259 |
<div class="inside">
|
260 |
<table class="form-table">
|
@@ -291,7 +292,7 @@ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
|
|
291 |
</div>
|
292 |
</div>
|
293 |
|
294 |
-
<div id="metabox_define_validation_texts" class="postbox" >
|
295 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Validation Settings', 'calculated-fields-form' ); ?></span></h3>
|
296 |
<div class="inside">
|
297 |
<table class="form-table">
|
@@ -358,9 +359,9 @@ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
|
|
358 |
<div id="metabox_basic_settings" class="postbox" >
|
359 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Note', 'calculated-fields-form' ); ?></span></h3>
|
360 |
<div class="inside">
|
361 |
-
<?php _e( 'To
|
362 |
-
<?php print '<
|
363 |
-
<?php _e( '
|
364 |
<br /><br />
|
365 |
</div>
|
366 |
</div>
|
@@ -389,7 +390,7 @@ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
|
|
389 |
<h2><?php _e( 'Form Processing and Payment Settings', 'calculated-fields-form' ); ?>:</h2>
|
390 |
<hr />
|
391 |
|
392 |
-
<div id="metabox_payment_settings" class="postbox metabox_disabled_section" style="position:relative;">
|
393 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Payment Settings', 'calculated-fields-form' ); ?></span></h3>
|
394 |
<div class="inside">
|
395 |
|
@@ -440,7 +441,7 @@ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
|
|
440 |
</div>
|
441 |
</div>
|
442 |
|
443 |
-
<div id="metabox_paypal_integration" class="postbox metabox_disabled_section">
|
444 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Paypal Payment Configuration', 'calculated-fields-form' ); ?></span></h3>
|
445 |
<div class="inside">
|
446 |
|
@@ -514,7 +515,7 @@ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
|
|
514 |
</div>
|
515 |
</div>
|
516 |
|
517 |
-
<div id="metabox_notification_email" class="postbox metabox_disabled_section" >
|
518 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Form Processing / Email Settings', 'calculated-fields-form' ); ?></span></h3>
|
519 |
<div class="inside">
|
520 |
<table class="form-table">
|
@@ -564,7 +565,7 @@ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
|
|
564 |
</div>
|
565 |
|
566 |
|
567 |
-
<div id="metabox_email_copy_to_user" class="postbox metabox_disabled_section" >
|
568 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Email Copy to User', 'calculated-fields-form' ); ?></span></h3>
|
569 |
<div class="inside">
|
570 |
<table class="form-table">
|
@@ -605,7 +606,7 @@ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
|
|
605 |
</div>
|
606 |
</div>
|
607 |
|
608 |
-
<div id="metabox_captcha_settings" class="postbox metabox_disabled_section" >
|
609 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Captcha Verification', 'calculated-fields-form' ); ?></span></h3>
|
610 |
<div class="inside">
|
611 |
<table class="form-table">
|
118 |
<link href="<?php print esc_attr(plugins_url('/vendors/jquery-ui/jquery-ui.min.css', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH)); ?>" type="text/css" rel="stylesheet" property="stylesheet" />
|
119 |
<pre style="display:none;">
|
120 |
<script type="text/javascript">
|
121 |
+
var cff_metabox_nonce = '<?php print esc_js( wp_create_nonce( 'cff-metabox-status' ) ); ?>';
|
122 |
try
|
123 |
{
|
124 |
function calculatedFieldsFormReady()
|
184 |
stop: function(){$calculatedfieldsfQuery('.ctrlsColumn .itemForm').removeClass('button-primary');}
|
185 |
});
|
186 |
|
187 |
+
jQuery(".metabox_disabled_section .inside")
|
188 |
.click( function(){
|
189 |
if(confirm("<?php _e( 'These features aren\'t available in this version. Do you want to open the plugin\'s page to check other versions?', 'calculated-fields-form' ); ?>"))
|
190 |
document.location = 'https://cff.dwbooster.com/';
|
255 |
<a href="#metabox_email_copy_to_user"><?php _e('Email copy to user', 'calculated-fields-form'); ?></a> |
|
256 |
<a href="#metabox_captcha_settings"><?php _e('Captcha settings', 'calculated-fields-form'); ?></a>
|
257 |
</div>
|
258 |
+
<div id="metabox_define_texts" class="postbox cff-metabox <?php print esc_attr($cpcff_main->metabox_status( 'metabox_define_texts' ) ); ?>" >
|
259 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Define Texts', 'calculated-fields-form' ); ?></span></h3>
|
260 |
<div class="inside">
|
261 |
<table class="form-table">
|
292 |
</div>
|
293 |
</div>
|
294 |
|
295 |
+
<div id="metabox_define_validation_texts" class="postbox cff-metabox <?php print esc_attr($cpcff_main->metabox_status( 'metabox_define_validation_texts' ) ); ?>" >
|
296 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Validation Settings', 'calculated-fields-form' ); ?></span></h3>
|
297 |
<div class="inside">
|
298 |
<table class="form-table">
|
359 |
<div id="metabox_basic_settings" class="postbox" >
|
360 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Note', 'calculated-fields-form' ); ?></span></h3>
|
361 |
<div class="inside">
|
362 |
+
<?php _e( 'To display the form in a post/page, enter your shortcode in the post/page content:', 'calculated-fields-form' ); ?>
|
363 |
+
<?php print '<b>[CP_CALCULATED_FIELDS id="'.CP_CALCULATEDFIELDSF_ID.'"]</b>'; ?><br />
|
364 |
+
<?php _e( 'The CFF plugin implements widgets and blocks to allow inserting the form visually with the most popular page builders such as Gutenberg Editor, Classic Editor, Elementor, Site Origin, Visual Composer, Beaver Builder, Divi, and for the other page builders insert the shortcode directly.', 'calculated-fields-form' ); ?>
|
365 |
<br /><br />
|
366 |
</div>
|
367 |
</div>
|
390 |
<h2><?php _e( 'Form Processing and Payment Settings', 'calculated-fields-form' ); ?>:</h2>
|
391 |
<hr />
|
392 |
|
393 |
+
<div id="metabox_payment_settings" class="postbox metabox_disabled_section cff-metabox <?php print esc_attr($cpcff_main->metabox_status( 'metabox_payment_settings' ) ); ?>" style="position:relative;">
|
394 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Payment Settings', 'calculated-fields-form' ); ?></span></h3>
|
395 |
<div class="inside">
|
396 |
|
441 |
</div>
|
442 |
</div>
|
443 |
|
444 |
+
<div id="metabox_paypal_integration" class="postbox metabox_disabled_section cff-metabox <?php print esc_attr($cpcff_main->metabox_status( 'metabox_paypal_integration' ) ); ?>">
|
445 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Paypal Payment Configuration', 'calculated-fields-form' ); ?></span></h3>
|
446 |
<div class="inside">
|
447 |
|
515 |
</div>
|
516 |
</div>
|
517 |
|
518 |
+
<div id="metabox_notification_email" class="postbox metabox_disabled_section cff-metabox <?php print esc_attr($cpcff_main->metabox_status( 'metabox_notification_email' ) ); ?>" >
|
519 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Form Processing / Email Settings', 'calculated-fields-form' ); ?></span></h3>
|
520 |
<div class="inside">
|
521 |
<table class="form-table">
|
565 |
</div>
|
566 |
|
567 |
|
568 |
+
<div id="metabox_email_copy_to_user" class="postbox metabox_disabled_section cff-metabox <?php print esc_attr($cpcff_main->metabox_status( 'metabox_email_copy_to_user' ) ); ?>" >
|
569 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Email Copy to User', 'calculated-fields-form' ); ?></span></h3>
|
570 |
<div class="inside">
|
571 |
<table class="form-table">
|
606 |
</div>
|
607 |
</div>
|
608 |
|
609 |
+
<div id="metabox_captcha_settings" class="postbox metabox_disabled_section cff-metabox <?php print esc_attr($cpcff_main->metabox_status( 'metabox_captcha_settings' ) ); ?>" >
|
610 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Captcha Verification', 'calculated-fields-form' ); ?></span></h3>
|
611 |
<div class="inside">
|
612 |
<table class="form-table">
|
inc/cpcff_admin_int_list.inc.php
CHANGED
@@ -56,7 +56,7 @@ if( isset($_REQUEST['cp_default_template']) )
|
|
56 |
if (isset($_GET['a']) && $_GET['a'] == '1')
|
57 |
{
|
58 |
check_admin_referer( 'cff-add-form', '_cpcff_nonce' );
|
59 |
-
$cpcff_main->create_form(
|
60 |
isset($_GET["name"]) ? sanitize_text_field(stripcslashes($_GET["name"])) : '',
|
61 |
isset($_GET["category"]) ? sanitize_text_field(stripcslashes($_GET["category"])) : ''
|
62 |
);
|
@@ -66,6 +66,10 @@ if (isset($_GET['a']) && $_GET['a'] == '1')
|
|
66 |
update_option('calculated-fields-form-category', sanitize_text_field(stripcslashes($_GET["category"])));
|
67 |
|
68 |
$message = __( "Item added", 'calculated-fields-form' );
|
|
|
|
|
|
|
|
|
69 |
}
|
70 |
else if (!empty($_GET['u']))
|
71 |
{
|
@@ -152,6 +156,7 @@ endif;
|
|
152 |
<h1><?php _e( 'Calculated Fields Form', 'calculated-fields-form' ); ?></h1>
|
153 |
|
154 |
<script type="text/javascript">
|
|
|
155 |
function cp_addItem()
|
156 |
{
|
157 |
var calname = document.getElementById("cp_itemname").value,
|
@@ -241,7 +246,7 @@ endif;
|
|
241 |
<div id="normal-sortables" class="meta-box-sortables">
|
242 |
|
243 |
<!-- Form Categories -->
|
244 |
-
<div id="
|
245 |
<div class="inside" style="overflow-x:auto;">
|
246 |
<form action="admin.php?page=cp_calculated_fields_form" method="post">
|
247 |
<?php
|
@@ -265,7 +270,7 @@ endif;
|
|
265 |
</div>
|
266 |
|
267 |
<!-- Forms List -->
|
268 |
-
<div id="
|
269 |
<h3 class='hndle' style="padding:5px;"><span><?php
|
270 |
_e( 'Form List / Items List', 'calculated-fields-form' );
|
271 |
|
@@ -310,7 +315,7 @@ endif;
|
|
310 |
</div>
|
311 |
</div>
|
312 |
|
313 |
-
<div id="
|
314 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'New Form', 'calculated-fields-form' ); ?></span></h3>
|
315 |
<div class="inside">
|
316 |
<form name="additem">
|
@@ -329,7 +334,7 @@ endif;
|
|
329 |
</div>
|
330 |
</div>
|
331 |
<i id="default-settings-section"></i>
|
332 |
-
<div id="
|
333 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Default Settings', 'calculated-fields-form' ); ?></span></h3>
|
334 |
<div class="inside">
|
335 |
<p><?php _e('Applies the default settings to new forms.', 'calculated-fields-form'); ?></p>
|
@@ -362,7 +367,7 @@ endif;
|
|
362 |
<div><?php _e('For additional resources visit the plugin\'s', 'calculated-fields-form')?> <a href="https://cff-bundles.dwbooster.com" target="_blank" style="font-weight:bold;"><?php _e('Marketplace', 'calculated-fields-form'); ?></a></div>
|
363 |
<div class="cff-bundles-plugin"></div>
|
364 |
</div>
|
365 |
-
<div id="
|
366 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Troubleshoot Area & General Settings', 'calculated-fields-form' ); ?></span></h3>
|
367 |
<div class="inside">
|
368 |
<form name="updatesettings">
|
56 |
if (isset($_GET['a']) && $_GET['a'] == '1')
|
57 |
{
|
58 |
check_admin_referer( 'cff-add-form', '_cpcff_nonce' );
|
59 |
+
$new_form = $cpcff_main->create_form(
|
60 |
isset($_GET["name"]) ? sanitize_text_field(stripcslashes($_GET["name"])) : '',
|
61 |
isset($_GET["category"]) ? sanitize_text_field(stripcslashes($_GET["category"])) : ''
|
62 |
);
|
66 |
update_option('calculated-fields-form-category', sanitize_text_field(stripcslashes($_GET["category"])));
|
67 |
|
68 |
$message = __( "Item added", 'calculated-fields-form' );
|
69 |
+
if($new_form)
|
70 |
+
{
|
71 |
+
print "<script>document.location = 'admin.php?page=cp_calculated_fields_form&cal=".$new_form->get_id()."&r=".rand()."&_cpcff_nonce=".wp_create_nonce( 'cff-form-settings' )."';</script>";
|
72 |
+
}
|
73 |
}
|
74 |
else if (!empty($_GET['u']))
|
75 |
{
|
156 |
<h1><?php _e( 'Calculated Fields Form', 'calculated-fields-form' ); ?></h1>
|
157 |
|
158 |
<script type="text/javascript">
|
159 |
+
var cff_metabox_nonce = '<?php print esc_js( wp_create_nonce( 'cff-metabox-status' ) ); ?>';
|
160 |
function cp_addItem()
|
161 |
{
|
162 |
var calname = document.getElementById("cp_itemname").value,
|
246 |
<div id="normal-sortables" class="meta-box-sortables">
|
247 |
|
248 |
<!-- Form Categories -->
|
249 |
+
<div id="metabox_categories_list" class="postbox" >
|
250 |
<div class="inside" style="overflow-x:auto;">
|
251 |
<form action="admin.php?page=cp_calculated_fields_form" method="post">
|
252 |
<?php
|
270 |
</div>
|
271 |
|
272 |
<!-- Forms List -->
|
273 |
+
<div id="metabox_form_list" class="postbox" >
|
274 |
<h3 class='hndle' style="padding:5px;"><span><?php
|
275 |
_e( 'Form List / Items List', 'calculated-fields-form' );
|
276 |
|
315 |
</div>
|
316 |
</div>
|
317 |
|
318 |
+
<div id="metabox_new_form_area" class="postbox" >
|
319 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'New Form', 'calculated-fields-form' ); ?></span></h3>
|
320 |
<div class="inside">
|
321 |
<form name="additem">
|
334 |
</div>
|
335 |
</div>
|
336 |
<i id="default-settings-section"></i>
|
337 |
+
<div id="metabox_default_settings" class="postbox cff-metabox <?php print esc_attr($cpcff_main->metabox_status( 'metabox_default_settings' ) ); ?>" >
|
338 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Default Settings', 'calculated-fields-form' ); ?></span></h3>
|
339 |
<div class="inside">
|
340 |
<p><?php _e('Applies the default settings to new forms.', 'calculated-fields-form'); ?></p>
|
367 |
<div><?php _e('For additional resources visit the plugin\'s', 'calculated-fields-form')?> <a href="https://cff-bundles.dwbooster.com" target="_blank" style="font-weight:bold;"><?php _e('Marketplace', 'calculated-fields-form'); ?></a></div>
|
368 |
<div class="cff-bundles-plugin"></div>
|
369 |
</div>
|
370 |
+
<div id="metabox_troubleshoot_area" class="postbox cff-metabox <?php print esc_attr($cpcff_main->metabox_status( 'metabox_troubleshoot_area' ) ); ?>" >
|
371 |
<h3 class='hndle' style="padding:5px;"><span><?php _e( 'Troubleshoot Area & General Settings', 'calculated-fields-form' ); ?></span></h3>
|
372 |
<div class="inside">
|
373 |
<form name="updatesettings">
|
inc/cpcff_main.inc.php
CHANGED
@@ -171,6 +171,9 @@ if(!class_exists('CPCFF_MAIN'))
|
|
171 |
update_option('CP_CALCULATEDFIELDSF_VERSION', CP_CALCULATEDFIELDSF_VERSION);
|
172 |
}
|
173 |
|
|
|
|
|
|
|
174 |
// Adds the plugin links in the plugins sections
|
175 |
add_filter( 'plugin_action_links_'.CP_CALCULATEDFIELDSF_BASE_NAME, array($this, 'links' ) );
|
176 |
|
@@ -380,6 +383,36 @@ if(!class_exists('CPCFF_MAIN'))
|
|
380 |
}
|
381 |
} // End admin_resources
|
382 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
public function form_preview( $atts )
|
384 |
{
|
385 |
if(isset($atts['shortcode_atts']))
|
171 |
update_option('CP_CALCULATEDFIELDSF_VERSION', CP_CALCULATEDFIELDSF_VERSION);
|
172 |
}
|
173 |
|
174 |
+
// Update metabox status if corresponds
|
175 |
+
$this->update_metabox_status();
|
176 |
+
|
177 |
// Adds the plugin links in the plugins sections
|
178 |
add_filter( 'plugin_action_links_'.CP_CALCULATEDFIELDSF_BASE_NAME, array($this, 'links' ) );
|
179 |
|
383 |
}
|
384 |
} // End admin_resources
|
385 |
|
386 |
+
public function metabox_status( $metabox_id )
|
387 |
+
{
|
388 |
+
$statuses = get_option( 'cff-metaboxes-statuses', [] );
|
389 |
+
return ( ! empty( $statuses ) && is_array( $statuses ) && isset( $statuses[ $metabox_id ] ) && $statuses[ $metabox_id ] == 0) ? 'cff-metabox-closed' : 'cff-metabox-opened';
|
390 |
+
} // End metabox_status
|
391 |
+
|
392 |
+
private function update_metabox_status()
|
393 |
+
{
|
394 |
+
if(
|
395 |
+
! empty( $_POST['cff-metabox-nonce'] ) &&
|
396 |
+
wp_verify_nonce( $_POST['cff-metabox-nonce'], 'cff-metabox-status' ) &&
|
397 |
+
isset( $_POST['cff-metabox-id'] ) &&
|
398 |
+
isset( $_POST['cff-metabox-action'] )
|
399 |
+
)
|
400 |
+
{
|
401 |
+
$metabox_id = sanitize_text_field( wp_unslash( $_POST['cff-metabox-id'] ) );
|
402 |
+
$metabox_action = sanitize_text_field( wp_unslash( $_POST['cff-metabox-action'] ) );
|
403 |
+
|
404 |
+
if( ! empty( $metabox_id ) ) {
|
405 |
+
$statuses = get_option( 'cff-metaboxes-statuses', [] );
|
406 |
+
if( empty( $statuses ) || ! is_array( $statuses ) )
|
407 |
+
{
|
408 |
+
$statuses = [];
|
409 |
+
}
|
410 |
+
$statuses[$metabox_id] = $metabox_action == 'open' ? 1 : 0;
|
411 |
+
update_option( 'cff-metaboxes-statuses', $statuses );
|
412 |
+
}
|
413 |
+
}
|
414 |
+
} // End update_metabox_status
|
415 |
+
|
416 |
public function form_preview( $atts )
|
417 |
{
|
418 |
if(isset($atts['shortcode_atts']))
|
js/fbuilder-pro-admin.jquery.js
CHANGED
@@ -1237,4 +1237,17 @@
|
|
1237 |
return 'Not available yet';
|
1238 |
}
|
1239 |
}
|
1240 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1237 |
return 'Not available yet';
|
1238 |
}
|
1239 |
}
|
1240 |
+
);
|
1241 |
+
|
1242 |
+
$( '.cff-metabox .hndle' ).on( 'click', function(){
|
1243 |
+
var e = $( this ).closest('.cff-metabox');
|
1244 |
+
e.toggleClass( 'cff-metabox-opened cff-metabox-closed' );
|
1245 |
+
$.post(
|
1246 |
+
'admin.php?page=cp_calculated_fields_form',
|
1247 |
+
{
|
1248 |
+
'cff-metabox-id' : e.attr('id'),
|
1249 |
+
'cff-metabox-action' : e.hasClass( 'cff-metabox-opened' ) ? 'open' : 'close',
|
1250 |
+
'cff-metabox-nonce' : cff_metabox_nonce || 0
|
1251 |
+
}
|
1252 |
+
);
|
1253 |
+
} );
|
js/fbuilder-pro-public.jquery.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
$.fbuilder['version'] = '1.1.
|
2 |
$.fbuilder['controls'] = $.fbuilder['controls'] || {};
|
3 |
$.fbuilder['forms'] = $.fbuilder['forms'] || {};
|
4 |
|
1 |
+
$.fbuilder['version'] = '1.1.97';
|
2 |
$.fbuilder['controls'] = $.fbuilder['controls'] || {};
|
3 |
$.fbuilder['forms'] = $.fbuilder['forms'] || {};
|
4 |
|