Completed
Push — master ( 9a0984...263488 )
by Stephanie
11:38 queued 05:45
created
classes/views/styles/_field-labels.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <div class="field-group field-group-background clearfix frm-first-row">
2 2
 	<label><?php esc_html_e( 'Color', 'formidable' ) ?></label>
3
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('label_color') ) ?>" id="frm_label_color" class="hex" value="<?php echo esc_attr( $style->post_content['label_color'] ) ?>" />
3
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'label_color' ) ) ?>" id="frm_label_color" class="hex" value="<?php echo esc_attr( $style->post_content['label_color'] ) ?>" />
4 4
 </div>
5 5
 <div class="field-group clearfix frm-first-row">
6 6
 	<label><?php esc_html_e( 'Weight', 'formidable' ) ?></label>
7
-	<select name="<?php echo esc_attr( $frm_style->get_field_name('weight') ) ?>" id="frm_weight">
7
+	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'weight' ) ) ?>" id="frm_weight">
8 8
 		<?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?>
9 9
 		<option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['weight'], $value ) ?>><?php echo esc_html( $name ) ?></option>
10 10
 		<?php } ?>
@@ -12,14 +12,14 @@  discard block
 block discarded – undo
12 12
 </div>
13 13
 <div class="field-group clearfix frm-first-row">
14 14
 	<label><?php esc_html_e( 'Size', 'formidable' ) ?></label>
15
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('font_size') ) ?>" id="frm_font_size" value="<?php echo esc_attr($style->post_content['font_size']) ?>"  size="3" />
15
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'font_size' ) ) ?>" id="frm_font_size" value="<?php echo esc_attr( $style->post_content['font_size'] ) ?>"  size="3" />
16 16
 </div>
17 17
 
18 18
 <div class="field-group clearfix frm_clear">
19 19
 	<label><?php esc_html_e( 'Position', 'formidable' ) ?></label>
20
-	<select name="<?php echo esc_attr( $frm_style->get_field_name('position') ) ?>" id="frm_position">
20
+	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'position' ) ) ?>" id="frm_position">
21 21
 	    <?php foreach ( FrmStylesHelper::get_css_label_positions() as $pos => $pos_label ) { ?>
22
-	        <option value="<?php echo esc_attr( $pos ) ?>" <?php selected($style->post_content['position'], $pos) ?>><?php echo esc_html( $pos_label ) ?></option>
22
+	        <option value="<?php echo esc_attr( $pos ) ?>" <?php selected( $style->post_content['position'], $pos ) ?>><?php echo esc_html( $pos_label ) ?></option>
23 23
 	    <?php } ?>
24 24
 	</select>
25 25
 </div>
@@ -38,23 +38,23 @@  discard block
 block discarded – undo
38 38
 
39 39
 <div class="field-group clearfix">
40 40
 	<label><?php esc_html_e( 'Width', 'formidable' ) ?></label>
41
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('width') ) ?>" id="frm_width" value="<?php echo esc_attr( $style->post_content['width'] ) ?>" />
41
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'width' ) ) ?>" id="frm_width" value="<?php echo esc_attr( $style->post_content['width'] ) ?>" />
42 42
 </div>
43 43
 
44 44
 <div class="field-group clearfix frm_clear">
45 45
 	<label><?php esc_html_e( 'Padding', 'formidable' ) ?></label>
46
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('label_padding') ) ?>" id="frm_label_padding" value="<?php echo esc_attr( $style->post_content['label_padding'] ) ?>" />
46
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'label_padding' ) ) ?>" id="frm_label_padding" value="<?php echo esc_attr( $style->post_content['label_padding'] ) ?>" />
47 47
 </div>
48 48
 
49 49
 <div class="clear"></div>
50 50
 <h3><?php esc_html_e( 'Required Indicator', 'formidable' ) ?></h3>
51 51
 <div class="field-group field-group-border clearfix after-h3">
52 52
 	<label class="background"><?php esc_html_e( 'Color', 'formidable' ) ?></label>
53
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('required_color') ) ?>" id="frm_required_color" class="hex" value="<?php echo esc_attr( $style->post_content['required_color'] ) ?>" />
53
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'required_color' ) ) ?>" id="frm_required_color" class="hex" value="<?php echo esc_attr( $style->post_content['required_color'] ) ?>" />
54 54
 </div>
55 55
 <div class="field-group clearfix after-h3">
56 56
 	<label><?php esc_html_e( 'Weight', 'formidable' ) ?></label>
57
-	<select name="<?php echo esc_attr( $frm_style->get_field_name('required_weight') ) ?>" id="frm_required_weight">
57
+	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'required_weight' ) ) ?>" id="frm_required_weight">
58 58
 		<?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?>
59 59
 		<option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['required_weight'], $value ) ?>><?php echo esc_html( $name ) ?></option>
60 60
 		<?php } ?>
Please login to merge, or discard this patch.
classes/helpers/FrmFormsHelper.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -422,6 +422,9 @@
 block discarded – undo
422 422
         $reset_fields = true;
423 423
     }
424 424
 
425
+	/**
426
+	 * @return string
427
+	 */
425 428
 	public static function replace_shortcodes( $html, $form, $title = false, $description = false, $values = array() ) {
426 429
 		$codes = array(
427 430
 			'form_name' => $title,
Please login to merge, or discard this patch.
Indentation   +202 added lines, -202 removed lines patch added patch discarded remove patch
@@ -14,38 +14,38 @@  discard block
 block discarded – undo
14 14
 
15 15
 	public static function get_direct_link( $key, $form = false ) {
16 16
 		$target_url = esc_url( admin_url( 'admin-ajax.php?action=frm_forms_preview&form=' . $key ) );
17
-        $target_url = apply_filters('frm_direct_link', $target_url, $key, $form);
18
-
19
-        return $target_url;
20
-    }
21
-
22
-    public static function forms_dropdown( $field_name, $field_value = '', $args = array() ) {
23
-        $defaults = array(
24
-            'blank'     => true,
25
-            'field_id'  => false,
26
-            'onchange'  => false,
27
-            'exclude'   => false,
28
-            'class'     => '',
17
+		$target_url = apply_filters('frm_direct_link', $target_url, $key, $form);
18
+
19
+		return $target_url;
20
+	}
21
+
22
+	public static function forms_dropdown( $field_name, $field_value = '', $args = array() ) {
23
+		$defaults = array(
24
+			'blank'     => true,
25
+			'field_id'  => false,
26
+			'onchange'  => false,
27
+			'exclude'   => false,
28
+			'class'     => '',
29 29
 			'inc_children' => 'exclude',
30
-        );
31
-        $args = wp_parse_args( $args, $defaults );
30
+		);
31
+		$args = wp_parse_args( $args, $defaults );
32 32
 
33
-        if ( ! $args['field_id'] ) {
34
-            $args['field_id'] = $field_name;
35
-        }
33
+		if ( ! $args['field_id'] ) {
34
+			$args['field_id'] = $field_name;
35
+		}
36 36
 
37 37
 		$query = array();
38
-        if ( $args['exclude'] ) {
38
+		if ( $args['exclude'] ) {
39 39
 			$query['id !'] = $args['exclude'];
40
-        }
40
+		}
41 41
 
42
-        $where = apply_filters('frm_forms_dropdown', $query, $field_name);
42
+		$where = apply_filters('frm_forms_dropdown', $query, $field_name);
43 43
 		$forms = FrmForm::get_published_forms( $where, 999, $args['inc_children'] );
44 44
 		$add_html = array();
45 45
 		self::add_html_attr( $args['onchange'], 'onchange', $add_html );
46 46
 		self::add_html_attr( $args['class'], 'class', $add_html );
47 47
 
48
-        ?>
48
+		?>
49 49
 		<select name="<?php echo esc_attr( $field_name ); ?>" id="<?php echo esc_attr( $args['field_id'] ) ?>" <?php echo implode( ' ', $add_html ); ?>>
50 50
 		<?php if ( $args['blank'] ) { ?>
51 51
 			<option value=""><?php echo ( $args['blank'] == 1 ) ? ' ' : '- ' . esc_attr( $args['blank'] ) . ' -'; ?></option>
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		<?php } ?>
58 58
         </select>
59 59
         <?php
60
-    }
60
+	}
61 61
 
62 62
 	/**
63 63
 	 * @param string $class
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 		}
73 73
 	}
74 74
 
75
-    public static function form_switcher() {
75
+	public static function form_switcher() {
76 76
 		$where = apply_filters( 'frm_forms_dropdown', array(), '' );
77 77
 		$forms = FrmForm::get_published_forms( $where );
78 78
 
@@ -84,32 +84,32 @@  discard block
 block discarded – undo
84 84
 			unset( $args['form'] );
85 85
 		} else if ( isset( $_GET['form']) && ! isset( $_GET['id'] ) ) {
86 86
 			unset( $args['id'] );
87
-        }
87
+		}
88 88
 
89 89
 		$frm_action = FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' );
90 90
 		if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) && in_array( $frm_action, array( 'edit', 'show', 'destroy_all' ) ) ) {
91
-            $args['frm_action'] = 'list';
92
-            $args['form'] = 0;
91
+			$args['frm_action'] = 'list';
92
+			$args['form'] = 0;
93 93
 		} else if ( FrmAppHelper::is_admin_page('formidable' ) && in_array( $frm_action, array( 'new', 'duplicate' ) ) ) {
94
-            $args['frm_action'] = 'edit';
94
+			$args['frm_action'] = 'edit';
95 95
 		} else if ( isset( $_GET['post'] ) ) {
96
-            $args['form'] = 0;
97
-            $base = admin_url('edit.php?post_type=frm_display');
98
-        }
96
+			$args['form'] = 0;
97
+			$base = admin_url('edit.php?post_type=frm_display');
98
+		}
99 99
 
100
-        ?>
100
+		?>
101 101
 		<li id="frm_bs_dropdown" class="dropdown <?php echo esc_attr( is_rtl() ? 'pull-right' : 'pull-left' ) ?>">
102 102
 			<a href="#" id="frm-navbarDrop" class="frm-dropdown-toggle" data-toggle="dropdown"><?php esc_html_e( 'Switch Form', 'formidable' ) ?> <b class="caret"></b></a>
103 103
 		    <ul class="frm-dropdown-menu frm-on-top" role="menu" aria-labelledby="frm-navbarDrop">
104 104
 			<?php
105 105
 			foreach ( $forms as $form ) {
106 106
 				if ( isset( $args['id'] ) ) {
107
-			        $args['id'] = $form->id;
107
+					$args['id'] = $form->id;
108 108
 				}
109
-			    if ( isset( $args['form'] ) ) {
110
-			        $args['form'] = $form->id;
109
+				if ( isset( $args['form'] ) ) {
110
+					$args['form'] = $form->id;
111 111
 				}
112
-                ?>
112
+				?>
113 113
 				<li><a href="<?php echo esc_url( isset( $base ) ? add_query_arg( $args, $base ) : add_query_arg( $args ) ); ?>" tabindex="-1"><?php echo esc_html( empty( $form->name ) ? __( '(no title)' ) : FrmAppHelper::truncate( $form->name, 60 ) ); ?></a></li>
114 114
 			<?php
115 115
 				unset( $form );
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 			</ul>
119 119
 		</li>
120 120
         <?php
121
-    }
121
+	}
122 122
 
123 123
 	public static function get_sortable_classes( $col, $sort_col, $sort_dir ) {
124 124
 		echo ( $sort_col == $col ) ? 'sorted' : 'sortable';
@@ -171,18 +171,18 @@  discard block
 block discarded – undo
171 171
 		return $message;
172 172
 	}
173 173
 
174
-    /**
175
-     * Used when a form is created
176
-     */
177
-    public static function setup_new_vars( $values = array() ) {
178
-        global $wpdb;
174
+	/**
175
+	 * Used when a form is created
176
+	 */
177
+	public static function setup_new_vars( $values = array() ) {
178
+		global $wpdb;
179 179
 
180
-        if ( ! empty( $values ) ) {
181
-            $post_values = $values;
182
-        } else {
183
-            $values = array();
184
-            $post_values = isset($_POST) ? $_POST : array();
185
-        }
180
+		if ( ! empty( $values ) ) {
181
+			$post_values = $values;
182
+		} else {
183
+			$values = array();
184
+			$post_values = isset($_POST) ? $_POST : array();
185
+		}
186 186
 
187 187
 		$defaults = array(
188 188
 			'name' => '',
@@ -191,10 +191,10 @@  discard block
 block discarded – undo
191 191
 		foreach ( $defaults as $var => $default ) {
192 192
 			if ( ! isset( $values[ $var ] ) ) {
193 193
 				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
194
-            }
195
-        }
194
+			}
195
+		}
196 196
 
197
-        $values['description'] = FrmAppHelper::use_wpautop($values['description']);
197
+		$values['description'] = FrmAppHelper::use_wpautop($values['description']);
198 198
 
199 199
 		$defaults = array(
200 200
 			'form_id'        => '',
@@ -212,64 +212,64 @@  discard block
 block discarded – undo
212 212
 		}
213 213
 		unset( $defaults );
214 214
 
215
-        if ( ! isset( $values['form_key'] ) ) {
215
+		if ( ! isset( $values['form_key'] ) ) {
216 216
 			$values['form_key'] = ( $post_values && isset( $post_values['form_key'] ) ) ? $post_values['form_key'] : FrmAppHelper::get_unique_key( '', $wpdb->prefix . 'frm_forms', 'form_key' );
217
-        }
217
+		}
218 218
 
219 219
 		$values = self::fill_default_opts( $values, false, $post_values );
220 220
 		$values['custom_style'] = FrmAppHelper::custom_style_value( $post_values );
221 221
 
222
-        return apply_filters('frm_setup_new_form_vars', $values);
223
-    }
222
+		return apply_filters('frm_setup_new_form_vars', $values);
223
+	}
224 224
 
225
-    /**
226
-     * Used when editing a form
227
-     */
228
-    public static function setup_edit_vars( $values, $record, $post_values = array() ) {
225
+	/**
226
+	 * Used when editing a form
227
+	 */
228
+	public static function setup_edit_vars( $values, $record, $post_values = array() ) {
229 229
 		if ( empty( $post_values ) ) {
230 230
 			$post_values = stripslashes_deep( $_POST );
231 231
 		}
232 232
 
233
-        $values['form_key'] = isset($post_values['form_key']) ? $post_values['form_key'] : $record->form_key;
234
-        $values['default_template'] = isset($post_values['default_template']) ? $post_values['default_template'] : $record->default_template;
235
-        $values['is_template'] = isset($post_values['is_template']) ? $post_values['is_template'] : $record->is_template;
236
-        $values['status'] = $record->status;
233
+		$values['form_key'] = isset($post_values['form_key']) ? $post_values['form_key'] : $record->form_key;
234
+		$values['default_template'] = isset($post_values['default_template']) ? $post_values['default_template'] : $record->default_template;
235
+		$values['is_template'] = isset($post_values['is_template']) ? $post_values['is_template'] : $record->is_template;
236
+		$values['status'] = $record->status;
237 237
 
238
-        $values = self::fill_default_opts($values, $record, $post_values);
238
+		$values = self::fill_default_opts($values, $record, $post_values);
239 239
 
240
-        return apply_filters('frm_setup_edit_form_vars', $values);
241
-    }
240
+		return apply_filters('frm_setup_edit_form_vars', $values);
241
+	}
242 242
 
243 243
 	public static function fill_default_opts( $values, $record, $post_values ) {
244 244
 
245
-        $defaults = self::get_default_opts();
245
+		$defaults = self::get_default_opts();
246 246
 		foreach ( $defaults as $var => $default ) {
247
-            if ( is_array($default) ) {
248
-                if ( ! isset( $values[ $var ] ) ) {
247
+			if ( is_array($default) ) {
248
+				if ( ! isset( $values[ $var ] ) ) {
249 249
 					$values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array();
250
-                }
250
+				}
251 251
 
252
-                foreach ( $default as $k => $v ) {
252
+				foreach ( $default as $k => $v ) {
253 253
 					$values[ $var ][ $k ] = ( $post_values && isset( $post_values[ $var ][ $k ] ) ) ? $post_values[ $var ][ $k ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) ) ? $record->options[ $var ][ $k ] : $v );
254 254
 
255
-                    if ( is_array( $v ) ) {
256
-                        foreach ( $v as $k1 => $v1 ) {
255
+					if ( is_array( $v ) ) {
256
+						foreach ( $v as $k1 => $v1 ) {
257 257
 							$values[ $var ][ $k ][ $k1 ] = ( $post_values && isset( $post_values[ $var ][ $k ][ $k1 ] ) ) ? $post_values[ $var ][ $k ][ $k1 ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) && isset( $record->options[ $var ][ $k ][ $k1 ] ) ) ? $record->options[ $var ][ $k ][ $k1 ] : $v1 );
258
-                            unset( $k1, $v1 );
259
-                        }
260
-                    }
258
+							unset( $k1, $v1 );
259
+						}
260
+					}
261 261
 
262
-                    unset($k, $v);
263
-                }
264
-            } else {
262
+					unset($k, $v);
263
+				}
264
+			} else {
265 265
 				$values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default );
266
-            }
266
+			}
267 267
 
268
-            unset($var, $default);
269
-        }
268
+			unset($var, $default);
269
+		}
270 270
 
271
-        return $values;
272
-    }
271
+		return $values;
272
+	}
273 273
 
274 274
 	public static function get_default_opts() {
275 275
 		$frm_settings = FrmAppHelper::get_settings();
@@ -304,13 +304,13 @@  discard block
 block discarded – undo
304 304
 		}
305 305
 	}
306 306
 
307
-    /**
308
-     * @param string $loc
309
-     */
307
+	/**
308
+	 * @param string $loc
309
+	 */
310 310
 	public static function get_default_html( $loc ) {
311 311
 		if ( $loc == 'submit' ) {
312
-            $draft_link = self::get_draft_link();
313
-            $default_html = <<<SUBMIT_HTML
312
+			$draft_link = self::get_draft_link();
313
+			$default_html = <<<SUBMIT_HTML
314 314
 <div class="frm_submit">
315 315
 [if back_button]<button type="submit" name="frm_prev_page" formnovalidate="formnovalidate" class="frm_prev_page" [back_hook]>[back_label]</button>[/if back_button]
316 316
 <button class="frm_button_submit" type="submit"  [button_action]>[button_label]</button>
@@ -318,22 +318,22 @@  discard block
 block discarded – undo
318 318
 </div>
319 319
 SUBMIT_HTML;
320 320
 		} else if ( $loc == 'before' ) {
321
-            $default_html = <<<BEFORE_HTML
321
+			$default_html = <<<BEFORE_HTML
322 322
 <legend class="frm_screen_reader">[form_name]</legend>
323 323
 [if form_name]<h3 class="frm_form_title">[form_name]</h3>[/if form_name]
324 324
 [if form_description]<div class="frm_description">[form_description]</div>[/if form_description]
325 325
 BEFORE_HTML;
326 326
 		} else {
327
-            $default_html = '';
328
-        }
327
+			$default_html = '';
328
+		}
329 329
 
330
-        return $default_html;
331
-    }
330
+		return $default_html;
331
+	}
332 332
 
333
-    public static function get_draft_link() {
334
-        $link = '[if save_draft]<a href="#" class="frm_save_draft" [draft_hook]>[draft_label]</a>[/if save_draft]';
335
-        return $link;
336
-    }
333
+	public static function get_draft_link() {
334
+		$link = '[if save_draft]<a href="#" class="frm_save_draft" [draft_hook]>[draft_label]</a>[/if save_draft]';
335
+		return $link;
336
+	}
337 337
 
338 338
 	public static function get_custom_submit( $html, $form, $submit, $form_action, $values ) {
339 339
 		$button = self::replace_shortcodes( $html, $form, $submit, $form_action, $values );
@@ -360,13 +360,13 @@  discard block
 block discarded – undo
360 360
 		echo $button_parts[1];
361 361
 	}
362 362
 
363
-    /**
364
-     * Automatically add end section fields if they don't exist (2.0 migration)
365
-     * @since 2.0
366
-     *
367
-     * @param boolean $reset_fields
368
-     */
369
-    public static function auto_add_end_section_fields( $form, $fields, &$reset_fields ) {
363
+	/**
364
+	 * Automatically add end section fields if they don't exist (2.0 migration)
365
+	 * @since 2.0
366
+	 *
367
+	 * @param boolean $reset_fields
368
+	 */
369
+	public static function auto_add_end_section_fields( $form, $fields, &$reset_fields ) {
370 370
 		if ( empty( $fields ) ) {
371 371
 			return;
372 372
 		}
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 		$prev_order = false;
377 377
 		$add_order = 0;
378 378
 		$last_field = false;
379
-        foreach ( $fields as $field ) {
379
+		foreach ( $fields as $field ) {
380 380
 			if ( $prev_order === $field->field_order ) {
381 381
 				$add_order++;
382 382
 			}
@@ -387,48 +387,48 @@  discard block
 block discarded – undo
387 387
 				FrmField::update( $field->id, array( 'field_order' => $field->field_order ) );
388 388
 			}
389 389
 
390
-            switch ( $field->type ) {
391
-                case 'divider':
392
-                    // create an end section if open
390
+			switch ( $field->type ) {
391
+				case 'divider':
392
+					// create an end section if open
393 393
 					self::maybe_create_end_section( $open, $reset_fields, $add_order, $end_section_values, $field, 'move' );
394 394
 
395
-                    // mark it open for the next end section
396
-                    $open = true;
395
+					// mark it open for the next end section
396
+					$open = true;
397 397
 					break;
398
-                case 'break':
398
+				case 'break':
399 399
 					self::maybe_create_end_section( $open, $reset_fields, $add_order, $end_section_values, $field, 'move' );
400 400
 					break;
401
-                case 'end_divider':
402
-                    if ( ! $open ) {
403
-                        // the section isn't open, so this is an extra field that needs to be removed
404
-                        FrmField::destroy( $field->id );
405
-                        $reset_fields = true;
406
-                    }
407
-
408
-                    // There is already an end section here, so there is no need to create one
409
-                    $open = false;
410
-            }
401
+				case 'end_divider':
402
+					if ( ! $open ) {
403
+						// the section isn't open, so this is an extra field that needs to be removed
404
+						FrmField::destroy( $field->id );
405
+						$reset_fields = true;
406
+					}
407
+
408
+					// There is already an end section here, so there is no need to create one
409
+					$open = false;
410
+			}
411 411
 			$prev_order = $field->field_order;
412 412
 
413 413
 			$last_field = $field;
414 414
 			unset( $field );
415
-        }
415
+		}
416 416
 
417 417
 		self::maybe_create_end_section( $open, $reset_fields, $add_order, $end_section_values, $last_field );
418
-    }
418
+	}
419 419
 
420 420
 	/**
421 421
 	 * Create end section field if it doesn't exist. This is for migration from < 2.0
422 422
 	 * Fix any ordering that may be messed up
423 423
 	 */
424 424
 	public static function maybe_create_end_section( &$open, &$reset_fields, &$add_order, $end_section_values, $field, $move = 'no' ) {
425
-        if ( ! $open ) {
426
-            return;
427
-        }
425
+		if ( ! $open ) {
426
+			return;
427
+		}
428 428
 
429 429
 		$end_section_values['field_order'] = $field->field_order + 1;
430 430
 
431
-        FrmField::create( $end_section_values );
431
+		FrmField::create( $end_section_values );
432 432
 
433 433
 		if ( $move == 'move' ) {
434 434
 			// bump the order of current field unless we're at the end of the form
@@ -436,9 +436,9 @@  discard block
 block discarded – undo
436 436
 		}
437 437
 
438 438
 		$add_order += 2;
439
-        $open = false;
440
-        $reset_fields = true;
441
-    }
439
+		$open = false;
440
+		$reset_fields = true;
441
+	}
442 442
 
443 443
 	public static function replace_shortcodes( $html, $form, $title = false, $description = false, $values = array() ) {
444 444
 		$codes = array(
@@ -447,33 +447,33 @@  discard block
 block discarded – undo
447 447
 			'entry_key' => true,
448 448
 		);
449 449
 		foreach ( $codes as $code => $show ) {
450
-            if ( $code == 'form_name' ) {
451
-                $replace_with = $form->name;
452
-            } else if ( $code == 'form_description' ) {
453
-                $replace_with = FrmAppHelper::use_wpautop($form->description);
454
-            } else if ( $code == 'entry_key' && isset($_GET) && isset($_GET['entry']) ) {
455
-                $replace_with = FrmAppHelper::simple_get( 'entry' );
456
-            } else {
457
-                $replace_with = '';
458
-            }
450
+			if ( $code == 'form_name' ) {
451
+				$replace_with = $form->name;
452
+			} else if ( $code == 'form_description' ) {
453
+				$replace_with = FrmAppHelper::use_wpautop($form->description);
454
+			} else if ( $code == 'entry_key' && isset($_GET) && isset($_GET['entry']) ) {
455
+				$replace_with = FrmAppHelper::simple_get( 'entry' );
456
+			} else {
457
+				$replace_with = '';
458
+			}
459 459
 
460 460
 			FrmShortcodeHelper::remove_inline_conditions( ( FrmAppHelper::is_true( $show ) && $replace_with != '' ), $code, $replace_with, $html );
461
-        }
461
+		}
462 462
 
463
-        //replace [form_key]
464
-        $html = str_replace('[form_key]', $form->form_key, $html);
463
+		//replace [form_key]
464
+		$html = str_replace('[form_key]', $form->form_key, $html);
465 465
 
466
-        //replace [frmurl]
467
-        $html = str_replace('[frmurl]', FrmFieldsHelper::dynamic_default_values( 'frmurl' ), $html);
466
+		//replace [frmurl]
467
+		$html = str_replace('[frmurl]', FrmFieldsHelper::dynamic_default_values( 'frmurl' ), $html);
468 468
 
469 469
 		if ( strpos( $html, '[button_label]' ) ) {
470 470
 			add_filter( 'frm_submit_button', 'FrmFormsHelper::submit_button_label', 1 );
471 471
 			$submit_label = apply_filters( 'frm_submit_button', $title, $form );
472 472
 			$submit_label = esc_attr( do_shortcode( $submit_label ) );
473 473
 			$html = str_replace( '[button_label]', $submit_label, $html );
474
-        }
474
+		}
475 475
 
476
-        $html = apply_filters('frm_form_replace_shortcodes', $html, $form, $values);
476
+		$html = apply_filters('frm_form_replace_shortcodes', $html, $form, $values);
477 477
 
478 478
 		if ( strpos( $html, '[if back_button]' ) ) {
479 479
 			$html = preg_replace( '/(\[if\s+back_button\])(.*?)(\[\/if\s+back_button\])/mis', '', $html );
@@ -487,17 +487,17 @@  discard block
 block discarded – undo
487 487
 			$html = do_shortcode( $html );
488 488
 		}
489 489
 
490
-        return $html;
491
-    }
490
+		return $html;
491
+	}
492 492
 
493 493
 	public static function submit_button_label( $submit ) {
494
-        if ( ! $submit || empty($submit) ) {
495
-            $frm_settings = FrmAppHelper::get_settings();
496
-            $submit = $frm_settings->submit_value;
497
-        }
494
+		if ( ! $submit || empty($submit) ) {
495
+			$frm_settings = FrmAppHelper::get_settings();
496
+			$submit = $frm_settings->submit_value;
497
+		}
498 498
 
499
-        return $submit;
500
-    }
499
+		return $submit;
500
+	}
501 501
 
502 502
 	/**
503 503
 	 * If the Formidable styling isn't being loaded,
@@ -514,19 +514,19 @@  discard block
 block discarded – undo
514 514
 	}
515 515
 
516 516
 	public static function get_form_style_class( $form = false ) {
517
-        $style = self::get_form_style($form);
518
-        $class = ' with_frm_style';
519
-
520
-        if ( empty($style) ) {
521
-            if ( FrmAppHelper::is_admin_page('formidable-entries') ) {
522
-                return $class;
523
-            } else {
524
-                return;
525
-            }
526
-        }
527
-
528
-        //If submit button needs to be inline or centered
529
-        if ( is_object($form) ) {
517
+		$style = self::get_form_style($form);
518
+		$class = ' with_frm_style';
519
+
520
+		if ( empty($style) ) {
521
+			if ( FrmAppHelper::is_admin_page('formidable-entries') ) {
522
+				return $class;
523
+			} else {
524
+				return;
525
+			}
526
+		}
527
+
528
+		//If submit button needs to be inline or centered
529
+		if ( is_object($form) ) {
530 530
 			$form = $form->options;
531 531
 		}
532 532
 
@@ -539,10 +539,10 @@  discard block
 block discarded – undo
539 539
 			$class .= ' frm_center_submit';
540 540
 		}
541 541
 
542
-        $class = apply_filters('frm_add_form_style_class', $class, $style);
542
+		$class = apply_filters('frm_add_form_style_class', $class, $style);
543 543
 
544
-        return $class;
545
-    }
544
+		return $class;
545
+	}
546 546
 
547 547
 	/**
548 548
 	 * Returns appropriate class if form has top labels
@@ -593,12 +593,12 @@  discard block
 block discarded – undo
593 593
 		return in_array( $label_position, array( 'top', 'inside', 'hidden' ) );
594 594
 	}
595 595
 
596
-    /**
597
-     * @param string|boolean $form
598
-     *
599
-     * @return string
600
-     */
601
-    public static function get_form_style( $form ) {
596
+	/**
597
+	 * @param string|boolean $form
598
+	 *
599
+	 * @return string
600
+	 */
601
+	public static function get_form_style( $form ) {
602 602
 		$style = 1;
603 603
 		if ( empty( $form ) || 'default' == 'form' ) {
604 604
 			return $style;
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 		$style = ( $form && is_object( $form ) && isset( $form->options['custom_style'] ) ) ? $form->options['custom_style'] : $style;
619 619
 
620 620
 		return $style;
621
-    }
621
+	}
622 622
 
623 623
 	/**
624 624
 	 * Display the validation error messages when an entry is submitted
@@ -687,8 +687,8 @@  discard block
 block discarded – undo
687 687
 	}
688 688
 
689 689
 	public static function get_scroll_js( $form_id ) {
690
-        echo '<script type="text/javascript">document.addEventListener(\'DOMContentLoaded\',function(){frmFrontForm.scrollMsg(' . (int) $form_id . ');})</script>';
691
-    }
690
+		echo '<script type="text/javascript">document.addEventListener(\'DOMContentLoaded\',function(){frmFrontForm.scrollMsg(' . (int) $form_id . ');})</script>';
691
+	}
692 692
 
693 693
 	/**
694 694
 	 * @since 3.0
@@ -742,21 +742,21 @@  discard block
 block discarded – undo
742 742
 	}
743 743
 
744 744
 	public static function edit_form_link( $form_id ) {
745
-        if ( is_object($form_id) ) {
746
-            $form = $form_id;
747
-            $name = $form->name;
748
-            $form_id = $form->id;
749
-        } else {
750
-            $name = FrmForm::getName($form_id);
751
-        }
752
-
753
-        if ( $form_id ) {
745
+		if ( is_object($form_id) ) {
746
+			$form = $form_id;
747
+			$name = $form->name;
748
+			$form_id = $form->id;
749
+		} else {
750
+			$name = FrmForm::getName($form_id);
751
+		}
752
+
753
+		if ( $form_id ) {
754 754
 			$val = '<a href="' . esc_url( admin_url( 'admin.php?page=formidable&frm_action=edit&id=' . $form_id ) ) . '">' . ( '' == $name ? __( '(no title)' ) : FrmAppHelper::truncate( $name, 40 ) ) . '</a>';
755
-	    } else {
756
-	        $val = '';
757
-	    }
755
+		} else {
756
+			$val = '';
757
+		}
758 758
 
759
-	    return $val;
759
+		return $val;
760 760
 	}
761 761
 
762 762
 	public static function delete_trash_link( $id, $status, $length = 'label' ) {
@@ -918,18 +918,18 @@  discard block
 block discarded – undo
918 918
 	}
919 919
 
920 920
 	public static function status_nice_name( $status ) {
921
-        $nice_names = array(
922
-            'draft'     => __( 'Draft', 'formidable' ),
923
-            'trash'     => __( 'Trash', 'formidable' ),
924
-            'publish'   => __( 'Published', 'formidable' ),
925
-        );
921
+		$nice_names = array(
922
+			'draft'     => __( 'Draft', 'formidable' ),
923
+			'trash'     => __( 'Trash', 'formidable' ),
924
+			'publish'   => __( 'Published', 'formidable' ),
925
+		);
926 926
 
927
-        if ( ! in_array($status, array_keys($nice_names)) ) {
928
-            $status = 'publish';
929
-        }
927
+		if ( ! in_array($status, array_keys($nice_names)) ) {
928
+			$status = 'publish';
929
+		}
930 930
 
931 931
 		$name = $nice_names[ $status ];
932 932
 
933
-        return $name;
934
-    }
933
+		return $name;
934
+	}
935 935
 }
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined('ABSPATH') ) {
2
+if ( ! defined( 'ABSPATH' ) ) {
3 3
 	die( 'You are not allowed to call this page directly.' );
4 4
 }
5 5
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 	public static function get_direct_link( $key, $form = false ) {
16 16
 		$target_url = esc_url( admin_url( 'admin-ajax.php?action=frm_forms_preview&form=' . $key ) );
17
-        $target_url = apply_filters('frm_direct_link', $target_url, $key, $form);
17
+        $target_url = apply_filters( 'frm_direct_link', $target_url, $key, $form );
18 18
 
19 19
         return $target_url;
20 20
     }
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 			$query['id !'] = $args['exclude'];
40 40
         }
41 41
 
42
-        $where = apply_filters('frm_forms_dropdown', $query, $field_name);
42
+        $where = apply_filters( 'frm_forms_dropdown', $query, $field_name );
43 43
 		$forms = FrmForm::get_published_forms( $where, 999, $args['inc_children'] );
44 44
 		$add_html = array();
45 45
 		self::add_html_attr( $args['onchange'], 'onchange', $add_html );
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 */
69 69
 	public static function add_html_attr( $class, $param, &$add_html ) {
70 70
 		if ( ! empty( $class ) ) {
71
-			$add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
71
+			$add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
72 72
 		}
73 73
 	}
74 74
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 		);
83 83
 		if ( isset( $_GET['id'] ) && ! isset( $_GET['form'] ) ) {
84 84
 			unset( $args['form'] );
85
-		} else if ( isset( $_GET['form']) && ! isset( $_GET['id'] ) ) {
85
+		} else if ( isset( $_GET['form'] ) && ! isset( $_GET['id'] ) ) {
86 86
 			unset( $args['id'] );
87 87
         }
88 88
 
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 		if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) && in_array( $frm_action, array( 'edit', 'show', 'destroy_all' ) ) ) {
91 91
             $args['frm_action'] = 'list';
92 92
             $args['form'] = 0;
93
-		} else if ( FrmAppHelper::is_admin_page('formidable' ) && in_array( $frm_action, array( 'new', 'duplicate' ) ) ) {
93
+		} else if ( FrmAppHelper::is_admin_page( 'formidable' ) && in_array( $frm_action, array( 'new', 'duplicate' ) ) ) {
94 94
             $args['frm_action'] = 'edit';
95 95
 		} else if ( isset( $_GET['post'] ) ) {
96 96
             $args['form'] = 0;
97
-            $base = admin_url('edit.php?post_type=frm_display');
97
+            $base = admin_url( 'edit.php?post_type=frm_display' );
98 98
         }
99 99
 
100 100
         ?>
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             $post_values = $values;
182 182
         } else {
183 183
             $values = array();
184
-            $post_values = isset($_POST) ? $_POST : array();
184
+            $post_values = isset( $_POST ) ? $_POST : array();
185 185
         }
186 186
 
187 187
 		$defaults = array(
@@ -189,12 +189,12 @@  discard block
 block discarded – undo
189 189
 			'description' => '',
190 190
 		);
191 191
 		foreach ( $defaults as $var => $default ) {
192
-			if ( ! isset( $values[ $var ] ) ) {
193
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
192
+			if ( ! isset( $values[$var] ) ) {
193
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
194 194
             }
195 195
         }
196 196
 
197
-        $values['description'] = FrmAppHelper::use_wpautop($values['description']);
197
+        $values['description'] = FrmAppHelper::use_wpautop( $values['description'] );
198 198
 
199 199
 		$defaults = array(
200 200
 			'form_id'        => '',
@@ -206,8 +206,8 @@  discard block
 block discarded – undo
206 206
 			'parent_form_id' => 0,
207 207
 		);
208 208
 		foreach ( $defaults as $var => $default ) {
209
-			if ( ! isset( $values[ $var ] ) ) {
210
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
209
+			if ( ! isset( $values[$var] ) ) {
210
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
211 211
 			}
212 212
 		}
213 213
 		unset( $defaults );
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 		$values = self::fill_default_opts( $values, false, $post_values );
220 220
 		$values['custom_style'] = FrmAppHelper::custom_style_value( $post_values );
221 221
 
222
-        return apply_filters('frm_setup_new_form_vars', $values);
222
+        return apply_filters( 'frm_setup_new_form_vars', $values );
223 223
     }
224 224
 
225 225
     /**
@@ -230,42 +230,42 @@  discard block
 block discarded – undo
230 230
 			$post_values = stripslashes_deep( $_POST );
231 231
 		}
232 232
 
233
-        $values['form_key'] = isset($post_values['form_key']) ? $post_values['form_key'] : $record->form_key;
234
-        $values['default_template'] = isset($post_values['default_template']) ? $post_values['default_template'] : $record->default_template;
235
-        $values['is_template'] = isset($post_values['is_template']) ? $post_values['is_template'] : $record->is_template;
233
+        $values['form_key'] = isset( $post_values['form_key'] ) ? $post_values['form_key'] : $record->form_key;
234
+        $values['default_template'] = isset( $post_values['default_template'] ) ? $post_values['default_template'] : $record->default_template;
235
+        $values['is_template'] = isset( $post_values['is_template'] ) ? $post_values['is_template'] : $record->is_template;
236 236
         $values['status'] = $record->status;
237 237
 
238
-        $values = self::fill_default_opts($values, $record, $post_values);
238
+        $values = self::fill_default_opts( $values, $record, $post_values );
239 239
 
240
-        return apply_filters('frm_setup_edit_form_vars', $values);
240
+        return apply_filters( 'frm_setup_edit_form_vars', $values );
241 241
     }
242 242
 
243 243
 	public static function fill_default_opts( $values, $record, $post_values ) {
244 244
 
245 245
         $defaults = self::get_default_opts();
246 246
 		foreach ( $defaults as $var => $default ) {
247
-            if ( is_array($default) ) {
248
-                if ( ! isset( $values[ $var ] ) ) {
249
-					$values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array();
247
+            if ( is_array( $default ) ) {
248
+                if ( ! isset( $values[$var] ) ) {
249
+					$values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array();
250 250
                 }
251 251
 
252 252
                 foreach ( $default as $k => $v ) {
253
-					$values[ $var ][ $k ] = ( $post_values && isset( $post_values[ $var ][ $k ] ) ) ? $post_values[ $var ][ $k ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) ) ? $record->options[ $var ][ $k ] : $v );
253
+					$values[$var][$k] = ( $post_values && isset( $post_values[$var][$k] ) ) ? $post_values[$var][$k] : ( ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) ) ? $record->options[$var][$k] : $v );
254 254
 
255 255
                     if ( is_array( $v ) ) {
256 256
                         foreach ( $v as $k1 => $v1 ) {
257
-							$values[ $var ][ $k ][ $k1 ] = ( $post_values && isset( $post_values[ $var ][ $k ][ $k1 ] ) ) ? $post_values[ $var ][ $k ][ $k1 ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) && isset( $record->options[ $var ][ $k ][ $k1 ] ) ) ? $record->options[ $var ][ $k ][ $k1 ] : $v1 );
257
+							$values[$var][$k][$k1] = ( $post_values && isset( $post_values[$var][$k][$k1] ) ) ? $post_values[$var][$k][$k1] : ( ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) && isset( $record->options[$var][$k][$k1] ) ) ? $record->options[$var][$k][$k1] : $v1 );
258 258
                             unset( $k1, $v1 );
259 259
                         }
260 260
                     }
261 261
 
262
-                    unset($k, $v);
262
+                    unset( $k, $v );
263 263
                 }
264 264
             } else {
265
-				$values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default );
265
+				$values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default );
266 266
             }
267 267
 
268
-            unset($var, $default);
268
+            unset( $var, $default );
269 269
         }
270 270
 
271 271
         return $values;
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 	public static function fill_form_options( &$options, $values ) {
300 300
 		$defaults = self::get_default_opts();
301 301
 		foreach ( $defaults as $var => $default ) {
302
-			$options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default;
302
+			$options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default;
303 303
 			unset( $var, $default );
304 304
 		}
305 305
 	}
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 		$last_field = false;
379 379
         foreach ( $fields as $field ) {
380 380
 			if ( $prev_order === $field->field_order ) {
381
-				$add_order++;
381
+				$add_order ++;
382 382
 			}
383 383
 
384 384
 			if ( $add_order ) {
@@ -450,8 +450,8 @@  discard block
 block discarded – undo
450 450
             if ( $code == 'form_name' ) {
451 451
                 $replace_with = $form->name;
452 452
             } else if ( $code == 'form_description' ) {
453
-                $replace_with = FrmAppHelper::use_wpautop($form->description);
454
-            } else if ( $code == 'entry_key' && isset($_GET) && isset($_GET['entry']) ) {
453
+                $replace_with = FrmAppHelper::use_wpautop( $form->description );
454
+            } else if ( $code == 'entry_key' && isset( $_GET ) && isset( $_GET['entry'] ) ) {
455 455
                 $replace_with = FrmAppHelper::simple_get( 'entry' );
456 456
             } else {
457 457
                 $replace_with = '';
@@ -461,10 +461,10 @@  discard block
 block discarded – undo
461 461
         }
462 462
 
463 463
         //replace [form_key]
464
-        $html = str_replace('[form_key]', $form->form_key, $html);
464
+        $html = str_replace( '[form_key]', $form->form_key, $html );
465 465
 
466 466
         //replace [frmurl]
467
-        $html = str_replace('[frmurl]', FrmFieldsHelper::dynamic_default_values( 'frmurl' ), $html);
467
+        $html = str_replace( '[frmurl]', FrmFieldsHelper::dynamic_default_values( 'frmurl' ), $html );
468 468
 
469 469
 		if ( strpos( $html, '[button_label]' ) ) {
470 470
 			add_filter( 'frm_submit_button', 'FrmFormsHelper::submit_button_label', 1 );
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 			$html = str_replace( '[button_label]', $submit_label, $html );
474 474
         }
475 475
 
476
-        $html = apply_filters('frm_form_replace_shortcodes', $html, $form, $values);
476
+        $html = apply_filters( 'frm_form_replace_shortcodes', $html, $form, $values );
477 477
 
478 478
 		if ( strpos( $html, '[if back_button]' ) ) {
479 479
 			$html = preg_replace( '/(\[if\s+back_button\])(.*?)(\[\/if\s+back_button\])/mis', '', $html );
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
     }
492 492
 
493 493
 	public static function submit_button_label( $submit ) {
494
-        if ( ! $submit || empty($submit) ) {
494
+        if ( ! $submit || empty( $submit ) ) {
495 495
             $frm_settings = FrmAppHelper::get_settings();
496 496
             $submit = $frm_settings->submit_value;
497 497
         }
@@ -514,11 +514,11 @@  discard block
 block discarded – undo
514 514
 	}
515 515
 
516 516
 	public static function get_form_style_class( $form = false ) {
517
-        $style = self::get_form_style($form);
517
+        $style = self::get_form_style( $form );
518 518
         $class = ' with_frm_style';
519 519
 
520
-        if ( empty($style) ) {
521
-            if ( FrmAppHelper::is_admin_page('formidable-entries') ) {
520
+        if ( empty( $style ) ) {
521
+            if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) ) {
522 522
                 return $class;
523 523
             } else {
524 524
                 return;
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
         }
527 527
 
528 528
         //If submit button needs to be inline or centered
529
-        if ( is_object($form) ) {
529
+        if ( is_object( $form ) ) {
530 530
 			$form = $form->options;
531 531
 		}
532 532
 
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 			$class .= ' frm_center_submit';
540 540
 		}
541 541
 
542
-        $class = apply_filters('frm_add_form_style_class', $class, $style);
542
+        $class = apply_filters( 'frm_add_form_style_class', $class, $style );
543 543
 
544 544
         return $class;
545 545
     }
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
 	 * @since 3.0
695 695
 	 */
696 696
 	public static function actions_dropdown( $atts ) {
697
-		if ( FrmAppHelper::is_admin_page('formidable' ) ) {
697
+		if ( FrmAppHelper::is_admin_page( 'formidable' ) ) {
698 698
 			$status = $atts['status'];
699 699
 			$form_id = isset( $atts['id'] ) ? $atts['id'] : FrmAppHelper::get_param( 'id', 0, 'get', 'absint' );
700 700
 			$trash_link = self::delete_trash_info( $form_id, $status );
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 		if ( 'trash' == $form->status ) {
717 717
 			$actions['restore'] = $trash_links['restore'];
718 718
 
719
-			if ( current_user_can('frm_delete_forms') ) {
719
+			if ( current_user_can( 'frm_delete_forms' ) ) {
720 720
 				$actions['trash'] = $trash_links['delete'];
721 721
 			}
722 722
 		} else {
@@ -742,12 +742,12 @@  discard block
 block discarded – undo
742 742
 	}
743 743
 
744 744
 	public static function edit_form_link( $form_id ) {
745
-        if ( is_object($form_id) ) {
745
+        if ( is_object( $form_id ) ) {
746 746
             $form = $form_id;
747 747
             $name = $form->name;
748 748
             $form_id = $form->id;
749 749
         } else {
750
-            $name = FrmForm::getName($form_id);
750
+            $name = FrmForm::getName( $form_id );
751 751
         }
752 752
 
753 753
         if ( $form_id ) {
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
 			} elseif ( isset( $link_details['confirm'] ) ) {
780 780
 				$link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"';
781 781
 			}
782
-			$label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] );
782
+			$label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] );
783 783
 			$link .= '>' . $label . '</a>';
784 784
 		}
785 785
 		return $link;
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
 
794 794
 		if ( 'trash' == $status ) {
795 795
 			$info = $labels['restore'];
796
-		} elseif ( current_user_can('frm_delete_forms') ) {
796
+		} elseif ( current_user_can( 'frm_delete_forms' ) ) {
797 797
 			if ( EMPTY_TRASH_DAYS ) {
798 798
 				$info = $labels['trash'];
799 799
 			} else {
@@ -924,11 +924,11 @@  discard block
 block discarded – undo
924 924
             'publish'   => __( 'Published', 'formidable' ),
925 925
         );
926 926
 
927
-        if ( ! in_array($status, array_keys($nice_names)) ) {
927
+        if ( ! in_array( $status, array_keys( $nice_names ) ) ) {
928 928
             $status = 'publish';
929 929
         }
930 930
 
931
-		$name = $nice_names[ $status ];
931
+		$name = $nice_names[$status];
932 932
 
933 933
         return $name;
934 934
     }
Please login to merge, or discard this patch.
classes/helpers/FrmListHelper.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -259,6 +259,9 @@  discard block
 block discarded – undo
259 259
 <?php
260 260
 	}
261 261
 
262
+	/**
263
+	 * @param string $param_name
264
+	 */
262 265
 	private function hidden_search_inputs( $param_name ) {
263 266
 		if ( ! empty( $_REQUEST[ $param_name ] ) ) {
264 267
 			echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $_REQUEST[ $param_name ] ) . '" />';
@@ -397,6 +400,9 @@  discard block
 block discarded – undo
397 400
 		return $action;
398 401
 	}
399 402
 
403
+	/**
404
+	 * @param string $action_name
405
+	 */
400 406
 	private static function get_bulk_action( $action_name ) {
401 407
 		$action = false;
402 408
 		$action_param = self::get_param( array(
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
 	protected $modes = array();
68 68
 
69 69
 	/**
70
-	*
71
-	* @var array
72
-	*/
73
-    protected $params;
70
+	 *
71
+	 * @var array
72
+	 */
73
+	protected $params;
74 74
 
75 75
 	/**
76 76
 	 * Stores the value returned by ->get_column_info()
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
 	protected $compat_methods = array( 'set_pagination_args', 'get_views', 'get_bulk_actions', 'bulk_actions', 'row_actions', 'view_switcher', 'get_items_per_page', 'pagination', 'get_sortable_columns', 'get_column_info', 'get_table_classes', 'display_tablenav', 'extra_tablenav', 'single_row_columns' );
85 85
 
86 86
 	/**
87
-	* Construct the table object
88
-	*/
87
+	 * Construct the table object
88
+	 */
89 89
 	public function __construct( $args ) {
90
-	    $args = wp_parse_args( $args, array(
90
+		$args = wp_parse_args( $args, array(
91 91
 			'params' => array(),
92 92
 			'plural' => '',
93 93
 			'singular' => '',
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined('ABSPATH') ) {
2
+if ( ! defined( 'ABSPATH' ) ) {
3 3
 	die( 'You are not allowed to call this page directly.' );
4 4
 }
5 5
 
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
 			return $this->get_pagenum();
205 205
 		}
206 206
 
207
-		if ( isset( $this->_pagination_args[ $key ] ) ) {
208
-			return $this->_pagination_args[ $key ];
207
+		if ( isset( $this->_pagination_args[$key] ) ) {
208
+			return $this->_pagination_args[$key];
209 209
 		}
210 210
 	}
211 211
 
@@ -260,8 +260,8 @@  discard block
 block discarded – undo
260 260
 	}
261 261
 
262 262
 	private function hidden_search_inputs( $param_name ) {
263
-		if ( ! empty( $_REQUEST[ $param_name ] ) ) {
264
-			echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $_REQUEST[ $param_name ] ) . '" />';
263
+		if ( ! empty( $_REQUEST[$param_name] ) ) {
264
+			echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $_REQUEST[$param_name] ) . '" />';
265 265
 		}
266 266
 	}
267 267
 
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 
305 305
 		echo "<ul class='subsubsub'>\n";
306 306
 		foreach ( $views as $class => $view ) {
307
-			$views[ $class ] = "\t<li class='$class'>$view";
307
+			$views[$class] = "\t<li class='$class'>$view";
308 308
 		}
309 309
 		echo implode( " |</li>\n", $views ) . "</li>\n";
310 310
 		echo '</ul>';
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 
430 430
 		$out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
431 431
 		foreach ( $actions as $action => $link ) {
432
-			++$i;
432
+			++ $i;
433 433
 			( $i == $action_count ) ? $sep = '' : $sep = ' | ';
434 434
 			$out .= "<span class='$action'>$link$sep</span>";
435 435
 		}
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 			'prev'  => __( 'Previous page' ),
643 643
 			'next'  => __( 'Next page' ),
644 644
 		);
645
-		return $labels[ $link ];
645
+		return $labels[$link];
646 646
 	}
647 647
 
648 648
 	private function current_url() {
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
 
731 731
 		// If the primary column doesn't exist fall back to the
732 732
 		// first non-checkbox column.
733
-		if ( ! isset( $columns[ $default ] ) ) {
733
+		if ( ! isset( $columns[$default] ) ) {
734 734
 			$default = FrmListHelper::get_default_primary_column_name();
735 735
 		}
736 736
 
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
 		 */
745 745
 		$column  = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
746 746
 
747
-		if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
747
+		if ( empty( $column ) || ! isset( $columns[$column] ) ) {
748 748
 			$column = $default;
749 749
 		}
750 750
 
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
 			// In 4.3, we added a fourth argument for primary column.
767 767
 			$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
768 768
 			foreach ( $this->_column_headers as $key => $value ) {
769
-				$column_headers[ $key ] = $value;
769
+				$column_headers[$key] = $value;
770 770
 			}
771 771
 
772 772
 			return $column_headers;
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
 				$data[1] = false;
800 800
 			}
801 801
 
802
-			$sortable[ $id ] = $data;
802
+			$sortable[$id] = $data;
803 803
 		}
804 804
 
805 805
 		$primary = $this->get_primary_column_name();
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 			static $cb_counter = 1;
855 855
 			$columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
856 856
 				. '<input id="cb-select-all-' . esc_attr( $cb_counter ) . '" type="checkbox" />';
857
-			$cb_counter++;
857
+			$cb_counter ++;
858 858
 		}
859 859
 
860 860
 		foreach ( $columns as $column_key => $column_display_name ) {
@@ -874,8 +874,8 @@  discard block
 block discarded – undo
874 874
 				$class[] = 'column-primary';
875 875
 			}
876 876
 
877
-			if ( isset( $sortable[ $column_key ] ) ) {
878
-				list( $orderby, $desc_first ) = $sortable[ $column_key ];
877
+			if ( isset( $sortable[$column_key] ) ) {
878
+				list( $orderby, $desc_first ) = $sortable[$column_key];
879 879
 
880 880
 				if ( $current_orderby == $orderby ) {
881 881
 					$order = 'asc' == $current_order ? 'desc' : 'asc';
Please login to merge, or discard this patch.
classes/views/frm-forms/shortcode_opts.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 <?php
15 15
 foreach ( $opts as $opt => $val ) {
16 16
 	if ( isset( $val['type'] ) && 'text' === $val['type'] ) {
17
-    ?>
17
+	?>
18 18
 		<li>
19 19
 			<label class="setting" for="frmsc_<?php echo esc_attr( $shortcode . '_' . $opt ) ?>">
20 20
 				<span><?php echo esc_html( $val['label'] ) ?></span>
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         </li>
37 37
 	<?php
38 38
 	} else {
39
-    ?>
39
+	?>
40 40
 		<li>
41 41
 			<label class="setting" for="frmsc_<?php echo esc_attr( $shortcode . '_' . $opt ) ?>">
42 42
 				<input type="checkbox" id="frmsc_<?php echo esc_attr( $shortcode . '_' . $opt ) ?>" value="<?php echo esc_attr( $val['val'] ) ?>" />
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if ( ! empty($form_id) ) {
2
+if ( ! empty( $form_id ) ) {
3 3
 ?>
4 4
     <h4 class="frm_left_label"><?php esc_html_e( 'Select a form:', 'formidable' ); ?></h4>
5 5
 	<?php FrmFormsHelper::forms_dropdown( 'frmsc_' . $shortcode . '_' . $form_id ); ?>
Please login to merge, or discard this patch.
classes/views/shared/mb_adv_info.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 				if ( $f->type == 'data' ) {
46 46
 					//get all fields from linked form
47
-                    if ( isset($f->field_options['form_select']) && is_numeric($f->field_options['form_select']) ) {
47
+                    if ( isset( $f->field_options['form_select'] ) && is_numeric( $f->field_options['form_select'] ) ) {
48 48
 						$linked_form = FrmDb::get_var( $wpdb->prefix . 'frm_fields', array( 'id' => $f->field_options['form_select'] ), 'form_id' );
49 49
                         if ( ! in_array( $linked_form, $linked_forms ) ) {
50 50
                             $linked_forms[] = $linked_form;
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
 									) );
64 64
 
65 65
                                     $ldfe = $linked_field->id;
66
-                                    unset($linked_field);
66
+                                    unset( $linked_field );
67 67
                                 }
68 68
                             }
69 69
                         }
70 70
                     }
71 71
                     $dfe = $f->id;
72 72
         	    }
73
-                unset($f);
73
+                unset( $f );
74 74
                 }
75 75
 			}
76 76
 			?>
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
120 120
             ?>
121 121
                 <li>
122 122
                     <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>
123
-                	<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>
124
-                	<a href="javascript:void(0)" class="frm_insert_code" data-code="<?php echo esc_attr($f->id) ?>"><?php echo FrmAppHelper::truncate($f->name, 60) ?></a>
123
+                	<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>
124
+                	<a href="javascript:void(0)" class="frm_insert_code" data-code="<?php echo esc_attr( $f->id ) ?>"><?php echo FrmAppHelper::truncate( $f->name, 60 ) ?></a>
125 125
                 </li>
126 126
                 <?php
127 127
 
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
 		foreach ( $cond_shortcodes as $skey => $sname ) {
144 144
 	    ?>
145 145
 	    <li class="frm_col_<?php echo esc_attr( $col ) ?>">
146
-	        <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>
146
+	        <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>
147 147
 	    </li>
148 148
 	    <?php
149 149
 	        $col = ( $col == 'one' ) ? 'two' : 'one';
150
-	        unset($skey, $sname);
150
+	        unset( $skey, $sname );
151 151
 	    }
152 152
         ?>
153 153
         </ul>
@@ -172,15 +172,15 @@  discard block
 block discarded – undo
172 172
 		?>
173 173
 		<?php if ( isset( $file ) ) { ?>
174 174
         <li class="frm_col_<?php echo esc_attr( $col ) ?>">
175
-	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show_image=1"><?php esc_html_e( 'Show image', 'formidable' ) ?></a>
175
+	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $file->id ) ?> show_image=1"><?php esc_html_e( 'Show image', 'formidable' ) ?></a>
176 176
 	    </li>
177 177
 		<?php $col = ( $col == 'one' ? 'two' : 'one' ); ?>
178 178
 		<li class="frm_col_<?php echo esc_attr( $col ) ?>">
179
-	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show=id"><?php esc_html_e( 'Image ID', 'formidable' ) ?></a>
179
+	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $file->id ) ?> show=id"><?php esc_html_e( 'Image ID', 'formidable' ) ?></a>
180 180
 	    </li>
181 181
 		<?php $col = ( $col == 'one' ? 'two' : 'one' ); ?>
182 182
 		<li class="frm_col_<?php echo esc_attr( $col ) ?>">
183
-	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show_filename=1"><?php esc_html_e( 'Image Name', 'formidable' ) ?></a>
183
+	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $file->id ) ?> show_filename=1"><?php esc_html_e( 'Image Name', 'formidable' ) ?></a>
184 184
 	    </li>
185 185
 	    <?php } ?>
186 186
         </ul>
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
         	    <li class="frm_col_one">
229 229
 					<a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $dfe . ' show="created-at"' ) ?>"><?php esc_html_e( 'Creation Date', 'formidable' ); ?></a>
230 230
         	    </li>
231
-        	    <?php if ( isset($ldfe) ) { ?>
231
+        	    <?php if ( isset( $ldfe ) ) { ?>
232 232
         	    <li class="frm_col_two">
233 233
 					<a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $dfe . ' show="' . $ldfe . '"' ) ?>"><?php esc_html_e( 'Field From Entry', 'formidable' ); ?></a>
234 234
         	    </li>
Please login to merge, or discard this patch.
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -48,15 +48,15 @@  discard block
 block discarded – undo
48 48
 
49 49
 				if ( $f->type == 'data' ) {
50 50
 					//get all fields from linked form
51
-                    if ( isset($f->field_options['form_select']) && is_numeric($f->field_options['form_select']) ) {
51
+					if ( isset($f->field_options['form_select']) && is_numeric($f->field_options['form_select']) ) {
52 52
 						$linked_form = FrmDb::get_var( $wpdb->prefix . 'frm_fields', array( 'id' => $f->field_options['form_select'] ), 'form_id' );
53
-                        if ( ! in_array( $linked_form, $linked_forms ) ) {
54
-                            $linked_forms[] = $linked_form;
53
+						if ( ! in_array( $linked_form, $linked_forms ) ) {
54
+							$linked_forms[] = $linked_form;
55 55
 							$linked_fields = FrmField::getAll( array(
56 56
 								'fi.type not' => FrmField::no_save_fields(),
57 57
 								'fi.form_id'  => $linked_form,
58 58
 							) );
59
-                            $ldfe = '';
59
+							$ldfe = '';
60 60
 							if ( $linked_fields ) {
61 61
 								foreach ( $linked_fields as $linked_field ) {
62 62
 									FrmAppHelper::insert_opt_html( array(
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
 										'type' => $linked_field->type,
67 67
 									) );
68 68
 
69
-                                    $ldfe = $linked_field->id;
70
-                                    unset($linked_field);
71
-                                }
72
-                            }
73
-                        }
74
-                    }
75
-                    $dfe = $f->id;
76
-        	    }
77
-                unset($f);
78
-                }
69
+									$ldfe = $linked_field->id;
70
+									unset($linked_field);
71
+								}
72
+							}
73
+						}
74
+					}
75
+					$dfe = $f->id;
76
+				}
77
+				unset($f);
78
+				}
79 79
 			}
80 80
 			?>
81 81
         </ul>
@@ -87,27 +87,27 @@  discard block
 block discarded – undo
87 87
         <?php esc_html_e( 'Helpers', 'formidable' ) ?>:
88 88
         <ul class="frm_code_list">
89 89
         <?php
90
-        $col = 'one';
90
+		$col = 'one';
91 91
 		foreach ( $entry_shortcodes as $skey => $sname ) {
92 92
 			if ( empty( $skey ) ) {
93
-                 $col = 'one';
94
-                 echo '<li class="clear frm_block"></li>';
95
-                 continue;
96
-            }
93
+				 $col = 'one';
94
+				 echo '<li class="clear frm_block"></li>';
95
+				 continue;
96
+			}
97 97
 
98 98
 			$classes = ( in_array( $skey, array( 'siteurl', 'sitename', 'entry_count' ) ) ) ? 'show_before_content show_after_content' : '';
99 99
 			$classes .= ( strpos( $skey, 'default-' ) === 0 ) ? 'hide_frm_not_email_subject' : '';
100
-        ?>
100
+		?>
101 101
         <li class="frm_col_<?php echo esc_attr( $col ) ?>">
102 102
 			<a href="javascript:void(0)" class="frmbutton button <?php echo esc_attr( $classes ); ?> frm_insert_code" data-code="<?php echo esc_attr( $skey ) ?>">
103 103
 				<?php echo esc_html( $sname ) ?>
104 104
 			</a>
105 105
         </li>
106 106
         <?php
107
-            $col = ( $col == 'one' ) ? 'two' : 'one';
107
+			$col = ( $col == 'one' ) ? 'two' : 'one';
108 108
 			unset( $skey, $sname, $classes );
109
-        }
110
-        ?>
109
+		}
110
+		?>
111 111
         </ul>
112 112
 		<div class="clear"></div>
113 113
 	</div>
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
 	    <ul class="frm_code_list frm_full_width">
123 123
 			<?php
124 124
 			if ( ! empty( $fields ) ) {
125
-		        foreach ( $fields as $f ) {
125
+				foreach ( $fields as $f ) {
126 126
 					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'] == '' ) ) ) {
127
-                        continue;
128
-                }
129
-            ?>
127
+						continue;
128
+				}
129
+			?>
130 130
                 <li>
131 131
                     <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>
132 132
                 	<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>
@@ -148,17 +148,17 @@  discard block
 block discarded – undo
148 148
         <p class="howto"><?php esc_html_e( 'Click a button below to insert sample logic into your view', 'formidable' ) ?></p>
149 149
         <ul class="frm_code_list">
150 150
         <?php
151
-        $col = 'one';
151
+		$col = 'one';
152 152
 		foreach ( $cond_shortcodes as $skey => $sname ) {
153
-	    ?>
153
+		?>
154 154
 	    <li class="frm_col_<?php echo esc_attr( $col ) ?>">
155 155
 	        <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>
156 156
 	    </li>
157 157
 	    <?php
158
-	        $col = ( $col == 'one' ) ? 'two' : 'one';
159
-	        unset($skey, $sname);
160
-	    }
161
-        ?>
158
+			$col = ( $col == 'one' ) ? 'two' : 'one';
159
+			unset($skey, $sname);
160
+		}
161
+		?>
162 162
         </ul>
163 163
 	</div>
164 164
 	<?php } ?>
@@ -169,9 +169,9 @@  discard block
 block discarded – undo
169 169
 		</p>
170 170
 		<ul class="frm_code_list">
171 171
         <?php
172
-        $col = 'one';
172
+		$col = 'one';
173 173
 		foreach ( $adv_shortcodes as $skey => $sname ) {
174
-	    ?>
174
+		?>
175 175
 	    <li class="frm_col_<?php echo esc_attr( $col ) ?>">
176 176
 			<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'] ) . '"' : ''; ?>>
177 177
 				<?php echo is_array( $sname ) ? $sname['label'] : $sname; ?>
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	    </li>
180 180
 		<?php
181 181
 			$col = ( $col == 'one' ) ? 'two' : 'one';
182
-	        unset( $skey, $sname );
182
+			unset( $skey, $sname );
183 183
 		}
184 184
 		?>
185 185
 		<?php if ( isset( $file ) ) { ?>
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 		?>
218 218
         </ul>
219 219
 		<?php
220
-        }
220
+		}
221 221
 
222 222
 		if ( isset( $repeat_field ) ) {
223 223
 		?>
@@ -229,10 +229,10 @@  discard block
 block discarded – undo
229 229
         	    </li>
230 230
             </ul>
231 231
         <?php
232
-        }
232
+		}
233 233
 
234 234
 		if ( isset( $dfe ) ) {
235
-        ?>
235
+		?>
236 236
 
237 237
         <div class="clear"></div>
238 238
         <p class="howto"><?php esc_html_e( 'Dynamic field options', 'formidable' ); ?></p>
@@ -251,8 +251,8 @@  discard block
 block discarded – undo
251 251
 	</div>
252 252
 
253 253
     <?php
254
-    if ( $settings_tab ) {
254
+	if ( $settings_tab ) {
255 255
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-forms/mb_html_tab.php' );
256
-    }
257
-    ?>
256
+	}
257
+	?>
258 258
 </div>
Please login to merge, or discard this patch.
classes/views/styles/custom_css.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@
 block discarded – undo
27 27
 			);
28 28
 		}
29 29
 
30
-        foreach ( $style->post_content as $k => $v ) {
31
-            if ( $k == 'custom_css' ) {
32
-                continue;
33
-            }
34
-        ?>
30
+		foreach ( $style->post_content as $k => $v ) {
31
+			if ( $k == 'custom_css' ) {
32
+				continue;
33
+			}
34
+		?>
35 35
         <input type="hidden" value="<?php echo esc_attr($v) ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $k ) ) ?>" />    
36 36
 		<?php
37 37
 		}
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <div class="nav-menus-php">
2 2
 <div class="wrap">
3
-    <?php FrmStylesHelper::style_menu('custom_css'); ?>
3
+    <?php FrmStylesHelper::style_menu( 'custom_css' ); ?>
4 4
 
5 5
     <p><?php esc_html_e( 'You can add custom css here or in your theme style.css', 'formidable' ) ?></p>
6 6
 
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
 
9 9
 	<form method="post">
10 10
 	    <input type="hidden" name="ID" value="<?php echo esc_attr( $style->ID ) ?>" />
11
-        <input type="hidden" name="<?php echo esc_attr( $frm_style->get_field_name('post_title', '') ); ?>" value="<?php echo esc_attr( $style->post_title ) ?>" />
12
-        <input type="hidden" name="<?php echo esc_attr( $frm_style->get_field_name('menu_order', '') ); ?>" value="<?php echo esc_attr( $style->menu_order ) ?>" />
11
+        <input type="hidden" name="<?php echo esc_attr( $frm_style->get_field_name( 'post_title', '' ) ); ?>" value="<?php echo esc_attr( $style->post_title ) ?>" />
12
+        <input type="hidden" name="<?php echo esc_attr( $frm_style->get_field_name( 'menu_order', '' ) ); ?>" value="<?php echo esc_attr( $style->menu_order ) ?>" />
13 13
         <input type="hidden" name="style_name" value="frm_style_<?php echo esc_attr( $style->post_name ) ?>" />
14 14
 		<input type="hidden" name="frm_action" value="save_css" />
15 15
         <?php wp_nonce_field( 'frm_custom_css_nonce', 'frm_custom_css' ); ?>
16 16
 
17
-		<textarea name="<?php echo esc_attr( $frm_style->get_field_name('custom_css') ) ?>" id="<?php echo esc_attr( $id ) ?>" class="hide-if-js"><?php echo FrmAppHelper::esc_textarea( $style->post_content['custom_css'] ) ?></textarea>
17
+		<textarea name="<?php echo esc_attr( $frm_style->get_field_name( 'custom_css' ) ) ?>" id="<?php echo esc_attr( $id ) ?>" class="hide-if-js"><?php echo FrmAppHelper::esc_textarea( $style->post_content['custom_css'] ) ?></textarea>
18 18
 
19 19
 		<?php
20 20
 		if ( ! empty( $settings ) && $id == 'frm_codemirror_box' ) {
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
                 continue;
33 33
             }
34 34
         ?>
35
-        <input type="hidden" value="<?php echo esc_attr($v) ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $k ) ) ?>" />    
35
+        <input type="hidden" value="<?php echo esc_attr( $v ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $k ) ) ?>" />    
36 36
 		<?php
37 37
 		}
38 38
 		?>
Please login to merge, or discard this patch.
classes/views/frm-entries/errors.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( isset($include_extra_container) ) { ?>
2
+if ( isset( $include_extra_container ) ) { ?>
3 3
 <div class="<?php echo esc_attr( $include_extra_container ) ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container">
4 4
 <?php
5 5
 }
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     }
17 17
 }
18 18
 
19
-if ( isset($errors) && is_array( $errors ) && ! empty( $errors ) ) {
19
+if ( isset( $errors ) && is_array( $errors ) && ! empty( $errors ) ) {
20 20
 
21 21
 	if ( isset( $form ) && is_object( $form ) ) {
22 22
     	FrmFormsHelper::get_scroll_js( $form->id );
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 <?php
27 27
 $img = '';
28 28
 if ( ! FrmAppHelper::is_admin() ) {
29
-    $img = apply_filters('frm_error_icon', $img);
30
-    if ( $img && ! empty($img) ) {
29
+    $img = apply_filters( 'frm_error_icon', $img );
30
+    if ( $img && ! empty( $img ) ) {
31 31
     	echo '<img src="' . esc_url( $img ) . '" alt="" />';
32 32
     }
33 33
 }
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 <?php
5 5
 }
6 6
 if ( isset( $message ) && $message != '' ) {
7
-    if ( FrmAppHelper::is_admin() ) {
7
+	if ( FrmAppHelper::is_admin() ) {
8 8
 ?>
9 9
 <div id="message" class="frm_message updated"><?php echo wp_kses_post( $message ) ?></div>
10 10
 <?php
@@ -13,23 +13,23 @@  discard block
 block discarded – undo
13 13
 
14 14
 		// we need to allow scripts here for javascript in the success message
15 15
 		echo $message;
16
-    }
16
+	}
17 17
 }
18 18
 
19 19
 if ( isset($errors) && is_array( $errors ) && ! empty( $errors ) ) {
20 20
 
21 21
 	if ( isset( $form ) && is_object( $form ) ) {
22
-    	FrmFormsHelper::get_scroll_js( $form->id );
22
+		FrmFormsHelper::get_scroll_js( $form->id );
23 23
 	}
24 24
 	?>
25 25
 <div class="<?php echo esc_attr( FrmFormsHelper::form_error_class() ) ?>">
26 26
 <?php
27 27
 $img = '';
28 28
 if ( ! FrmAppHelper::is_admin() ) {
29
-    $img = apply_filters('frm_error_icon', $img);
30
-    if ( $img && ! empty($img) ) {
31
-    	echo '<img src="' . esc_url( $img ) . '" alt="" />';
32
-    }
29
+	$img = apply_filters('frm_error_icon', $img);
30
+	if ( $img && ! empty($img) ) {
31
+		echo '<img src="' . esc_url( $img ) . '" alt="" />';
32
+	}
33 33
 }
34 34
 
35 35
 FrmFormsHelper::show_errors( compact( 'img', 'errors', 'form' ) );
Please login to merge, or discard this patch.
classes/views/frm-form-actions/_action_inside.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1
-<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('post_excerpt', '') ) ?>" class="frm_action_name" value="<?php echo esc_attr( $form_action->post_excerpt ); ?>" />
2
-<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('ID', '') ) ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" />
1
+<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'post_excerpt', '' ) ) ?>" class="frm_action_name" value="<?php echo esc_attr( $form_action->post_excerpt ); ?>" />
2
+<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'ID', '' ) ) ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" />
3 3
 
4 4
 <table class="form-table">
5 5
     <tr>
6 6
         <th>
7
-			<label <?php FrmAppHelper::maybe_add_tooltip('action_title') ?>><?php esc_html_e( 'Label', 'formidable' ) ?></label>
7
+			<label <?php FrmAppHelper::maybe_add_tooltip( 'action_title' ) ?>><?php esc_html_e( 'Label', 'formidable' ) ?></label>
8 8
         </th>
9
-        <td><input type="text" name="<?php echo esc_attr( $action_control->get_field_name('post_title', '') ) ?>" value="<?php echo esc_attr($form_action->post_title); ?>" class="large-text <?php FrmAppHelper::maybe_add_tooltip('action_title', 'open') ?>" id="<?php echo esc_attr( $action_control->get_field_id('action_post_title') ) ?>" />
9
+        <td><input type="text" name="<?php echo esc_attr( $action_control->get_field_name( 'post_title', '' ) ) ?>" value="<?php echo esc_attr( $form_action->post_title ); ?>" class="large-text <?php FrmAppHelper::maybe_add_tooltip( 'action_title', 'open' ) ?>" id="<?php echo esc_attr( $action_control->get_field_id( 'action_post_title' ) ) ?>" />
10 10
         </td>
11 11
     </tr>
12 12
 </table>
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 if ( count( $action_control->action_options['event'] ) == 1 || $action_control->action_options['force_event'] ) {
25 25
 	foreach ( $action_control->action_options['event'] as $e ) {
26 26
 	?>
27
-	<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" value="<?php echo esc_attr( $e ) ?>" />
27
+	<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ) ?>[]" value="<?php echo esc_attr( $e ) ?>" />
28 28
 <?php
29 29
 	}
30 30
 } else {
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
 	<h3><?php esc_html_e( 'Action Triggers', 'formidable' ); ?></h3>
33 33
 	<p>
34 34
 		<label class="frm_left_label"><?php esc_html_e( 'Trigger this action after', 'formidable' ) ?></label>
35
-		<select name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" multiple="multiple" class="frm_multiselect" id="<?php echo esc_attr( $action_control->get_field_id('event') ) ?>">
35
+		<select name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ) ?>[]" multiple="multiple" class="frm_multiselect" id="<?php echo esc_attr( $action_control->get_field_id( 'event' ) ) ?>">
36 36
 	<?php
37 37
 
38 38
 	$event_labels = FrmFormAction::trigger_labels();
39 39
 	foreach ( $action_control->action_options['event'] as $event ) {
40 40
 	?>
41
-		<option value="<?php echo esc_attr( $event ) ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event; ?></option>
41
+		<option value="<?php echo esc_attr( $event ) ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo isset( $event_labels[$event] ) ? $event_labels[$event] : $event; ?></option>
42 42
 <?php } ?>
43 43
 		</select>
44 44
 	</p>
@@ -54,5 +54,5 @@  discard block
 block discarded – undo
54 54
 do_action( 'frm_additional_action_settings', $form_action, $pass_args );
55 55
 
56 56
 ?>
57
-<span class="alignright frm_action_id <?php echo empty( $form_action->ID ) ? 'frm_hidden' : ''; ?>"><?php printf( __( 'Action ID: %1$s', 'formidable' ), $form_action->ID); ?></span>
57
+<span class="alignright frm_action_id <?php echo empty( $form_action->ID ) ? 'frm_hidden' : ''; ?>"><?php printf( __( 'Action ID: %1$s', 'formidable' ), $form_action->ID ); ?></span>
58 58
 <div style="clear:both;"></div>
Please login to merge, or discard this patch.
classes/views/frm-form-actions/form_action.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@
 block discarded – undo
23 23
     </div>
24 24
     <div class="widget-inside frm_hidden">
25 25
         <?php
26
-        if ( defined('DOING_AJAX') || ! $action_control->action_options['ajax_load'] ) {
27
-            // only load settings if they are just added or are open
26
+		if ( defined('DOING_AJAX') || ! $action_control->action_options['ajax_load'] ) {
27
+			// only load settings if they are just added or are open
28 28
 			include( dirname( __FILE__ ) . '/_action_inside.php' );
29
-        } else {
29
+		} else {
30 30
 			// include hidden settings so action won't get lost on update
31 31
 			?>
32 32
         <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('post_excerpt', '') ) ?>" class="frm_action_name" value="<?php echo esc_attr( $form_action->post_excerpt ); ?>" />
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@
 block discarded – undo
23 23
     </div>
24 24
     <div class="widget-inside frm_hidden">
25 25
         <?php
26
-        if ( defined('DOING_AJAX') || ! $action_control->action_options['ajax_load'] ) {
26
+        if ( defined( 'DOING_AJAX' ) || ! $action_control->action_options['ajax_load'] ) {
27 27
             // only load settings if they are just added or are open
28 28
 			include( dirname( __FILE__ ) . '/_action_inside.php' );
29 29
         } else {
30 30
 			// include hidden settings so action won't get lost on update
31 31
 			?>
32
-        <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('post_excerpt', '') ) ?>" class="frm_action_name" value="<?php echo esc_attr( $form_action->post_excerpt ); ?>" />
33
-        <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('ID', '') ) ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" />
32
+        <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'post_excerpt', '' ) ) ?>" class="frm_action_name" value="<?php echo esc_attr( $form_action->post_excerpt ); ?>" />
33
+        <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'ID', '' ) ) ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" />
34 34
 		<?php } ?>
35 35
     </div>
36 36
 </div>
Please login to merge, or discard this patch.