@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | </div> |
6 | 6 | </div> |
7 | 7 | <?php |
8 | - return; |
|
8 | + return; |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | global $frm_vars; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | } else { |
39 | 39 | do_action( 'frm_show_other_field_type', $field, $form, array( 'action' => $form_action ) ); |
40 | 40 | } |
41 | - do_action('frm_get_field_scripts', $field, $form, $form->id); |
|
41 | + do_action('frm_get_field_scripts', $field, $form, $form->id); |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | |
64 | 64 | // close open collapsible toggle div |
65 | 65 | if ( isset($frm_vars['collapse_div']) && $frm_vars['collapse_div'] ) { |
66 | - echo "</div>\n"; |
|
67 | - unset($frm_vars['collapse_div']); |
|
66 | + echo "</div>\n"; |
|
67 | + unset($frm_vars['collapse_div']); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | echo FrmFormsHelper::replace_shortcodes($values['after_html'], $form); |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | if ( FrmForm::show_submit( $form ) ) { |
80 | - unset($values['fields']); |
|
81 | - FrmFormsHelper::get_custom_submit($values['submit_html'], $form, $submit, $form_action, $values); |
|
80 | + unset($values['fields']); |
|
81 | + FrmFormsHelper::get_custom_submit($values['submit_html'], $form, $submit, $form_action, $values); |
|
82 | 82 | } |
83 | 83 | ?> |
84 | 84 | </fieldset> |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( empty($values) || ! isset($values['fields']) || empty($values['fields']) ) { ?> |
|
3 | -<div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class($form); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container"> |
|
2 | +if ( empty( $values ) || ! isset( $values['fields'] ) || empty( $values['fields'] ) ) { ?> |
|
3 | +<div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class( $form ); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container"> |
|
4 | 4 | <div class="frm_error_style"><strong><?php _e( 'Oops!', 'formidable' ) ?></strong> <?php printf( __( 'You did not add any fields to your form. %1$sGo back%2$s and add some.', 'formidable' ), '<a href="' . esc_url( admin_url( '?page=formidable&frm_action=edit&id=' . $form->id ) ) . '">', '</a>' ) ?> |
5 | 5 | </div> |
6 | 6 | </div> |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | <div class="frm_form_fields <?php echo esc_attr( apply_filters( 'frm_form_fields_class', '', $values ) ); ?>"> |
22 | 22 | <fieldset> |
23 | 23 | <?php echo FrmFormsHelper::replace_shortcodes( $values['before_html'], $form, $title, $description ); ?> |
24 | -<input type="hidden" name="frm_action" value="<?php echo esc_attr($form_action) ?>" /> |
|
25 | -<input type="hidden" name="form_id" value="<?php echo esc_attr($form->id) ?>" /> |
|
26 | -<input type="hidden" name="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" id="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" value="<?php echo esc_attr($frm_hide_fields) ?>" /> |
|
24 | +<input type="hidden" name="frm_action" value="<?php echo esc_attr( $form_action ) ?>" /> |
|
25 | +<input type="hidden" name="form_id" value="<?php echo esc_attr( $form->id ) ?>" /> |
|
26 | +<input type="hidden" name="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" id="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" value="<?php echo esc_attr( $frm_hide_fields ) ?>" /> |
|
27 | 27 | <input type="hidden" name="frm_helpers_<?php echo esc_attr( $form->id ) ?>" id="frm_helpers_<?php echo esc_attr( $form->id ) ?>" value="<?php echo esc_attr( $frm_helpers ) ?>" /> |
28 | -<input type="hidden" name="form_key" value="<?php echo esc_attr($form->form_key) ?>" /> |
|
28 | +<input type="hidden" name="form_key" value="<?php echo esc_attr( $form->form_key ) ?>" /> |
|
29 | 29 | <input type="hidden" name="item_meta[0]" value="" /> |
30 | 30 | <?php wp_nonce_field( 'frm_submit_entry_nonce', 'frm_submit_entry_' . $form->id ); ?> |
31 | 31 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | } else { |
39 | 39 | do_action( 'frm_show_other_field_type', $field, $form, array( 'action' => $form_action ) ); |
40 | 40 | } |
41 | - do_action('frm_get_field_scripts', $field, $form, $form->id); |
|
41 | + do_action( 'frm_get_field_scripts', $field, $form, $form->id ); |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | if ( FrmAppHelper::is_admin() ) { ?> |
47 | 47 | <div class="frm_form_field form-field"> |
48 | 48 | <label class="frm_primary_label"><?php _e( 'Entry Key', 'formidable' ) ?></label> |
49 | -<input type="text" name="item_key" value="<?php echo esc_attr($values['item_key']) ?>" /> |
|
49 | +<input type="text" name="item_key" value="<?php echo esc_attr( $values['item_key'] ) ?>" /> |
|
50 | 50 | </div> |
51 | 51 | <?php } else { ?> |
52 | -<input type="hidden" name="item_key" value="<?php echo esc_attr($values['item_key']) ?>" /> |
|
52 | +<input type="hidden" name="item_key" value="<?php echo esc_attr( $values['item_key'] ) ?>" /> |
|
53 | 53 | <?php } |
54 | 54 | |
55 | -do_action('frm_entry_form', $form, $form_action, $errors); |
|
55 | +do_action( 'frm_entry_form', $form, $form_action, $errors ); |
|
56 | 56 | |
57 | 57 | global $frm_vars; |
58 | 58 | // close open section div |
@@ -62,23 +62,23 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | // close open collapsible toggle div |
65 | -if ( isset($frm_vars['collapse_div']) && $frm_vars['collapse_div'] ) { |
|
65 | +if ( isset( $frm_vars['collapse_div'] ) && $frm_vars['collapse_div'] ) { |
|
66 | 66 | echo "</div>\n"; |
67 | - unset($frm_vars['collapse_div']); |
|
67 | + unset( $frm_vars['collapse_div'] ); |
|
68 | 68 | } |
69 | 69 | |
70 | -echo FrmFormsHelper::replace_shortcodes($values['after_html'], $form); |
|
70 | +echo FrmFormsHelper::replace_shortcodes( $values['after_html'], $form ); |
|
71 | 71 | |
72 | 72 | |
73 | -if ( has_action('frm_entries_footer_scripts') ) { ?> |
|
73 | +if ( has_action( 'frm_entries_footer_scripts' ) ) { ?> |
|
74 | 74 | <script type="text/javascript"> |
75 | -<?php do_action('frm_entries_footer_scripts', $values['fields'], $form); ?> |
|
75 | +<?php do_action( 'frm_entries_footer_scripts', $values['fields'], $form ); ?> |
|
76 | 76 | </script><?php |
77 | 77 | } |
78 | 78 | |
79 | 79 | if ( FrmForm::show_submit( $form ) ) { |
80 | - unset($values['fields']); |
|
81 | - FrmFormsHelper::get_custom_submit($values['submit_html'], $form, $submit, $form_action, $values); |
|
80 | + unset( $values['fields'] ); |
|
81 | + FrmFormsHelper::get_custom_submit( $values['submit_html'], $form, $submit, $form_action, $values ); |
|
82 | 82 | } |
83 | 83 | ?> |
84 | 84 | </fieldset> |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <div id="form_entries_page" class="wrap"> |
2 | 2 | <div class="frmicon icon32"><br/></div> |
3 | 3 | <h2><?php _e( 'Entries', 'formidable' ); ?> |
4 | - <?php do_action('frm_entry_inside_h2', $form); ?> |
|
4 | + <?php do_action( 'frm_entry_inside_h2', $form ); ?> |
|
5 | 5 | </h2> |
6 | 6 | |
7 | - <?php require(FrmAppHelper::plugin_path() .'/classes/views/shared/errors.php'); ?> |
|
7 | + <?php require( FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php' ); ?> |
|
8 | 8 | |
9 | 9 | <form id="posts-filter" method="get"> |
10 | 10 | <div id="poststuff"> |
11 | 11 | <div id="post-body" class="metabox-holder columns-2"> |
12 | 12 | <div id="post-body-content"> |
13 | - <?php FrmAppController::get_form_nav($form, true, 'hide'); ?> |
|
13 | + <?php FrmAppController::get_form_nav( $form, true, 'hide' ); ?> |
|
14 | 14 | </div> |
15 | 15 | <div id="postbox-container-1" class="postbox-container"> |
16 | 16 | <input type="hidden" name="page" value="formidable-entries" /> |
@@ -1,17 +1,17 @@ |
||
1 | -<div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class($values); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container"> |
|
1 | +<div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class( $values ); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container"> |
|
2 | 2 | <?php |
3 | 3 | if ( ! isset( $include_form_tag ) || $include_form_tag ) { |
4 | 4 | ?> |
5 | -<form enctype="<?php echo esc_attr( apply_filters( 'frm_form_enctype', 'multipart/form-data', $form ) ) ?>" method="post" class="frm-show-form <?php do_action('frm_form_classes', $form) ?>" id="form_<?php echo esc_attr( $form->form_key ) ?>" <?php echo $frm_settings->use_html ? '' : 'action=""'; ?>> |
|
5 | +<form enctype="<?php echo esc_attr( apply_filters( 'frm_form_enctype', 'multipart/form-data', $form ) ) ?>" method="post" class="frm-show-form <?php do_action( 'frm_form_classes', $form ) ?>" id="form_<?php echo esc_attr( $form->form_key ) ?>" <?php echo $frm_settings->use_html ? '' : 'action=""'; ?>> |
|
6 | 6 | <?php |
7 | 7 | } else { ?> |
8 | -<div id="form_<?php echo esc_attr( $form->form_key ) ?>" class="frm-show-form <?php do_action('frm_form_classes', $form) ?>" > |
|
8 | +<div id="form_<?php echo esc_attr( $form->form_key ) ?>" class="frm-show-form <?php do_action( 'frm_form_classes', $form ) ?>" > |
|
9 | 9 | <?php |
10 | 10 | } |
11 | 11 | |
12 | -include(FrmAppHelper::plugin_path() .'/classes/views/frm-entries/errors.php'); |
|
12 | +include( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/errors.php' ); |
|
13 | 13 | $form_action = 'create'; |
14 | -require(FrmAppHelper::plugin_path() .'/classes/views/frm-entries/form.php'); |
|
14 | +require( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/form.php' ); |
|
15 | 15 | |
16 | 16 | if ( ! isset( $include_form_tag ) || $include_form_tag ) { |
17 | 17 | ?> |
@@ -1,18 +1,18 @@ |
||
1 | 1 | <div class="frmcenter frm_no_entries_form"> |
2 | 2 | <?php |
3 | -if ( $form && isset($form->options['no_save']) && $form->options['no_save'] ) { ?> |
|
3 | +if ( $form && isset( $form->options['no_save'] ) && $form->options['no_save'] ) { ?> |
|
4 | 4 | <h3><?php _e( 'This form is not set to save any entries.', 'formidable' ) ?></h3> |
5 | -<p>If you would like entries in this form to be saved, go to the <a href="<?php echo esc_url(admin_url('admin.php?page=formidable') . '&frm_action=settings&id='. $form->id) ?>">form Settings</a> page and uncheck the "Do not store any entries submitted from this form" box.</p> |
|
5 | +<p>If you would like entries in this form to be saved, go to the <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable' ) . '&frm_action=settings&id=' . $form->id ) ?>">form Settings</a> page and uncheck the "Do not store any entries submitted from this form" box.</p> |
|
6 | 6 | <?php |
7 | 7 | } else if ( $form ) { |
8 | 8 | ?> |
9 | -<div class="frm_no_entries_header"><?php printf(__( 'No Entries for form: %s', 'formidable' ), $form->name); ?></div> |
|
10 | -<p class="frm_no_entries_text"><?php printf( __( 'For instructions on publishing your form see %1$sthis page%2$s <br/> or click "%3$sAdd New%4$s" above to add an entry from here (Requires License)', 'formidable' ), '<a href="https://formidablepro.com/knowledgebase/publish-your-forms/" target="_blank">', '</a>', '<a href="' . esc_url( admin_url('admin.php?page=formidable-entries&frm_action=new&form=' . $form->id ) ) . '">', '</a>' ); ?></p> |
|
9 | +<div class="frm_no_entries_header"><?php printf( __( 'No Entries for form: %s', 'formidable' ), $form->name ); ?></div> |
|
10 | +<p class="frm_no_entries_text"><?php printf( __( 'For instructions on publishing your form see %1$sthis page%2$s <br/> or click "%3$sAdd New%4$s" above to add an entry from here (Requires License)', 'formidable' ), '<a href="https://formidablepro.com/knowledgebase/publish-your-forms/" target="_blank">', '</a>', '<a href="' . esc_url( admin_url( 'admin.php?page=formidable-entries&frm_action=new&form=' . $form->id ) ) . '">', '</a>' ); ?></p> |
|
11 | 11 | <?php |
12 | 12 | } else { |
13 | 13 | ?> |
14 | 14 | <div class="frm_no_entries_header"><?php _e( 'You have not created any forms yet.', 'formidable' ); ?></div> |
15 | -<p class="frm_no_entries_text"><?php printf( __( 'To view entries, you must first %1$sbuild a form%2$s', 'formidable' ), '<a href="'. esc_url( admin_url( 'admin.php?page=formidable&frm_action=new' ) ) . '">', '</a>' ); ?></p> |
|
15 | +<p class="frm_no_entries_text"><?php printf( __( 'To view entries, you must first %1$sbuild a form%2$s', 'formidable' ), '<a href="' . esc_url( admin_url( 'admin.php?page=formidable&frm_action=new' ) ) . '">', '</a>' ); ?></p> |
|
16 | 16 | <?php |
17 | 17 | } ?> |
18 | 18 | </div> |
@@ -15,43 +15,43 @@ |
||
15 | 15 | <div class="inside"> |
16 | 16 | <table class="form-table"><tbody> |
17 | 17 | <?php |
18 | - $first_h3 = 'frm_first_h3'; |
|
19 | - foreach ( $fields as $field ) { |
|
18 | + $first_h3 = 'frm_first_h3'; |
|
19 | + foreach ( $fields as $field ) { |
|
20 | 20 | if ( in_array( $field->type, array( 'captcha', 'html', 'end_divider', 'form' ) ) ) { |
21 | - continue; |
|
22 | - } |
|
21 | + continue; |
|
22 | + } |
|
23 | 23 | |
24 | - if ( in_array($field->type, array( 'break', 'divider' ) ) ) { |
|
25 | - ?> |
|
24 | + if ( in_array($field->type, array( 'break', 'divider' ) ) ) { |
|
25 | + ?> |
|
26 | 26 | </tbody></table> |
27 | 27 | <br/><h3 class="<?php echo esc_attr( $first_h3 ) ?>"><?php echo esc_html( $field->name ) ?></h3> |
28 | 28 | <table class="form-table"><tbody> |
29 | 29 | <?php |
30 | - $first_h3 = ''; |
|
31 | - } else { |
|
32 | - ?> |
|
30 | + $first_h3 = ''; |
|
31 | + } else { |
|
32 | + ?> |
|
33 | 33 | <tr> |
34 | 34 | <th scope="row"><?php echo esc_html( $field->name ) ?>:</th> |
35 | 35 | <td> |
36 | 36 | <?php |
37 | 37 | $embedded_field_id = ( $entry->form_id != $field->form_id ) ? 'form' . $field->form_id : 0; |
38 | - $atts = array( |
|
39 | - 'type' => $field->type, 'post_id' => $entry->post_id, |
|
40 | - 'show_filename' => true, 'show_icon' => true, 'entry_id' => $entry->id, |
|
41 | - 'embedded_field_id' => $embedded_field_id, |
|
42 | - ); |
|
43 | - echo $display_value = FrmEntriesHelper::prepare_display_value($entry, $field, $atts); |
|
38 | + $atts = array( |
|
39 | + 'type' => $field->type, 'post_id' => $entry->post_id, |
|
40 | + 'show_filename' => true, 'show_icon' => true, 'entry_id' => $entry->id, |
|
41 | + 'embedded_field_id' => $embedded_field_id, |
|
42 | + ); |
|
43 | + echo $display_value = FrmEntriesHelper::prepare_display_value($entry, $field, $atts); |
|
44 | 44 | |
45 | - if ( is_email($display_value) && ! in_array($display_value, $to_emails) ) { |
|
46 | - $to_emails[] = $display_value; |
|
47 | - } |
|
48 | - ?> |
|
45 | + if ( is_email($display_value) && ! in_array($display_value, $to_emails) ) { |
|
46 | + $to_emails[] = $display_value; |
|
47 | + } |
|
48 | + ?> |
|
49 | 49 | </td> |
50 | 50 | </tr> |
51 | 51 | <?php } |
52 | - } |
|
52 | + } |
|
53 | 53 | |
54 | - ?> |
|
54 | + ?> |
|
55 | 55 | |
56 | 56 | <?php if ( $entry->parent_item_id ) { ?> |
57 | 57 | <tr><th><?php _e( 'Parent Entry ID', 'formidable' ) ?>:</th> |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <div id="form_show_entry_page" class="wrap"> |
2 | 2 | <div class="frmicon icon32"><br/></div> |
3 | 3 | <h2><?php _e( 'View Entry', 'formidable' ) ?> |
4 | - <?php do_action('frm_entry_inside_h2', $entry->form_id); ?> |
|
4 | + <?php do_action( 'frm_entry_inside_h2', $entry->form_id ); ?> |
|
5 | 5 | </h2> |
6 | 6 | |
7 | 7 | <div class="frm_forms"> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | <div id="poststuff"> |
10 | 10 | <div id="post-body" class="metabox-holder columns-2"> |
11 | 11 | <div id="post-body-content"> |
12 | - <?php FrmAppController::get_form_nav($entry->form_id, true); ?> |
|
12 | + <?php FrmAppController::get_form_nav( $entry->form_id, true ); ?> |
|
13 | 13 | <div class="postbox"> |
14 | 14 | <h3 class="hndle"><span><?php _e( 'Entry', 'formidable' ) ?></span></h3> |
15 | 15 | <div class="inside"> |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | continue; |
22 | 22 | } |
23 | 23 | |
24 | - if ( in_array($field->type, array( 'break', 'divider' ) ) ) { |
|
24 | + if ( in_array( $field->type, array( 'break', 'divider' ) ) ) { |
|
25 | 25 | ?> |
26 | 26 | </tbody></table> |
27 | 27 | <br/><h3 class="<?php echo esc_attr( $first_h3 ) ?>"><?php echo esc_html( $field->name ) ?></h3> |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | 'show_filename' => true, 'show_icon' => true, 'entry_id' => $entry->id, |
41 | 41 | 'embedded_field_id' => $embedded_field_id, |
42 | 42 | ); |
43 | - echo $display_value = FrmEntriesHelper::prepare_display_value($entry, $field, $atts); |
|
43 | + echo $display_value = FrmEntriesHelper::prepare_display_value( $entry, $field, $atts ); |
|
44 | 44 | |
45 | - if ( is_email($display_value) && ! in_array($display_value, $to_emails) ) { |
|
45 | + if ( is_email( $display_value ) && ! in_array( $display_value, $to_emails ) ) { |
|
46 | 46 | $to_emails[] = $display_value; |
47 | 47 | } |
48 | 48 | ?> |
@@ -59,14 +59,14 @@ discard block |
||
59 | 59 | </td></tr> |
60 | 60 | <?php } ?> |
61 | 61 | </tbody></table> |
62 | - <?php do_action('frm_show_entry', $entry); ?> |
|
62 | + <?php do_action( 'frm_show_entry', $entry ); ?> |
|
63 | 63 | </div> |
64 | 64 | </div> |
65 | 65 | |
66 | - <?php do_action('frm_after_show_entry', $entry); ?> |
|
66 | + <?php do_action( 'frm_after_show_entry', $entry ); ?> |
|
67 | 67 | |
68 | 68 | </div> |
69 | - <?php require(FrmAppHelper::plugin_path() .'/classes/views/frm-entries/sidebar-show.php'); ?> |
|
69 | + <?php require( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/sidebar-show.php' ); ?> |
|
70 | 70 | </div> |
71 | 71 | </div> |
72 | 72 | </div> |
@@ -66,18 +66,18 @@ |
||
66 | 66 | <?php } ?> |
67 | 67 | |
68 | 68 | <?php |
69 | - foreach ( (array) $data as $k => $d ) { |
|
69 | + foreach ( (array) $data as $k => $d ) { |
|
70 | 70 | if ( in_array( $k, array( 'browser', 'referrer' ) ) ) { |
71 | - continue; |
|
72 | - } |
|
73 | - ?> |
|
71 | + continue; |
|
72 | + } |
|
73 | + ?> |
|
74 | 74 | <div class="misc-pub-section"> |
75 | 75 | <b><?php echo sanitize_text_field( ucfirst( str_replace( '-', ' ', $k ) ) ); ?></b>: |
76 | 76 | <?php echo wp_kses_post( implode( ', ', (array) $d ) ); ?> |
77 | 77 | </div> |
78 | 78 | <?php |
79 | - unset($k, $d); |
|
80 | - } |
|
81 | - ?> |
|
79 | + unset($k, $d); |
|
80 | + } |
|
81 | + ?> |
|
82 | 82 | </div> |
83 | 83 | </div> |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | <div class="misc-pub-section"> |
7 | 7 | <span class="dashicons dashicons-admin-post wp-media-buttons-icon"></span> |
8 | 8 | <?php _e( 'Post', 'formidable' ) ?>: |
9 | - <b><?php echo get_the_title($entry->post_id) ?></b> |
|
10 | - <span><a href="<?php echo esc_url( admin_url('post.php?post='. $entry->post_id .'&action=edit') ) ?>"><?php _e( 'Edit', 'formidable' ) ?></a> |
|
9 | + <b><?php echo get_the_title( $entry->post_id ) ?></b> |
|
10 | + <span><a href="<?php echo esc_url( admin_url( 'post.php?post=' . $entry->post_id . '&action=edit' ) ) ?>"><?php _e( 'Edit', 'formidable' ) ?></a> |
|
11 | 11 | <a href="<?php echo esc_url( get_permalink( $entry->post_id ) ) ?>"><?php _e( 'View', 'formidable' ) ?></a></span> |
12 | 12 | </div> |
13 | 13 | <?php } ?> |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | <?php if ( $entry->updated_by && $entry->updated_by != $entry->user_id ) { ?> |
36 | 36 | <div class="misc-pub-section"> |
37 | 37 | <span class="dashicons dashicons-admin-users wp-media-buttons-icon"></span> |
38 | - <?php printf( __( 'Updated by: %1$s', 'formidable' ), FrmProFieldsHelper::get_display_name( $entry->updated_by, 'display_name', array( 'link' => true ) ) ); ?> |
|
38 | + <?php printf( __( 'Updated by: %1$s', 'formidable' ), FrmProFieldsHelper::get_display_name( $entry->updated_by, 'display_name', array( 'link' => true ) ) ); ?> |
|
39 | 39 | </div> |
40 | 40 | <?php } ?> |
41 | 41 | <?php } ?> |
@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | </div> |
59 | 59 | <?php } ?> |
60 | 60 | |
61 | - <?php if ( isset($data['referrer']) ) { ?> |
|
61 | + <?php if ( isset( $data['referrer'] ) ) { ?> |
|
62 | 62 | <div class="misc-pub-section"> |
63 | 63 | <b><?php _e( 'Referrer', 'formidable' ) ?></b>:<br/> |
64 | - <?php echo wp_kses_post( str_replace( "\r\n", '<br/>', $data['referrer'] ) ); ?> |
|
64 | + <?php echo wp_kses_post( str_replace( "\r\n", '<br/>', $data['referrer'] ) ); ?> |
|
65 | 65 | </div> |
66 | 66 | <?php } ?> |
67 | 67 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | <?php echo wp_kses_post( implode( ', ', (array) $d ) ); ?> |
77 | 77 | </div> |
78 | 78 | <?php |
79 | - unset($k, $d); |
|
79 | + unset( $k, $d ); |
|
80 | 80 | } |
81 | 81 | ?> |
82 | 82 | </div> |
@@ -5,11 +5,11 @@ discard block |
||
5 | 5 | <div class="submitbox"> |
6 | 6 | <div id="minor-publishing" class="frm_remove_border"> |
7 | 7 | <div class="misc-pub-section"> |
8 | - <?php do_action('frm_show_entry_publish_box', $entry); ?> |
|
8 | + <?php do_action( 'frm_show_entry_publish_box', $entry ); ?> |
|
9 | 9 | <div class="clear"></div> |
10 | 10 | </div> |
11 | 11 | <div id="misc-publishing-actions"> |
12 | - <?php include(dirname(__FILE__) .'/_sidebar-shared-pub.php'); ?> |
|
12 | + <?php include( dirname( __FILE__ ) . '/_sidebar-shared-pub.php' ); ?> |
|
13 | 13 | <div class="misc-pub-section"> |
14 | 14 | <span class="dashicons dashicons-format-aside wp-media-buttons-icon"></span> |
15 | 15 | <a href="#" onclick="window.print();return false;"><?php _e( 'Print', 'formidable' ) ?></a> |
@@ -17,22 +17,22 @@ discard block |
||
17 | 17 | </div> |
18 | 18 | </div> |
19 | 19 | <div id="major-publishing-actions"> |
20 | - <?php if ( current_user_can('frm_delete_entries') ) { ?> |
|
20 | + <?php if ( current_user_can( 'frm_delete_entries' ) ) { ?> |
|
21 | 21 | <div id="delete-action"> |
22 | - <a href="<?php echo esc_url( admin_url('admin.php?page=formidable-entries&frm_action=destroy&id='. $id .'&form='. $entry->form_id) ) ?>" class="submitdelete deletion" onclick="return confirm('<?php _e( 'Are you sure you want to delete that entry?', 'formidable' ) ?>');" title="<?php esc_attr_e( 'Delete' ) ?>"><?php _e( 'Delete' ) ?></a> |
|
23 | - <?php if ( ! empty($entry->post_id) ) { ?> |
|
24 | - <a href="<?php echo esc_url( admin_url('admin.php?page=formidable-entries&frm_action=destroy&id='. $id .'&form='. $entry->form_id .'&keep_post=1') ) ?>" class="submitdelete deletion frm_delete_wo_post" onclick="return confirm('<?php esc_attr_e( 'Are you sure you want to delete this entry?', 'formidable' ) ?>);" title="<?php esc_attr_e( 'Delete entry but leave the post', 'formidable' ) ?>"><?php _e( 'Delete without Post', 'formidable' ) ?></a> |
|
22 | + <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-entries&frm_action=destroy&id=' . $id . '&form=' . $entry->form_id ) ) ?>" class="submitdelete deletion" onclick="return confirm('<?php _e( 'Are you sure you want to delete that entry?', 'formidable' ) ?>');" title="<?php esc_attr_e( 'Delete' ) ?>"><?php _e( 'Delete' ) ?></a> |
|
23 | + <?php if ( ! empty( $entry->post_id ) ) { ?> |
|
24 | + <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-entries&frm_action=destroy&id=' . $id . '&form=' . $entry->form_id . '&keep_post=1' ) ) ?>" class="submitdelete deletion frm_delete_wo_post" onclick="return confirm('<?php esc_attr_e( 'Are you sure you want to delete this entry?', 'formidable' ) ?>);" title="<?php esc_attr_e( 'Delete entry but leave the post', 'formidable' ) ?>"><?php _e( 'Delete without Post', 'formidable' ) ?></a> |
|
25 | 25 | <?php } ?> |
26 | 26 | </div> |
27 | 27 | <?php } ?> |
28 | 28 | |
29 | - <?php do_action('frm_entry_major_pub', $entry); ?> |
|
29 | + <?php do_action( 'frm_entry_major_pub', $entry ); ?> |
|
30 | 30 | <div class="clear"></div> |
31 | 31 | </div> |
32 | 32 | </div> |
33 | 33 | </div> |
34 | 34 | </div> |
35 | -<?php do_action('frm_show_entry_sidebar', $entry); |
|
36 | -FrmEntriesController::entry_sidebar($entry); |
|
35 | +<?php do_action( 'frm_show_entry_sidebar', $entry ); |
|
36 | +FrmEntriesController::entry_sidebar( $entry ); |
|
37 | 37 | ?> |
38 | 38 | </div> |
@@ -4,18 +4,18 @@ discard block |
||
4 | 4 | <meta charset="<?php bloginfo( 'charset' ); ?>" /> |
5 | 5 | <title><?php bloginfo('name'); ?></title> |
6 | 6 | <?php |
7 | - wp_admin_css( 'global' ); |
|
8 | - wp_admin_css(); |
|
9 | - wp_admin_css( 'colors' ); |
|
10 | - wp_admin_css( 'ie' ); |
|
7 | + wp_admin_css( 'global' ); |
|
8 | + wp_admin_css(); |
|
9 | + wp_admin_css( 'colors' ); |
|
10 | + wp_admin_css( 'ie' ); |
|
11 | 11 | if ( is_multisite() ) { |
12 | - wp_admin_css( 'ms' ); |
|
12 | + wp_admin_css( 'ms' ); |
|
13 | 13 | } |
14 | 14 | |
15 | - do_action('admin_print_styles'); |
|
16 | - do_action('admin_print_scripts'); |
|
15 | + do_action('admin_print_styles'); |
|
16 | + do_action('admin_print_scripts'); |
|
17 | 17 | |
18 | - ?> |
|
18 | + ?> |
|
19 | 19 | </head> |
20 | 20 | <body class="wp-admin no-js wp-core-ui frm_field_opts_popup <?php echo esc_attr( apply_filters( 'admin_body_class', '' ) . ' ' . $admin_body_class ); ?>"> |
21 | 21 | <div class="frm_med_padding"> |
@@ -29,21 +29,21 @@ discard block |
||
29 | 29 | <?php |
30 | 30 | $other_array = array(); |
31 | 31 | foreach ( $field->options as $fkey => $fopt ) { |
32 | - //If it is an other option, don't include it |
|
33 | - if ( $fkey && strpos( $fkey, 'other') !== false ) { |
|
34 | - continue; |
|
35 | - } |
|
32 | + //If it is an other option, don't include it |
|
33 | + if ( $fkey && strpos( $fkey, 'other') !== false ) { |
|
34 | + continue; |
|
35 | + } |
|
36 | 36 | if ( is_array( $fopt ) ) { |
37 | - $label = (isset($fopt['label'])) ? $fopt['label'] : reset($fopt); |
|
38 | - $value = (isset($fopt['value'])) ? $fopt['value'] : $label; |
|
37 | + $label = (isset($fopt['label'])) ? $fopt['label'] : reset($fopt); |
|
38 | + $value = (isset($fopt['value'])) ? $fopt['value'] : $label; |
|
39 | 39 | if ( $label != $value && FrmField::is_option_true( $field, 'separate_value' ) ) { |
40 | - echo "$label|$value\n"; |
|
40 | + echo "$label|$value\n"; |
|
41 | 41 | } else { |
42 | - echo $label ."\n"; |
|
43 | - } |
|
42 | + echo $label ."\n"; |
|
43 | + } |
|
44 | 44 | } else { |
45 | - echo $fopt ."\n"; |
|
46 | - } |
|
45 | + echo $fopt ."\n"; |
|
46 | + } |
|
47 | 47 | } ?> |
48 | 48 | </textarea> |
49 | 49 |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | <html <?php language_attributes(); ?>> |
3 | 3 | <head> |
4 | 4 | <meta charset="<?php bloginfo( 'charset' ); ?>" /> |
5 | - <title><?php bloginfo('name'); ?></title> |
|
5 | + <title><?php bloginfo( 'name' ); ?></title> |
|
6 | 6 | <?php |
7 | 7 | wp_admin_css( 'global' ); |
8 | 8 | wp_admin_css(); |
@@ -12,8 +12,8 @@ discard block |
||
12 | 12 | wp_admin_css( 'ms' ); |
13 | 13 | } |
14 | 14 | |
15 | - do_action('admin_print_styles'); |
|
16 | - do_action('admin_print_scripts'); |
|
15 | + do_action( 'admin_print_styles' ); |
|
16 | + do_action( 'admin_print_scripts' ); |
|
17 | 17 | |
18 | 18 | ?> |
19 | 19 | </head> |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | <p class="howto"><?php _e( 'Edit or add field options (one per line)', 'formidable' ) ?></p> |
23 | 23 | <ul class="frm_prepop"> |
24 | 24 | <?php foreach ( $prepop as $label => $pop ) { ?> |
25 | - <li><a href="javascript:void(0)" onclick='frmPrePop(<?php echo str_replace("'", '‘', json_encode($pop)) ?>); return false;'><?php echo esc_html( $label ) ?></a></li> |
|
25 | + <li><a href="javascript:void(0)" onclick='frmPrePop(<?php echo str_replace( "'", '‘', json_encode( $pop ) ) ?>); return false;'><?php echo esc_html( $label ) ?></a></li> |
|
26 | 26 | <?php } ?> |
27 | 27 | </ul> |
28 | 28 | <textarea name="frm_bulk_options" id="frm_bulk_options"> |
@@ -30,19 +30,19 @@ discard block |
||
30 | 30 | $other_array = array(); |
31 | 31 | foreach ( $field->options as $fkey => $fopt ) { |
32 | 32 | //If it is an other option, don't include it |
33 | - if ( $fkey && strpos( $fkey, 'other') !== false ) { |
|
33 | + if ( $fkey && strpos( $fkey, 'other' ) !== false ) { |
|
34 | 34 | continue; |
35 | 35 | } |
36 | 36 | if ( is_array( $fopt ) ) { |
37 | - $label = (isset($fopt['label'])) ? $fopt['label'] : reset($fopt); |
|
38 | - $value = (isset($fopt['value'])) ? $fopt['value'] : $label; |
|
37 | + $label = ( isset( $fopt['label'] ) ) ? $fopt['label'] : reset( $fopt ); |
|
38 | + $value = ( isset( $fopt['value'] ) ) ? $fopt['value'] : $label; |
|
39 | 39 | if ( $label != $value && FrmField::is_option_true( $field, 'separate_value' ) ) { |
40 | 40 | echo "$label|$value\n"; |
41 | 41 | } else { |
42 | - echo $label ."\n"; |
|
42 | + echo $label . "\n"; |
|
43 | 43 | } |
44 | 44 | } else { |
45 | - echo $fopt ."\n"; |
|
45 | + echo $fopt . "\n"; |
|
46 | 46 | } |
47 | 47 | } ?> |
48 | 48 | </textarea> |
@@ -3,48 +3,48 @@ discard block |
||
3 | 3 | <?php } else if ( $field['type'] == 'textarea' ) { ?> |
4 | 4 | <textarea name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id ) ?>" <?php |
5 | 5 | if ( $field['max'] ) { |
6 | - echo 'rows="'. esc_attr( $field['max'] ) .'" '; |
|
6 | + echo 'rows="'. esc_attr( $field['max'] ) .'" '; |
|
7 | 7 | } |
8 | 8 | do_action('frm_field_input_html', $field); |
9 | 9 | ?>><?php echo FrmAppHelper::esc_textarea($field['value']) ?></textarea> |
10 | 10 | <?php |
11 | 11 | |
12 | 12 | } else if ( $field['type'] == 'radio' ) { |
13 | - $read_only = false; |
|
13 | + $read_only = false; |
|
14 | 14 | if ( FrmField::is_read_only( $field ) && ! FrmAppHelper::is_admin() ) { |
15 | - $read_only = true; ?> |
|
15 | + $read_only = true; ?> |
|
16 | 16 | <input type="hidden" value="<?php echo esc_attr( $field['value'] ) ?>" name="<?php echo esc_attr( $field_name ) ?>" /> |
17 | 17 | <?php |
18 | - } |
|
18 | + } |
|
19 | 19 | |
20 | - if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
20 | + if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
21 | 21 | do_action( 'frm_after_checkbox', array( 'field' => $field, 'field_name' => $field_name, 'type' => $field['type'] ) ); |
22 | - } else if ( is_array($field['options']) ) { |
|
23 | - foreach ( $field['options'] as $opt_key => $opt ) { |
|
22 | + } else if ( is_array($field['options']) ) { |
|
23 | + foreach ( $field['options'] as $opt_key => $opt ) { |
|
24 | 24 | if ( isset( $atts ) && isset( $atts['opt'] ) && ( $atts['opt'] != $opt_key ) ) { |
25 | - continue; |
|
26 | - } |
|
25 | + continue; |
|
26 | + } |
|
27 | 27 | |
28 | - $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field); |
|
29 | - $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field); ?> |
|
28 | + $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field); |
|
29 | + $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field); ?> |
|
30 | 30 | <div class="<?php echo esc_attr( apply_filters( 'frm_radio_class', 'frm_radio', $field, $field_val ) ) ?>"><?php |
31 | 31 | |
32 | 32 | if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
33 | 33 | ?><label for="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php |
34 | - } |
|
35 | - $checked = FrmAppHelper::check_selected($field['value'], $field_val) ? 'checked="checked" ' : ' '; |
|
34 | + } |
|
35 | + $checked = FrmAppHelper::check_selected($field['value'], $field_val) ? 'checked="checked" ' : ' '; |
|
36 | 36 | |
37 | - $other_opt = false; |
|
38 | - $other_args = FrmFieldsHelper::prepare_other_input( compact( 'field_name', 'opt_key', 'field' ), $other_opt, $checked ); |
|
39 | - ?> |
|
37 | + $other_opt = false; |
|
38 | + $other_args = FrmFieldsHelper::prepare_other_input( compact( 'field_name', 'opt_key', 'field' ), $other_opt, $checked ); |
|
39 | + ?> |
|
40 | 40 | <input type="radio" name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php |
41 | - echo $checked; |
|
42 | - do_action('frm_field_input_html', $field); |
|
41 | + echo $checked; |
|
42 | + do_action('frm_field_input_html', $field); |
|
43 | 43 | ?>/><?php |
44 | 44 | |
45 | 45 | if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
46 | - echo ' '. $opt .'</label>'; |
|
47 | - } |
|
46 | + echo ' '. $opt .'</label>'; |
|
47 | + } |
|
48 | 48 | |
49 | 49 | FrmFieldsHelper::include_other_input( array( |
50 | 50 | 'other_opt' => $other_opt, 'read_only' => $read_only, |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | 'html_id' => $html_id, 'opt_key' => $opt_key, |
54 | 54 | ) ); |
55 | 55 | |
56 | - unset( $other_opt, $other_args ); |
|
56 | + unset( $other_opt, $other_args ); |
|
57 | 57 | ?></div> |
58 | 58 | <?php |
59 | - } |
|
60 | - } |
|
59 | + } |
|
60 | + } |
|
61 | 61 | } else if ( $field['type'] == 'select' ) { |
62 | - $read_only = false; |
|
63 | - if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
62 | + $read_only = false; |
|
63 | + if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
64 | 64 | echo FrmFieldsHelper::dropdown_categories( array( 'name' => $field_name, 'field' => $field ) ); |
65 | 65 | } else { |
66 | 66 | if ( FrmField::is_read_only( $field ) && ! FrmAppHelper::is_admin() ) { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | ?> |
94 | 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 ($opt == '') ? ' ' : $opt; ?></option> |
95 | 95 | <?php |
96 | - } ?> |
|
96 | + } ?> |
|
97 | 97 | </select> |
98 | 98 | <?php |
99 | 99 | FrmFieldsHelper::include_other_input( array( |
@@ -102,52 +102,52 @@ discard block |
||
102 | 102 | 'value' => $other_args['value'], 'field' => $field, |
103 | 103 | 'html_id' => $html_id, 'opt_key' => false, |
104 | 104 | ) ); |
105 | - } |
|
105 | + } |
|
106 | 106 | } else if ( $field['type'] == 'checkbox' ) { |
107 | - $checked_values = $field['value']; |
|
108 | - $read_only = false; |
|
107 | + $checked_values = $field['value']; |
|
108 | + $read_only = false; |
|
109 | 109 | |
110 | 110 | if ( FrmField::is_read_only( $field ) && ! FrmAppHelper::is_admin() ) { |
111 | - $read_only = true; |
|
112 | - if ( $checked_values ) { |
|
113 | - foreach ( (array) $checked_values as $checked_value ) { ?> |
|
111 | + $read_only = true; |
|
112 | + if ( $checked_values ) { |
|
113 | + foreach ( (array) $checked_values as $checked_value ) { ?> |
|
114 | 114 | <input type="hidden" value="<?php echo esc_attr( $checked_value ) ?>" name="<?php echo esc_attr( $field_name ) ?>[]" /> |
115 | 115 | <?php |
116 | - } |
|
117 | - } else { ?> |
|
116 | + } |
|
117 | + } else { ?> |
|
118 | 118 | <input type="hidden" value="" name="<?php echo esc_attr( $field_name ) ?>[]" /> |
119 | 119 | <?php |
120 | - } |
|
121 | - } |
|
120 | + } |
|
121 | + } |
|
122 | 122 | |
123 | - if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
123 | + if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
124 | 124 | do_action( 'frm_after_checkbox', array( 'field' => $field, 'field_name' => $field_name, 'type' => $field['type'] ) ); |
125 | - } else if ( $field['options'] ) { |
|
126 | - foreach ( $field['options'] as $opt_key => $opt ) { |
|
127 | - if ( isset($atts) && isset($atts['opt']) && ($atts['opt'] != $opt_key) ) { |
|
128 | - continue; |
|
129 | - } |
|
130 | - |
|
131 | - $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field); |
|
132 | - $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field); |
|
133 | - $checked = FrmAppHelper::check_selected($checked_values, $field_val) ? ' checked="checked"' : ''; |
|
134 | - |
|
135 | - // Check if other opt, and get values for other field if needed |
|
136 | - $other_opt = false; |
|
125 | + } else if ( $field['options'] ) { |
|
126 | + foreach ( $field['options'] as $opt_key => $opt ) { |
|
127 | + if ( isset($atts) && isset($atts['opt']) && ($atts['opt'] != $opt_key) ) { |
|
128 | + continue; |
|
129 | + } |
|
130 | + |
|
131 | + $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field); |
|
132 | + $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field); |
|
133 | + $checked = FrmAppHelper::check_selected($checked_values, $field_val) ? ' checked="checked"' : ''; |
|
134 | + |
|
135 | + // Check if other opt, and get values for other field if needed |
|
136 | + $other_opt = false; |
|
137 | 137 | $other_args = FrmFieldsHelper::prepare_other_input( compact( 'field', 'field_name', 'opt_key' ), $other_opt, $checked ); |
138 | 138 | |
139 | - ?> |
|
139 | + ?> |
|
140 | 140 | <div class="<?php echo esc_attr( apply_filters( 'frm_checkbox_class', 'frm_checkbox', $field, $field_val ) ) ?>" id="frm_checkbox_<?php echo esc_attr( $field['id'] ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php |
141 | 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 |
|
144 | - } |
|
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 |
|
144 | + } |
|
145 | 145 | |
146 | - ?><input type="checkbox" name="<?php echo esc_attr( $field_name ) ?>[<?php echo ( $other_opt ? esc_attr( $opt_key ) : '' ) ?>]" id="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php echo $checked ?> <?php do_action('frm_field_input_html', $field) ?> /><?php |
|
146 | + ?><input type="checkbox" name="<?php echo esc_attr( $field_name ) ?>[<?php echo ( $other_opt ? esc_attr( $opt_key ) : '' ) ?>]" id="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php echo $checked ?> <?php do_action('frm_field_input_html', $field) ?> /><?php |
|
147 | 147 | |
148 | - if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
|
149 | - echo ' '. $opt .'</label>'; |
|
150 | - } |
|
148 | + if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
|
149 | + echo ' '. $opt .'</label>'; |
|
150 | + } |
|
151 | 151 | |
152 | 152 | FrmFieldsHelper::include_other_input( array( |
153 | 153 | 'other_opt' => $other_opt, 'read_only' => $read_only, |
@@ -156,17 +156,17 @@ discard block |
||
156 | 156 | 'html_id' => $html_id, 'opt_key' => $opt_key, |
157 | 157 | ) ); |
158 | 158 | |
159 | - unset( $other_opt, $other_args, $checked ); |
|
159 | + unset( $other_opt, $other_args, $checked ); |
|
160 | 160 | |
161 | - ?></div> |
|
161 | + ?></div> |
|
162 | 162 | <?php |
163 | - } |
|
164 | - } |
|
163 | + } |
|
164 | + } |
|
165 | 165 | } else if ( $field['type'] == 'captcha' && ! FrmAppHelper::is_admin() ) { |
166 | - $frm_settings = FrmAppHelper::get_settings(); |
|
167 | - if ( ! empty($frm_settings->pubkey) ) { |
|
168 | - FrmFieldsHelper::display_recaptcha($field); |
|
169 | - } |
|
166 | + $frm_settings = FrmAppHelper::get_settings(); |
|
167 | + if ( ! empty($frm_settings->pubkey) ) { |
|
168 | + FrmFieldsHelper::display_recaptcha($field); |
|
169 | + } |
|
170 | 170 | } else { |
171 | - do_action('frm_form_fields', $field, $field_name, compact('errors', 'html_id')); |
|
171 | + do_action('frm_form_fields', $field, $field_name, compact('errors', 'html_id')); |
|
172 | 172 | } |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php if ( in_array( $field['type'], array( 'email', 'url', 'text' ) ) ) { ?> |
2 | -<input type="<?php echo ( $frm_settings->use_html || $field['type'] == 'password' ) ? $field['type'] : 'text'; ?>" id="<?php echo esc_attr( $html_id ) ?>" name="<?php echo esc_attr( $field_name ) ?>" value="<?php echo esc_attr( $field['value'] ) ?>" <?php do_action('frm_field_input_html', $field) ?>/> |
|
2 | +<input type="<?php echo ( $frm_settings->use_html || $field['type'] == 'password' ) ? $field['type'] : 'text'; ?>" id="<?php echo esc_attr( $html_id ) ?>" name="<?php echo esc_attr( $field_name ) ?>" value="<?php echo esc_attr( $field['value'] ) ?>" <?php do_action( 'frm_field_input_html', $field ) ?>/> |
|
3 | 3 | <?php } else if ( $field['type'] == 'textarea' ) { ?> |
4 | 4 | <textarea name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id ) ?>" <?php |
5 | 5 | if ( $field['max'] ) { |
6 | - echo 'rows="'. esc_attr( $field['max'] ) .'" '; |
|
6 | + echo 'rows="' . esc_attr( $field['max'] ) . '" '; |
|
7 | 7 | } |
8 | -do_action('frm_field_input_html', $field); |
|
9 | -?>><?php echo FrmAppHelper::esc_textarea($field['value']) ?></textarea> |
|
8 | +do_action( 'frm_field_input_html', $field ); |
|
9 | +?>><?php echo FrmAppHelper::esc_textarea( $field['value'] ) ?></textarea> |
|
10 | 10 | <?php |
11 | 11 | |
12 | 12 | } else if ( $field['type'] == 'radio' ) { |
@@ -17,33 +17,33 @@ discard block |
||
17 | 17 | <?php |
18 | 18 | } |
19 | 19 | |
20 | - if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
20 | + if ( isset( $field['post_field'] ) && $field['post_field'] == 'post_category' ) { |
|
21 | 21 | do_action( 'frm_after_checkbox', array( 'field' => $field, 'field_name' => $field_name, 'type' => $field['type'] ) ); |
22 | - } else if ( is_array($field['options']) ) { |
|
22 | + } else if ( is_array( $field['options'] ) ) { |
|
23 | 23 | foreach ( $field['options'] as $opt_key => $opt ) { |
24 | 24 | if ( isset( $atts ) && isset( $atts['opt'] ) && ( $atts['opt'] != $opt_key ) ) { |
25 | 25 | continue; |
26 | 26 | } |
27 | 27 | |
28 | - $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field); |
|
29 | - $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field); ?> |
|
28 | + $field_val = apply_filters( 'frm_field_value_saved', $opt, $opt_key, $field ); |
|
29 | + $opt = apply_filters( 'frm_field_label_seen', $opt, $opt_key, $field ); ?> |
|
30 | 30 | <div class="<?php echo esc_attr( apply_filters( 'frm_radio_class', 'frm_radio', $field, $field_val ) ) ?>"><?php |
31 | 31 | |
32 | 32 | if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
33 | 33 | ?><label for="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php |
34 | 34 | } |
35 | - $checked = FrmAppHelper::check_selected($field['value'], $field_val) ? 'checked="checked" ' : ' '; |
|
35 | + $checked = FrmAppHelper::check_selected( $field['value'], $field_val ) ? 'checked="checked" ' : ' '; |
|
36 | 36 | |
37 | 37 | $other_opt = false; |
38 | 38 | $other_args = FrmFieldsHelper::prepare_other_input( compact( 'field_name', 'opt_key', 'field' ), $other_opt, $checked ); |
39 | 39 | ?> |
40 | 40 | <input type="radio" name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php |
41 | 41 | echo $checked; |
42 | - do_action('frm_field_input_html', $field); |
|
42 | + do_action( 'frm_field_input_html', $field ); |
|
43 | 43 | ?>/><?php |
44 | 44 | |
45 | 45 | if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
46 | - echo ' '. $opt .'</label>'; |
|
46 | + echo ' ' . $opt . '</label>'; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | FrmFieldsHelper::include_other_input( array( |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | } else if ( $field['type'] == 'select' ) { |
62 | 62 | $read_only = false; |
63 | - if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
63 | + if ( isset( $field['post_field'] ) && $field['post_field'] == 'post_category' ) { |
|
64 | 64 | echo FrmFieldsHelper::dropdown_categories( array( 'name' => $field_name, 'field' => $field ) ); |
65 | 65 | } else { |
66 | 66 | if ( FrmField::is_read_only( $field ) && ! FrmAppHelper::is_admin() ) { |
@@ -71,12 +71,12 @@ discard block |
||
71 | 71 | <input type="hidden" value="<?php echo esc_attr( $selected_value ) ?>" name="<?php echo esc_attr( $field_name ) ?>[]" /> <?php |
72 | 72 | } |
73 | 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 |
|
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 | 75 | } ?> |
76 | - <select disabled="disabled" <?php do_action('frm_field_input_html', $field) ?>> <?php |
|
76 | + <select disabled="disabled" <?php do_action( 'frm_field_input_html', $field ) ?>> <?php |
|
77 | 77 | |
78 | 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) ?>> |
|
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 | 80 | <?php } |
81 | 81 | |
82 | 82 | $other_opt = $other_checked = false; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | } |
93 | 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 ($opt == '') ? ' ' : $opt; ?></option> |
|
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 ( $opt == '' ) ? ' ' : $opt; ?></option> |
|
95 | 95 | <?php |
96 | 96 | } ?> |
97 | 97 | </select> |
@@ -120,17 +120,17 @@ discard block |
||
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
123 | - if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
123 | + if ( isset( $field['post_field'] ) && $field['post_field'] == 'post_category' ) { |
|
124 | 124 | do_action( 'frm_after_checkbox', array( 'field' => $field, 'field_name' => $field_name, 'type' => $field['type'] ) ); |
125 | 125 | } else if ( $field['options'] ) { |
126 | 126 | foreach ( $field['options'] as $opt_key => $opt ) { |
127 | - if ( isset($atts) && isset($atts['opt']) && ($atts['opt'] != $opt_key) ) { |
|
127 | + if ( isset( $atts ) && isset( $atts['opt'] ) && ( $atts['opt'] != $opt_key ) ) { |
|
128 | 128 | continue; |
129 | 129 | } |
130 | 130 | |
131 | - $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field); |
|
132 | - $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field); |
|
133 | - $checked = FrmAppHelper::check_selected($checked_values, $field_val) ? ' checked="checked"' : ''; |
|
131 | + $field_val = apply_filters( 'frm_field_value_saved', $opt, $opt_key, $field ); |
|
132 | + $opt = apply_filters( 'frm_field_label_seen', $opt, $opt_key, $field ); |
|
133 | + $checked = FrmAppHelper::check_selected( $checked_values, $field_val ) ? ' checked="checked"' : ''; |
|
134 | 134 | |
135 | 135 | // Check if other opt, and get values for other field if needed |
136 | 136 | $other_opt = false; |
@@ -143,10 +143,10 @@ discard block |
||
143 | 143 | ?><label for="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php |
144 | 144 | } |
145 | 145 | |
146 | - ?><input type="checkbox" name="<?php echo esc_attr( $field_name ) ?>[<?php echo ( $other_opt ? esc_attr( $opt_key ) : '' ) ?>]" id="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php echo $checked ?> <?php do_action('frm_field_input_html', $field) ?> /><?php |
|
146 | + ?><input type="checkbox" name="<?php echo esc_attr( $field_name ) ?>[<?php echo ( $other_opt ? esc_attr( $opt_key ) : '' ) ?>]" id="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php echo $checked ?> <?php do_action( 'frm_field_input_html', $field ) ?> /><?php |
|
147 | 147 | |
148 | 148 | if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
149 | - echo ' '. $opt .'</label>'; |
|
149 | + echo ' ' . $opt . '</label>'; |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | FrmFieldsHelper::include_other_input( array( |
@@ -164,9 +164,9 @@ discard block |
||
164 | 164 | } |
165 | 165 | } else if ( $field['type'] == 'captcha' && ! FrmAppHelper::is_admin() ) { |
166 | 166 | $frm_settings = FrmAppHelper::get_settings(); |
167 | - if ( ! empty($frm_settings->pubkey) ) { |
|
168 | - FrmFieldsHelper::display_recaptcha($field); |
|
167 | + if ( ! empty( $frm_settings->pubkey ) ) { |
|
168 | + FrmFieldsHelper::display_recaptcha( $field ); |
|
169 | 169 | } |
170 | 170 | } else { |
171 | - do_action('frm_form_fields', $field, $field_name, compact('errors', 'html_id')); |
|
171 | + do_action( 'frm_form_fields', $field, $field_name, compact( 'errors', 'html_id' ) ); |
|
172 | 172 | } |