@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | $_GET['page'] = 'formidable'; |
| 27 | 27 | |
| 28 | - $values = array( |
|
| 28 | + $values = array( |
|
| 29 | 29 | 'id' => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ), |
| 30 | 30 | 'doing_ajax' => true, |
| 31 | 31 | ); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | ob_start(); |
| 50 | 50 | self::load_single_field( $field, $values ); |
| 51 | - $field_html[ absint( $field->id ) ] = ob_get_contents(); |
|
| 51 | + $field_html[absint( $field->id )] = ob_get_contents(); |
|
| 52 | 52 | ob_end_clean(); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | foreach ( $opts as $opt_key => $opt ) { |
| 285 | 285 | if ( strpos( $opt, '|' ) !== false ) { |
| 286 | 286 | $vals = explode( '|', $opt ); |
| 287 | - $opts[ $opt_key ] = array( |
|
| 287 | + $opts[$opt_key] = array( |
|
| 288 | 288 | 'label' => trim( $vals[0] ), |
| 289 | 289 | 'value' => trim( $vals[1] ), |
| 290 | 290 | ); |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | $other_array = array(); |
| 300 | 300 | foreach ( $field['options'] as $opt_key => $opt ) { |
| 301 | 301 | if ( FrmFieldsHelper::is_other_opt( $opt_key ) ) { |
| 302 | - $other_array[ $opt_key ] = $opt; |
|
| 302 | + $other_array[$opt_key] = $opt; |
|
| 303 | 303 | } |
| 304 | 304 | unset( $opt_key, $opt ); |
| 305 | 305 | } |
@@ -343,18 +343,18 @@ discard block |
||
| 343 | 343 | $frm_settings = FrmAppHelper::get_settings(); |
| 344 | 344 | $field_types = FrmFieldTypeOptionData::get_field_types( $field['type'] ); |
| 345 | 345 | |
| 346 | - if ( ! isset( $all_field_types[ $field['type'] ] ) ) { |
|
| 346 | + if ( ! isset( $all_field_types[$field['type']] ) ) { |
|
| 347 | 347 | // Add fallback for an add-on field type that has been deactivated. |
| 348 | - $all_field_types[ $field['type'] ] = array( |
|
| 348 | + $all_field_types[$field['type']] = array( |
|
| 349 | 349 | 'name' => ucfirst( $field['type'] ), |
| 350 | 350 | 'icon' => 'frm_icon_font frm_pencil_icon', |
| 351 | 351 | ); |
| 352 | - } elseif ( ! is_array( $all_field_types[ $field['type'] ] ) ) { |
|
| 352 | + } elseif ( ! is_array( $all_field_types[$field['type']] ) ) { |
|
| 353 | 353 | // Fallback for fields added in a more basic way. |
| 354 | - FrmFormsHelper::prepare_field_type( $all_field_types[ $field['type'] ] ); |
|
| 354 | + FrmFormsHelper::prepare_field_type( $all_field_types[$field['type']] ); |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | - $type_name = $all_field_types[ $field['type'] ]['name']; |
|
| 357 | + $type_name = $all_field_types[$field['type']]['name']; |
|
| 358 | 358 | if ( $field['type'] === 'divider' && FrmField::is_option_true( $field, 'repeat' ) ) { |
| 359 | 359 | $type_name = $all_field_types['divider|repeat']['name']; |
| 360 | 360 | } |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | $pro_is_installed = FrmAppHelper::pro_is_installed(); |
| 371 | 371 | $no_allow = ! $pro_is_installed ? 'frm_noallow' : ''; |
| 372 | 372 | |
| 373 | - $field_has_unique_option = in_array( |
|
| 373 | + $field_has_unique_option = in_array( |
|
| 374 | 374 | $field['type'], |
| 375 | 375 | array( 'address', 'checkbox', 'email', 'name', 'number', 'phone', 'radio', 'text', 'textarea', 'url' ), |
| 376 | 376 | true |
@@ -445,14 +445,14 @@ discard block |
||
| 445 | 445 | |
| 446 | 446 | if ( FrmAppHelper::pro_is_connected() ) { |
| 447 | 447 | foreach ( $settings as $type ) { |
| 448 | - if ( ! empty( $field[ $type ] ) ) { |
|
| 448 | + if ( ! empty( $field[$type] ) ) { |
|
| 449 | 449 | $active = $type; |
| 450 | 450 | } |
| 451 | 451 | } |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | - $types[ $active ]['class'] .= ' current'; |
|
| 455 | - $types[ $active ]['current'] = true; |
|
| 454 | + $types[$active]['class'] .= ' current'; |
|
| 455 | + $types[$active]['current'] = true; |
|
| 456 | 456 | |
| 457 | 457 | return $types; |
| 458 | 458 | } |
@@ -471,8 +471,8 @@ discard block |
||
| 471 | 471 | 'website' => 'url', |
| 472 | 472 | 'image' => 'url', |
| 473 | 473 | ); |
| 474 | - if ( isset( $type_switch[ $type ] ) ) { |
|
| 475 | - $type = $type_switch[ $type ]; |
|
| 474 | + if ( isset( $type_switch[$type] ) ) { |
|
| 475 | + $type = $type_switch[$type]; |
|
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | $pro_fields = FrmField::pro_field_selection(); |
@@ -637,11 +637,11 @@ discard block |
||
| 637 | 637 | // include "col" for valid html |
| 638 | 638 | $unit = trim( preg_replace( '/[0-9]+/', '', $field['size'] ) ); |
| 639 | 639 | |
| 640 | - if ( ! isset( $calc[ $unit ] ) ) { |
|
| 640 | + if ( ! isset( $calc[$unit] ) ) { |
|
| 641 | 641 | return; |
| 642 | 642 | } |
| 643 | 643 | |
| 644 | - $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[ $unit ]; |
|
| 644 | + $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[$unit]; |
|
| 645 | 645 | |
| 646 | 646 | $add_html['cols'] = 'cols="' . absint( $size ) . '"'; |
| 647 | 647 | } |
@@ -891,11 +891,11 @@ discard block |
||
| 891 | 891 | private static function get_form_for_js_validation( $field ) { |
| 892 | 892 | global $frm_vars; |
| 893 | 893 | if ( ! empty( $frm_vars['js_validate_forms'] ) ) { |
| 894 | - if ( isset( $frm_vars['js_validate_forms'][ $field['form_id'] ] ) ) { |
|
| 895 | - return $frm_vars['js_validate_forms'][ $field['form_id'] ]; |
|
| 894 | + if ( isset( $frm_vars['js_validate_forms'][$field['form_id']] ) ) { |
|
| 895 | + return $frm_vars['js_validate_forms'][$field['form_id']]; |
|
| 896 | 896 | } |
| 897 | - if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][ $field['parent_form_id'] ] ) ) { |
|
| 898 | - return $frm_vars['js_validate_forms'][ $field['parent_form_id'] ]; |
|
| 897 | + if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][$field['parent_form_id']] ) ) { |
|
| 898 | + return $frm_vars['js_validate_forms'][$field['parent_form_id']]; |
|
| 899 | 899 | } |
| 900 | 900 | } |
| 901 | 901 | return false; |
@@ -986,13 +986,13 @@ discard block |
||
| 986 | 986 | foreach ( $field['shortcodes'] as $k => $v ) { |
| 987 | 987 | if ( isset( $field['subfield_name'] ) && 0 === strpos( $k, 'aria-invalid' ) ) { |
| 988 | 988 | $subfield_name = $field['subfield_name']; |
| 989 | - if ( ! isset( $field['shortcodes'][ 'aria-invalid-' . $subfield_name ] ) ) { |
|
| 989 | + if ( ! isset( $field['shortcodes']['aria-invalid-' . $subfield_name] ) ) { |
|
| 990 | 990 | continue; |
| 991 | 991 | } |
| 992 | 992 | // Change the key to the correct aria-invalid value so that $add_html is set correctly for the current subfield of a combo field. |
| 993 | 993 | $k = 'aria-invalid'; |
| 994 | - $v = $field['shortcodes'][ 'aria-invalid-' . $subfield_name ]; |
|
| 995 | - unset( $field['shortcodes'][ 'aria-invalid-' . $subfield_name ] ); |
|
| 994 | + $v = $field['shortcodes']['aria-invalid-' . $subfield_name]; |
|
| 995 | + unset( $field['shortcodes']['aria-invalid-' . $subfield_name] ); |
|
| 996 | 996 | } |
| 997 | 997 | if ( 'opt' === $k || ! self::should_allow_input_attribute( $k ) ) { |
| 998 | 998 | continue; |
@@ -1000,10 +1000,10 @@ discard block |
||
| 1000 | 1000 | |
| 1001 | 1001 | if ( is_numeric( $k ) && strpos( $v, '=' ) ) { |
| 1002 | 1002 | $add_html[] = $v; |
| 1003 | - } elseif ( ! empty( $k ) && isset( $add_html[ $k ] ) ) { |
|
| 1004 | - $add_html[ $k ] = str_replace( $k . '="', $k . '="' . $v, $add_html[ $k ] ); |
|
| 1003 | + } elseif ( ! empty( $k ) && isset( $add_html[$k] ) ) { |
|
| 1004 | + $add_html[$k] = str_replace( $k . '="', $k . '="' . $v, $add_html[$k] ); |
|
| 1005 | 1005 | } else { |
| 1006 | - $add_html[ $k ] = $k . '="' . esc_attr( $v ) . '"'; |
|
| 1006 | + $add_html[$k] = $k . '="' . esc_attr( $v ) . '"'; |
|
| 1007 | 1007 | } |
| 1008 | 1008 | |
| 1009 | 1009 | unset( $k, $v ); |