Version Description
- Improve cache clearing in order to make Formidable compatible with persistent object caching
- Add vertical-align:baseline to radio and checkboxes to prevent styling conflicts
- Add hook for invalid form entry error message
- Add form id to 'frm_include_meta_keys' hook
- Fix IE11 and Edge form builder issues with editing field options
- Allow localhost to pass URL validation
- Remove frm_field_input_html calls for fields on form builder page
- Pro Features *
- Add option to send emails on import
- Allow default style to export with form
- Fix form importing with a style (make sure style is selected in form's settings)
- Fix exporting Views without form
- Fix adding subfield types in Chrome
- Make sure "Remove" link still shows when frm_compact is used in file upload field
- Make sure actions only trigger on import when import is selected
- Check if transient timeout has been deleted to prevent expired update links
- Fix conditional logic in a section after removing and re-adding a row
- Make sure repeating section is cleared after a form is submitted
- Move repeating section form to trash when parent is trashed
- Make sure collapsible icon uses section color
- Fix errors when "Show page content" is selected in form's settings
- If repeating form entries page is accessed directly, go to parent's entries page
- Fix editing entries with file upload in repeating section
- Allow translation of more file upload messages and no results message in autocomplete dropdown
- Fix donut graphs
- Fix PHP 5.2 graph errors
- Adjust lowercase value sorting in Lookup fields
- Fix auto_id errors with WPML
- Prevent multiple View filters from being added during migration
- Fix Phone Number mask on ajax submission form
- Fix exclude_fields option with editlink
- Fix truncating in place so it doesn't cut words in half
- Make sure autocomplete, multi-select, and read-only attributes are included for category dropdowns
- Remove "Unique" option from userID fields
- Fix hidden row_ids field name (in repeating section)
- Make sure character limit, read-only, etc do not apply on form builder page
- Make sure second and third level Lookup fields correctly limit options to the current user
- Fix HTML validation errors for checkboxes in repeating fields
Download this release
Release Info
Developer | sswells |
Plugin | Formidable Forms – Form Builder for WordPress |
Version | 2.02.07 |
Comparing to | |
See all releases |
Code changes from version 2.02.06 to 2.02.07
- classes/controllers/FrmAddonsController.php +18 -4
- classes/controllers/FrmAppController.php +5 -3
- classes/controllers/FrmFieldsController.php +0 -6
- classes/controllers/FrmFormActionsController.php +7 -3
- classes/controllers/FrmFormsController.php +9 -1
- classes/controllers/FrmXMLController.php +20 -11
- classes/helpers/FrmAppHelper.php +38 -32
- classes/helpers/FrmFieldsHelper.php +21 -73
- classes/helpers/FrmFormsHelper.php +19 -3
- classes/helpers/FrmXMLHelper.php +31 -1
- classes/models/FrmAddon.php +7 -0
- classes/models/FrmEntry.php +4 -6
- classes/models/FrmEntryMeta.php +1 -1
- classes/models/FrmEntryValidate.php +3 -3
- classes/models/FrmField.php +9 -13
- classes/models/FrmForm.php +18 -9
- classes/models/FrmNotification.php +0 -6
- classes/models/FrmPointers.php +0 -4
- classes/views/addons/upgrade_to_pro.php +25 -24
- classes/views/frm-entries/errors.php +1 -1
- classes/views/frm-fields/back-end/dropdown-field.php +35 -0
- classes/views/frm-fields/front-end/dropdown-field.php +41 -0
- classes/views/frm-fields/input.php +2 -45
- classes/views/frm-fields/show-build.php +2 -35
- classes/views/frm-forms/add_field.php +1 -1
- css/_single_theme.css.php +2 -1
- css/custom_theme.css.php +1 -1
- css/dropzone.css +2 -2
- css/frm_admin.css +13 -4
- formidable.php +1 -1
- js/formidable.js +31 -14
- js/formidable.min.js +85 -84
- js/formidable_admin.js +1 -1
- languages/formidable-az_AZ.mo +0 -0
- languages/formidable-az_AZ.po +609 -591
- languages/formidable-da_DK.mo +0 -0
- languages/formidable-de_DE.mo +0 -0
- languages/formidable-de_DE.po +612 -594
- languages/formidable-es_ES.mo +0 -0
- languages/formidable-es_ES.po +608 -590
- languages/formidable-fr_FR.mo +0 -0
- languages/formidable-fr_FR.po +0 -7944
- languages/formidable-it_IT.mo +0 -0
- languages/formidable-it_IT.po +0 -7819
- languages/formidable-ja_JP.mo +0 -0
- languages/formidable-ja_JP.po +346 -328
classes/controllers/FrmAddonsController.php
CHANGED
@@ -5,8 +5,7 @@ class FrmAddonsController {
|
|
5 |
public static function menu() {
|
6 |
add_submenu_page( 'formidable', 'Formidable | ' . __( 'AddOns', 'formidable' ), __( 'AddOns', 'formidable' ), 'frm_view_forms', 'formidable-addons', 'FrmAddonsController::list_addons' );
|
7 |
|
8 |
-
|
9 |
-
if ( ! empty( $affiliate ) && ! FrmAppHelper::pro_is_installed() ) {
|
10 |
add_submenu_page( 'formidable', 'Formidable | ' . __( 'Upgrade to Pro', 'formidable' ), __( 'Upgrade to Pro', 'formidable' ), 'frm_view_forms', 'formidable-pro-upgrade', 'FrmAddonsController::upgrade_to_pro' );
|
11 |
}
|
12 |
}
|
@@ -132,9 +131,24 @@ class FrmAddonsController {
|
|
132 |
|
133 |
public static function upgrade_to_pro() {
|
134 |
$addons = self::get_ordered_addons();
|
135 |
-
$
|
136 |
-
$
|
137 |
|
138 |
include( FrmAppHelper::plugin_path() . '/classes/views/addons/upgrade_to_pro.php' );
|
139 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
}
|
5 |
public static function menu() {
|
6 |
add_submenu_page( 'formidable', 'Formidable | ' . __( 'AddOns', 'formidable' ), __( 'AddOns', 'formidable' ), 'frm_view_forms', 'formidable-addons', 'FrmAddonsController::list_addons' );
|
7 |
|
8 |
+
if ( ! FrmAppHelper::pro_is_installed() ) {
|
|
|
9 |
add_submenu_page( 'formidable', 'Formidable | ' . __( 'Upgrade to Pro', 'formidable' ), __( 'Upgrade to Pro', 'formidable' ), 'frm_view_forms', 'formidable-pro-upgrade', 'FrmAddonsController::upgrade_to_pro' );
|
10 |
}
|
11 |
}
|
131 |
|
132 |
public static function upgrade_to_pro() {
|
133 |
$addons = self::get_ordered_addons();
|
134 |
+
$pro_pricing = array();
|
135 |
+
self::prepare_pro_info( $addons[0], $pro_pricing );
|
136 |
|
137 |
include( FrmAppHelper::plugin_path() . '/classes/views/addons/upgrade_to_pro.php' );
|
138 |
}
|
139 |
+
|
140 |
+
private static function prepare_pro_info( $pro, &$pro_pricing ) {
|
141 |
+
$pro_pricing = array(
|
142 |
+
'personal' => array( 'id' => 5, 'price' => '49.00', 'name' => 'Personal' ),
|
143 |
+
'professional' => array( 'id' => 6, 'price' => '99.00', 'name' => 'Professional' ),
|
144 |
+
'smallbusiness' => array( 'id' => 3, 'price' => '199.00', 'name' => 'Small Business' ),
|
145 |
+
'enterprise' => array( 'id' => 4, 'price' => '399.00', 'name' => 'Enterprise' ),
|
146 |
+
);
|
147 |
+
|
148 |
+
foreach ( $pro['pricing'] as $name => $price ) {
|
149 |
+
if ( isset( $pro_pricing[ $name ] ) ) {
|
150 |
+
$pro_pricing[ $name ]['price'] = $price;
|
151 |
+
}
|
152 |
+
}
|
153 |
+
}
|
154 |
}
|
classes/controllers/FrmAppController.php
CHANGED
@@ -48,12 +48,14 @@ class FrmAppController {
|
|
48 |
$form = $id = false;
|
49 |
}
|
50 |
|
51 |
-
$nav_items = self::get_form_nav_items( $
|
52 |
|
53 |
include( FrmAppHelper::plugin_path() . '/classes/views/shared/form-nav.php' );
|
54 |
}
|
55 |
|
56 |
-
private static function get_form_nav_items( $
|
|
|
|
|
57 |
$nav_items = array(
|
58 |
array(
|
59 |
'link' => admin_url( 'admin.php?page=formidable&frm_action=edit&id=' . absint( $id ) ),
|
@@ -78,7 +80,7 @@ class FrmAppController {
|
|
78 |
),
|
79 |
);
|
80 |
|
81 |
-
$nav_items = apply_filters( 'frm_form_nav_list', $nav_items, array( 'form_id' => $id ) );
|
82 |
return $nav_items;
|
83 |
}
|
84 |
|
48 |
$form = $id = false;
|
49 |
}
|
50 |
|
51 |
+
$nav_items = self::get_form_nav_items( $form );
|
52 |
|
53 |
include( FrmAppHelper::plugin_path() . '/classes/views/shared/form-nav.php' );
|
54 |
}
|
55 |
|
56 |
+
private static function get_form_nav_items( $form ) {
|
57 |
+
$id = ( $form && $form->parent_form_id ) ? $form->parent_form_id : $form->id;
|
58 |
+
|
59 |
$nav_items = array(
|
60 |
array(
|
61 |
'link' => admin_url( 'admin.php?page=formidable&frm_action=edit&id=' . absint( $id ) ),
|
80 |
),
|
81 |
);
|
82 |
|
83 |
+
$nav_items = apply_filters( 'frm_form_nav_list', $nav_items, array( 'form_id' => $id, 'form' => $form ) );
|
84 |
return $nav_items;
|
85 |
}
|
86 |
|
classes/controllers/FrmFieldsController.php
CHANGED
@@ -565,12 +565,6 @@ class FrmFieldsController {
|
|
565 |
return;
|
566 |
}
|
567 |
|
568 |
-
global $frm_vars;
|
569 |
-
if ( is_admin() && ! FrmAppHelper::is_preview_page() && ! in_array( $field['type'], array( 'scale', 'radio', 'checkbox', 'data', 'lookup' ) ) ) {
|
570 |
-
// Add the dyn_default_value class to some field inputs on form builder page
|
571 |
-
$class[] = 'dyn_default_value';
|
572 |
-
}
|
573 |
-
|
574 |
if ( isset($field['size']) && $field['size'] > 0 ) {
|
575 |
$class[] = 'auto_width';
|
576 |
}
|
565 |
return;
|
566 |
}
|
567 |
|
|
|
|
|
|
|
|
|
|
|
|
|
568 |
if ( isset($field['size']) && $field['size'] > 0 ) {
|
569 |
$class[] = 'auto_width';
|
570 |
}
|
classes/controllers/FrmFormActionsController.php
CHANGED
@@ -261,11 +261,15 @@ class FrmFormActionsController {
|
|
261 |
|
262 |
$stored_actions = $action_priority = array();
|
263 |
|
264 |
-
|
|
|
|
|
|
|
|
|
265 |
|
266 |
foreach ( $form_actions as $action ) {
|
267 |
-
|
268 |
-
$skip_this_action = ( ! in_array( $
|
269 |
$skip_this_action = apply_filters( 'frm_skip_form_action', $skip_this_action, compact( 'action', 'entry', 'form', 'event' ) );
|
270 |
if ( $skip_this_action ) {
|
271 |
continue;
|
261 |
|
262 |
$stored_actions = $action_priority = array();
|
263 |
|
264 |
+
if ( in_array( $event, array( 'create', 'update' ) ) && defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {
|
265 |
+
$this_event = 'import';
|
266 |
+
} else {
|
267 |
+
$this_event = $event;
|
268 |
+
}
|
269 |
|
270 |
foreach ( $form_actions as $action ) {
|
271 |
+
|
272 |
+
$skip_this_action = ( ! in_array( $this_event, $action->post_content['event'] ) );
|
273 |
$skip_this_action = apply_filters( 'frm_skip_form_action', $skip_this_action, compact( 'action', 'entry', 'form', 'event' ) );
|
274 |
if ( $skip_this_action ) {
|
275 |
continue;
|
classes/controllers/FrmFormsController.php
CHANGED
@@ -1155,7 +1155,7 @@ class FrmFormsController {
|
|
1155 |
}
|
1156 |
|
1157 |
$values = FrmEntriesHelper::setup_new_vars($fields, $form, true);
|
1158 |
-
$created = (
|
1159 |
$conf_method = apply_filters('frm_success_filter', 'message', $form, $form->options, 'create');
|
1160 |
|
1161 |
if ( $created && is_numeric($created) && $conf_method != 'message' ) {
|
@@ -1191,6 +1191,14 @@ class FrmFormsController {
|
|
1191 |
do_action( 'frm_after_entry_processed', array( 'entry_id' => $created, 'form' => $form ) );
|
1192 |
}
|
1193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1194 |
public static function front_head() {
|
1195 |
$version = FrmAppHelper::plugin_version();
|
1196 |
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
1155 |
}
|
1156 |
|
1157 |
$values = FrmEntriesHelper::setup_new_vars($fields, $form, true);
|
1158 |
+
$created = self::just_created_entry( $form->id );
|
1159 |
$conf_method = apply_filters('frm_success_filter', 'message', $form, $form->options, 'create');
|
1160 |
|
1161 |
if ( $created && is_numeric($created) && $conf_method != 'message' ) {
|
1191 |
do_action( 'frm_after_entry_processed', array( 'entry_id' => $created, 'form' => $form ) );
|
1192 |
}
|
1193 |
|
1194 |
+
/**
|
1195 |
+
* @since 2.2.7
|
1196 |
+
*/
|
1197 |
+
public static function just_created_entry( $form_id ) {
|
1198 |
+
global $frm_vars;
|
1199 |
+
return ( isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][ $form_id ] ) && isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) ? $frm_vars['created_entries'][ $form_id ]['entry_id'] : 0;
|
1200 |
+
}
|
1201 |
+
|
1202 |
public static function front_head() {
|
1203 |
$version = FrmAppHelper::plugin_version();
|
1204 |
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
classes/controllers/FrmXMLController.php
CHANGED
@@ -155,16 +155,7 @@ class FrmXMLController {
|
|
155 |
public static function generate_xml( $type, $args = array() ) {
|
156 |
global $wpdb;
|
157 |
|
158 |
-
$type
|
159 |
-
if ( in_array( 'items', $type) && ! in_array( 'forms', $type) ) {
|
160 |
-
// make sure the form is included if there are entries
|
161 |
-
$type[] = 'forms';
|
162 |
-
}
|
163 |
-
|
164 |
-
if ( in_array( 'forms', $type) ) {
|
165 |
-
// include actions with forms
|
166 |
-
$type[] = 'actions';
|
167 |
-
}
|
168 |
|
169 |
$tables = array(
|
170 |
'items' => $wpdb->prefix . 'frm_items',
|
@@ -227,13 +218,19 @@ class FrmXMLController {
|
|
227 |
break;
|
228 |
case 'styles':
|
229 |
// Loop through all exported forms and get their selected style IDs
|
|
|
|
|
230 |
$form_ids = $args['ids'];
|
231 |
$style_ids = array();
|
232 |
foreach ( $form_ids as $form_id ) {
|
233 |
$form_data = FrmForm::getOne( $form_id );
|
234 |
// For forms that have not been updated while running 2.0, check if custom_style is set
|
235 |
if ( isset( $form_data->options['custom_style'] ) ) {
|
236 |
-
|
|
|
|
|
|
|
|
|
237 |
}
|
238 |
unset( $form_id, $form_data );
|
239 |
}
|
@@ -266,6 +263,18 @@ class FrmXMLController {
|
|
266 |
include( FrmAppHelper::plugin_path() . '/classes/views/xml/xml.php' );
|
267 |
}
|
268 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
|
270 |
public static function generate_csv( $atts ) {
|
271 |
$form_ids = $atts['ids'];
|
155 |
public static function generate_xml( $type, $args = array() ) {
|
156 |
global $wpdb;
|
157 |
|
158 |
+
self::prepare_types_array( $type );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
|
160 |
$tables = array(
|
161 |
'items' => $wpdb->prefix . 'frm_items',
|
218 |
break;
|
219 |
case 'styles':
|
220 |
// Loop through all exported forms and get their selected style IDs
|
221 |
+
$frm_style = new FrmStyle();
|
222 |
+
$default_style = $frm_style->get_default_style();
|
223 |
$form_ids = $args['ids'];
|
224 |
$style_ids = array();
|
225 |
foreach ( $form_ids as $form_id ) {
|
226 |
$form_data = FrmForm::getOne( $form_id );
|
227 |
// For forms that have not been updated while running 2.0, check if custom_style is set
|
228 |
if ( isset( $form_data->options['custom_style'] ) ) {
|
229 |
+
if ( $form_data->options['custom_style'] == 1 ) {
|
230 |
+
$style_ids[] = $default_style->ID;
|
231 |
+
} else {
|
232 |
+
$style_ids[] = $form_data->options['custom_style'];
|
233 |
+
}
|
234 |
}
|
235 |
unset( $form_id, $form_data );
|
236 |
}
|
263 |
include( FrmAppHelper::plugin_path() . '/classes/views/xml/xml.php' );
|
264 |
}
|
265 |
|
266 |
+
private static function prepare_types_array( &$type ) {
|
267 |
+
$type = (array) $type;
|
268 |
+
if ( ! in_array( 'forms', $type ) && ( in_array( 'items', $type ) || in_array( 'posts', $type ) ) ) {
|
269 |
+
// make sure the form is included if there are entries
|
270 |
+
$type[] = 'forms';
|
271 |
+
}
|
272 |
+
|
273 |
+
if ( in_array( 'forms', $type ) ) {
|
274 |
+
// include actions with forms
|
275 |
+
$type[] = 'actions';
|
276 |
+
}
|
277 |
+
}
|
278 |
|
279 |
public static function generate_csv( $atts ) {
|
280 |
$form_ids = $atts['ids'];
|
classes/helpers/FrmAppHelper.php
CHANGED
@@ -4,13 +4,13 @@ if ( ! defined('ABSPATH') ) {
|
|
4 |
}
|
5 |
|
6 |
class FrmAppHelper {
|
7 |
-
public static $db_version =
|
8 |
public static $pro_db_version = 37;
|
9 |
|
10 |
/**
|
11 |
* @since 2.0
|
12 |
*/
|
13 |
-
public static $plug_version = '2.02.
|
14 |
|
15 |
/**
|
16 |
* @since 1.07.02
|
@@ -66,9 +66,10 @@ class FrmAppHelper {
|
|
66 |
}
|
67 |
|
68 |
public static function get_affiliate() {
|
|
|
69 |
$affiliate_id = apply_filters( 'frm_affiliate_link', get_option('frm_aff') );
|
70 |
$affiliate_id = strtolower( $affiliate_id );
|
71 |
-
$allowed_affiliates = array(
|
72 |
if ( ! in_array( $affiliate_id, $allowed_affiliates ) ) {
|
73 |
$affiliate_id = false;
|
74 |
}
|
@@ -258,13 +259,6 @@ class FrmAppHelper {
|
|
258 |
return $value;
|
259 |
}
|
260 |
|
261 |
-
/**
|
262 |
-
*
|
263 |
-
* @param string $param
|
264 |
-
* @param mixed $default
|
265 |
-
* @param string $sanitize
|
266 |
-
* @return string|array
|
267 |
-
*/
|
268 |
public static function get_post_param( $param, $default = '', $sanitize = '' ) {
|
269 |
return self::get_simple_request( array( 'type' => 'post', 'param' => $param, 'default' => $default, 'sanitize' => $sanitize ) );
|
270 |
}
|
@@ -455,12 +449,36 @@ class FrmAppHelper {
|
|
455 |
$results = $wpdb->{$type}($query);
|
456 |
}
|
457 |
|
|
|
|
|
|
|
|
|
|
|
|
|
458 |
if ( ! self::prevent_caching() ) {
|
|
|
459 |
wp_cache_set( $cache_key, $results, $group, $time );
|
460 |
}
|
|
|
461 |
|
462 |
-
|
463 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
464 |
|
465 |
/**
|
466 |
* Data that should be stored for a long time can be stored in a transient.
|
@@ -499,31 +517,18 @@ class FrmAppHelper {
|
|
499 |
* @since 2.0
|
500 |
*
|
501 |
* @param string $group The name of the cache group
|
502 |
-
* @return boolean True or False
|
503 |
*/
|
504 |
public static function cache_delete_group( $group ) {
|
505 |
-
|
506 |
-
|
507 |
-
if ( is_callable( array( $wp_object_cache, '__get' ) ) ) {
|
508 |
-
$group_cache = $wp_object_cache->__get('cache');
|
509 |
-
} elseif ( is_callable( array( $wp_object_cache, 'redis_status' ) ) && $wp_object_cache->redis_status() ) {
|
510 |
-
// check if the object cache is overridden by Redis
|
511 |
-
$wp_object_cache->flush();
|
512 |
-
$group_cache = array();
|
513 |
-
} else {
|
514 |
-
// version < 4.0 fallback
|
515 |
-
$group_cache = $wp_object_cache->cache;
|
516 |
-
}
|
517 |
|
518 |
-
if (
|
519 |
-
foreach ( $
|
520 |
-
wp_cache_delete( $
|
521 |
}
|
522 |
-
return true;
|
523 |
-
}
|
524 |
|
525 |
-
|
526 |
-
|
|
|
527 |
|
528 |
/**
|
529 |
* Check a value from a shortcode to see if true or false.
|
@@ -1731,6 +1736,7 @@ class FrmAppHelper {
|
|
1731 |
'offset' => apply_filters( 'frm_scroll_offset', 4 ),
|
1732 |
'nonce' => wp_create_nonce( 'frm_ajax' ),
|
1733 |
'id' => __( 'ID', 'formidable' ),
|
|
|
1734 |
) );
|
1735 |
|
1736 |
if ( $location == 'admin' ) {
|
4 |
}
|
5 |
|
6 |
class FrmAppHelper {
|
7 |
+
public static $db_version = 33; //version of the database we are moving to
|
8 |
public static $pro_db_version = 37;
|
9 |
|
10 |
/**
|
11 |
* @since 2.0
|
12 |
*/
|
13 |
+
public static $plug_version = '2.02.07';
|
14 |
|
15 |
/**
|
16 |
* @since 1.07.02
|
66 |
}
|
67 |
|
68 |
public static function get_affiliate() {
|
69 |
+
return '';
|
70 |
$affiliate_id = apply_filters( 'frm_affiliate_link', get_option('frm_aff') );
|
71 |
$affiliate_id = strtolower( $affiliate_id );
|
72 |
+
$allowed_affiliates = array();
|
73 |
if ( ! in_array( $affiliate_id, $allowed_affiliates ) ) {
|
74 |
$affiliate_id = false;
|
75 |
}
|
259 |
return $value;
|
260 |
}
|
261 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
public static function get_post_param( $param, $default = '', $sanitize = '' ) {
|
263 |
return self::get_simple_request( array( 'type' => 'post', 'param' => $param, 'default' => $default, 'sanitize' => $sanitize ) );
|
264 |
}
|
449 |
$results = $wpdb->{$type}($query);
|
450 |
}
|
451 |
|
452 |
+
self::set_cache( $cache_key, $results, $group, $time );
|
453 |
+
|
454 |
+
return $results;
|
455 |
+
}
|
456 |
+
|
457 |
+
public static function set_cache( $cache_key, $results, $group = '', $time = 300 ) {
|
458 |
if ( ! self::prevent_caching() ) {
|
459 |
+
self::add_key_to_group_cache( $cache_key, $group );
|
460 |
wp_cache_set( $cache_key, $results, $group, $time );
|
461 |
}
|
462 |
+
}
|
463 |
|
464 |
+
/**
|
465 |
+
* Keep track of the keys cached in each group so they can be deleted
|
466 |
+
* in Redis and Memcache
|
467 |
+
*/
|
468 |
+
public static function add_key_to_group_cache( $key, $group ) {
|
469 |
+
$cached = self::get_group_cached_keys( $group );
|
470 |
+
$cached[ $key ] = $key;
|
471 |
+
wp_cache_set( 'cached_keys', $cached, $group, 300 );
|
472 |
+
}
|
473 |
+
|
474 |
+
public static function get_group_cached_keys( $group ) {
|
475 |
+
$cached = wp_cache_get( 'cached_keys', $group );
|
476 |
+
if ( ! $cached ) {
|
477 |
+
$cached = array();
|
478 |
+
}
|
479 |
+
|
480 |
+
return $cached;
|
481 |
+
}
|
482 |
|
483 |
/**
|
484 |
* Data that should be stored for a long time can be stored in a transient.
|
517 |
* @since 2.0
|
518 |
*
|
519 |
* @param string $group The name of the cache group
|
|
|
520 |
*/
|
521 |
public static function cache_delete_group( $group ) {
|
522 |
+
$cached_keys = self::get_group_cached_keys( $group );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
|
524 |
+
if ( ! empty( $cached_keys ) ) {
|
525 |
+
foreach ( $cached_keys as $key ) {
|
526 |
+
wp_cache_delete( $key, $group );
|
527 |
}
|
|
|
|
|
528 |
|
529 |
+
wp_cache_delete( 'cached_keys', $group );
|
530 |
+
}
|
531 |
+
}
|
532 |
|
533 |
/**
|
534 |
* Check a value from a shortcode to see if true or false.
|
1736 |
'offset' => apply_filters( 'frm_scroll_offset', 4 ),
|
1737 |
'nonce' => wp_create_nonce( 'frm_ajax' ),
|
1738 |
'id' => __( 'ID', 'formidable' ),
|
1739 |
+
'no_results' => __( 'No results match', 'formidable' ),
|
1740 |
) );
|
1741 |
|
1742 |
if ( $location == 'admin' ) {
|
classes/helpers/FrmFieldsHelper.php
CHANGED
@@ -452,6 +452,14 @@ DEFAULT_HTML;
|
|
452 |
}
|
453 |
}
|
454 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
455 |
public static function display_recaptcha( $field ) {
|
456 |
$frm_settings = FrmAppHelper::get_settings();
|
457 |
$lang = apply_filters( 'frm_recaptcha_lang', $frm_settings->re_lang, $field );
|
@@ -496,79 +504,6 @@ DEFAULT_HTML;
|
|
496 |
}
|
497 |
}
|
498 |
|
499 |
-
public static function dropdown_categories( $args ) {
|
500 |
-
$defaults = array( 'field' => false, 'name' => false, 'show_option_all' => ' ' );
|
501 |
-
$args = wp_parse_args($args, $defaults);
|
502 |
-
|
503 |
-
if ( ! $args['field'] ) {
|
504 |
-
return;
|
505 |
-
}
|
506 |
-
|
507 |
-
if ( ! $args['name'] ) {
|
508 |
-
$args['name'] = 'item_meta[' . $args['field']['id'] . ']';
|
509 |
-
}
|
510 |
-
|
511 |
-
$id = self::get_html_id($args['field']);
|
512 |
-
$class = $args['field']['type'];
|
513 |
-
|
514 |
-
$exclude = (is_array($args['field']['exclude_cat'])) ? implode(',', $args['field']['exclude_cat']) : $args['field']['exclude_cat'];
|
515 |
-
$exclude = apply_filters('frm_exclude_cats', $exclude, $args['field']);
|
516 |
-
|
517 |
-
if ( is_array($args['field']['value']) ) {
|
518 |
-
if ( ! empty($exclude) ) {
|
519 |
-
$args['field']['value'] = array_diff($args['field']['value'], explode(',', $exclude));
|
520 |
-
}
|
521 |
-
$selected = reset($args['field']['value']);
|
522 |
-
} else {
|
523 |
-
$selected = $args['field']['value'];
|
524 |
-
}
|
525 |
-
|
526 |
-
$tax_atts = array(
|
527 |
-
'show_option_all' => $args['show_option_all'], 'hierarchical' => 1, 'name' => $args['name'],
|
528 |
-
'id' => $id, 'exclude' => $exclude, 'class' => $class, 'selected' => $selected,
|
529 |
-
'hide_empty' => false, 'echo' => 0, 'orderby' => 'name',
|
530 |
-
);
|
531 |
-
|
532 |
-
$tax_atts = apply_filters('frm_dropdown_cat', $tax_atts, $args['field']);
|
533 |
-
|
534 |
-
if ( FrmAppHelper::pro_is_installed() ) {
|
535 |
-
$post_type = FrmProFormsHelper::post_type($args['field']['form_id']);
|
536 |
-
$tax_atts['taxonomy'] = FrmProAppHelper::get_custom_taxonomy($post_type, $args['field']);
|
537 |
-
if ( ! $tax_atts['taxonomy'] ) {
|
538 |
-
return;
|
539 |
-
}
|
540 |
-
|
541 |
-
// If field type is dropdown (not Dynamic), exclude children when parent is excluded
|
542 |
-
if ( $args['field']['type'] != 'data' && is_taxonomy_hierarchical($tax_atts['taxonomy']) ) {
|
543 |
-
$tax_atts['exclude_tree'] = $exclude;
|
544 |
-
}
|
545 |
-
}
|
546 |
-
|
547 |
-
$dropdown = wp_dropdown_categories($tax_atts);
|
548 |
-
|
549 |
-
$add_html = FrmFieldsController::input_html($args['field'], false);
|
550 |
-
|
551 |
-
if ( FrmAppHelper::pro_is_installed() ) {
|
552 |
-
$add_html .= FrmProFieldsController::input_html($args['field'], false);
|
553 |
-
}
|
554 |
-
|
555 |
-
$dropdown = str_replace( "<select name='" . esc_attr( $args['name'] ) . "' id='" . esc_attr( $id ) . "' class='" . esc_attr( $class ) . "'", "<select name='" . esc_attr( $args['name'] ) . "' id='" . esc_attr( $id ) . "' " . $add_html, $dropdown );
|
556 |
-
|
557 |
-
if ( is_array($args['field']['value']) ) {
|
558 |
-
$skip = true;
|
559 |
-
foreach ( $args['field']['value'] as $v ) {
|
560 |
-
if ( $skip ) {
|
561 |
-
$skip = false;
|
562 |
-
continue;
|
563 |
-
}
|
564 |
-
$dropdown = str_replace(' value="' . esc_attr( $v ) . '"', ' value="' . esc_attr( $v ) . '" selected="selected"', $dropdown );
|
565 |
-
unset($v);
|
566 |
-
}
|
567 |
-
}
|
568 |
-
|
569 |
-
return $dropdown;
|
570 |
-
}
|
571 |
-
|
572 |
public static function get_term_link( $tax_id ) {
|
573 |
$tax = get_taxonomy($tax_id);
|
574 |
if ( ! $tax ) {
|
@@ -1394,4 +1329,17 @@ DEFAULT_HTML;
|
|
1394 |
_deprecated_function( __FUNCTION__, '2.0.9', 'FrmField::maybe_get_field' );
|
1395 |
FrmField::maybe_get_field( $field );
|
1396 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1397 |
}
|
452 |
}
|
453 |
}
|
454 |
|
455 |
+
public static function get_checkbox_id( $field, $opt_key ) {
|
456 |
+
$id = $field['id'];
|
457 |
+
if ( isset( $field['in_section'] ) && $field['in_section'] ) {
|
458 |
+
$id .= '-' . $field['in_section'];
|
459 |
+
}
|
460 |
+
return 'frm_checkbox_' . $id . '-' . $opt_key;
|
461 |
+
}
|
462 |
+
|
463 |
public static function display_recaptcha( $field ) {
|
464 |
$frm_settings = FrmAppHelper::get_settings();
|
465 |
$lang = apply_filters( 'frm_recaptcha_lang', $frm_settings->re_lang, $field );
|
504 |
}
|
505 |
}
|
506 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
507 |
public static function get_term_link( $tax_id ) {
|
508 |
$tax = get_taxonomy($tax_id);
|
509 |
if ( ! $tax ) {
|
1329 |
_deprecated_function( __FUNCTION__, '2.0.9', 'FrmField::maybe_get_field' );
|
1330 |
FrmField::maybe_get_field( $field );
|
1331 |
}
|
1332 |
+
|
1333 |
+
public static function dropdown_categories( $args ) {
|
1334 |
+
_deprecated_function( __FUNCTION__, '2.02.07', 'FrmProPost::get_category_dropdown' );
|
1335 |
+
|
1336 |
+
if ( FrmAppHelper::pro_is_installed() ) {
|
1337 |
+
$args['location'] = 'front';
|
1338 |
+
$dropdown = FrmProPost::get_category_dropdown( $args['field'], $args );
|
1339 |
+
} else {
|
1340 |
+
$dropdown = '';
|
1341 |
+
}
|
1342 |
+
|
1343 |
+
return $dropdown;
|
1344 |
+
}
|
1345 |
}
|
classes/helpers/FrmFormsHelper.php
CHANGED
@@ -119,6 +119,21 @@ class FrmFormsHelper {
|
|
119 |
echo ($sort_col == $col && $sort_dir == 'desc') ? ' asc' : ' desc';
|
120 |
}
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
public static function get_success_message( $atts ) {
|
123 |
$message = apply_filters( 'frm_content', $atts['message'], $atts['form'], $atts['entry_id'] );
|
124 |
$message = FrmAppHelper::use_wpautop( do_shortcode( $message ) );
|
@@ -494,11 +509,12 @@ BEFORE_HTML;
|
|
494 |
* @since 2.0.6
|
495 |
*/
|
496 |
public static function show_errors( $args ) {
|
497 |
-
$
|
498 |
-
|
|
|
499 |
$show_img = false;
|
500 |
} else {
|
501 |
-
echo wp_kses_post( $
|
502 |
$show_img = true;
|
503 |
}
|
504 |
|
119 |
echo ($sort_col == $col && $sort_dir == 'desc') ? ' asc' : ' desc';
|
120 |
}
|
121 |
|
122 |
+
/**
|
123 |
+
* Get the invalid form error message
|
124 |
+
*
|
125 |
+
* @since 2.02.07
|
126 |
+
* @param array $args
|
127 |
+
* @return string
|
128 |
+
*/
|
129 |
+
public static function get_invalid_error_message( $args ) {
|
130 |
+
$frm_settings = FrmAppHelper::get_settings();
|
131 |
+
|
132 |
+
$invalid_msg = apply_filters( 'frm_invalid_error_message', $frm_settings->invalid_msg, $args );
|
133 |
+
|
134 |
+
return $invalid_msg;
|
135 |
+
}
|
136 |
+
|
137 |
public static function get_success_message( $atts ) {
|
138 |
$message = apply_filters( 'frm_content', $atts['message'], $atts['form'], $atts['entry_id'] );
|
139 |
$message = FrmAppHelper::use_wpautop( do_shortcode( $message ) );
|
509 |
* @since 2.0.6
|
510 |
*/
|
511 |
public static function show_errors( $args ) {
|
512 |
+
$invalid_msg = self::get_invalid_error_message( $args );
|
513 |
+
|
514 |
+
if ( empty( $invalid_msg ) ) {
|
515 |
$show_img = false;
|
516 |
} else {
|
517 |
+
echo wp_kses_post( $invalid_msg );
|
518 |
$show_img = true;
|
519 |
}
|
520 |
|
classes/helpers/FrmXMLHelper.php
CHANGED
@@ -426,6 +426,7 @@ class FrmXMLHelper {
|
|
426 |
|
427 |
/**
|
428 |
* Updates the custom style setting on import
|
|
|
429 |
*
|
430 |
* @since 2.0.19
|
431 |
* @param array $form
|
@@ -453,12 +454,36 @@ class FrmXMLHelper {
|
|
453 |
if ( $style_id ) {
|
454 |
$form['options']['custom_style'] = $style_id;
|
455 |
} else {
|
|
|
|
|
|
|
456 |
// Set to default
|
457 |
$form['options']['custom_style'] = 1;
|
458 |
}
|
459 |
}
|
460 |
}
|
461 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
462 |
public static function import_xml_views( $views, $imported ) {
|
463 |
$imported['posts'] = array();
|
464 |
$form_action_type = FrmFormActionsController::$action_post_type;
|
@@ -699,11 +724,16 @@ class FrmXMLHelper {
|
|
699 |
}
|
700 |
|
701 |
private static function maybe_update_stylesheet( $imported ) {
|
702 |
-
|
|
|
|
|
703 |
if ( is_admin() && function_exists( 'get_filesystem_method' ) ) {
|
704 |
$frm_style = new FrmStyle();
|
705 |
$frm_style->update( 'default' );
|
706 |
}
|
|
|
|
|
|
|
707 |
}
|
708 |
}
|
709 |
|
426 |
|
427 |
/**
|
428 |
* Updates the custom style setting on import
|
429 |
+
* Convert the post slug to an ID
|
430 |
*
|
431 |
* @since 2.0.19
|
432 |
* @param array $form
|
454 |
if ( $style_id ) {
|
455 |
$form['options']['custom_style'] = $style_id;
|
456 |
} else {
|
457 |
+
// save the old style to maybe update after styles import
|
458 |
+
$form['options']['old_style'] = $form['options']['custom_style'];
|
459 |
+
|
460 |
// Set to default
|
461 |
$form['options']['custom_style'] = 1;
|
462 |
}
|
463 |
}
|
464 |
}
|
465 |
|
466 |
+
/**
|
467 |
+
* After styles are imported, check for any forms that were linked
|
468 |
+
* and link them back up.
|
469 |
+
*
|
470 |
+
* @since 2.2.7
|
471 |
+
*/
|
472 |
+
private static function update_custom_style_setting_after_import( $form_id ) {
|
473 |
+
$form = FrmForm::getOne( $form_id );
|
474 |
+
|
475 |
+
if ( $form && isset( $form->options['old_style'] ) ) {
|
476 |
+
$form = (array) $form;
|
477 |
+
$saved_style = $form['options']['custom_style'];
|
478 |
+
$form['options']['custom_style'] = $form['options']['old_style'];
|
479 |
+
self::update_custom_style_setting_on_import( $form );
|
480 |
+
$has_changed = ( $form['options']['custom_style'] != $saved_style && $form['options']['custom_style'] != $form['options']['old_style'] );
|
481 |
+
if ( $has_changed ) {
|
482 |
+
FrmForm::update( $form['id'], $form );
|
483 |
+
}
|
484 |
+
}
|
485 |
+
}
|
486 |
+
|
487 |
public static function import_xml_views( $views, $imported ) {
|
488 |
$imported['posts'] = array();
|
489 |
$form_action_type = FrmFormActionsController::$action_post_type;
|
724 |
}
|
725 |
|
726 |
private static function maybe_update_stylesheet( $imported ) {
|
727 |
+
$new_styles = isset( $imported['imported']['styles'] ) && ! empty( $imported['imported']['styles'] );
|
728 |
+
$updated_styles = isset( $imported['updated']['styles'] ) && ! empty( $imported['updated']['styles'] );
|
729 |
+
if ( $new_styles || $updated_styles ) {
|
730 |
if ( is_admin() && function_exists( 'get_filesystem_method' ) ) {
|
731 |
$frm_style = new FrmStyle();
|
732 |
$frm_style->update( 'default' );
|
733 |
}
|
734 |
+
foreach ( $imported['forms'] as $form_id ) {
|
735 |
+
self::update_custom_style_setting_after_import( $form_id );
|
736 |
+
}
|
737 |
}
|
738 |
}
|
739 |
|
classes/models/FrmAddon.php
CHANGED
@@ -117,6 +117,13 @@ class FrmAddon {
|
|
117 |
} else if ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) {
|
118 |
$cache_key = 'edd_plugin_' . md5( sanitize_key( $this->license . $this->version ) . '_get_version' );
|
119 |
$version_info = get_transient( $cache_key );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
if ( $version_info !== false && version_compare( $version_info->new_version, $this->version, '>' ) ) {
|
121 |
$transient->response[ $this->plugin_folder ] = $version_info;
|
122 |
} else {
|
117 |
} else if ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) {
|
118 |
$cache_key = 'edd_plugin_' . md5( sanitize_key( $this->license . $this->version ) . '_get_version' );
|
119 |
$version_info = get_transient( $cache_key );
|
120 |
+
|
121 |
+
$expiration = get_option( '_transient_timeout_' . $cache_key );
|
122 |
+
if ( $expiration === false ) {
|
123 |
+
// make sure transients don't stick around on some sites
|
124 |
+
$version_info = false;
|
125 |
+
}
|
126 |
+
|
127 |
if ( $version_info !== false && version_compare( $version_info->new_version, $this->version, '>' ) ) {
|
128 |
$transient->response[ $this->plugin_folder ] = $version_info;
|
129 |
} else {
|
classes/models/FrmEntry.php
CHANGED
@@ -296,7 +296,7 @@ class FrmEntry {
|
|
296 |
|
297 |
$entry->metas = array();
|
298 |
|
299 |
-
$include_key = apply_filters( 'frm_include_meta_keys', false );
|
300 |
foreach ( $metas as $meta_val ) {
|
301 |
if ( $meta_val->item_id == $entry->id ) {
|
302 |
$entry->metas[ $meta_val->field_id ] = maybe_unserialize( $meta_val->meta_value );
|
@@ -317,7 +317,7 @@ class FrmEntry {
|
|
317 |
}
|
318 |
unset($metas);
|
319 |
|
320 |
-
|
321 |
|
322 |
return $entry;
|
323 |
}
|
@@ -374,9 +374,7 @@ class FrmEntry {
|
|
374 |
$entries = $wpdb->get_results($query, OBJECT_K);
|
375 |
unset($query);
|
376 |
|
377 |
-
|
378 |
-
wp_cache_set( $cache_key, $entries, 'frm_entry', 300 );
|
379 |
-
}
|
380 |
}
|
381 |
|
382 |
if ( ! $meta || ! $entries ) {
|
@@ -419,7 +417,7 @@ class FrmEntry {
|
|
419 |
|
420 |
if ( ! FrmAppHelper::prevent_caching() ) {
|
421 |
foreach ( $entries as $entry ) {
|
422 |
-
|
423 |
unset( $entry );
|
424 |
}
|
425 |
}
|
296 |
|
297 |
$entry->metas = array();
|
298 |
|
299 |
+
$include_key = apply_filters( 'frm_include_meta_keys', false, array( 'form_id' => $entry->form_id ) );
|
300 |
foreach ( $metas as $meta_val ) {
|
301 |
if ( $meta_val->item_id == $entry->id ) {
|
302 |
$entry->metas[ $meta_val->field_id ] = maybe_unserialize( $meta_val->meta_value );
|
317 |
}
|
318 |
unset($metas);
|
319 |
|
320 |
+
FrmAppHelper::set_cache( $entry->id, $entry, 'frm_entry' );
|
321 |
|
322 |
return $entry;
|
323 |
}
|
374 |
$entries = $wpdb->get_results($query, OBJECT_K);
|
375 |
unset($query);
|
376 |
|
377 |
+
FrmAppHelper::set_cache( $cache_key, $entries, 'frm_entry' );
|
|
|
|
|
378 |
}
|
379 |
|
380 |
if ( ! $meta || ! $entries ) {
|
417 |
|
418 |
if ( ! FrmAppHelper::prevent_caching() ) {
|
419 |
foreach ( $entries as $entry ) {
|
420 |
+
FrmAppHelper::set_cache( $entry->id, $entry, 'frm_entry' );
|
421 |
unset( $entry );
|
422 |
}
|
423 |
}
|
classes/models/FrmEntryMeta.php
CHANGED
@@ -379,7 +379,7 @@ class FrmEntryMeta {
|
|
379 |
}
|
380 |
|
381 |
$results = $wpdb->get_col($query, 0);
|
382 |
-
|
383 |
|
384 |
return $results;
|
385 |
}
|
379 |
}
|
380 |
|
381 |
$results = $wpdb->get_col($query, 0);
|
382 |
+
FrmAppHelper::set_cache( $cache_key, $results, 'frm_entry' );
|
383 |
|
384 |
return $results;
|
385 |
}
|
classes/models/FrmEntryValidate.php
CHANGED
@@ -111,10 +111,10 @@ class FrmEntryValidate {
|
|
111 |
$value = preg_match( '/^(https?|ftps?|mailto|news|feed|telnet):/is', $value ) ? $value : 'http://' . $value;
|
112 |
}
|
113 |
|
114 |
-
//validate the url format
|
115 |
-
|
116 |
$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
|
117 |
-
|
118 |
}
|
119 |
|
120 |
public static function validate_email_field( &$errors, $field, $value, $args ) {
|
111 |
$value = preg_match( '/^(https?|ftps?|mailto|news|feed|telnet):/is', $value ) ? $value : 'http://' . $value;
|
112 |
}
|
113 |
|
114 |
+
// validate the url format
|
115 |
+
if ( ! preg_match('/^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i', $value) ) {
|
116 |
$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
|
117 |
+
}
|
118 |
}
|
119 |
|
120 |
public static function validate_email_field( &$errors, $field, $value, $args ) {
|
classes/models/FrmField.php
CHANGED
@@ -189,7 +189,7 @@ class FrmField {
|
|
189 |
if ( $query_results ) {
|
190 |
wp_cache_delete( $id, 'frm_field' );
|
191 |
if ( $form_id ) {
|
192 |
-
self::delete_form_transient($form_id);
|
193 |
}
|
194 |
}
|
195 |
|
@@ -235,11 +235,7 @@ class FrmField {
|
|
235 |
global $wpdb;
|
236 |
$wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s', '_transient_timeout_frm_form_fields_' . $form_id . 'ex%', '_transient_frm_form_fields_' . $form_id . 'ex%', '_transient_timeout_frm_form_fields_' . $form_id . 'in%', '_transient_frm_form_fields_' . $form_id . 'in%' ) );
|
237 |
|
238 |
-
|
239 |
-
wp_cache_delete($cache_key, 'frm_field');
|
240 |
-
|
241 |
-
// this cache key is autogenerated in FrmDb::get_var
|
242 |
-
wp_cache_delete( '(__fi.form_id=%d_OR_fr.parent_form_id=%d_)__' . $form_id . '_' . $form_id . '_ORDER_BY_field_orderfi.*__fr.name_as_form_name_results', 'frm_field' );
|
243 |
|
244 |
$form = FrmForm::getOne($form_id);
|
245 |
if ( $form && $form->parent_form_id ) {
|
@@ -273,9 +269,9 @@ class FrmField {
|
|
273 |
}
|
274 |
|
275 |
if ( is_numeric($id) ) {
|
276 |
-
|
277 |
} else if ( $results ) {
|
278 |
-
|
279 |
}
|
280 |
|
281 |
self::prepare_options( $results );
|
@@ -470,7 +466,7 @@ class FrmField {
|
|
470 |
|
471 |
self::format_field_results( $results );
|
472 |
|
473 |
-
|
474 |
|
475 |
return stripslashes_deep( $results );
|
476 |
}
|
@@ -481,8 +477,8 @@ class FrmField {
|
|
481 |
private static function format_field_results( &$results ) {
|
482 |
if ( is_array( $results ) ) {
|
483 |
foreach ( $results as $r_key => $result ) {
|
484 |
-
|
485 |
-
|
486 |
|
487 |
$results[ $r_key ]->field_options = maybe_unserialize( $result->field_options );
|
488 |
$results[ $r_key ]->options = maybe_unserialize( $result->options );
|
@@ -491,8 +487,8 @@ class FrmField {
|
|
491 |
unset( $r_key, $result );
|
492 |
}
|
493 |
} else if ( $results ) {
|
494 |
-
|
495 |
-
|
496 |
|
497 |
self::prepare_options( $results );
|
498 |
}
|
189 |
if ( $query_results ) {
|
190 |
wp_cache_delete( $id, 'frm_field' );
|
191 |
if ( $form_id ) {
|
192 |
+
self::delete_form_transient( $form_id );
|
193 |
}
|
194 |
}
|
195 |
|
235 |
global $wpdb;
|
236 |
$wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s', '_transient_timeout_frm_form_fields_' . $form_id . 'ex%', '_transient_frm_form_fields_' . $form_id . 'ex%', '_transient_timeout_frm_form_fields_' . $form_id . 'in%', '_transient_frm_form_fields_' . $form_id . 'in%' ) );
|
237 |
|
238 |
+
FrmAppHelper::cache_delete_group( 'frm_field' );
|
|
|
|
|
|
|
|
|
239 |
|
240 |
$form = FrmForm::getOne($form_id);
|
241 |
if ( $form && $form->parent_form_id ) {
|
269 |
}
|
270 |
|
271 |
if ( is_numeric($id) ) {
|
272 |
+
FrmAppHelper::set_cache( $results->field_key, $results, 'frm_field' );
|
273 |
} else if ( $results ) {
|
274 |
+
FrmAppHelper::set_cache( $results->id, $results, 'frm_field' );
|
275 |
}
|
276 |
|
277 |
self::prepare_options( $results );
|
466 |
|
467 |
self::format_field_results( $results );
|
468 |
|
469 |
+
FrmAppHelper::set_cache( $cache_key, $results, 'frm_field' );
|
470 |
|
471 |
return stripslashes_deep( $results );
|
472 |
}
|
477 |
private static function format_field_results( &$results ) {
|
478 |
if ( is_array( $results ) ) {
|
479 |
foreach ( $results as $r_key => $result ) {
|
480 |
+
FrmAppHelper::set_cache( $result->id, $result, 'frm_field' );
|
481 |
+
FrmAppHelper::set_cache( $result->field_key, $result, 'frm_field' );
|
482 |
|
483 |
$results[ $r_key ]->field_options = maybe_unserialize( $result->field_options );
|
484 |
$results[ $r_key ]->options = maybe_unserialize( $result->options );
|
487 |
unset( $r_key, $result );
|
488 |
}
|
489 |
} else if ( $results ) {
|
490 |
+
FrmAppHelper::set_cache( $results->id, $results, 'frm_field' );
|
491 |
+
FrmAppHelper::set_cache( $results->field_key, $results, 'frm_field' );
|
492 |
|
493 |
self::prepare_options( $results );
|
494 |
}
|
classes/models/FrmForm.php
CHANGED
@@ -24,7 +24,7 @@ class FrmForm {
|
|
24 |
'created_at' => isset($values['created_at']) ? $values['created_at'] : current_time('mysql', 1),
|
25 |
);
|
26 |
|
27 |
-
|
28 |
FrmFormsHelper::fill_form_options( $options, $values );
|
29 |
|
30 |
$options['before_html'] = isset($values['options']['before_html']) ? $values['options']['before_html'] : FrmFormsHelper::get_default_html('before');
|
@@ -171,7 +171,7 @@ class FrmForm {
|
|
171 |
return $new_values;
|
172 |
}
|
173 |
|
174 |
-
|
175 |
FrmFormsHelper::fill_form_options( $options, $values );
|
176 |
|
177 |
$options['custom_style'] = isset($values['options']['custom_style']) ? $values['options']['custom_style'] : 0;
|
@@ -225,7 +225,8 @@ class FrmForm {
|
|
225 |
continue;
|
226 |
}
|
227 |
|
228 |
-
|
|
|
229 |
//updating the settings page
|
230 |
if ( isset( $values['field_options'][ 'custom_html_' . $field_id ] ) ) {
|
231 |
$field->field_options['custom_html'] = isset( $values['field_options'][ 'custom_html_' . $field_id ] ) ? $values['field_options'][ 'custom_html_' . $field_id ] : ( isset( $field->field_options['custom_html'] ) ? $field->field_options['custom_html'] : FrmFieldsHelper::get_default_html( $field->type ) );
|
@@ -241,7 +242,7 @@ class FrmForm {
|
|
241 |
}
|
242 |
}
|
243 |
|
244 |
-
if (
|
245 |
continue;
|
246 |
}
|
247 |
|
@@ -269,6 +270,7 @@ class FrmForm {
|
|
269 |
|
270 |
FrmField::delete_form_transient($field->form_id);
|
271 |
}
|
|
|
272 |
|
273 |
return $values;
|
274 |
}
|
@@ -290,13 +292,14 @@ class FrmForm {
|
|
290 |
global $wpdb;
|
291 |
|
292 |
if ( is_array($id) ) {
|
293 |
-
$where = array( 'id' => $id );
|
294 |
FrmDb::get_where_clause_and_values( $where );
|
295 |
array_unshift( $where['values'], $status );
|
296 |
|
297 |
$query_results = $wpdb->query( $wpdb->prepare( 'UPDATE ' . $wpdb->prefix . 'frm_forms SET status = %s ' . $where['where'], $where['values'] ) );
|
298 |
} else {
|
299 |
$query_results = $wpdb->update( $wpdb->prefix . 'frm_forms', array( 'status' => $status ), array( 'id' => $id ) );
|
|
|
300 |
}
|
301 |
|
302 |
if ( $query_results ) {
|
@@ -329,6 +332,12 @@ class FrmForm {
|
|
329 |
array( 'id' => $id )
|
330 |
);
|
331 |
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
if ( $query_results ) {
|
333 |
self::clear_form_cache();
|
334 |
}
|
@@ -491,7 +500,7 @@ class FrmForm {
|
|
491 |
$results = FrmDb::get_row( $table_name, $where );
|
492 |
|
493 |
if ( isset($results->options) ) {
|
494 |
-
|
495 |
$results->options = maybe_unserialize($results->options);
|
496 |
}
|
497 |
return stripslashes_deep($results);
|
@@ -513,7 +522,7 @@ class FrmForm {
|
|
513 |
|
514 |
if ( $results ) {
|
515 |
foreach ( $results as $result ) {
|
516 |
-
|
517 |
$result->options = maybe_unserialize( $result->options );
|
518 |
}
|
519 |
}
|
@@ -550,7 +559,7 @@ class FrmForm {
|
|
550 |
|
551 |
$cache_key = 'frm_form_counts';
|
552 |
|
553 |
-
$counts = wp_cache_get( $cache_key, '
|
554 |
if ( false !== $counts ) {
|
555 |
return $counts;
|
556 |
}
|
@@ -579,7 +588,7 @@ class FrmForm {
|
|
579 |
}
|
580 |
|
581 |
$counts = (object) $counts;
|
582 |
-
|
583 |
|
584 |
return $counts;
|
585 |
}
|
24 |
'created_at' => isset($values['created_at']) ? $values['created_at'] : current_time('mysql', 1),
|
25 |
);
|
26 |
|
27 |
+
$options = isset( $values['options'] ) ? (array) $values['options'] : array();
|
28 |
FrmFormsHelper::fill_form_options( $options, $values );
|
29 |
|
30 |
$options['before_html'] = isset($values['options']['before_html']) ? $values['options']['before_html'] : FrmFormsHelper::get_default_html('before');
|
171 |
return $new_values;
|
172 |
}
|
173 |
|
174 |
+
$options = isset( $values['options'] ) ? (array) $values['options'] : array();
|
175 |
FrmFormsHelper::fill_form_options( $options, $values );
|
176 |
|
177 |
$options['custom_style'] = isset($values['options']['custom_style']) ? $values['options']['custom_style'] : 0;
|
225 |
continue;
|
226 |
}
|
227 |
|
228 |
+
$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options'][ 'custom_html_' . $field_id ] ) );
|
229 |
+
if ( $is_settings_page ) {
|
230 |
//updating the settings page
|
231 |
if ( isset( $values['field_options'][ 'custom_html_' . $field_id ] ) ) {
|
232 |
$field->field_options['custom_html'] = isset( $values['field_options'][ 'custom_html_' . $field_id ] ) ? $values['field_options'][ 'custom_html_' . $field_id ] : ( isset( $field->field_options['custom_html'] ) ? $field->field_options['custom_html'] : FrmFieldsHelper::get_default_html( $field->type ) );
|
242 |
}
|
243 |
}
|
244 |
|
245 |
+
if ( $is_settings_page && ! defined( 'WP_IMPORTING' ) ) {
|
246 |
continue;
|
247 |
}
|
248 |
|
270 |
|
271 |
FrmField::delete_form_transient($field->form_id);
|
272 |
}
|
273 |
+
self::clear_form_cache();
|
274 |
|
275 |
return $values;
|
276 |
}
|
292 |
global $wpdb;
|
293 |
|
294 |
if ( is_array($id) ) {
|
295 |
+
$where = array( 'id' => $id, 'parent_form_id' => $id, 'or' => 1 );
|
296 |
FrmDb::get_where_clause_and_values( $where );
|
297 |
array_unshift( $where['values'], $status );
|
298 |
|
299 |
$query_results = $wpdb->query( $wpdb->prepare( 'UPDATE ' . $wpdb->prefix . 'frm_forms SET status = %s ' . $where['where'], $where['values'] ) );
|
300 |
} else {
|
301 |
$query_results = $wpdb->update( $wpdb->prefix . 'frm_forms', array( 'status' => $status ), array( 'id' => $id ) );
|
302 |
+
$wpdb->update( $wpdb->prefix . 'frm_forms', array( 'status' => $status ), array( 'parent_form_id' => $id ) );
|
303 |
}
|
304 |
|
305 |
if ( $query_results ) {
|
332 |
array( 'id' => $id )
|
333 |
);
|
334 |
|
335 |
+
$wpdb->update(
|
336 |
+
$wpdb->prefix . 'frm_forms',
|
337 |
+
array( 'status' => 'trash', 'options' => serialize( $options ) ),
|
338 |
+
array( 'parent_form_id' => $id )
|
339 |
+
);
|
340 |
+
|
341 |
if ( $query_results ) {
|
342 |
self::clear_form_cache();
|
343 |
}
|
500 |
$results = FrmDb::get_row( $table_name, $where );
|
501 |
|
502 |
if ( isset($results->options) ) {
|
503 |
+
FrmAppHelper::set_cache( $results->id, $results, 'frm_form' );
|
504 |
$results->options = maybe_unserialize($results->options);
|
505 |
}
|
506 |
return stripslashes_deep($results);
|
522 |
|
523 |
if ( $results ) {
|
524 |
foreach ( $results as $result ) {
|
525 |
+
FrmAppHelper::set_cache( $result->id, $result, 'frm_form' );
|
526 |
$result->options = maybe_unserialize( $result->options );
|
527 |
}
|
528 |
}
|
559 |
|
560 |
$cache_key = 'frm_form_counts';
|
561 |
|
562 |
+
$counts = wp_cache_get( $cache_key, 'frm_form' );
|
563 |
if ( false !== $counts ) {
|
564 |
return $counts;
|
565 |
}
|
588 |
}
|
589 |
|
590 |
$counts = (object) $counts;
|
591 |
+
FrmAppHelper::set_cache( $cache_key, $counts, 'frm_form' );
|
592 |
|
593 |
return $counts;
|
594 |
}
|
classes/models/FrmNotification.php
CHANGED
@@ -9,12 +9,6 @@ class FrmNotification {
|
|
9 |
}
|
10 |
|
11 |
public static function trigger_email( $action, $entry, $form ) {
|
12 |
-
if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {
|
13 |
-
return;
|
14 |
-
}
|
15 |
-
|
16 |
-
global $wpdb;
|
17 |
-
|
18 |
$notification = $action->post_content;
|
19 |
$email_key = $action->ID;
|
20 |
|
9 |
}
|
10 |
|
11 |
public static function trigger_email( $action, $entry, $form ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
$notification = $action->post_content;
|
13 |
$email_key = $action->ID;
|
14 |
|
classes/models/FrmPointers.php
CHANGED
@@ -179,10 +179,6 @@ class FrmPointers {
|
|
179 |
|
180 |
private function opening_line() {
|
181 |
$opening = __( 'You’ve just installed a new form builder plugin!', 'formidable' );
|
182 |
-
$affiliate = FrmAppHelper::get_affiliate();
|
183 |
-
if ( $affiliate == 'mojo' ) {
|
184 |
-
$opening = 'Your Forms plugin has been installed by MOJO Marketplace for your convenience.';
|
185 |
-
}
|
186 |
return $opening;
|
187 |
}
|
188 |
|
179 |
|
180 |
private function opening_line() {
|
181 |
$opening = __( 'You’ve just installed a new form builder plugin!', 'formidable' );
|
|
|
|
|
|
|
|
|
182 |
return $opening;
|
183 |
}
|
184 |
|
classes/views/addons/upgrade_to_pro.php
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
<div class="wrap upgrade_to_pro">
|
2 |
-
<h1 class="frm_pro_heading">
|
3 |
-
|
|
|
|
|
|
|
4 |
|
5 |
<div class="clear"></div>
|
6 |
|
@@ -12,44 +15,42 @@
|
|
12 |
<thead>
|
13 |
<tr>
|
14 |
<th></th>
|
15 |
-
<?php foreach ( $
|
16 |
-
$price_id++;
|
17 |
-
if ( $name == 'smallbusiness' ) {
|
18 |
-
$name = 'Small Business';
|
19 |
-
} ?>
|
20 |
<th>
|
21 |
-
<h3><?php echo esc_attr( ucfirst( $name ) ) ?></h3>
|
22 |
-
<h4>$<?php echo esc_attr( $price ) ?></h4>
|
23 |
-
<a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/checkout?edd_action=add_to_cart&download_id=93790' ) ) ?>&edd_options[price_id]=<?php echo absint( $
|
|
|
|
|
24 |
</th>
|
25 |
<?php } ?>
|
26 |
</tr>
|
27 |
</thead>
|
28 |
<tbody>
|
29 |
<tr>
|
30 |
-
<th>
|
31 |
<td>1 Site</td>
|
32 |
-
<td>
|
33 |
<td>15 Sites</td>
|
34 |
-
<td>
|
35 |
-
</tr>
|
36 |
-
<tr>
|
37 |
-
<th>Product Updates Forever</th>
|
38 |
-
<td>Manual</td>
|
39 |
-
<td>Manual</td>
|
40 |
-
<td>Manual</td>
|
41 |
-
<td>Automatic</td>
|
42 |
</tr>
|
43 |
<tr>
|
44 |
<th>Automatic Updates</th>
|
45 |
<td>1 Year</td>
|
46 |
<td>1 Year</td>
|
47 |
-
<td>
|
48 |
<td>Lifetime</td>
|
49 |
</tr>
|
50 |
<tr>
|
51 |
-
<th>
|
52 |
-
<td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
<td>Standard Support</td>
|
54 |
<td>Priority Support</td>
|
55 |
<td>Elite Support</td>
|
@@ -57,7 +58,7 @@
|
|
57 |
<tr>
|
58 |
<th>Included AddOns</th>
|
59 |
<td>None</td>
|
60 |
-
<td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">
|
61 |
<td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">Advanced Addons</a></td>
|
62 |
<td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">Enterprise Addons</a></td>
|
63 |
</tr>
|
1 |
<div class="wrap upgrade_to_pro">
|
2 |
+
<h1 class="frm_pro_heading">
|
3 |
+
<img src="<?php echo esc_url( FrmAppHelper::plugin_url() ) ?>/images/logo.png" alt="Upgrade to Pro" />
|
4 |
+
<span class="alignright">Save time and make life easier. Upgrade to Pro.</span>
|
5 |
+
<span class="clear"></span>
|
6 |
+
</h1>
|
7 |
|
8 |
<div class="clear"></div>
|
9 |
|
15 |
<thead>
|
16 |
<tr>
|
17 |
<th></th>
|
18 |
+
<?php foreach ( $pro_pricing as $price_info ) { ?>
|
|
|
|
|
|
|
|
|
19 |
<th>
|
20 |
+
<h3><?php echo esc_attr( ucfirst( $price_info['name'] ) ) ?></h3>
|
21 |
+
<h4>$<?php echo esc_attr( $price_info['price'] ) ?></h4>
|
22 |
+
<a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/checkout?edd_action=add_to_cart&download_id=93790' ) ) ?>&edd_options[price_id]=<?php echo absint( $price_info['id'] ) ?>" class="button-primary" target="_blank">
|
23 |
+
<?php _e( 'Get Started', 'formidable' ) ?>
|
24 |
+
</a>
|
25 |
</th>
|
26 |
<?php } ?>
|
27 |
</tr>
|
28 |
</thead>
|
29 |
<tbody>
|
30 |
<tr>
|
31 |
+
<th>Number of Sites</th>
|
32 |
<td>1 Site</td>
|
33 |
+
<td>3 Sites</td>
|
34 |
<td>15 Sites</td>
|
35 |
+
<td>Unlimited Sites</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
</tr>
|
37 |
<tr>
|
38 |
<th>Automatic Updates</th>
|
39 |
<td>1 Year</td>
|
40 |
<td>1 Year</td>
|
41 |
+
<td>1 Year</td>
|
42 |
<td>Lifetime</td>
|
43 |
</tr>
|
44 |
<tr>
|
45 |
+
<th>Support Term</th>
|
46 |
+
<td>1 Year</td>
|
47 |
+
<td>1 Year</td>
|
48 |
+
<td>1 Year</td>
|
49 |
+
<td>1 Year</td>
|
50 |
+
</tr>
|
51 |
+
<tr>
|
52 |
+
<th>Support Priority</th>
|
53 |
+
<td>Standard Support</td>
|
54 |
<td>Standard Support</td>
|
55 |
<td>Priority Support</td>
|
56 |
<td>Elite Support</td>
|
58 |
<tr>
|
59 |
<th>Included AddOns</th>
|
60 |
<td>None</td>
|
61 |
+
<td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">Premium Addons</a></td>
|
62 |
<td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">Advanced Addons</a></td>
|
63 |
<td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">Enterprise Addons</a></td>
|
64 |
</tr>
|
classes/views/frm-entries/errors.php
CHANGED
@@ -30,7 +30,7 @@ if ( ! FrmAppHelper::is_admin() ) {
|
|
30 |
}
|
31 |
}
|
32 |
|
33 |
-
FrmFormsHelper::show_errors( compact( 'img', 'errors' ) );
|
34 |
|
35 |
?>
|
36 |
</div>
|
30 |
}
|
31 |
}
|
32 |
|
33 |
+
FrmFormsHelper::show_errors( compact( 'img', 'errors', 'form' ) );
|
34 |
|
35 |
?>
|
36 |
</div>
|
classes/views/frm-fields/back-end/dropdown-field.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( isset($field['post_field']) && $field['post_field'] == 'post_category' && FrmAppHelper::pro_is_installed() ) {
|
4 |
+
echo FrmProPost::get_category_dropdown( $field, array( 'name' => $field_name, 'id' => 'placeholder_id', 'location' => 'form_builder' ) );
|
5 |
+
} else { ?>
|
6 |
+
<select name="<?php echo esc_attr( $field_name ) . ( FrmField::is_option_true( $field, 'multiple' ) ? '[]' : '' ); ?>" <?php
|
7 |
+
echo FrmField::is_option_true( $field, 'size' ) ? 'class="auto_width"' : '';
|
8 |
+
echo FrmField::is_option_true( $field, 'multiple' ) ? ' multiple="multiple"' : ''; ?> >
|
9 |
+
<?php foreach ( $field['options'] as $opt_key => $opt ) {
|
10 |
+
$field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field);
|
11 |
+
$opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field);
|
12 |
+
$selected = ( $field['default_value'] == $field_val || FrmFieldsHelper::get_other_val( array( 'opt_key', 'field' ) ) ) ? ' selected="selected"' : ''; ?>
|
13 |
+
<option value="<?php echo esc_attr( $field_val ) ?>"<?php echo $selected ?>><?php echo esc_html( $opt ) ?> </option>
|
14 |
+
<?php } ?>
|
15 |
+
</select>
|
16 |
+
<?php }
|
17 |
+
|
18 |
+
if ( $display['default_blank'] ) { ?>
|
19 |
+
<span id="frm_clear_on_focus_<?php echo esc_attr( $field['id'] ) ?>" class="frm_clear_on_focus frm-show-click">
|
20 |
+
<?php FrmFieldsHelper::show_default_blank_js( $field['default_blank'] ); ?>
|
21 |
+
</span>
|
22 |
+
<input type="hidden" name="field_options[default_blank_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['default_blank'] ) ?>" />
|
23 |
+
<?php } ?>
|
24 |
+
<div class="clear"></div>
|
25 |
+
<div class="frm-show-click frm_small_top_margin">
|
26 |
+
<?php
|
27 |
+
|
28 |
+
if ( ! isset( $field['post_field'] ) || ! in_array( $field['post_field'], array( 'post_category' ) ) ) { ?>
|
29 |
+
<?php do_action('frm_add_multiple_opts_labels', $field); ?>
|
30 |
+
<ul id="frm_field_<?php echo esc_attr( $field['id'] ) ?>_opts" class="frm_sortable_field_opts<?php echo ( count($field['options']) > 10 ) ? ' frm_field_opts_list' : ''; ?>">
|
31 |
+
<?php FrmFieldsHelper::show_single_option($field); ?>
|
32 |
+
</ul>
|
33 |
+
<?php
|
34 |
+
} ?>
|
35 |
+
</div>
|
classes/views/frm-fields/front-end/dropdown-field.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$read_only = false;
|
4 |
+
if ( isset($field['post_field']) && $field['post_field'] == 'post_category' && FrmAppHelper::pro_is_installed() ) {
|
5 |
+
echo FrmProPost::get_category_dropdown( $field, array( 'location' => 'front', 'name' => $field_name, 'id' => $html_id ) );
|
6 |
+
} else {
|
7 |
+
if ( FrmAppHelper::pro_is_installed() && FrmField::is_read_only( $field ) ) {
|
8 |
+
$read_only = true;
|
9 |
+
|
10 |
+
echo FrmProDropdownFieldsController::get_hidden_fields_with_readonly_values( $field, $field_name, $html_id ); ?>
|
11 |
+
<select <?php do_action('frm_field_input_html', $field) ?>> <?php
|
12 |
+
|
13 |
+
} else { ?>
|
14 |
+
<select name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id ) ?>" <?php do_action('frm_field_input_html', $field) ?>>
|
15 |
+
<?php }
|
16 |
+
|
17 |
+
$other_opt = $other_checked = false;
|
18 |
+
foreach ( $field['options'] as $opt_key => $opt ) {
|
19 |
+
$field_val = apply_filters( 'frm_field_value_saved', $opt, $opt_key, $field );
|
20 |
+
$opt = apply_filters( 'frm_field_label_seen', $opt, $opt_key, $field );
|
21 |
+
$selected = FrmAppHelper::check_selected( $field['value'], $field_val );
|
22 |
+
if ( $other_opt === false ) {
|
23 |
+
$other_args = FrmFieldsHelper::prepare_other_input( compact( 'field', 'field_name', 'opt_key' ), $other_opt, $selected );
|
24 |
+
if ( FrmFieldsHelper::is_other_opt( $opt_key ) && $selected ) {
|
25 |
+
$other_checked = true;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
?>
|
29 |
+
<option value="<?php echo esc_attr($field_val) ?>" <?php echo $selected ? ' selected="selected"' : ''; ?><?php echo ( FrmFieldsHelper::is_other_opt( $opt_key ) ) ? ' class="frm_other_trigger"' : '';?>><?php echo esc_html( $opt == '' ? ' ' : $opt ); ?></option>
|
30 |
+
<?php
|
31 |
+
} ?>
|
32 |
+
</select>
|
33 |
+
<?php
|
34 |
+
|
35 |
+
FrmFieldsHelper::include_other_input( array(
|
36 |
+
'other_opt' => $other_opt, 'read_only' => $read_only,
|
37 |
+
'checked' => $other_checked, 'name' => $other_args['name'],
|
38 |
+
'value' => $other_args['value'], 'field' => $field,
|
39 |
+
'html_id' => $html_id, 'opt_key' => false,
|
40 |
+
) );
|
41 |
+
}
|
classes/views/frm-fields/input.php
CHANGED
@@ -59,50 +59,7 @@ do_action('frm_field_input_html', $field);
|
|
59 |
}
|
60 |
}
|
61 |
} else if ( $field['type'] == 'select' ) {
|
62 |
-
|
63 |
-
if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) {
|
64 |
-
echo FrmFieldsHelper::dropdown_categories( array( 'name' => $field_name, 'field' => $field ) );
|
65 |
-
} else {
|
66 |
-
if ( FrmField::is_read_only( $field ) && ! FrmAppHelper::is_admin() ) {
|
67 |
-
$read_only = true;
|
68 |
-
|
69 |
-
if ( is_array( $field['value'] ) ) {
|
70 |
-
foreach ( $field['value'] as $selected_value ) { ?>
|
71 |
-
<input type="hidden" value="<?php echo esc_attr( $selected_value ) ?>" name="<?php echo esc_attr( $field_name ) ?>[]" /> <?php
|
72 |
-
}
|
73 |
-
} else { ?>
|
74 |
-
<input type="hidden" value="<?php echo esc_attr($field['value']) ?>" name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id ) ?>" /> <?php
|
75 |
-
} ?>
|
76 |
-
<select disabled="disabled" <?php do_action('frm_field_input_html', $field) ?>> <?php
|
77 |
-
|
78 |
-
} else { ?>
|
79 |
-
<select name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id ) ?>" <?php do_action('frm_field_input_html', $field) ?>>
|
80 |
-
<?php }
|
81 |
-
|
82 |
-
$other_opt = $other_checked = false;
|
83 |
-
foreach ( $field['options'] as $opt_key => $opt ) {
|
84 |
-
$field_val = apply_filters( 'frm_field_value_saved', $opt, $opt_key, $field );
|
85 |
-
$opt = apply_filters( 'frm_field_label_seen', $opt, $opt_key, $field );
|
86 |
-
$selected = FrmAppHelper::check_selected( $field['value'], $field_val );
|
87 |
-
if ( $other_opt === false ) {
|
88 |
-
$other_args = FrmFieldsHelper::prepare_other_input( compact( 'field', 'field_name', 'opt_key' ), $other_opt, $selected );
|
89 |
-
if ( FrmFieldsHelper::is_other_opt( $opt_key ) && $selected ) {
|
90 |
-
$other_checked = true;
|
91 |
-
}
|
92 |
-
}
|
93 |
-
?>
|
94 |
-
<option value="<?php echo esc_attr($field_val) ?>" <?php echo $selected ? ' selected="selected"' : ''; ?><?php echo ( FrmFieldsHelper::is_other_opt( $opt_key ) ) ? ' class="frm_other_trigger"' : '';?>><?php echo esc_html( $opt == '' ? ' ' : $opt ); ?></option>
|
95 |
-
<?php
|
96 |
-
} ?>
|
97 |
-
</select>
|
98 |
-
<?php
|
99 |
-
FrmFieldsHelper::include_other_input( array(
|
100 |
-
'other_opt' => $other_opt, 'read_only' => $read_only,
|
101 |
-
'checked' => $other_checked, 'name' => $other_args['name'],
|
102 |
-
'value' => $other_args['value'], 'field' => $field,
|
103 |
-
'html_id' => $html_id, 'opt_key' => false,
|
104 |
-
) );
|
105 |
-
}
|
106 |
} else if ( $field['type'] == 'checkbox' ) {
|
107 |
$checked_values = $field['value'];
|
108 |
$read_only = false;
|
@@ -137,7 +94,7 @@ do_action('frm_field_input_html', $field);
|
|
137 |
$other_args = FrmFieldsHelper::prepare_other_input( compact( 'field', 'field_name', 'opt_key' ), $other_opt, $checked );
|
138 |
|
139 |
?>
|
140 |
-
<div class="<?php echo esc_attr( apply_filters( 'frm_checkbox_class', 'frm_checkbox', $field, $field_val ) ) ?>" id="
|
141 |
|
142 |
if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) {
|
143 |
?><label for="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php
|
59 |
}
|
60 |
}
|
61 |
} else if ( $field['type'] == 'select' ) {
|
62 |
+
include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/front-end/dropdown-field.php' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
} else if ( $field['type'] == 'checkbox' ) {
|
64 |
$checked_values = $field['value'];
|
65 |
$read_only = false;
|
94 |
$other_args = FrmFieldsHelper::prepare_other_input( compact( 'field', 'field_name', 'opt_key' ), $other_opt, $checked );
|
95 |
|
96 |
?>
|
97 |
+
<div class="<?php echo esc_attr( apply_filters( 'frm_checkbox_class', 'frm_checkbox', $field, $field_val ) ) ?>" id="<?php echo esc_attr( FrmFieldsHelper::get_checkbox_id( $field, $opt_key ) ) ?>"><?php
|
98 |
|
99 |
if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) {
|
100 |
?><label for="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php
|
classes/views/frm-fields/show-build.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php if ( in_array( $display['type'], array( 'text', 'website', 'email', 'url' ) ) ) { ?>
|
2 |
-
<input type="text" name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id ) ?>" value="<?php echo esc_attr( $field['default_value'] ); ?>"
|
3 |
<?php } else if ( $field['type'] == 'textarea' ) { ?>
|
4 |
<textarea name="<?php echo esc_attr( $field_name ) ?>" <?php
|
5 |
echo ( FrmField::is_option_true( $field, 'size' ) ) ? esc_attr( 'style="width:' . $field['size'] . ( is_numeric( $field['size'] ) ? 'px' : '' ) . ';"' ) : '';
|
@@ -19,40 +19,7 @@
|
|
19 |
<?php
|
20 |
}
|
21 |
} else if ( $field['type'] == 'select' ) {
|
22 |
-
|
23 |
-
echo FrmFieldsHelper::dropdown_categories( array( 'name' => $field_name, 'field' => $field ) );
|
24 |
-
} else { ?>
|
25 |
-
<select name="<?php echo esc_attr( $field_name ) . ( FrmField::is_option_true( $field, 'multiple' ) ? '[]' : '' ); ?>" <?php
|
26 |
-
echo FrmField::is_option_true( $field, 'size' ) ? 'class="auto_width"' : '';
|
27 |
-
echo FrmField::is_option_true( $field, 'multiple' ) ? ' multiple="multiple"' : ''; ?> >
|
28 |
-
<?php foreach ( $field['options'] as $opt_key => $opt ) {
|
29 |
-
$field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field);
|
30 |
-
$opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field);
|
31 |
-
$selected = ( $field['default_value'] == $field_val || FrmFieldsHelper::get_other_val( array( 'opt_key', 'field' ) ) ) ? ' selected="selected"' : ''; ?>
|
32 |
-
<option value="<?php echo esc_attr( $field_val ) ?>"<?php echo $selected ?>><?php echo esc_html( $opt ) ?> </option>
|
33 |
-
<?php } ?>
|
34 |
-
</select>
|
35 |
-
<?php }
|
36 |
-
|
37 |
-
if ( $display['default_blank'] ) { ?>
|
38 |
-
<span id="frm_clear_on_focus_<?php echo esc_attr( $field['id'] ) ?>" class="frm_clear_on_focus frm-show-click">
|
39 |
-
<?php FrmFieldsHelper::show_default_blank_js( $field['default_blank'] ); ?>
|
40 |
-
</span>
|
41 |
-
<input type="hidden" name="field_options[default_blank_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['default_blank'] ) ?>" />
|
42 |
-
<?php } ?>
|
43 |
-
<div class="clear"></div>
|
44 |
-
<div class="frm-show-click frm_small_top_margin">
|
45 |
-
<?php
|
46 |
-
|
47 |
-
if ( ! isset( $field['post_field'] ) || ! in_array( $field['post_field'], array( 'post_category' ) ) ) { ?>
|
48 |
-
<?php do_action('frm_add_multiple_opts_labels', $field); ?>
|
49 |
-
<ul id="frm_field_<?php echo esc_attr( $field['id'] ) ?>_opts" class="frm_sortable_field_opts<?php echo ( count($field['options']) > 10 ) ? ' frm_field_opts_list' : ''; ?>">
|
50 |
-
<?php FrmFieldsHelper::show_single_option($field); ?>
|
51 |
-
</ul>
|
52 |
-
<?php
|
53 |
-
} ?>
|
54 |
-
</div>
|
55 |
-
<?php
|
56 |
} else if ( $field['type'] == 'captcha' ) {
|
57 |
if ( empty($frm_settings->pubkey) ) { ?>
|
58 |
<div class="howto frm_no_captcha_text"><?php printf(__( 'Your captcha will not appear on your form until you %1$sset up%2$s the Site and Secret Keys', 'formidable' ), '<a href="?page=formidable-settings">', '</a>') ?></div>
|
1 |
<?php if ( in_array( $display['type'], array( 'text', 'website', 'email', 'url' ) ) ) { ?>
|
2 |
+
<input type="text" name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id ) ?>" value="<?php echo esc_attr( $field['default_value'] ); ?>" class="dyn_default_value" />
|
3 |
<?php } else if ( $field['type'] == 'textarea' ) { ?>
|
4 |
<textarea name="<?php echo esc_attr( $field_name ) ?>" <?php
|
5 |
echo ( FrmField::is_option_true( $field, 'size' ) ) ? esc_attr( 'style="width:' . $field['size'] . ( is_numeric( $field['size'] ) ? 'px' : '' ) . ';"' ) : '';
|
19 |
<?php
|
20 |
}
|
21 |
} else if ( $field['type'] == 'select' ) {
|
22 |
+
include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/dropdown-field.php' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
} else if ( $field['type'] == 'captcha' ) {
|
24 |
if ( empty($frm_settings->pubkey) ) { ?>
|
25 |
<div class="howto frm_no_captcha_text"><?php printf(__( 'Your captcha will not appear on your form until you %1$sset up%2$s the Site and Secret Keys', 'formidable' ), '<a href="?page=formidable-settings">', '</a>') ?></div>
|
classes/views/frm-forms/add_field.php
CHANGED
@@ -88,7 +88,7 @@ if ( $display['conf_field'] ) { ?>
|
|
88 |
<div id="frm_conf_field_<?php echo esc_attr( $field['id'] ) ?>_container" class="frm_conf_field_container frm_form_fields frm_conf_details<?php echo esc_attr( $field['id'] . ( $field['conf_field'] ? '' : ' frm_hidden' ) ); ?>">
|
89 |
<div id="frm_conf_field_<?php echo esc_attr( $field['id'] ) ?>_inner_container" class="frm_inner_conf_container">
|
90 |
<div class="frm_form_fields">
|
91 |
-
<input type="text" id="conf_field_<?php echo esc_attr( $field['field_key'] ) ?>" name="field_options[conf_input_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['conf_input'] ); ?>"
|
92 |
</div>
|
93 |
<div id="conf_field_description_<?php echo esc_attr( $field['id'] ) ?>" class="frm_ipe_field_conf_desc description <?php echo ($field['conf_desc'] == '') ? 'frm-show-click' : '' ?>"><?php
|
94 |
echo ($field['conf_desc'] == '') ? __( '(Click to add description)', 'formidable' ) : force_balance_tags($field['conf_desc']); ?></div>
|
88 |
<div id="frm_conf_field_<?php echo esc_attr( $field['id'] ) ?>_container" class="frm_conf_field_container frm_form_fields frm_conf_details<?php echo esc_attr( $field['id'] . ( $field['conf_field'] ? '' : ' frm_hidden' ) ); ?>">
|
89 |
<div id="frm_conf_field_<?php echo esc_attr( $field['id'] ) ?>_inner_container" class="frm_inner_conf_container">
|
90 |
<div class="frm_form_fields">
|
91 |
+
<input type="text" id="conf_field_<?php echo esc_attr( $field['field_key'] ) ?>" name="field_options[conf_input_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['conf_input'] ); ?>" class="dyn_default_value" />
|
92 |
</div>
|
93 |
<div id="conf_field_description_<?php echo esc_attr( $field['id'] ) ?>" class="frm_ipe_field_conf_desc description <?php echo ($field['conf_desc'] == '') ? 'frm-show-click' : '' ?>"><?php
|
94 |
echo ($field['conf_desc'] == '') ? __( '(Click to add description)', 'formidable' ) : force_balance_tags($field['conf_desc']); ?></div>
|
css/_single_theme.css.php
CHANGED
@@ -164,10 +164,12 @@ if ( ! isset( $center_form ) ) {
|
|
164 |
|
165 |
.<?php echo esc_html( $style_class ) ?> .frm_trigger.active .frm_icon_font.frm_arrow_icon:before{
|
166 |
content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['-'] : $arrow_icons[1]['-'] ) ?>";
|
|
|
167 |
}
|
168 |
|
169 |
.<?php echo esc_html( $style_class ) ?> .frm_trigger .frm_icon_font.frm_arrow_icon:before{
|
170 |
content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['+'] : $arrow_icons[1]['+'] ) ?>";
|
|
|
171 |
}
|
172 |
|
173 |
.<?php echo esc_html( $style_class ) ?> .form-field{
|
@@ -729,7 +731,6 @@ if ( ! $submit_style ) { ?>
|
|
729 |
background-color:transparent<?php echo esc_html( $important ) ?>;
|
730 |
border:none<?php echo esc_html( $important ) ?>;
|
731 |
display:inline<?php echo esc_html( $important ) ?>;
|
732 |
-
width:auto<?php echo esc_html( $important ) ?>;
|
733 |
padding:0<?php echo esc_html( $important ) ?>;
|
734 |
}
|
735 |
|
164 |
|
165 |
.<?php echo esc_html( $style_class ) ?> .frm_trigger.active .frm_icon_font.frm_arrow_icon:before{
|
166 |
content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['-'] : $arrow_icons[1]['-'] ) ?>";
|
167 |
+
color:#<?php echo esc_html( $section_color . $important ) ?>;
|
168 |
}
|
169 |
|
170 |
.<?php echo esc_html( $style_class ) ?> .frm_trigger .frm_icon_font.frm_arrow_icon:before{
|
171 |
content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['+'] : $arrow_icons[1]['+'] ) ?>";
|
172 |
+
color:#<?php echo esc_html( $section_color . $important ) ?>;
|
173 |
}
|
174 |
|
175 |
.<?php echo esc_html( $style_class ) ?> .form-field{
|
731 |
background-color:transparent<?php echo esc_html( $important ) ?>;
|
732 |
border:none<?php echo esc_html( $important ) ?>;
|
733 |
display:inline<?php echo esc_html( $important ) ?>;
|
|
|
734 |
padding:0<?php echo esc_html( $important ) ?>;
|
735 |
}
|
736 |
|
css/custom_theme.css.php
CHANGED
@@ -259,6 +259,7 @@ a.frm_save_draft{
|
|
259 |
margin-right:5px;
|
260 |
width:auto;
|
261 |
border:none;
|
|
|
262 |
}
|
263 |
|
264 |
.with_frm_style :invalid,
|
@@ -1034,7 +1035,6 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
|
|
1034 |
-webkit-box-shadow:none;
|
1035 |
box-shadow:none !important;
|
1036 |
display:inline;
|
1037 |
-
width:auto !important;
|
1038 |
-moz-appearance:textfield;
|
1039 |
padding:0;
|
1040 |
}
|
259 |
margin-right:5px;
|
260 |
width:auto;
|
261 |
border:none;
|
262 |
+
vertical-align:baseline;
|
263 |
}
|
264 |
|
265 |
.with_frm_style :invalid,
|
1035 |
-webkit-box-shadow:none;
|
1036 |
box-shadow:none !important;
|
1037 |
display:inline;
|
|
|
1038 |
-moz-appearance:textfield;
|
1039 |
padding:0;
|
1040 |
}
|
css/dropzone.css
CHANGED
@@ -549,7 +549,7 @@
|
|
549 |
}
|
550 |
|
551 |
.frm_compact .frm_dropzone .dz-preview.dz-error .dz-error-message{
|
552 |
-
top:
|
553 |
padding: 4px;
|
554 |
width: auto;
|
555 |
text-align: center;
|
@@ -562,7 +562,7 @@
|
|
562 |
top: 6px;
|
563 |
}
|
564 |
|
565 |
-
.frm_compact .frm_dropzone .dz-
|
566 |
display:none;
|
567 |
}
|
568 |
|
549 |
}
|
550 |
|
551 |
.frm_compact .frm_dropzone .dz-preview.dz-error .dz-error-message{
|
552 |
+
top: -40px;
|
553 |
padding: 4px;
|
554 |
width: auto;
|
555 |
text-align: center;
|
562 |
top: 6px;
|
563 |
}
|
564 |
|
565 |
+
.frm_compact .frm_dropzone .dz-preview:hover .dz-error-mark{
|
566 |
display:none;
|
567 |
}
|
568 |
|
css/frm_admin.css
CHANGED
@@ -290,6 +290,15 @@ form label.frm_primary_label input{font-size:12px;}
|
|
290 |
margin-top:10px;
|
291 |
}
|
292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
.update-nag.frm-update-to-pro{
|
294 |
display:block;
|
295 |
text-align:center;
|
@@ -323,10 +332,8 @@ form label.frm_primary_label input{font-size:12px;}
|
|
323 |
border:1px solid #BB3E01;
|
324 |
}
|
325 |
|
326 |
-
.frm_pro_heading{
|
327 |
-
|
328 |
-
left:285px;
|
329 |
-
line-height: 2.3em !important;
|
330 |
}
|
331 |
|
332 |
.upgrade_to_pro .frm_check_icon{
|
@@ -681,6 +688,8 @@ label input[type="checkbox"], label input[type="radio"] {vertical-align:inherit;
|
|
681 |
border-radius:5px;
|
682 |
-moz-border-radius:5px;
|
683 |
-webkit-border-radius:5px;
|
|
|
|
|
684 |
position:relative;
|
685 |
}
|
686 |
.frm_field_list #frm-insert-fields .button a{
|
290 |
margin-top:10px;
|
291 |
}
|
292 |
|
293 |
+
.upgrade_to_pro{
|
294 |
+
background: #fff;
|
295 |
+
padding: 10px 25px 25px;
|
296 |
+
}
|
297 |
+
|
298 |
+
.upgrade_to_pro .error{
|
299 |
+
display:none;
|
300 |
+
}
|
301 |
+
|
302 |
.update-nag.frm-update-to-pro{
|
303 |
display:block;
|
304 |
text-align:center;
|
332 |
border:1px solid #BB3E01;
|
333 |
}
|
334 |
|
335 |
+
.frm_pro_heading span{
|
336 |
+
margin-top:20px;
|
|
|
|
|
337 |
}
|
338 |
|
339 |
.upgrade_to_pro .frm_check_icon{
|
688 |
border-radius:5px;
|
689 |
-moz-border-radius:5px;
|
690 |
-webkit-border-radius:5px;
|
691 |
+
}
|
692 |
+
#postbox-container-1 .frm_field_list #frm-insert-fields .frmbutton.dropdown{
|
693 |
position:relative;
|
694 |
}
|
695 |
.frm_field_list #frm-insert-fields .button a{
|
formidable.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Formidable
|
4 |
Description: Quickly and easily create drag-and-drop forms
|
5 |
-
Version: 2.02.
|
6 |
Plugin URI: http://formidablepro.com/
|
7 |
Author URI: http://strategy11.com
|
8 |
Author: Strategy11
|
2 |
/*
|
3 |
Plugin Name: Formidable
|
4 |
Description: Quickly and easily create drag-and-drop forms
|
5 |
+
Version: 2.02.07
|
6 |
Plugin URI: http://formidablepro.com/
|
7 |
Author URI: http://strategy11.com
|
8 |
Author: Strategy11
|
js/formidable.js
CHANGED
@@ -140,6 +140,12 @@ function frmFrontFormJS(){
|
|
140 |
maxFilesize: uploadFields[i].maxFilesize,
|
141 |
maxFiles: max,
|
142 |
uploadMultiple: uploadFields[i].uploadMultiple,
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
dictCancelUpload: uploadFields[i].cancel,
|
144 |
dictCancelUploadConfirmation: uploadFields[i].cancelConfirm,
|
145 |
dictRemoveFile: uploadFields[i].remove,
|
@@ -167,7 +173,7 @@ function frmFrontFormJS(){
|
|
167 |
this.on('successmultiple', function( files, response ) {
|
168 |
var mediaIDs = jQuery.parseJSON(response);
|
169 |
for ( var m = 0; m < files.length; m++ ) {
|
170 |
-
jQuery(files[m].previewElement).append( getHiddenUploadHTML( uploadFields[i], mediaIDs[m] ) );
|
171 |
}
|
172 |
});
|
173 |
|
@@ -180,7 +186,7 @@ function frmFrontFormJS(){
|
|
180 |
this.on('complete', function( file ) {
|
181 |
if ( typeof file.mediaID !== 'undefined' ) {
|
182 |
if ( uploadFields[i].uploadMultiple ) {
|
183 |
-
jQuery(file.previewElement).append( getHiddenUploadHTML( uploadFields[i], file.mediaID ) );
|
184 |
}
|
185 |
|
186 |
// Add download link to the file
|
@@ -229,8 +235,8 @@ function frmFrontFormJS(){
|
|
229 |
});
|
230 |
}
|
231 |
|
232 |
-
function getHiddenUploadHTML( field, mediaID ) {
|
233 |
-
return '<input name="'+
|
234 |
}
|
235 |
|
236 |
function removeFile(){
|
@@ -376,18 +382,19 @@ function frmFrontFormJS(){
|
|
376 |
var field_id = nameParts[0];
|
377 |
var isRepeating = false;
|
378 |
|
379 |
-
if ( nameParts.length === 1
|
380 |
return field_id;
|
381 |
}
|
382 |
|
|
|
|
|
|
|
|
|
|
|
383 |
// Check if 'this' is in a repeating section
|
384 |
if ( jQuery('input[name="item_meta['+ field_id +'][form]"]').length ) {
|
385 |
-
// If item_meta[370][0]
|
386 |
-
if ( nameParts.length === 2 && nameParts[1] == '[0' ) {
|
387 |
-
return 0;
|
388 |
-
}
|
389 |
|
390 |
-
// this is a repeatable section with name: item_meta[
|
391 |
field_id = nameParts[2].replace('[', '');
|
392 |
isRepeating = true;
|
393 |
}
|
@@ -2388,7 +2395,7 @@ function frmFrontFormJS(){
|
|
2388 |
var dec = thisCalc.calc_dec;
|
2389 |
|
2390 |
// allow .toFixed for reverse compatability
|
2391 |
-
if ( thisFullCalc.indexOf(').toFixed(') ) {
|
2392 |
var calcParts = thisFullCalc.split(').toFixed(');
|
2393 |
if ( isNumeric(calcParts[1]) ) {
|
2394 |
dec = calcParts[1];
|
@@ -3423,19 +3430,25 @@ function frmFrontFormJS(){
|
|
3423 |
/* Repeating Fields */
|
3424 |
function removeRow(){
|
3425 |
/*jshint validthis:true */
|
3426 |
-
var
|
|
|
|
|
3427 |
var thisRow = jQuery(document.getElementById(id));
|
3428 |
var fields = thisRow.find('input, select, textarea');
|
|
|
3429 |
|
3430 |
thisRow.fadeOut('slow', function(){
|
3431 |
thisRow.remove();
|
3432 |
|
3433 |
fields.each(function(){
|
3434 |
/* update calculations when a row is removed */
|
|
|
3435 |
if ( this.type != 'file' ) {
|
3436 |
-
var fieldID = getFieldId( this, false );
|
3437 |
doCalculation(fieldID, jQuery(this));
|
3438 |
}
|
|
|
|
|
|
|
3439 |
});
|
3440 |
|
3441 |
if(typeof(frmThemeOverride_frmRemoveRow) == 'function'){
|
@@ -3499,6 +3512,7 @@ function frmFrontFormJS(){
|
|
3499 |
if ( this.id === false || this.id === '' ) {
|
3500 |
return;
|
3501 |
}
|
|
|
3502 |
fieldObject = jQuery( '#' + this.id );
|
3503 |
checked.push(fieldID);
|
3504 |
hideOrShowFieldById( fieldID, repeatArgs );
|
@@ -3636,7 +3650,7 @@ function frmFrontFormJS(){
|
|
3636 |
|
3637 |
function loadChosen() {
|
3638 |
if ( jQuery().chosen ) {
|
3639 |
-
var opts = {allow_single_deselect:true};
|
3640 |
if ( typeof __frmChosen !== 'undefined' ) {
|
3641 |
opts = '{' + __frmChosen + '}';
|
3642 |
}
|
@@ -3996,6 +4010,9 @@ function frmFrontFormJS(){
|
|
3996 |
var scrollObj = '';
|
3997 |
if(typeof(object) == 'undefined'){
|
3998 |
scrollObj = jQuery(document.getElementById('frm_form_'+id+'_container'));
|
|
|
|
|
|
|
3999 |
} else if ( typeof id == 'string' ) {
|
4000 |
scrollObj = jQuery(object).find('#frm_field_'+id+'_container');
|
4001 |
} else {
|
140 |
maxFilesize: uploadFields[i].maxFilesize,
|
141 |
maxFiles: max,
|
142 |
uploadMultiple: uploadFields[i].uploadMultiple,
|
143 |
+
dictDefaultMessage: uploadFields[i].defaultMessage,
|
144 |
+
dictFallbackMessage: uploadFields[i].fallbackMessage,
|
145 |
+
dictFallbackText: uploadFields[i].fallbackText,
|
146 |
+
dictFileTooBig: uploadFields[i].fileTooBig,
|
147 |
+
dictInvalidFileType: uploadFields[i].invalidFileType,
|
148 |
+
dictResponseError: uploadFields[i].responseError,
|
149 |
dictCancelUpload: uploadFields[i].cancel,
|
150 |
dictCancelUploadConfirmation: uploadFields[i].cancelConfirm,
|
151 |
dictRemoveFile: uploadFields[i].remove,
|
173 |
this.on('successmultiple', function( files, response ) {
|
174 |
var mediaIDs = jQuery.parseJSON(response);
|
175 |
for ( var m = 0; m < files.length; m++ ) {
|
176 |
+
jQuery(files[m].previewElement).append( getHiddenUploadHTML( uploadFields[i], mediaIDs[m], fieldName ) );
|
177 |
}
|
178 |
});
|
179 |
|
186 |
this.on('complete', function( file ) {
|
187 |
if ( typeof file.mediaID !== 'undefined' ) {
|
188 |
if ( uploadFields[i].uploadMultiple ) {
|
189 |
+
jQuery(file.previewElement).append( getHiddenUploadHTML( uploadFields[i], file.mediaID, fieldName ) );
|
190 |
}
|
191 |
|
192 |
// Add download link to the file
|
235 |
});
|
236 |
}
|
237 |
|
238 |
+
function getHiddenUploadHTML( field, mediaID, fieldName ) {
|
239 |
+
return '<input name="'+ fieldName +'[]" type="hidden" value="'+ mediaID +'" data-frmfile="'+ field.fieldID +'" />';
|
240 |
}
|
241 |
|
242 |
function removeFile(){
|
382 |
var field_id = nameParts[0];
|
383 |
var isRepeating = false;
|
384 |
|
385 |
+
if ( nameParts.length === 1 ) {
|
386 |
return field_id;
|
387 |
}
|
388 |
|
389 |
+
if ( nameParts[1] === '[form' || nameParts[1] === '[row_ids' ) {
|
390 |
+
return 0;
|
391 |
+
}
|
392 |
+
|
393 |
+
|
394 |
// Check if 'this' is in a repeating section
|
395 |
if ( jQuery('input[name="item_meta['+ field_id +'][form]"]').length ) {
|
|
|
|
|
|
|
|
|
396 |
|
397 |
+
// this is a repeatable section with name: item_meta[repeating-section-id][row-id][field-id]
|
398 |
field_id = nameParts[2].replace('[', '');
|
399 |
isRepeating = true;
|
400 |
}
|
2395 |
var dec = thisCalc.calc_dec;
|
2396 |
|
2397 |
// allow .toFixed for reverse compatability
|
2398 |
+
if ( thisFullCalc.indexOf(').toFixed(') > -1 ) {
|
2399 |
var calcParts = thisFullCalc.split(').toFixed(');
|
2400 |
if ( isNumeric(calcParts[1]) ) {
|
2401 |
dec = calcParts[1];
|
3430 |
/* Repeating Fields */
|
3431 |
function removeRow(){
|
3432 |
/*jshint validthis:true */
|
3433 |
+
var rowNum = jQuery(this).data('key');
|
3434 |
+
var sectionID = jQuery(this).data('parent');
|
3435 |
+
var id = 'frm_section_'+ sectionID +'-'+ rowNum;
|
3436 |
var thisRow = jQuery(document.getElementById(id));
|
3437 |
var fields = thisRow.find('input, select, textarea');
|
3438 |
+
var formId = jQuery(this).closest('form').find('input[name="form_id"]').val();
|
3439 |
|
3440 |
thisRow.fadeOut('slow', function(){
|
3441 |
thisRow.remove();
|
3442 |
|
3443 |
fields.each(function(){
|
3444 |
/* update calculations when a row is removed */
|
3445 |
+
var fieldID = getFieldId( this, false );
|
3446 |
if ( this.type != 'file' ) {
|
|
|
3447 |
doCalculation(fieldID, jQuery(this));
|
3448 |
}
|
3449 |
+
|
3450 |
+
var container = 'frm_field_' + fieldID + '-' + sectionID + '-' + rowNum + '_container';
|
3451 |
+
removeFromHideFields( container, formId );
|
3452 |
});
|
3453 |
|
3454 |
if(typeof(frmThemeOverride_frmRemoveRow) == 'function'){
|
3512 |
if ( this.id === false || this.id === '' ) {
|
3513 |
return;
|
3514 |
}
|
3515 |
+
|
3516 |
fieldObject = jQuery( '#' + this.id );
|
3517 |
checked.push(fieldID);
|
3518 |
hideOrShowFieldById( fieldID, repeatArgs );
|
3650 |
|
3651 |
function loadChosen() {
|
3652 |
if ( jQuery().chosen ) {
|
3653 |
+
var opts = {allow_single_deselect:true,no_results_text:frm_js.no_results};
|
3654 |
if ( typeof __frmChosen !== 'undefined' ) {
|
3655 |
opts = '{' + __frmChosen + '}';
|
3656 |
}
|
4010 |
var scrollObj = '';
|
4011 |
if(typeof(object) == 'undefined'){
|
4012 |
scrollObj = jQuery(document.getElementById('frm_form_'+id+'_container'));
|
4013 |
+
if(scrollObj.length < 1 ){
|
4014 |
+
return;
|
4015 |
+
}
|
4016 |
} else if ( typeof id == 'string' ) {
|
4017 |
scrollObj = jQuery(object).find('#frm_field_'+id+'_container');
|
4018 |
} else {
|
js/formidable.min.js
CHANGED
@@ -2,91 +2,92 @@ function frmFrontFormJS(){function l(a){var b=jQuery(this),c=b.attr("type");"sub
|
|
2 |
jQuery(this).toggleClass("active").children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s").toggleClass("ui-icon-triangle-1-s ui-icon-triangle-1-e")}function p(){for(var a=__frmUniqueTimes,b=0;b<a.length;b++)a[b].dateID==this.id&&frmFrontForm.removeUsedTimes(this,a[b].timeID)}function r(){if(-1===this.className.indexOf("frm_custom_date")&&"undefined"!==typeof __frmDatepicker){var a=__frmDatepicker,b=this.id,c=b.split("-");c.pop();c='input[id^="'+c.join("-")+'"]';jQuery.datepicker.setDefaults(jQuery.datepicker.regional[""]);
|
3 |
for(var d=0,e=0;e<a.length;e++)if(a[e].triggerID=="#"+b||a[e].triggerID==c)d=e;""!==a[d].options.defaultDate&&(a[d].options.defaultDate=new Date(a[d].options.defaultDate));jQuery(this).datepicker(jQuery.extend(jQuery.datepicker.regional[a[d].locale],a[d].options))}}function v(a){if("undefined"!==typeof __frmDropzone)for(var b=__frmDropzone,c=0;c<b.length;c++)z(c,a)}function z(a,b){var c=__frmDropzone,d="#"+c[a].htmlID+"_dropzone",e=c[a].fieldName;"undefined"!==typeof b&&-1!==d.indexOf("-0_dropzone")&&
|
4 |
(d=d.replace("-0_dropzone","-"+b+"_dropzone"),e=e.replace("[0]","["+b+"]"),delete c[a].mockFiles);d=jQuery(d);if(!(1>d.length||d.hasClass("dz-clickable"))){var f=c[a].maxFiles;if("undefined"!==typeof c[a].mockFiles){var h=c[a].mockFiles.length;0<f&&(f-=h)}var h=d.closest("form"),g=h.find('input[type="submit"], .frm_submit input[type="button"]'),k=h.find(".frm_ajax_loading");d.dropzone({url:frm_js.ajax_url,addRemoveLinks:!0,paramName:d.attr("id").replace("_dropzone",""),maxFilesize:c[a].maxFilesize,
|
5 |
-
maxFiles:f,uploadMultiple:c[a].uploadMultiple,dictCancelUpload:c[a].cancel,dictCancelUploadConfirmation:c[a].cancelConfirm,dictRemoveFile:c[a].remove,dictMaxFilesExceeded:c[a].maxFilesExceeded,fallback:function(){jQuery(this.element).closest("form").removeClass("frm_ajax_submit")},
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
this.type,b=!1,c=!1;if("select-one"===a)c=!0,"frm_other_trigger"===this.options[this.selectedIndex].className&&(b=!0);else if("select-multiple"===a)for(var c=!0,d=this.options,b=!1,e=0;e<d.length;e++)if("frm_other_trigger"===d[e].className&&d[e].selected){b=!0;break}c?(a=
|
10 |
-
|
11 |
-
a.frmTriggered!=b)&&(ea(b,jQuery(this)),a="undefined"!==typeof a.originalEvent||-1<a.currentTarget.className.indexOf("frm_chzn")?"value changed":"other",fa(b,jQuery(this),a),L(b,jQuery(this)),jQuery(this).closest("form").hasClass("frm_js_validate"))){b=[];a=jQuery(this).closest(".frm_form_field");a.hasClass("frm_required_field")
|
12 |
-
this.type?b=ia(this,b):null!==this.pattern&&(b=ja(this,b));a.removeClass("frm_blank_field");a.find(".frm_error").remove();if(0<Object.keys(b).length)for(var d in b)M(a,d,b)}}function q(a,b){var c="",c=a instanceof jQuery?a.attr("name"):a.name;if(""===c)return c=a instanceof jQuery?a.data("name"):a.getAttribute("data-name"),
|
13 |
-
"[
|
14 |
-
|
15 |
-
c.fieldId+"-"+f+"-",f=document.querySelectorAll('[name="item_meta['+f+'][row_ids][]"]'),h=0,g=f.length;h<g;h++)""!==f[h].value&&d.push(e+f[h].value+"_container");1>d.length&&d.push(e+"0_container")}else d.push("frm_field_"+c.fieldId+"_container");e=d.length;for(f=0;f<e;f++)c.containerId=d[f],ka(c,d[f]),la(c)}}function O(a){var b="";"0"!==a.inEmbedForm?b=a.inEmbedForm:
|
16 |
-
|
17 |
-
children:"",inputType:a.inputType},"data"==a.inputType?Ra(a,b):b&&Sa(a)):!1!==B(a.containerId,a.formId)&&(
|
18 |
-
c.fieldType?(c=""===a.value?""===d||1==d.length&&""===d[0]?!1:!0:Q(a.operator,a.value,d),b.dataLogic=a,b.dataLogic.actualValue=d,d=c):d=Q(a.operator,a.value,d);return d}function qa(a,b){var c;if("radio"==a.inputType||"checkbox"==a.inputType)c=ra(a,b),c=document.querySelectorAll('input[name^="'+c+'"]'),c="checkbox"==a.inputType?R(c):sa(c);else if(c="",!0===a.isMultiSelect){c=
|
19 |
-
null===c&&(c="")):c=R(d)}else d="field_"+a.fieldKey,a.isRepeating&&(d+="-"+b.repeatRow),d=document.getElementById(d),null!==d&&(c=d.value);"undefined"===typeof c?c="":"string"===typeof c&&(c=c.trim());return c}function ra(a,b){return a.isRepeating?"item_meta["+("0"!==b.inEmbedForm?b.inEmbedForm:b.inSection)+"]["+b.repeatRow+"]["+a.fieldId+"]":"item_meta["+a.fieldId+"]"}function R(a){for(var b=
|
20 |
-
function Q(a,b,c){b=Ta(b);c=Ua(b,c);return"string"===typeof b&&"-1"!=b.indexOf(""")&&Q(a,b.replace(""",'"'),c)?!0:{"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"<":function(a,b){return a>b},">":function(a,b){return a<b},LIKE:function(a,b){if(!b)return!1;a=S(a);b=ta(a,b);return-1!=b.indexOf(a)},"not LIKE":function(a,b){if(!b)return!0;a=S(a);b=ta(a,b);return-1==
|
21 |
-
"string"===typeof a&&(a=a.trim());return a}function Ua(a,b){"undefined"===typeof b&&(b="");jQuery.isArray(b)&&-1<jQuery.inArray(String(a),b)&&(b=a);"number"===typeof a&&"string"===typeof b&&(b=parseFloat(b));"string"===typeof b&&(b=b.trim());return b}function ta(a,b){b=S(b);var c;if(jQuery.isArray(b))for(var d=0,e=b.length;d<e;d++)if(c=b[d].toLowerCase(),-1<c.indexOf(a)){b=a;break}return b}
|
22 |
-
a?"hide":"show"}function na(a){return document.getElementById(a).querySelectorAll('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]')}function pa(a){if("divider"==a.fieldType){var b=[];"divider"==a.fieldType&&(b=document.querySelectorAll('[data-sectionid="'+a.fieldId+'"]'));a=b}else"form"==a.fieldType?a=document.querySelectorAll('[id^="field_'+
|
23 |
-
a+'"]'));return a}function oa(a,b,c){if(a.length)for(var d,e=["checkbox","radio"],f=0;f<a.length;f++)if(!(0<f&&"undefined"!==typeof d&&d.name==a[f].name&&-1<e.indexOf(d.type)||b&&T(a[f],c))){d=a[f];var h=jQuery(d),g=h.data("frmval");if("undefined"!==typeof g){if("checkbox"==d.type||"radio"==d.type)for(var k=document.getElementsByName(d.name),m=
|
24 |
-
|
25 |
-
|
26 |
-
a.containerId).hide();var c=na(a.containerId)}else c=pa(a);Y(c);va(a.containerId,a.formId)}}function Y(a){if(!(1>a.length)){for(var b,c=!0,d=0,e=a.length;d<e;d++)0<d&&b.name!=a[d].name&&!0===c&&u(jQuery(b)),c=!0,"radio"==a[d].type||"checkbox"==a[d].type?a[d].checked=!1:"SELECT"==a[d].tagName?(0===a[d].selectedIndex?
|
27 |
-
|
28 |
-
|
29 |
-
a.fieldId+"_container"):(c=document.getElementById("frm_field_"+a.fieldId+"_container"),null!==c&&b.push(c));c=0;for(d=b.length;c<d;c++){ka(a,b[c].id);var e=a,f=b[c];e.parentVals=W(e);if("select"==e.inputType)Va(e,f);else if("radio"==e.inputType||"checkbox"==e.inputType)if(!1===e.parentVals){var h=f.getElementsByTagName("input");
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
(
|
35 |
-
success:function(c){b.value!=c&&xa(a.fieldKey,b,c)}})}function xa(a,b,c){b.value=c;u(jQuery(b),a)}function Ra(a,b){if(b){var c=jQuery("#"+a.containerId);ya(c)}jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_get_data",entry_id:a.dataLogic.actualValue,current_field:a.fieldId,hide_id:a.containerId,nonce:frm_js.nonce},success:function(d){if(b){var e=
|
36 |
-
a.fieldKey,""!==a.repeatRow&&(e+="-"+a.repeatRow),e=document.getElementById(e),e.value=d,B(a.containerId,a.formId)&&
|
37 |
-
prev_val:e,nonce:frm_js.nonce},success:function(b){var d=c.find(".frm_opt_container");d.html(b);var g=d.find('select, input[type="checkbox"], input[type="radio"]');za(d);""===b||1>g.length?P(a,!0):(b=Ba(g),Aa(a,c,g,e!==b))}})}function ya(a){var b=a.html();-1<b.indexOf("frm-loading-img")||(a.html(b+'<span class="frm-loading-img"></span>'),a.find(".frm_opt_container").hide())}
|
38 |
-
|
39 |
-
|
40 |
-
function Ca(a,b,c){var d=!1;b.repeatingSection&&(a="frm_field_"+a+"-"+b.repeatingSection,a+="-"+b.repeatRow+"_container",d=-1<c.indexOf(a));return d}function X(a,b,c,d){var e=a.calc[b],f=e.calc,h=jQuery(document.getElementById("field_"+b)),g={triggerField:d,inSection:!1,thisFieldCall:'input[id^="field_'+b+'-"]'};1>h.length&&"undefined"!==typeof d&&(g.inSection
|
41 |
-
|
42 |
-
"scale"==g.thisField.type?g.thisFieldCall=g.thisFieldCall+":checked,"+g.thisFieldCall+"[type=hidden]":"select"==g.thisField.type||"time"==g.thisField.type?g.thisFieldCall="select"+k.fieldKeys[g.thisFieldId]+" option:selected,"+g.thisFieldCall+"[type=hidden]":"textarea"==g.thisField.type&&(g.thisFieldCall=g.thisFieldCall+",textarea"+k.fieldKeys[g.thisFieldId]);
|
43 |
-
bb(g,c,d);if("undefined"===typeof d[g.valKey]||isNaN(d[g.valKey]))d[g.valKey]=0;"date"==g.thisField.type&&0===d[g.valKey]&&(b="")}k="["+g.thisFieldId+"]";k=k.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");b=b.replace(new RegExp(k,"g"),d[g.valKey])}return b}function bb(a,b,c){if("undefined"!==typeof c[a.valKey]&&0!==c[a.valKey])return c;c[a.valKey]=0;var d=Fa(a);
|
44 |
-
typeof jQuery.datepicker){h="-";-1<f.indexOf("/")&&(h="/");f=f.split(h);var d=d.split(h),g,k;g=h=k="";for(var m=0;m<f.length;m++)if("y"==f[m])g=((new Date).getFullYear()+15).toString().substr(2,2),g=d[m]>g?"19"+d[m]:"20"+d[m];else if("yy"==f[m])g=d[m];else if("m"==f[m]||"mm"==f[m])h=d[m],2>h.length&&(h="0"+h);else if("d"==f[m]||"dd"==f[m])k=d[m],2>k.length&&(k=
|
45 |
-
|
46 |
-
b||"undefined"===typeof b||1>b.length)b=!1;return b}function Da(a){if("undefined"===typeof a.triggerField)return null;var b=a.triggerField.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid");return b.length?(a=a.thisFieldCall.replace("[id=","[id^="),b.find(a)):null}function Ga(a,b){var c;c=!1;if("hidden"==b.type)""!==ba(b)&&(c=!0);else if("select"==a.type){var d=
|
47 |
-
|
48 |
-
|
49 |
-
jQuery(c).each(function(){d=this.value});else if("file"==a.type||c)"undefined"===typeof c&&(c=q(a,!0),c=c.replace("file","")),"undefined"===typeof b[c]&&(d=cb(c)),e=c;else{e=a.className;if(-1!==e.indexOf("frm_pos_none"))return b;d=jQuery(a).val();if("string"!==typeof d)for(var c=d,d="",f=0;f<c.length;f++)""!==c[f]&&(d=
|
50 |
-
|
51 |
-
|
52 |
-
"disabled");"undefined"==typeof b&&jQuery(a).find('input[name="frm_action"]').val();jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+"&action=frm_entries_"+b+"&nonce="+frm_js.nonce,success:function(b){var d={content:"",errors:{},pass:!1};null===b&&(b=d);b=b.replace(/^\s+|\s+$/g,"");b=0===b.indexOf("{")?jQuery.parseJSON(b):d;if("undefined"!=
|
53 |
-
var e=jQuery(a).find('input[name="form_id"]').val();jQuery(a).closest("#frm_form_"+e+"_container").replaceWith(b.content);frmFrontForm.scrollMsg(e);"function"==typeof frmThemeOverride_frmAfterSubmit&&(e=jQuery('input[name="frm_page_order_'+e+'"]').val(),d=jQuery(b.content).find('input[name="form_id"]').val(),frmThemeOverride_frmAfterSubmit(d,e,b.content,a));e=jQuery(a).find('input[name="id"]');
|
54 |
-
jQuery(b.content).find(".frm_message").length&&ca("pageLoad");da()}else if(Object.keys(b.errors).length){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");d=!0;Ja();var f=!1,h;for(e in b.errors)if(h=jQuery(a).find("#frm_field_"+e+"_container"),h.length){if(!h.is(":visible")){var g=h.closest(".frm_toggle_container");
|
55 |
-
|
56 |
-
"function"==typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(b,c):a.append('<div class="frm_error">'+c[b]+"</div>"))}function Ja(){jQuery(".form-field").removeClass("frm_blank_field");jQuery(".form-field .frm_error").replaceWith("");jQuery(".frm_error_style").remove()}function Ka(a){var b=jQuery(a).find(".frm_blank_field:first");b.length&&frmFrontForm.scrollMsg(b,a,!0)}function eb(a){var b=
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
for(var l=0,n=0;n<m;n++){var k=0,p=a.entries[n];d&&(b.setCell(l,k,p.id),k++);for(var q=0,r=e;q<r;q++){var t=a.fields[q];f=Na(t);t=p.metas[t.id];"number"!=f||null!==t&&""!==t?"boolean"==f&&(t=null===t||"false"==t||!1===t?!1:!0):t=0;b.setCell(l,k,t);k++}h&&("undefined"!==typeof p.editLink?b.setCell(l,k,'<a href="'+p.editLink+'">'+a.options.edit_link+"</a>"):b.setCell(l,k,""),k++);g&&("undefined"!==
|
61 |
-
|
62 |
-
a.graph_id);if(null!==c){var d=a.type.charAt(0).toUpperCase()+a.type.slice(1);"Histogram"!==d&&"Table"!==d&&(d+="Chart");(new google.visualization[d](c)).draw(b,a.options)}}})}function Na(a){var b="string";if("number"==a.type)b="number";else if("checkbox"==a.type||"select"==a.type){var c=a.options.length;"select"==a.type&&""===a.options[0]&&(c="post_status"==a.field_options.post_field?
|
63 |
-
b=jQuery(
|
64 |
-
1:1+parseInt(c);jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_add_form_row",field_id:a,i:b,nonce:frm_js.nonce},success:function(c){var e=c.html,f=jQuery(e).hide().fadeIn("slow");jQuery(".frm_repeat_"+a+":last").after(f);var h=["other"],g,
|
65 |
-
|
66 |
-
b)),m=k.html();k.html('<span class="frm-loading-img" id="'+c+b+'"></span><div class="frm_orig_content" style="display:none">'+m+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:d,entry_id:b,
|
67 |
-
|
68 |
-
|
69 |
-
".
|
70 |
-
if("undefined"!==typeof
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
jQuery(document).on("
|
77 |
-
|
78 |
-
|
79 |
-
var d=frmFrontForm.validateFormSubmit(b);0===Object.keys(d).length&&(jQuery(b).find(".frm_ajax_loading").addClass("frm_loading_now"),-1<c.indexOf("frm_ajax_submit")?1>jQuery(b).find('input[type="file"]').length?
|
80 |
-
|
81 |
-
0,f=d.length;e<f;e++){var h=d[e];""!==h.value&&"hidden"!=h.type&&("number"==h.type?b=ia(h,b):"email"==h.type?b=ha(h,b,c):null!==h.pattern&&(b=ja(h,b)))}c=jQuery(a).find(".frm-g-recaptcha");c.length&&(d=c.data("rid"),0===grecaptcha.getResponse(d).length&&(c=c.closest(".frm_form_field").attr("id").replace("frm_field_","").replace("_container",
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
url:frm_js.ajax_url,dataType:"json",data:{action:"frm_fields_ajax_time_options",time_field:b,date_field:a.id,entry_id:c?c.val():"",date:jQuery(a).val(),nonce:frm_js.nonce},success:function(a){var c=jQuery(document.getElementById(b));
|
87 |
-
invisible:function(a){jQuery(a).css("visibility","hidden")},visible:function(a){jQuery(a).css("visibility","visible")}}}var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(l){frmFrontForm.init()});
|
|
|
88 |
function frmUpdateField(l,n,p,r,v){jQuery(document.getElementById("frm_update_field_"+l+"_"+n)).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_update_field_ajax",entry_id:l,field_id:n,value:p,nonce:frm_js.nonce},success:function(){""===r.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById("frm_update_field_"+l+"_"+n+"_"+v)).fadeOut("slow"):jQuery(document.getElementById("frm_update_field_"+l+"_"+n+"_"+v)).replaceWith(r)}})}
|
89 |
-
function frmEditEntry(l,n,p,r,v,z){console.warn("DEPRECATED: function frmEditEntry in v2.0.13 use frmFrontForm.editEntry");var y=jQuery(document.getElementById("frm_edit_"+l)),w=y.html(),A=jQuery(document.getElementById(n+l)),
|
90 |
success:function(q){A.children(".frm-loading-img").replaceWith(q);y.replaceWith('<span id="frm_edit_'+l+'"><a onclick="frmCancelEdit('+l+",'"+n+"','"+frmFrontForm.escapeHtml(w)+"',"+p+","+r+",'"+z+'\')" class="'+z+'">'+v+"</a></span>")}})}
|
91 |
function frmCancelEdit(l,n,p,r,v,z){console.warn("DEPRECATED: function frmCancelEdit in v2.0.13 use frmFrontForm.cancelEdit");var y=jQuery(document.getElementById("frm_edit_"+l)),w=y.find("a"),A=w.html();w.hasClass("frm_ajax_edited")||(w=jQuery(document.getElementById(n+l)),w.children(".frm_forms").replaceWith(""),w.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));y.replaceWith('<a id="frm_edit_'+l+'" class="frm_edit_link '+z+'" href="javascript:frmEditEntry('+l+",'"+
|
92 |
n+"',"+r+","+v+",'"+frmFrontForm.escapeHtml(A)+"','"+z+"')\">"+p+"</a>")}
|
2 |
jQuery(this).toggleClass("active").children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s").toggleClass("ui-icon-triangle-1-s ui-icon-triangle-1-e")}function p(){for(var a=__frmUniqueTimes,b=0;b<a.length;b++)a[b].dateID==this.id&&frmFrontForm.removeUsedTimes(this,a[b].timeID)}function r(){if(-1===this.className.indexOf("frm_custom_date")&&"undefined"!==typeof __frmDatepicker){var a=__frmDatepicker,b=this.id,c=b.split("-");c.pop();c='input[id^="'+c.join("-")+'"]';jQuery.datepicker.setDefaults(jQuery.datepicker.regional[""]);
|
3 |
for(var d=0,e=0;e<a.length;e++)if(a[e].triggerID=="#"+b||a[e].triggerID==c)d=e;""!==a[d].options.defaultDate&&(a[d].options.defaultDate=new Date(a[d].options.defaultDate));jQuery(this).datepicker(jQuery.extend(jQuery.datepicker.regional[a[d].locale],a[d].options))}}function v(a){if("undefined"!==typeof __frmDropzone)for(var b=__frmDropzone,c=0;c<b.length;c++)z(c,a)}function z(a,b){var c=__frmDropzone,d="#"+c[a].htmlID+"_dropzone",e=c[a].fieldName;"undefined"!==typeof b&&-1!==d.indexOf("-0_dropzone")&&
|
4 |
(d=d.replace("-0_dropzone","-"+b+"_dropzone"),e=e.replace("[0]","["+b+"]"),delete c[a].mockFiles);d=jQuery(d);if(!(1>d.length||d.hasClass("dz-clickable"))){var f=c[a].maxFiles;if("undefined"!==typeof c[a].mockFiles){var h=c[a].mockFiles.length;0<f&&(f-=h)}var h=d.closest("form"),g=h.find('input[type="submit"], .frm_submit input[type="button"]'),k=h.find(".frm_ajax_loading");d.dropzone({url:frm_js.ajax_url,addRemoveLinks:!0,paramName:d.attr("id").replace("_dropzone",""),maxFilesize:c[a].maxFilesize,
|
5 |
+
maxFiles:f,uploadMultiple:c[a].uploadMultiple,dictDefaultMessage:c[a].defaultMessage,dictFallbackMessage:c[a].fallbackMessage,dictFallbackText:c[a].fallbackText,dictFileTooBig:c[a].fileTooBig,dictInvalidFileType:c[a].invalidFileType,dictResponseError:c[a].responseError,dictCancelUpload:c[a].cancel,dictCancelUploadConfirmation:c[a].cancelConfirm,dictRemoveFile:c[a].remove,dictMaxFilesExceeded:c[a].maxFilesExceeded,fallback:function(){jQuery(this.element).closest("form").removeClass("frm_ajax_submit")},
|