@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $_GET['page'] = 'formidable'; |
| 28 | 28 | |
| 29 | - $values = array( |
|
| 29 | + $values = array( |
|
| 30 | 30 | 'id' => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ), |
| 31 | 31 | 'doing_ajax' => true, |
| 32 | 32 | ); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | ob_start(); |
| 52 | 52 | self::load_single_field( $field, $values ); |
| 53 | - $field_html[ absint( $field->id ) ] = ob_get_contents(); |
|
| 53 | + $field_html[absint( $field->id )] = ob_get_contents(); |
|
| 54 | 54 | ob_end_clean(); |
| 55 | 55 | }//end foreach |
| 56 | 56 | |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | foreach ( $opts as $opt_key => $opt ) { |
| 289 | 289 | if ( strpos( $opt, '|' ) !== false ) { |
| 290 | 290 | $vals = explode( '|', $opt ); |
| 291 | - $opts[ $opt_key ] = array( |
|
| 291 | + $opts[$opt_key] = array( |
|
| 292 | 292 | 'label' => trim( $vals[0] ), |
| 293 | 293 | 'value' => trim( $vals[1] ), |
| 294 | 294 | ); |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | foreach ( $field['options'] as $opt_key => $opt ) { |
| 306 | 306 | if ( FrmFieldsHelper::is_other_opt( $opt_key ) ) { |
| 307 | - $other_array[ $opt_key ] = $opt; |
|
| 307 | + $other_array[$opt_key] = $opt; |
|
| 308 | 308 | } |
| 309 | 309 | unset( $opt_key, $opt ); |
| 310 | 310 | } |
@@ -349,18 +349,18 @@ discard block |
||
| 349 | 349 | $frm_settings = FrmAppHelper::get_settings(); |
| 350 | 350 | $field_types = FrmFieldTypeOptionData::get_field_types( $field['type'] ); |
| 351 | 351 | |
| 352 | - if ( ! isset( $all_field_types[ $field['type'] ] ) ) { |
|
| 352 | + if ( ! isset( $all_field_types[$field['type']] ) ) { |
|
| 353 | 353 | // Add fallback for an add-on field type that has been deactivated. |
| 354 | - $all_field_types[ $field['type'] ] = array( |
|
| 354 | + $all_field_types[$field['type']] = array( |
|
| 355 | 355 | 'name' => ucfirst( $field['type'] ), |
| 356 | 356 | 'icon' => 'frm_icon_font frm_pencil_icon', |
| 357 | 357 | ); |
| 358 | - } elseif ( ! is_array( $all_field_types[ $field['type'] ] ) ) { |
|
| 358 | + } elseif ( ! is_array( $all_field_types[$field['type']] ) ) { |
|
| 359 | 359 | // Fallback for fields added in a more basic way. |
| 360 | - FrmFormsHelper::prepare_field_type( $all_field_types[ $field['type'] ] ); |
|
| 360 | + FrmFormsHelper::prepare_field_type( $all_field_types[$field['type']] ); |
|
| 361 | 361 | } |
| 362 | 362 | |
| 363 | - $type_name = $all_field_types[ $field['type'] ]['name']; |
|
| 363 | + $type_name = $all_field_types[$field['type']]['name']; |
|
| 364 | 364 | |
| 365 | 365 | if ( $field['type'] === 'divider' && FrmField::is_option_true( $field, 'repeat' ) ) { |
| 366 | 366 | $type_name = $all_field_types['divider|repeat']['name']; |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | $no_allow = ! $pro_is_installed ? 'frm_noallow' : ''; |
| 379 | 379 | |
| 380 | 380 | if ( ! $pro_is_installed ) { |
| 381 | - $show_upsell_for_unique_value = in_array( |
|
| 381 | + $show_upsell_for_unique_value = in_array( |
|
| 382 | 382 | $field['type'], |
| 383 | 383 | array( 'address', 'checkbox', 'email', 'name', 'number', 'phone', 'radio', 'text', 'textarea', 'url' ), |
| 384 | 384 | true |
@@ -508,14 +508,14 @@ discard block |
||
| 508 | 508 | |
| 509 | 509 | if ( FrmAppHelper::pro_is_connected() ) { |
| 510 | 510 | foreach ( $settings as $type ) { |
| 511 | - if ( ! empty( $field[ $type ] ) ) { |
|
| 511 | + if ( ! empty( $field[$type] ) ) { |
|
| 512 | 512 | $active = $type; |
| 513 | 513 | } |
| 514 | 514 | } |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | - $types[ $active ]['class'] .= ' current'; |
|
| 518 | - $types[ $active ]['current'] = true; |
|
| 517 | + $types[$active]['class'] .= ' current'; |
|
| 518 | + $types[$active]['current'] = true; |
|
| 519 | 519 | |
| 520 | 520 | return $types; |
| 521 | 521 | } |
@@ -535,8 +535,8 @@ discard block |
||
| 535 | 535 | 'image' => 'url', |
| 536 | 536 | ); |
| 537 | 537 | |
| 538 | - if ( isset( $type_switch[ $type ] ) ) { |
|
| 539 | - $type = $type_switch[ $type ]; |
|
| 538 | + if ( isset( $type_switch[$type] ) ) { |
|
| 539 | + $type = $type_switch[$type]; |
|
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | $pro_fields = FrmField::pro_field_selection(); |
@@ -701,11 +701,11 @@ discard block |
||
| 701 | 701 | // include "col" for valid html |
| 702 | 702 | $unit = trim( preg_replace( '/[0-9]+/', '', $field['size'] ) ); |
| 703 | 703 | |
| 704 | - if ( ! isset( $calc[ $unit ] ) ) { |
|
| 704 | + if ( ! isset( $calc[$unit] ) ) { |
|
| 705 | 705 | return; |
| 706 | 706 | } |
| 707 | 707 | |
| 708 | - $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[ $unit ]; |
|
| 708 | + $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[$unit]; |
|
| 709 | 709 | |
| 710 | 710 | $add_html['cols'] = 'cols="' . absint( $size ) . '"'; |
| 711 | 711 | } |
@@ -961,12 +961,12 @@ discard block |
||
| 961 | 961 | global $frm_vars; |
| 962 | 962 | |
| 963 | 963 | if ( ! empty( $frm_vars['js_validate_forms'] ) ) { |
| 964 | - if ( isset( $frm_vars['js_validate_forms'][ $field['form_id'] ] ) ) { |
|
| 965 | - return $frm_vars['js_validate_forms'][ $field['form_id'] ]; |
|
| 964 | + if ( isset( $frm_vars['js_validate_forms'][$field['form_id']] ) ) { |
|
| 965 | + return $frm_vars['js_validate_forms'][$field['form_id']]; |
|
| 966 | 966 | } |
| 967 | 967 | |
| 968 | - if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][ $field['parent_form_id'] ] ) ) { |
|
| 969 | - return $frm_vars['js_validate_forms'][ $field['parent_form_id'] ]; |
|
| 968 | + if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][$field['parent_form_id']] ) ) { |
|
| 969 | + return $frm_vars['js_validate_forms'][$field['parent_form_id']]; |
|
| 970 | 970 | } |
| 971 | 971 | } |
| 972 | 972 | return false; |
@@ -1060,13 +1060,13 @@ discard block |
||
| 1060 | 1060 | if ( isset( $field['subfield_name'] ) && 0 === strpos( $k, 'aria-invalid' ) ) { |
| 1061 | 1061 | $subfield_name = $field['subfield_name']; |
| 1062 | 1062 | |
| 1063 | - if ( ! isset( $field['shortcodes'][ 'aria-invalid-' . $subfield_name ] ) ) { |
|
| 1063 | + if ( ! isset( $field['shortcodes']['aria-invalid-' . $subfield_name] ) ) { |
|
| 1064 | 1064 | continue; |
| 1065 | 1065 | } |
| 1066 | 1066 | // Change the key to the correct aria-invalid value so that $add_html is set correctly for the current subfield of a combo field. |
| 1067 | 1067 | $k = 'aria-invalid'; |
| 1068 | - $v = $field['shortcodes'][ 'aria-invalid-' . $subfield_name ]; |
|
| 1069 | - unset( $field['shortcodes'][ 'aria-invalid-' . $subfield_name ] ); |
|
| 1068 | + $v = $field['shortcodes']['aria-invalid-' . $subfield_name]; |
|
| 1069 | + unset( $field['shortcodes']['aria-invalid-' . $subfield_name] ); |
|
| 1070 | 1070 | } |
| 1071 | 1071 | |
| 1072 | 1072 | if ( 'opt' === $k || ! self::should_allow_input_attribute( $k ) ) { |
@@ -1075,10 +1075,10 @@ discard block |
||
| 1075 | 1075 | |
| 1076 | 1076 | if ( is_numeric( $k ) && strpos( $v, '=' ) ) { |
| 1077 | 1077 | $add_html[] = $v; |
| 1078 | - } elseif ( ! empty( $k ) && isset( $add_html[ $k ] ) ) { |
|
| 1079 | - $add_html[ $k ] = str_replace( $k . '="', $k . '="' . $v, $add_html[ $k ] ); |
|
| 1078 | + } elseif ( ! empty( $k ) && isset( $add_html[$k] ) ) { |
|
| 1079 | + $add_html[$k] = str_replace( $k . '="', $k . '="' . $v, $add_html[$k] ); |
|
| 1080 | 1080 | } else { |
| 1081 | - $add_html[ $k ] = $k . '="' . esc_attr( $v ) . '"'; |
|
| 1081 | + $add_html[$k] = $k . '="' . esc_attr( $v ) . '"'; |
|
| 1082 | 1082 | } |
| 1083 | 1083 | |
| 1084 | 1084 | unset( $k, $v ); |