@@ -42,51 +42,51 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | if ( $f->type == 'data' ) { |
| 44 | 44 | //get all fields from linked form |
| 45 | - if ( isset($f->field_options['form_select']) && is_numeric($f->field_options['form_select']) ) { |
|
| 45 | + if ( isset($f->field_options['form_select']) && is_numeric($f->field_options['form_select']) ) { |
|
| 46 | 46 | $linked_form = FrmDb::get_var( $wpdb->prefix . 'frm_fields', array( 'id' => $f->field_options['form_select'] ), 'form_id' ); |
| 47 | - if ( ! in_array( $linked_form, $linked_forms ) ) { |
|
| 48 | - $linked_forms[] = $linked_form; |
|
| 47 | + if ( ! in_array( $linked_form, $linked_forms ) ) { |
|
| 48 | + $linked_forms[] = $linked_form; |
|
| 49 | 49 | $linked_fields = FrmField::getAll( array( 'fi.type not' => FrmField::no_save_fields(), 'fi.form_id' => $linked_form ) ); |
| 50 | - $ldfe = ''; |
|
| 50 | + $ldfe = ''; |
|
| 51 | 51 | if ( $linked_fields ) { |
| 52 | 52 | foreach ( $linked_fields as $linked_field ) { |
| 53 | - FrmAppHelper::insert_opt_html( array( 'id' => $f->id . ' show=' . $linked_field->id, 'key' => $f->field_key . ' show=' . $linked_field->field_key, 'name' => do_shortcode($linked_field->name), 'type' => $linked_field->type ) ); |
|
| 54 | - |
|
| 55 | - $ldfe = $linked_field->id; |
|
| 56 | - unset($linked_field); |
|
| 57 | - } |
|
| 58 | - } |
|
| 59 | - } |
|
| 60 | - } |
|
| 61 | - $dfe = $f->id; |
|
| 62 | - } |
|
| 63 | - unset($f); |
|
| 64 | - } |
|
| 65 | - } ?> |
|
| 53 | + FrmAppHelper::insert_opt_html( array( 'id' => $f->id . ' show=' . $linked_field->id, 'key' => $f->field_key . ' show=' . $linked_field->field_key, 'name' => do_shortcode($linked_field->name), 'type' => $linked_field->type ) ); |
|
| 54 | + |
|
| 55 | + $ldfe = $linked_field->id; |
|
| 56 | + unset($linked_field); |
|
| 57 | + } |
|
| 58 | + } |
|
| 59 | + } |
|
| 60 | + } |
|
| 61 | + $dfe = $f->id; |
|
| 62 | + } |
|
| 63 | + unset($f); |
|
| 64 | + } |
|
| 65 | + } ?> |
|
| 66 | 66 | </ul> |
| 67 | 67 | |
| 68 | 68 | <?php _e( 'Helpers', 'formidable' ) ?>: |
| 69 | 69 | <ul class="frm_code_list"> |
| 70 | 70 | <?php |
| 71 | - $col = 'one'; |
|
| 71 | + $col = 'one'; |
|
| 72 | 72 | foreach ( $entry_shortcodes as $skey => $sname ) { |
| 73 | 73 | if ( empty( $skey ) ) { |
| 74 | - $col = 'one'; |
|
| 75 | - echo '<li class="clear frm_block"></li>'; |
|
| 76 | - continue; |
|
| 77 | - } |
|
| 78 | - ?> |
|
| 74 | + $col = 'one'; |
|
| 75 | + echo '<li class="clear frm_block"></li>'; |
|
| 76 | + continue; |
|
| 77 | + } |
|
| 78 | + ?> |
|
| 79 | 79 | <li class="frm_col_<?php echo esc_attr( $col ) ?>"> |
| 80 | 80 | <a href="javascript:void(0)" class="frmbutton button <?php |
| 81 | 81 | echo ( in_array( $skey, array( 'siteurl', 'sitename', 'entry_count' ) ) ) ? 'show_before_content show_after_content' : ''; |
| 82 | - echo ( strpos( $skey, 'default-' ) === 0 ) ? 'hide_frm_not_email_subject' : ''; |
|
| 83 | - ?> frm_insert_code" data-code="<?php echo esc_attr( $skey ) ?>"><?php echo esc_html( $sname ) ?></a> |
|
| 82 | + echo ( strpos( $skey, 'default-' ) === 0 ) ? 'hide_frm_not_email_subject' : ''; |
|
| 83 | + ?> frm_insert_code" data-code="<?php echo esc_attr( $skey ) ?>"><?php echo esc_html( $sname ) ?></a> |
|
| 84 | 84 | </li> |
| 85 | 85 | <?php |
| 86 | - $col = ( $col == 'one' ) ? 'two' : 'one'; |
|
| 87 | - unset($skey, $sname); |
|
| 88 | - } |
|
| 89 | - ?> |
|
| 86 | + $col = ( $col == 'one' ) ? 'two' : 'one'; |
|
| 87 | + unset($skey, $sname); |
|
| 88 | + } |
|
| 89 | + ?> |
|
| 90 | 90 | </ul> |
| 91 | 91 | </div> |
| 92 | 92 | |
@@ -99,11 +99,11 @@ discard block |
||
| 99 | 99 | <ul class="alignleft"><li><?php _e( 'Fields from your form', 'formidable' ) ?>:</li></ul> |
| 100 | 100 | <ul class="frm_code_list frm_full_width"> |
| 101 | 101 | <?php if ( ! empty( $fields ) ) { |
| 102 | - foreach ( $fields as $f ) { |
|
| 102 | + foreach ( $fields as $f ) { |
|
| 103 | 103 | if ( FrmField::is_no_save_field( $f->type ) || ( $f->type == 'data' && ( ! isset( $f->field_options['data_type'] ) || $f->field_options['data_type'] == 'data' || $f->field_options['data_type'] == '' ) ) ) { |
| 104 | - continue; |
|
| 105 | - } |
|
| 106 | - ?> |
|
| 104 | + continue; |
|
| 105 | + } |
|
| 106 | + ?> |
|
| 107 | 107 | <li> |
| 108 | 108 | <a href="javascript:void(0)" class="frmids alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->id ) ?>]<?php esc_attr_e( 'Conditional text here', 'formidable' ) ?>[/if <?php echo esc_attr( $f->id ) ?>">[if <?php echo (int) $f->id ?>]</a> |
| 109 | 109 | <a href="javascript:void(0)" class="frmkeys alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->field_key ) ?>]something[/if <?php echo esc_attr( $f->field_key ) ?>">[if <?php echo FrmAppHelper::truncate($f->field_key, 10) ?>]</a> |
@@ -111,30 +111,30 @@ discard block |
||
| 111 | 111 | </li> |
| 112 | 112 | <?php |
| 113 | 113 | |
| 114 | - if ( $f->type == 'user_id' ) { |
|
| 115 | - $uid = $f; |
|
| 116 | - } else if ( $f->type == 'file' ) { |
|
| 117 | - $file = $f; |
|
| 118 | - } |
|
| 119 | - unset($f); |
|
| 120 | - } |
|
| 121 | - } ?> |
|
| 114 | + if ( $f->type == 'user_id' ) { |
|
| 115 | + $uid = $f; |
|
| 116 | + } else if ( $f->type == 'file' ) { |
|
| 117 | + $file = $f; |
|
| 118 | + } |
|
| 119 | + unset($f); |
|
| 120 | + } |
|
| 121 | + } ?> |
|
| 122 | 122 | </ul> |
| 123 | 123 | |
| 124 | 124 | <p class="howto"><?php _e( 'Click a button below to insert sample logic into your view', 'formidable' ) ?></p> |
| 125 | 125 | <ul class="frm_code_list"> |
| 126 | 126 | <?php |
| 127 | - $col = 'one'; |
|
| 127 | + $col = 'one'; |
|
| 128 | 128 | foreach ( $cond_shortcodes as $skey => $sname ) { |
| 129 | - ?> |
|
| 129 | + ?> |
|
| 130 | 130 | <li class="frm_col_<?php echo esc_attr( $col ) ?>"> |
| 131 | 131 | <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="if x <?php echo esc_attr($skey) ?>][/if x"><?php echo esc_html( $sname ) ?></a> |
| 132 | 132 | </li> |
| 133 | 133 | <?php |
| 134 | - $col = ( $col == 'one' ) ? 'two' : 'one'; |
|
| 135 | - unset($skey, $sname); |
|
| 136 | - } |
|
| 137 | - ?> |
|
| 134 | + $col = ( $col == 'one' ) ? 'two' : 'one'; |
|
| 135 | + unset($skey, $sname); |
|
| 136 | + } |
|
| 137 | + ?> |
|
| 138 | 138 | </ul> |
| 139 | 139 | </div> |
| 140 | 140 | <?php } ?> |
@@ -142,19 +142,19 @@ discard block |
||
| 142 | 142 | <div id="frm-adv-info-tab" class="tabs-panel"> |
| 143 | 143 | <ul class="frm_code_list"> |
| 144 | 144 | <?php |
| 145 | - $col = 'one'; |
|
| 145 | + $col = 'one'; |
|
| 146 | 146 | foreach ( $adv_shortcodes as $skey => $sname ) { |
| 147 | - ?> |
|
| 147 | + ?> |
|
| 148 | 148 | <li class="frm_col_<?php echo esc_attr( $col ) ?>"> |
| 149 | 149 | <a href="javascript:void(0)" class="frmbutton button frm_insert_code <?php echo is_array( $sname ) ? 'frm_help' : ''; ?>" data-code="x <?php echo esc_attr( $skey ) ?>" <?php echo is_array( $sname ) ? 'title="' . esc_attr( $sname['title'] ) . '"' : ''; ?>> |
| 150 | 150 | <?php echo is_array( $sname ) ? $sname['label'] : $sname; ?> |
| 151 | 151 | </a> |
| 152 | 152 | </li> |
| 153 | 153 | <?php |
| 154 | - $col = ($col == 'one') ? 'two' : 'one'; |
|
| 155 | - unset($skey, $sname); |
|
| 156 | - } |
|
| 157 | - ?> |
|
| 154 | + $col = ($col == 'one') ? 'two' : 'one'; |
|
| 155 | + unset($skey, $sname); |
|
| 156 | + } |
|
| 157 | + ?> |
|
| 158 | 158 | <?php if ( isset($file) ) { ?> |
| 159 | 159 | <li class="frm_col_<?php echo esc_attr( $col ) ?>"> |
| 160 | 160 | <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show_image=1"><?php _e( 'Show image', 'formidable' ) ?></a> |
@@ -171,8 +171,8 @@ discard block |
||
| 171 | 171 | <div class="clear"></div> |
| 172 | 172 | <?php |
| 173 | 173 | |
| 174 | - if ( isset($uid) && ! empty($user_fields) ) { |
|
| 175 | - $col = 'one'; ?> |
|
| 174 | + if ( isset($uid) && ! empty($user_fields) ) { |
|
| 175 | + $col = 'one'; ?> |
|
| 176 | 176 | <p class="howto"><?php _e( 'Insert user information', 'formidable' ) ?></p> |
| 177 | 177 | <ul class="frm_code_list"> |
| 178 | 178 | <?php foreach ( $user_fields as $uk => $uf ) { ?> |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $uid->id . ' show="' . $uk . '"' ) ?>"><?php echo esc_html( $uf ) ?></a> |
| 181 | 181 | </li> |
| 182 | 182 | <?php |
| 183 | - $col = ($col == 'one') ? 'two' : 'one'; |
|
| 184 | - unset($uf, $uk); |
|
| 185 | - } |
|
| 186 | - unset($uid); ?> |
|
| 183 | + $col = ($col == 'one') ? 'two' : 'one'; |
|
| 184 | + unset($uf, $uk); |
|
| 185 | + } |
|
| 186 | + unset($uid); ?> |
|
| 187 | 187 | </ul> |
| 188 | 188 | <?php } |
| 189 | 189 | |
| 190 | - if ( isset($repeat_field) ) { ?> |
|
| 190 | + if ( isset($repeat_field) ) { ?> |
|
| 191 | 191 | <div class="clear"></div> |
| 192 | 192 | <p class="howto"><?php _e( 'Repeating field options', 'formidable' ) ?></p> |
| 193 | 193 | <ul class="frm_code_list"> |
@@ -196,9 +196,9 @@ discard block |
||
| 196 | 196 | </li> |
| 197 | 197 | </ul> |
| 198 | 198 | <?php |
| 199 | - } |
|
| 199 | + } |
|
| 200 | 200 | |
| 201 | - if ( isset($dfe) ) { ?> |
|
| 201 | + if ( isset($dfe) ) { ?> |
|
| 202 | 202 | |
| 203 | 203 | <div class="clear"></div> |
| 204 | 204 | <p class="howto"><?php _e( 'Dynamic field options', 'formidable' ) ?></p> |
@@ -217,8 +217,8 @@ discard block |
||
| 217 | 217 | </div> |
| 218 | 218 | |
| 219 | 219 | <?php |
| 220 | - if ( $settings_tab ) { |
|
| 220 | + if ( $settings_tab ) { |
|
| 221 | 221 | include( FrmAppHelper::plugin_path() . '/classes/views/frm-forms/mb_html_tab.php' ); |
| 222 | - } |
|
| 223 | - ?> |
|
| 222 | + } |
|
| 223 | + ?> |
|
| 224 | 224 | </div> |
@@ -37,12 +37,12 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | FrmAppHelper::insert_opt_html( array( |
| 39 | 39 | 'id' => $f->id, 'key' => $f->field_key, |
| 40 | - 'name' => do_shortcode($f->name), 'type' => $f->type, |
|
| 40 | + 'name' => do_shortcode( $f->name ), 'type' => $f->type, |
|
| 41 | 41 | ) ); |
| 42 | 42 | |
| 43 | 43 | if ( $f->type == 'data' ) { |
| 44 | 44 | //get all fields from linked form |
| 45 | - if ( isset($f->field_options['form_select']) && is_numeric($f->field_options['form_select']) ) { |
|
| 45 | + if ( isset( $f->field_options['form_select'] ) && is_numeric( $f->field_options['form_select'] ) ) { |
|
| 46 | 46 | $linked_form = FrmDb::get_var( $wpdb->prefix . 'frm_fields', array( 'id' => $f->field_options['form_select'] ), 'form_id' ); |
| 47 | 47 | if ( ! in_array( $linked_form, $linked_forms ) ) { |
| 48 | 48 | $linked_forms[] = $linked_form; |
@@ -50,17 +50,17 @@ discard block |
||
| 50 | 50 | $ldfe = ''; |
| 51 | 51 | if ( $linked_fields ) { |
| 52 | 52 | foreach ( $linked_fields as $linked_field ) { |
| 53 | - FrmAppHelper::insert_opt_html( array( 'id' => $f->id . ' show=' . $linked_field->id, 'key' => $f->field_key . ' show=' . $linked_field->field_key, 'name' => do_shortcode($linked_field->name), 'type' => $linked_field->type ) ); |
|
| 53 | + FrmAppHelper::insert_opt_html( array( 'id' => $f->id . ' show=' . $linked_field->id, 'key' => $f->field_key . ' show=' . $linked_field->field_key, 'name' => do_shortcode( $linked_field->name ), 'type' => $linked_field->type ) ); |
|
| 54 | 54 | |
| 55 | 55 | $ldfe = $linked_field->id; |
| 56 | - unset($linked_field); |
|
| 56 | + unset( $linked_field ); |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | $dfe = $f->id; |
| 62 | 62 | } |
| 63 | - unset($f); |
|
| 63 | + unset( $f ); |
|
| 64 | 64 | } |
| 65 | 65 | } ?> |
| 66 | 66 | </ul> |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | </li> |
| 85 | 85 | <?php |
| 86 | 86 | $col = ( $col == 'one' ) ? 'two' : 'one'; |
| 87 | - unset($skey, $sname); |
|
| 87 | + unset( $skey, $sname ); |
|
| 88 | 88 | } |
| 89 | 89 | ?> |
| 90 | 90 | </ul> |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | ?> |
| 107 | 107 | <li> |
| 108 | 108 | <a href="javascript:void(0)" class="frmids alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->id ) ?>]<?php esc_attr_e( 'Conditional text here', 'formidable' ) ?>[/if <?php echo esc_attr( $f->id ) ?>">[if <?php echo (int) $f->id ?>]</a> |
| 109 | - <a href="javascript:void(0)" class="frmkeys alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->field_key ) ?>]something[/if <?php echo esc_attr( $f->field_key ) ?>">[if <?php echo FrmAppHelper::truncate($f->field_key, 10) ?>]</a> |
|
| 110 | - <a href="javascript:void(0)" class="frm_insert_code" data-code="<?php echo esc_attr($f->id) ?>"><?php echo FrmAppHelper::truncate(do_shortcode($f->name), 60) ?></a> |
|
| 109 | + <a href="javascript:void(0)" class="frmkeys alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->field_key ) ?>]something[/if <?php echo esc_attr( $f->field_key ) ?>">[if <?php echo FrmAppHelper::truncate( $f->field_key, 10 ) ?>]</a> |
|
| 110 | + <a href="javascript:void(0)" class="frm_insert_code" data-code="<?php echo esc_attr( $f->id ) ?>"><?php echo FrmAppHelper::truncate( do_shortcode( $f->name ), 60 ) ?></a> |
|
| 111 | 111 | </li> |
| 112 | 112 | <?php |
| 113 | 113 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } else if ( $f->type == 'file' ) { |
| 117 | 117 | $file = $f; |
| 118 | 118 | } |
| 119 | - unset($f); |
|
| 119 | + unset( $f ); |
|
| 120 | 120 | } |
| 121 | 121 | } ?> |
| 122 | 122 | </ul> |
@@ -128,11 +128,11 @@ discard block |
||
| 128 | 128 | foreach ( $cond_shortcodes as $skey => $sname ) { |
| 129 | 129 | ?> |
| 130 | 130 | <li class="frm_col_<?php echo esc_attr( $col ) ?>"> |
| 131 | - <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="if x <?php echo esc_attr($skey) ?>][/if x"><?php echo esc_html( $sname ) ?></a> |
|
| 131 | + <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="if x <?php echo esc_attr( $skey ) ?>][/if x"><?php echo esc_html( $sname ) ?></a> |
|
| 132 | 132 | </li> |
| 133 | 133 | <?php |
| 134 | 134 | $col = ( $col == 'one' ) ? 'two' : 'one'; |
| 135 | - unset($skey, $sname); |
|
| 135 | + unset( $skey, $sname ); |
|
| 136 | 136 | } |
| 137 | 137 | ?> |
| 138 | 138 | </ul> |
@@ -151,19 +151,19 @@ discard block |
||
| 151 | 151 | </a> |
| 152 | 152 | </li> |
| 153 | 153 | <?php |
| 154 | - $col = ($col == 'one') ? 'two' : 'one'; |
|
| 155 | - unset($skey, $sname); |
|
| 154 | + $col = ( $col == 'one' ) ? 'two' : 'one'; |
|
| 155 | + unset( $skey, $sname ); |
|
| 156 | 156 | } |
| 157 | 157 | ?> |
| 158 | - <?php if ( isset($file) ) { ?> |
|
| 158 | + <?php if ( isset( $file ) ) { ?> |
|
| 159 | 159 | <li class="frm_col_<?php echo esc_attr( $col ) ?>"> |
| 160 | - <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show_image=1"><?php _e( 'Show image', 'formidable' ) ?></a> |
|
| 160 | + <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $file->id ) ?> show_image=1"><?php _e( 'Show image', 'formidable' ) ?></a> |
|
| 161 | 161 | </li> |
| 162 | 162 | <li class="frm_col_<?php echo esc_attr( $col = ( $col == 'one' ? 'two' : 'one' ) ) ?>"> |
| 163 | - <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show=id"><?php _e( 'Image ID', 'formidable' ) ?></a> |
|
| 163 | + <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $file->id ) ?> show=id"><?php _e( 'Image ID', 'formidable' ) ?></a> |
|
| 164 | 164 | </li> |
| 165 | 165 | <li class="frm_col_<?php echo esc_attr( $col = ( $col == 'one' ? 'two' : 'one' ) ) ?>"> |
| 166 | - <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show_filename=1"><?php _e( 'Image Name', 'formidable' ) ?></a> |
|
| 166 | + <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $file->id ) ?> show_filename=1"><?php _e( 'Image Name', 'formidable' ) ?></a> |
|
| 167 | 167 | </li> |
| 168 | 168 | <?php } ?> |
| 169 | 169 | </ul> |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | <div class="clear"></div> |
| 172 | 172 | <?php |
| 173 | 173 | |
| 174 | - if ( isset($uid) && ! empty($user_fields) ) { |
|
| 174 | + if ( isset( $uid ) && ! empty( $user_fields ) ) { |
|
| 175 | 175 | $col = 'one'; ?> |
| 176 | 176 | <p class="howto"><?php _e( 'Insert user information', 'formidable' ) ?></p> |
| 177 | 177 | <ul class="frm_code_list"> |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $uid->id . ' show="' . $uk . '"' ) ?>"><?php echo esc_html( $uf ) ?></a> |
| 181 | 181 | </li> |
| 182 | 182 | <?php |
| 183 | - $col = ($col == 'one') ? 'two' : 'one'; |
|
| 184 | - unset($uf, $uk); |
|
| 183 | + $col = ( $col == 'one' ) ? 'two' : 'one'; |
|
| 184 | + unset( $uf, $uk ); |
|
| 185 | 185 | } |
| 186 | - unset($uid); ?> |
|
| 186 | + unset( $uid ); ?> |
|
| 187 | 187 | </ul> |
| 188 | 188 | <?php } |
| 189 | 189 | |
| 190 | - if ( isset($repeat_field) ) { ?> |
|
| 190 | + if ( isset( $repeat_field ) ) { ?> |
|
| 191 | 191 | <div class="clear"></div> |
| 192 | 192 | <p class="howto"><?php _e( 'Repeating field options', 'formidable' ) ?></p> |
| 193 | 193 | <ul class="frm_code_list"> |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | <?php |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - if ( isset($dfe) ) { ?> |
|
| 201 | + if ( isset( $dfe ) ) { ?> |
|
| 202 | 202 | |
| 203 | 203 | <div class="clear"></div> |
| 204 | 204 | <p class="howto"><?php _e( 'Dynamic field options', 'formidable' ) ?></p> |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | <li class="frm_col_one"> |
| 207 | 207 | <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $dfe . ' show="created-at"' ) ?>"><?php _e( 'Creation Date', 'formidable' ) ?></a> |
| 208 | 208 | </li> |
| 209 | - <?php if ( isset($ldfe) ) { ?> |
|
| 209 | + <?php if ( isset( $ldfe ) ) { ?> |
|
| 210 | 210 | <li class="frm_col_two"> |
| 211 | 211 | <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $dfe . ' show="' . $ldfe . '"' ) ?>"><?php _e( 'Field From Entry', 'formidable' ) ?></a> |
| 212 | 212 | </li> |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <div id="form_show_entry_page" class="wrap"> |
| 2 | 2 | <h2 class="frm_no_print"><?php _e( 'View Entry', 'formidable' ) ?> |
| 3 | - <?php do_action('frm_entry_inside_h2', $entry->form_id); ?> |
|
| 3 | + <?php do_action( 'frm_entry_inside_h2', $entry->form_id ); ?> |
|
| 4 | 4 | </h2> |
| 5 | 5 | |
| 6 | 6 | <div class="frm_forms"> |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | <div id="poststuff"> |
| 9 | 9 | <div id="post-body" class="metabox-holder columns-2"> |
| 10 | 10 | <div id="post-body-content"> |
| 11 | - <?php FrmAppController::get_form_nav($entry->form_id, true); ?> |
|
| 11 | + <?php FrmAppController::get_form_nav( $entry->form_id, true ); ?> |
|
| 12 | 12 | <div class="postbox"> |
| 13 | 13 | <h3 class="hndle"><span><?php _e( 'Entry', 'formidable' ) ?></span></h3> |
| 14 | 14 | <div class="inside"> |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | continue; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - if ( in_array($field->type, array( 'break', 'divider' ) ) ) { |
|
| 23 | + if ( in_array( $field->type, array( 'break', 'divider' ) ) ) { |
|
| 24 | 24 | ?> |
| 25 | 25 | </tbody></table> |
| 26 | 26 | <br/><h3 class="<?php echo esc_attr( $first_h3 ) ?>"><?php echo esc_html( $field->name ) ?></h3> |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | } else { |
| 31 | 31 | ?> |
| 32 | 32 | <tr> |
| 33 | - <th scope="row"><?php echo esc_html( do_shortcode($field->name) ) ?>:</th> |
|
| 33 | + <th scope="row"><?php echo esc_html( do_shortcode( $field->name ) ) ?>:</th> |
|
| 34 | 34 | <td> |
| 35 | 35 | <?php |
| 36 | 36 | $embedded_field_id = ( $entry->form_id != $field->form_id ) ? 'form' . $field->form_id : 0; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $display_value = FrmEntriesHelper::prepare_display_value( $entry, $field, $atts ); |
| 43 | 43 | echo $display_value; |
| 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,11 +59,11 @@ 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 | 69 | <?php require( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/sidebar-show.php' ); ?> |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | public static function menu() { |
| 6 | 6 | FrmAppHelper::force_capability( 'frm_view_entries' ); |
| 7 | 7 | |
| 8 | - add_submenu_page('formidable', 'Formidable | ' . __( 'Entries', 'formidable' ), __( 'Entries', 'formidable' ), 'frm_view_entries', 'formidable-entries', 'FrmEntriesController::route' ); |
|
| 8 | + add_submenu_page( 'formidable', 'Formidable | ' . __( 'Entries', 'formidable' ), __( 'Entries', 'formidable' ), 'frm_view_entries', 'formidable-entries', 'FrmEntriesController::route' ); |
|
| 9 | 9 | |
| 10 | 10 | if ( ! in_array( FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' ), array( 'edit', 'show' ) ) ) { |
| 11 | 11 | $menu_name = FrmAppHelper::get_menu_name(); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | 'id' => 'formidable-entries-tab', |
| 54 | 54 | 'title' => __( 'Overview', 'formidable' ), |
| 55 | 55 | 'content' => '<p>' . esc_html__( 'This screen provides access to all of your entries. You can customize the display of this screen to suit your workflow.', 'formidable' ) . '</p> <p>' . esc_html__( 'Hovering over a row in the entries list will display action links that allow you to manage your entry.', 'formidable' ) . '</p>', |
| 56 | - )); |
|
| 56 | + ) ); |
|
| 57 | 57 | |
| 58 | 58 | $screen->set_help_sidebar( |
| 59 | 59 | '<p><strong>' . esc_html__( 'For more information:', 'formidable' ) . '</strong></p>' . |
@@ -68,20 +68,20 @@ discard block |
||
| 68 | 68 | global $frm_vars; |
| 69 | 69 | $form_id = FrmForm::get_current_form_id(); |
| 70 | 70 | |
| 71 | - $columns[ $form_id . '_id' ] = 'ID'; |
|
| 72 | - $columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 71 | + $columns[$form_id . '_id'] = 'ID'; |
|
| 72 | + $columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 73 | 73 | |
| 74 | 74 | if ( $form_id ) { |
| 75 | 75 | self::get_columns_for_form( $form_id, $columns ); |
| 76 | 76 | } else { |
| 77 | - $columns[ $form_id . '_form_id' ] = __( 'Form', 'formidable' ); |
|
| 78 | - $columns[ $form_id . '_name' ] = __( 'Entry Name', 'formidable' ); |
|
| 79 | - $columns[ $form_id . '_user_id' ] = __( 'Created By', 'formidable' ); |
|
| 77 | + $columns[$form_id . '_form_id'] = __( 'Form', 'formidable' ); |
|
| 78 | + $columns[$form_id . '_name'] = __( 'Entry Name', 'formidable' ); |
|
| 79 | + $columns[$form_id . '_user_id'] = __( 'Created By', 'formidable' ); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - $columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' ); |
|
| 83 | - $columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' ); |
|
| 84 | - $columns[ $form_id . '_ip' ] = 'IP'; |
|
| 82 | + $columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' ); |
|
| 83 | + $columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' ); |
|
| 84 | + $columns[$form_id . '_ip'] = 'IP'; |
|
| 85 | 85 | |
| 86 | 86 | $frm_vars['cols'] = $columns; |
| 87 | 87 | |
@@ -107,24 +107,24 @@ discard block |
||
| 107 | 107 | if ( $sub_form_cols ) { |
| 108 | 108 | foreach ( $sub_form_cols as $k => $sub_form_col ) { |
| 109 | 109 | if ( FrmField::is_no_save_field( $sub_form_col->type ) ) { |
| 110 | - unset( $sub_form_cols[ $k ] ); |
|
| 110 | + unset( $sub_form_cols[$k] ); |
|
| 111 | 111 | continue; |
| 112 | 112 | } |
| 113 | - $columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $form_col->id ] = FrmAppHelper::truncate( do_shortcode($sub_form_col->name), 35 ); |
|
| 114 | - unset($sub_form_col); |
|
| 113 | + $columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $form_col->id] = FrmAppHelper::truncate( do_shortcode( $sub_form_col->name ), 35 ); |
|
| 114 | + unset( $sub_form_col ); |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | - unset($sub_form_cols); |
|
| 117 | + unset( $sub_form_cols ); |
|
| 118 | 118 | } else { |
| 119 | 119 | $col_id = $form_col->field_key; |
| 120 | 120 | if ( $form_col->form_id != $form_id ) { |
| 121 | 121 | $col_id .= '-_-form' . $form_col->form_id; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - if ( isset($form_col->field_options['separate_value']) && $form_col->field_options['separate_value'] ) { |
|
| 125 | - $columns[ $form_id . '_frmsep_' . $col_id ] = FrmAppHelper::truncate( do_shortcode($form_col->name), 35 ); |
|
| 124 | + if ( isset( $form_col->field_options['separate_value'] ) && $form_col->field_options['separate_value'] ) { |
|
| 125 | + $columns[$form_id . '_frmsep_' . $col_id] = FrmAppHelper::truncate( do_shortcode( $form_col->name ), 35 ); |
|
| 126 | 126 | } |
| 127 | - $columns[ $form_id . '_' . $col_id ] = FrmAppHelper::truncate( do_shortcode($form_col->name), 35 ); |
|
| 127 | + $columns[$form_id . '_' . $col_id] = FrmAppHelper::truncate( do_shortcode( $form_col->name ), 35 ); |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | global $frm_vars; |
| 144 | 144 | //add a check so we don't create a loop |
| 145 | - $frm_vars['prev_hidden_cols'] = ( isset($frm_vars['prev_hidden_cols']) && $frm_vars['prev_hidden_cols'] ) ? false : $prev_value; |
|
| 145 | + $frm_vars['prev_hidden_cols'] = ( isset( $frm_vars['prev_hidden_cols'] ) && $frm_vars['prev_hidden_cols'] ) ? false : $prev_value; |
|
| 146 | 146 | |
| 147 | 147 | return $check; |
| 148 | 148 | } |
@@ -157,19 +157,19 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | global $frm_vars; |
| 160 | - if ( ! isset($frm_vars['prev_hidden_cols']) || ! $frm_vars['prev_hidden_cols'] ) { |
|
| 160 | + if ( ! isset( $frm_vars['prev_hidden_cols'] ) || ! $frm_vars['prev_hidden_cols'] ) { |
|
| 161 | 161 | return; //don't continue if there's no previous value |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | foreach ( $meta_value as $mk => $mv ) { |
| 165 | 165 | //remove blank values |
| 166 | 166 | if ( empty( $mv ) ) { |
| 167 | - unset( $meta_value[ $mk ] ); |
|
| 167 | + unset( $meta_value[$mk] ); |
|
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | - $cur_form_prefix = reset($meta_value); |
|
| 172 | - $cur_form_prefix = explode('_', $cur_form_prefix); |
|
| 171 | + $cur_form_prefix = reset( $meta_value ); |
|
| 172 | + $cur_form_prefix = explode( '_', $cur_form_prefix ); |
|
| 173 | 173 | $cur_form_prefix = $cur_form_prefix[0]; |
| 174 | 174 | $save = false; |
| 175 | 175 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | $meta_value[] = $prev_hidden; |
| 190 | 190 | $save = true; |
| 191 | - unset($form_prefix); |
|
| 191 | + unset( $form_prefix ); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | if ( $save ) { |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | foreach ( $fields as $field ) { |
| 221 | 221 | if ( $field->type != 'checkbox' && ( ! isset( $field->field_options['post_field'] ) || $field->field_options['post_field'] == '' ) ) { |
| 222 | 222 | // Can't sort on checkboxes because they are stored serialized, or post fields |
| 223 | - $columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id; |
|
| 223 | + $columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id; |
|
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | break; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - unset($form_prefix); |
|
| 246 | + unset( $form_prefix ); |
|
| 247 | 247 | } |
| 248 | 248 | } |
| 249 | 249 | |
@@ -251,15 +251,15 @@ discard block |
||
| 251 | 251 | return $result; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | - $i = isset($frm_vars['cols']) ? count($frm_vars['cols']) : 0; |
|
| 254 | + $i = isset( $frm_vars['cols'] ) ? count( $frm_vars['cols'] ) : 0; |
|
| 255 | 255 | $max_columns = 8; |
| 256 | 256 | if ( $i <= $max_columns ) { |
| 257 | 257 | return $result; |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | global $frm_vars; |
| 261 | - if ( isset($frm_vars['current_form']) && $frm_vars['current_form'] ) { |
|
| 262 | - $frm_vars['current_form']->options = maybe_unserialize($frm_vars['current_form']->options); |
|
| 261 | + if ( isset( $frm_vars['current_form'] ) && $frm_vars['current_form'] ) { |
|
| 262 | + $frm_vars['current_form']->options = maybe_unserialize( $frm_vars['current_form']->options ); |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | $has_custom_hidden_columns = ( isset( $frm_vars['current_form'] ) && $frm_vars['current_form'] && isset( $frm_vars['current_form']->options['hidden_cols'] ) && ! empty( $frm_vars['current_form']->options['hidden_cols'] ) ); |
@@ -267,23 +267,23 @@ discard block |
||
| 267 | 267 | $result = $frm_vars['current_form']->options['hidden_cols']; |
| 268 | 268 | } else { |
| 269 | 269 | $cols = $frm_vars['cols']; |
| 270 | - $cols = array_reverse($cols, true); |
|
| 270 | + $cols = array_reverse( $cols, true ); |
|
| 271 | 271 | |
| 272 | 272 | if ( $form_id ) { |
| 273 | 273 | $result[] = $form_id . '_id'; |
| 274 | - $i--; |
|
| 274 | + $i --; |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | $result[] = $form_id . '_item_key'; |
| 278 | - $i--; |
|
| 278 | + $i --; |
|
| 279 | 279 | |
| 280 | 280 | foreach ( $cols as $col_key => $col ) { |
| 281 | 281 | if ( $i > $max_columns ) { |
| 282 | 282 | $result[] = $col_key; |
| 283 | 283 | } |
| 284 | 284 | //remove some columns by default |
| 285 | - $i--; |
|
| 286 | - unset($col_key, $col); |
|
| 285 | + $i --; |
|
| 286 | + unset( $col_key, $col ); |
|
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | |
@@ -315,14 +315,14 @@ discard block |
||
| 315 | 315 | if ( $pagenum > $total_pages && $total_pages > 0 ) { |
| 316 | 316 | $url = add_query_arg( 'paged', $total_pages ); |
| 317 | 317 | if ( headers_sent() ) { |
| 318 | - echo FrmAppHelper::js_redirect($url); |
|
| 318 | + echo FrmAppHelper::js_redirect( $url ); |
|
| 319 | 319 | } else { |
| 320 | 320 | wp_redirect( esc_url_raw( $url ) ); |
| 321 | 321 | } |
| 322 | 322 | die(); |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | - if ( empty($message) && isset($_GET['import-message']) ) { |
|
| 325 | + if ( empty( $message ) && isset( $_GET['import-message'] ) ) { |
|
| 326 | 326 | $message = __( 'Your import is complete', 'formidable' ); |
| 327 | 327 | } |
| 328 | 328 | |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | |
| 340 | 340 | /* Back End CRUD */ |
| 341 | 341 | public static function show( $id = 0 ) { |
| 342 | - FrmAppHelper::permission_check('frm_view_entries'); |
|
| 342 | + FrmAppHelper::permission_check( 'frm_view_entries' ); |
|
| 343 | 343 | |
| 344 | 344 | if ( ! $id ) { |
| 345 | 345 | $id = FrmAppHelper::get_param( 'id', 0, 'get', 'absint' ); |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | } |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | - $entry = FrmEntry::getOne($id, true); |
|
| 352 | + $entry = FrmEntry::getOne( $id, true ); |
|
| 353 | 353 | if ( ! $entry ) { |
| 354 | 354 | echo '<div id="form_show_entry_page" class="wrap">' . |
| 355 | 355 | __( 'You are trying to view an entry that does not exist.', 'formidable' ) . |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | return; |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | - $data = maybe_unserialize($entry->description); |
|
| 360 | + $data = maybe_unserialize( $entry->description ); |
|
| 361 | 361 | if ( ! is_array( $data ) || ! isset( $data['referrer'] ) ) { |
| 362 | 362 | $data = array( 'referrer' => $data ); |
| 363 | 363 | } |
@@ -369,11 +369,11 @@ discard block |
||
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | public static function destroy() { |
| 372 | - FrmAppHelper::permission_check('frm_delete_entries'); |
|
| 372 | + FrmAppHelper::permission_check( 'frm_delete_entries' ); |
|
| 373 | 373 | |
| 374 | 374 | $params = FrmForm::get_admin_params(); |
| 375 | 375 | |
| 376 | - if ( isset($params['keep_post']) && $params['keep_post'] ) { |
|
| 376 | + if ( isset( $params['keep_post'] ) && $params['keep_post'] ) { |
|
| 377 | 377 | //unlink entry from post |
| 378 | 378 | global $wpdb; |
| 379 | 379 | $wpdb->update( $wpdb->prefix . 'frm_items', array( 'post_id' => '' ), array( 'id' => $params['id'] ) ); |
@@ -452,9 +452,9 @@ discard block |
||
| 452 | 452 | if ( ! isset( $frm_vars['form_params'] ) ) { |
| 453 | 453 | $frm_vars['form_params'] = array(); |
| 454 | 454 | } |
| 455 | - $frm_vars['form_params'][ $form->id ] = $params; |
|
| 455 | + $frm_vars['form_params'][$form->id] = $params; |
|
| 456 | 456 | |
| 457 | - if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) { |
|
| 457 | + if ( isset( $frm_vars['created_entries'][$form_id] ) ) { |
|
| 458 | 458 | return; |
| 459 | 459 | } |
| 460 | 460 | |
@@ -469,13 +469,13 @@ discard block |
||
| 469 | 469 | */ |
| 470 | 470 | $errors = apply_filters( 'frm_entries_before_create', $errors, $form ); |
| 471 | 471 | |
| 472 | - $frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors ); |
|
| 472 | + $frm_vars['created_entries'][$form_id] = array( 'errors' => $errors ); |
|
| 473 | 473 | |
| 474 | 474 | if ( empty( $errors ) ) { |
| 475 | 475 | $_POST['frm_skip_cookie'] = 1; |
| 476 | 476 | if ( $params['action'] == 'create' ) { |
| 477 | - if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) { |
|
| 478 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); |
|
| 477 | + if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) { |
|
| 478 | + $frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST ); |
|
| 479 | 479 | } |
| 480 | 480 | } |
| 481 | 481 | |
@@ -510,10 +510,10 @@ discard block |
||
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | public static function filter_shortcode_value( $value, $tag, $atts, $field ) { |
| 513 | - $plain_text = add_filter('frm_plain_text_email', true); |
|
| 513 | + $plain_text = add_filter( 'frm_plain_text_email', true ); |
|
| 514 | 514 | FrmEntryFormat::textarea_display_value( $field->type, $plain_text, $value ); |
| 515 | 515 | |
| 516 | - if ( isset($atts['show']) && $atts['show'] == 'value' ) { |
|
| 516 | + if ( isset( $atts['show'] ) && $atts['show'] == 'value' ) { |
|
| 517 | 517 | return $value; |
| 518 | 518 | } |
| 519 | 519 | |
@@ -526,9 +526,9 @@ discard block |
||
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | public static function entry_sidebar( $entry ) { |
| 529 | - $data = maybe_unserialize($entry->description); |
|
| 530 | - $date_format = get_option('date_format'); |
|
| 531 | - $time_format = get_option('time_format'); |
|
| 529 | + $data = maybe_unserialize( $entry->description ); |
|
| 530 | + $date_format = get_option( 'date_format' ); |
|
| 531 | + $time_format = get_option( 'time_format' ); |
|
| 532 | 532 | if ( isset( $data['browser'] ) ) { |
| 533 | 533 | $browser = FrmEntryFormat::get_browser( $data['browser'] ); |
| 534 | 534 | } |