Completed
Push — master ( b3b06a...3634bc )
by Jamie
02:58
created
classes/helpers/FrmFormsHelper.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -375,6 +375,9 @@
 block discarded – undo
375 375
         $reset_fields = true;
376 376
     }
377 377
 
378
+    /**
379
+     * @return string
380
+     */
378 381
     public static function replace_shortcodes( $html, $form, $title = false, $description = false, $values = array() ) {
379 382
 		foreach ( array( 'form_name' => $title, 'form_description' => $description, 'entry_key' => true ) as $code => $show ) {
380 383
             if ( $code == 'form_name' ) {
Please login to merge, or discard this patch.
Indentation   +266 added lines, -266 removed lines patch added patch discarded remove patch
@@ -19,38 +19,38 @@  discard block
 block discarded – undo
19 19
 
20 20
 	public static function get_direct_link( $key, $form = false ) {
21 21
 		$target_url = esc_url( admin_url( 'admin-ajax.php?action=frm_forms_preview&form=' . $key ) );
22
-        $target_url = apply_filters('frm_direct_link', $target_url, $key, $form);
23
-
24
-        return $target_url;
25
-    }
26
-
27
-    public static function forms_dropdown( $field_name, $field_value = '', $args = array() ) {
28
-        $defaults = array(
29
-            'blank'     => true,
30
-            'field_id'  => false,
31
-            'onchange'  => false,
32
-            'exclude'   => false,
33
-            'class'     => '',
22
+		$target_url = apply_filters('frm_direct_link', $target_url, $key, $form);
23
+
24
+		return $target_url;
25
+	}
26
+
27
+	public static function forms_dropdown( $field_name, $field_value = '', $args = array() ) {
28
+		$defaults = array(
29
+			'blank'     => true,
30
+			'field_id'  => false,
31
+			'onchange'  => false,
32
+			'exclude'   => false,
33
+			'class'     => '',
34 34
 			'inc_children' => 'exclude',
35
-        );
36
-        $args = wp_parse_args( $args, $defaults );
35
+		);
36
+		$args = wp_parse_args( $args, $defaults );
37 37
 
38
-        if ( ! $args['field_id'] ) {
39
-            $args['field_id'] = $field_name;
40
-        }
38
+		if ( ! $args['field_id'] ) {
39
+			$args['field_id'] = $field_name;
40
+		}
41 41
 
42 42
 		$query = array();
43
-        if ( $args['exclude'] ) {
43
+		if ( $args['exclude'] ) {
44 44
 			$query['id !'] = $args['exclude'];
45
-        }
45
+		}
46 46
 
47
-        $where = apply_filters('frm_forms_dropdown', $query, $field_name);
47
+		$where = apply_filters('frm_forms_dropdown', $query, $field_name);
48 48
 		$forms = FrmForm::get_published_forms( $where, 999, $args['inc_children'] );
49 49
 		$add_html = array();
50 50
 		self::add_html_attr( $args['onchange'], 'onchange', $add_html );
51 51
 		self::add_html_attr( $args['class'], 'class', $add_html );
52 52
 
53
-        ?>
53
+		?>
54 54
 		<select name="<?php echo esc_attr( $field_name ); ?>" id="<?php echo esc_attr( $args['field_id'] ) ?>" <?php echo implode( ' ', $add_html ); ?>>
55 55
 		<?php if ( $args['blank'] ) { ?>
56 56
 			<option value=""><?php echo ( $args['blank'] == 1 ) ? ' ' : '- ' . esc_attr( $args['blank'] ) . ' -'; ?></option>
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		<?php } ?>
63 63
         </select>
64 64
         <?php
65
-    }
65
+	}
66 66
 
67 67
 	/**
68 68
 	 * @param string $class
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		}
78 78
 	}
79 79
 
80
-    public static function form_switcher() {
80
+	public static function form_switcher() {
81 81
 		$where = apply_filters( 'frm_forms_dropdown', array(), '' );
82 82
 		$forms = FrmForm::get_published_forms( $where );
83 83
 
@@ -86,32 +86,32 @@  discard block
 block discarded – undo
86 86
 			unset( $args['form'] );
87 87
 		} else if ( isset( $_GET['form']) && ! isset( $_GET['id'] ) ) {
88 88
 			unset( $args['id'] );
89
-        }
89
+		}
90 90
 
91 91
 		$frm_action = FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' );
92 92
 		if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) && in_array( $frm_action, array( 'edit', 'show', 'destroy_all' ) ) ) {
93
-            $args['frm_action'] = 'list';
94
-            $args['form'] = 0;
93
+			$args['frm_action'] = 'list';
94
+			$args['form'] = 0;
95 95
 		} else if ( FrmAppHelper::is_admin_page('formidable' ) && in_array( $frm_action, array( 'new', 'duplicate' ) ) ) {
96
-            $args['frm_action'] = 'edit';
96
+			$args['frm_action'] = 'edit';
97 97
 		} else if ( isset( $_GET['post'] ) ) {
98
-            $args['form'] = 0;
99
-            $base = admin_url('edit.php?post_type=frm_display');
100
-        }
98
+			$args['form'] = 0;
99
+			$base = admin_url('edit.php?post_type=frm_display');
100
+		}
101 101
 
102
-        ?>
102
+		?>
103 103
 		<li class="dropdown last" id="frm_bs_dropdown">
104 104
 			<a href="#" id="frm-navbarDrop" class="frm-dropdown-toggle" data-toggle="dropdown"><?php _e( 'Switch Form', 'formidable' ) ?> <b class="caret"></b></a>
105 105
 		    <ul class="frm-dropdown-menu frm-on-top" role="menu" aria-labelledby="frm-navbarDrop">
106 106
 			<?php
107 107
 			foreach ( $forms as $form ) {
108 108
 				if ( isset( $args['id'] ) ) {
109
-			        $args['id'] = $form->id;
109
+					$args['id'] = $form->id;
110 110
 				}
111
-			    if ( isset( $args['form'] ) ) {
112
-			        $args['form'] = $form->id;
111
+				if ( isset( $args['form'] ) ) {
112
+					$args['form'] = $form->id;
113 113
 				}
114
-                ?>
114
+				?>
115 115
 				<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>
116 116
 			<?php
117 117
 				unset( $form );
@@ -119,12 +119,12 @@  discard block
 block discarded – undo
119 119
 			</ul>
120 120
 		</li>
121 121
         <?php
122
-    }
122
+	}
123 123
 
124 124
 	public static function get_sortable_classes( $col, $sort_col, $sort_dir ) {
125
-        echo ($sort_col == $col) ? 'sorted' : 'sortable';
126
-        echo ($sort_col == $col && $sort_dir == 'desc') ? ' asc' : ' desc';
127
-    }
125
+		echo ($sort_col == $col) ? 'sorted' : 'sortable';
126
+		echo ($sort_col == $col && $sort_dir == 'desc') ? ' asc' : ' desc';
127
+	}
128 128
 
129 129
 	/**
130 130
 	 * Get the invalid form error message
@@ -148,104 +148,104 @@  discard block
 block discarded – undo
148 148
 		return $message;
149 149
 	}
150 150
 
151
-    /**
152
-     * Used when a form is created
153
-     */
154
-    public static function setup_new_vars( $values = array() ) {
155
-        global $wpdb;
151
+	/**
152
+	 * Used when a form is created
153
+	 */
154
+	public static function setup_new_vars( $values = array() ) {
155
+		global $wpdb;
156 156
 
157
-        if ( ! empty( $values ) ) {
158
-            $post_values = $values;
159
-        } else {
160
-            $values = array();
161
-            $post_values = isset($_POST) ? $_POST : array();
162
-        }
157
+		if ( ! empty( $values ) ) {
158
+			$post_values = $values;
159
+		} else {
160
+			$values = array();
161
+			$post_values = isset($_POST) ? $_POST : array();
162
+		}
163 163
 
164 164
 		foreach ( array( 'name' => '', 'description' => '' ) as $var => $default ) {
165 165
 			if ( ! isset( $values[ $var ] ) ) {
166 166
 				$values[ $var ] = FrmAppHelper::get_param( $var, $default );
167
-            }
168
-        }
167
+			}
168
+		}
169 169
 
170
-        $values['description'] = FrmAppHelper::use_wpautop($values['description']);
170
+		$values['description'] = FrmAppHelper::use_wpautop($values['description']);
171 171
 
172 172
 		foreach ( array( 'form_id' => '', 'logged_in' => '', 'editable' => '', 'default_template' => 0, 'is_template' => 0, 'status' => 'draft', 'parent_form_id' => 0 ) as $var => $default ) {
173
-            if ( ! isset( $values[ $var ] ) ) {
173
+			if ( ! isset( $values[ $var ] ) ) {
174 174
 				$values[ $var ] = FrmAppHelper::get_param( $var, $default );
175
-            }
176
-        }
175
+			}
176
+		}
177 177
 
178
-        if ( ! isset( $values['form_key'] ) ) {
178
+		if ( ! isset( $values['form_key'] ) ) {
179 179
 			$values['form_key'] = ( $post_values && isset( $post_values['form_key'] ) ) ? $post_values['form_key'] : FrmAppHelper::get_unique_key( '', $wpdb->prefix . 'frm_forms', 'form_key' );
180
-        }
180
+		}
181 181
 
182 182
 		$values = self::fill_default_opts( $values, false, $post_values );
183 183
 		$values['custom_style'] = FrmAppHelper::custom_style_value( $values, $post_values );
184 184
 
185
-        return apply_filters('frm_setup_new_form_vars', $values);
186
-    }
185
+		return apply_filters('frm_setup_new_form_vars', $values);
186
+	}
187 187
 
188
-    /**
189
-     * Used when editing a form
190
-     */
191
-    public static function setup_edit_vars( $values, $record, $post_values = array() ) {
188
+	/**
189
+	 * Used when editing a form
190
+	 */
191
+	public static function setup_edit_vars( $values, $record, $post_values = array() ) {
192 192
 		if ( empty( $post_values ) ) {
193 193
 			$post_values = stripslashes_deep( $_POST );
194 194
 		}
195 195
 
196
-        $values['form_key'] = isset($post_values['form_key']) ? $post_values['form_key'] : $record->form_key;
197
-        $values['default_template'] = isset($post_values['default_template']) ? $post_values['default_template'] : $record->default_template;
198
-        $values['is_template'] = isset($post_values['is_template']) ? $post_values['is_template'] : $record->is_template;
199
-        $values['status'] = $record->status;
196
+		$values['form_key'] = isset($post_values['form_key']) ? $post_values['form_key'] : $record->form_key;
197
+		$values['default_template'] = isset($post_values['default_template']) ? $post_values['default_template'] : $record->default_template;
198
+		$values['is_template'] = isset($post_values['is_template']) ? $post_values['is_template'] : $record->is_template;
199
+		$values['status'] = $record->status;
200 200
 
201
-        $values = self::fill_default_opts($values, $record, $post_values);
201
+		$values = self::fill_default_opts($values, $record, $post_values);
202 202
 
203
-        return apply_filters('frm_setup_edit_form_vars', $values);
204
-    }
203
+		return apply_filters('frm_setup_edit_form_vars', $values);
204
+	}
205 205
 
206 206
 	public static function fill_default_opts( $values, $record, $post_values ) {
207 207
 
208
-        $defaults = self::get_default_opts();
208
+		$defaults = self::get_default_opts();
209 209
 		foreach ( $defaults as $var => $default ) {
210
-            if ( is_array($default) ) {
211
-                if ( ! isset( $values[ $var ] ) ) {
210
+			if ( is_array($default) ) {
211
+				if ( ! isset( $values[ $var ] ) ) {
212 212
 					$values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array();
213
-                }
213
+				}
214 214
 
215
-                foreach ( $default as $k => $v ) {
215
+				foreach ( $default as $k => $v ) {
216 216
 					$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);
217 217
 
218
-                    if ( is_array( $v ) ) {
219
-                        foreach ( $v as $k1 => $v1 ) {
218
+					if ( is_array( $v ) ) {
219
+						foreach ( $v as $k1 => $v1 ) {
220 220
 							$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 );
221
-                            unset( $k1, $v1 );
222
-                        }
223
-                    }
221
+							unset( $k1, $v1 );
222
+						}
223
+					}
224 224
 
225
-                    unset($k, $v);
226
-                }
227
-            } else {
225
+					unset($k, $v);
226
+				}
227
+			} else {
228 228
 				$values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default );
229
-            }
229
+			}
230 230
 
231
-            unset($var, $default);
232
-        }
231
+			unset($var, $default);
232
+		}
233 233
 
234
-        return $values;
235
-    }
234
+		return $values;
235
+	}
236 236
 
237
-    public static function get_default_opts() {
238
-        $frm_settings = FrmAppHelper::get_settings();
237
+	public static function get_default_opts() {
238
+		$frm_settings = FrmAppHelper::get_settings();
239 239
 
240
-        return array(
241
-            'submit_value' => $frm_settings->submit_value, 'success_action' => 'message',
242
-            'success_msg' => $frm_settings->success_msg, 'show_form' => 0, 'akismet' => '',
243
-            'no_save' => 0, 'ajax_load' => 0, 'form_class' => '', 'custom_style' => 1,
244
-            'before_html' => self::get_default_html('before'),
245
-            'after_html' => '',
246
-            'submit_html' => self::get_default_html('submit'),
247
-        );
248
-    }
240
+		return array(
241
+			'submit_value' => $frm_settings->submit_value, 'success_action' => 'message',
242
+			'success_msg' => $frm_settings->success_msg, 'show_form' => 0, 'akismet' => '',
243
+			'no_save' => 0, 'ajax_load' => 0, 'form_class' => '', 'custom_style' => 1,
244
+			'before_html' => self::get_default_html('before'),
245
+			'after_html' => '',
246
+			'submit_html' => self::get_default_html('submit'),
247
+		);
248
+	}
249 249
 
250 250
 	/**
251 251
 	 * @param array $options
@@ -260,15 +260,15 @@  discard block
 block discarded – undo
260 260
 		}
261 261
 	}
262 262
 
263
-    /**
264
-     * @param string $loc
265
-     */
263
+	/**
264
+	 * @param string $loc
265
+	 */
266 266
 	public static function get_default_html( $loc ) {
267 267
 		if ( $loc == 'submit' ) {
268
-            $sending = __( 'Sending', 'formidable' );
269
-            $draft_link = self::get_draft_link();
270
-            $img = '[frmurl]/images/ajax_loader.gif';
271
-            $default_html = <<<SUBMIT_HTML
268
+			$sending = __( 'Sending', 'formidable' );
269
+			$draft_link = self::get_draft_link();
270
+			$img = '[frmurl]/images/ajax_loader.gif';
271
+			$default_html = <<<SUBMIT_HTML
272 272
 <div class="frm_submit">
273 273
 [if back_button]<input type="button" value="[back_label]" name="frm_prev_page" formnovalidate="formnovalidate" class="frm_prev_page" [back_hook] />[/if back_button]
274 274
 <input type="submit" value="[button_label]" [button_action] />
@@ -277,49 +277,49 @@  discard block
 block discarded – undo
277 277
 </div>
278 278
 SUBMIT_HTML;
279 279
 		} else if ( $loc == 'before' ) {
280
-            $default_html = <<<BEFORE_HTML
280
+			$default_html = <<<BEFORE_HTML
281 281
 <legend class="frm_hidden">[form_name]</legend>
282 282
 [if form_name]<h3 class="frm_form_title">[form_name]</h3>[/if form_name]
283 283
 [if form_description]<div class="frm_description">[form_description]</div>[/if form_description]
284 284
 BEFORE_HTML;
285 285
 		} else {
286
-            $default_html = '';
287
-        }
286
+			$default_html = '';
287
+		}
288 288
 
289
-        return $default_html;
290
-    }
289
+		return $default_html;
290
+	}
291 291
 
292
-    public static function get_draft_link() {
293
-        $link = '[if save_draft]<a href="#" class="frm_save_draft" [draft_hook]>[draft_label]</a>[/if save_draft]';
294
-        return $link;
295
-    }
292
+	public static function get_draft_link() {
293
+		$link = '[if save_draft]<a href="#" class="frm_save_draft" [draft_hook]>[draft_label]</a>[/if save_draft]';
294
+		return $link;
295
+	}
296 296
 
297 297
 	public static function get_custom_submit( $html, $form, $submit, $form_action, $values ) {
298
-        $button = self::replace_shortcodes($html, $form, $submit, $form_action, $values);
299
-        if ( ! strpos($button, '[button_action]') ) {
300
-            return;
301
-        }
298
+		$button = self::replace_shortcodes($html, $form, $submit, $form_action, $values);
299
+		if ( ! strpos($button, '[button_action]') ) {
300
+			return;
301
+		}
302 302
 
303
-        $button_parts = explode('[button_action]', $button);
304
-        echo $button_parts[0];
305
-        //echo ' id="frm_submit_"';
303
+		$button_parts = explode('[button_action]', $button);
304
+		echo $button_parts[0];
305
+		//echo ' id="frm_submit_"';
306 306
 
307
-        $classes = apply_filters('frm_submit_button_class', array(), $form);
308
-        if ( ! empty($classes) ) {
307
+		$classes = apply_filters('frm_submit_button_class', array(), $form);
308
+		if ( ! empty($classes) ) {
309 309
 			echo ' class="' . esc_attr( implode( ' ', $classes ) ) . '"';
310
-        }
311
-
312
-        do_action('frm_submit_button_action', $form, $form_action);
313
-        echo $button_parts[1];
314
-    }
315
-
316
-    /**
317
-     * Automatically add end section fields if they don't exist (2.0 migration)
318
-     * @since 2.0
319
-     *
320
-     * @param boolean $reset_fields
321
-     */
322
-    public static function auto_add_end_section_fields( $form, $fields, &$reset_fields ) {
310
+		}
311
+
312
+		do_action('frm_submit_button_action', $form, $form_action);
313
+		echo $button_parts[1];
314
+	}
315
+
316
+	/**
317
+	 * Automatically add end section fields if they don't exist (2.0 migration)
318
+	 * @since 2.0
319
+	 *
320
+	 * @param boolean $reset_fields
321
+	 */
322
+	public static function auto_add_end_section_fields( $form, $fields, &$reset_fields ) {
323 323
 		if ( empty( $fields ) ) {
324 324
 			return;
325 325
 		}
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 		$open = $prev_order = false;
329 329
 		$add_order = 0;
330 330
 		$last_field = false;
331
-        foreach ( $fields as $field ) {
331
+		foreach ( $fields as $field ) {
332 332
 			if ( $prev_order === $field->field_order ) {
333 333
 				$add_order++;
334 334
 			}
@@ -339,48 +339,48 @@  discard block
 block discarded – undo
339 339
 				FrmField::update( $field->id, array( 'field_order' => $field->field_order ) );
340 340
 			}
341 341
 
342
-            switch ( $field->type ) {
343
-                case 'divider':
344
-                    // create an end section if open
342
+			switch ( $field->type ) {
343
+				case 'divider':
344
+					// create an end section if open
345 345
 					self::maybe_create_end_section( $open, $reset_fields, $add_order, $end_section_values, $field, 'move' );
346 346
 
347
-                    // mark it open for the next end section
348
-                    $open = true;
349
-                break;
350
-                case 'break';
347
+					// mark it open for the next end section
348
+					$open = true;
349
+				break;
350
+				case 'break';
351 351
 					self::maybe_create_end_section( $open, $reset_fields, $add_order, $end_section_values, $field, 'move' );
352
-                break;
353
-                case 'end_divider':
354
-                    if ( ! $open ) {
355
-                        // the section isn't open, so this is an extra field that needs to be removed
356
-                        FrmField::destroy( $field->id );
357
-                        $reset_fields = true;
358
-                    }
359
-
360
-                    // There is already an end section here, so there is no need to create one
361
-                    $open = false;
362
-            }
352
+				break;
353
+				case 'end_divider':
354
+					if ( ! $open ) {
355
+						// the section isn't open, so this is an extra field that needs to be removed
356
+						FrmField::destroy( $field->id );
357
+						$reset_fields = true;
358
+					}
359
+
360
+					// There is already an end section here, so there is no need to create one
361
+					$open = false;
362
+			}
363 363
 			$prev_order = $field->field_order;
364 364
 
365 365
 			$last_field = $field;
366 366
 			unset( $field );
367
-        }
367
+		}
368 368
 
369 369
 		self::maybe_create_end_section( $open, $reset_fields, $add_order, $end_section_values, $last_field );
370
-    }
370
+	}
371 371
 
372 372
 	/**
373 373
 	 * Create end section field if it doesn't exist. This is for migration from < 2.0
374 374
 	 * Fix any ordering that may be messed up
375 375
 	 */
376 376
 	public static function maybe_create_end_section( &$open, &$reset_fields, &$add_order, $end_section_values, $field, $move = 'no' ) {
377
-        if ( ! $open ) {
378
-            return;
379
-        }
377
+		if ( ! $open ) {
378
+			return;
379
+		}
380 380
 
381 381
 		$end_section_values['field_order'] = $field->field_order + 1;
382 382
 
383
-        FrmField::create( $end_section_values );
383
+		FrmField::create( $end_section_values );
384 384
 
385 385
 		if ( $move == 'move' ) {
386 386
 			// bump the order of current field unless we're at the end of the form
@@ -388,39 +388,39 @@  discard block
 block discarded – undo
388 388
 		}
389 389
 
390 390
 		$add_order += 2;
391
-        $open = false;
392
-        $reset_fields = true;
393
-    }
391
+		$open = false;
392
+		$reset_fields = true;
393
+	}
394 394
 
395
-    public static function replace_shortcodes( $html, $form, $title = false, $description = false, $values = array() ) {
395
+	public static function replace_shortcodes( $html, $form, $title = false, $description = false, $values = array() ) {
396 396
 		foreach ( array( 'form_name' => $title, 'form_description' => $description, 'entry_key' => true ) as $code => $show ) {
397
-            if ( $code == 'form_name' ) {
398
-                $replace_with = $form->name;
399
-            } else if ( $code == 'form_description' ) {
400
-                $replace_with = FrmAppHelper::use_wpautop($form->description);
401
-            } else if ( $code == 'entry_key' && isset($_GET) && isset($_GET['entry']) ) {
402
-                $replace_with = FrmAppHelper::simple_get( 'entry' );
403
-            } else {
404
-                $replace_with = '';
405
-            }
397
+			if ( $code == 'form_name' ) {
398
+				$replace_with = $form->name;
399
+			} else if ( $code == 'form_description' ) {
400
+				$replace_with = FrmAppHelper::use_wpautop($form->description);
401
+			} else if ( $code == 'entry_key' && isset($_GET) && isset($_GET['entry']) ) {
402
+				$replace_with = FrmAppHelper::simple_get( 'entry' );
403
+			} else {
404
+				$replace_with = '';
405
+			}
406 406
 
407
-            FrmFieldsHelper::remove_inline_conditions( ( FrmAppHelper::is_true($show) && $replace_with != '' ), $code, $replace_with, $html );
408
-        }
407
+			FrmFieldsHelper::remove_inline_conditions( ( FrmAppHelper::is_true($show) && $replace_with != '' ), $code, $replace_with, $html );
408
+		}
409 409
 
410
-        //replace [form_key]
411
-        $html = str_replace('[form_key]', $form->form_key, $html);
410
+		//replace [form_key]
411
+		$html = str_replace('[form_key]', $form->form_key, $html);
412 412
 
413
-        //replace [frmurl]
414
-        $html = str_replace('[frmurl]', FrmFieldsHelper::dynamic_default_values( 'frmurl' ), $html);
413
+		//replace [frmurl]
414
+		$html = str_replace('[frmurl]', FrmFieldsHelper::dynamic_default_values( 'frmurl' ), $html);
415 415
 
416 416
 		if ( strpos( $html, '[button_label]' ) ) {
417 417
 			add_filter( 'frm_submit_button', 'FrmFormsHelper::submit_button_label', 1 );
418 418
 			$submit_label = apply_filters( 'frm_submit_button', $title, $form );
419 419
 			$submit_label = esc_attr( do_shortcode( $submit_label ) );
420 420
 			$html = str_replace( '[button_label]', $submit_label, $html );
421
-        }
421
+		}
422 422
 
423
-        $html = apply_filters('frm_form_replace_shortcodes', $html, $form, $values);
423
+		$html = apply_filters('frm_form_replace_shortcodes', $html, $form, $values);
424 424
 
425 425
 		if ( strpos( $html, '[if back_button]' ) ) {
426 426
 			$html = preg_replace( '/(\[if\s+back_button\])(.*?)(\[\/if\s+back_button\])/mis', '', $html );
@@ -434,32 +434,32 @@  discard block
 block discarded – undo
434 434
 			$html = do_shortcode( $html );
435 435
 		}
436 436
 
437
-        return $html;
438
-    }
437
+		return $html;
438
+	}
439 439
 
440 440
 	public static function submit_button_label( $submit ) {
441
-        if ( ! $submit || empty($submit) ) {
442
-            $frm_settings = FrmAppHelper::get_settings();
443
-            $submit = $frm_settings->submit_value;
444
-        }
441
+		if ( ! $submit || empty($submit) ) {
442
+			$frm_settings = FrmAppHelper::get_settings();
443
+			$submit = $frm_settings->submit_value;
444
+		}
445 445
 
446
-        return $submit;
447
-    }
446
+		return $submit;
447
+	}
448 448
 
449 449
 	public static function get_form_style_class( $form = false ) {
450
-        $style = self::get_form_style($form);
451
-        $class = ' with_frm_style';
452
-
453
-        if ( empty($style) ) {
454
-            if ( FrmAppHelper::is_admin_page('formidable-entries') ) {
455
-                return $class;
456
-            } else {
457
-                return;
458
-            }
459
-        }
460
-
461
-        //If submit button needs to be inline or centered
462
-        if ( is_object($form) ) {
450
+		$style = self::get_form_style($form);
451
+		$class = ' with_frm_style';
452
+
453
+		if ( empty($style) ) {
454
+			if ( FrmAppHelper::is_admin_page('formidable-entries') ) {
455
+				return $class;
456
+			} else {
457
+				return;
458
+			}
459
+		}
460
+
461
+		//If submit button needs to be inline or centered
462
+		if ( is_object($form) ) {
463 463
 			$form = $form->options;
464 464
 		}
465 465
 
@@ -471,17 +471,17 @@  discard block
 block discarded – undo
471 471
 			$class .= ' frm_center_submit';
472 472
 		}
473 473
 
474
-        $class = apply_filters('frm_add_form_style_class', $class, $style);
474
+		$class = apply_filters('frm_add_form_style_class', $class, $style);
475 475
 
476
-        return $class;
477
-    }
476
+		return $class;
477
+	}
478 478
 
479
-    /**
480
-     * @param string|boolean $form
481
-     *
482
-     * @return string
483
-     */
484
-    public static function get_form_style( $form ) {
479
+	/**
480
+	 * @param string|boolean $form
481
+	 *
482
+	 * @return string
483
+	 */
484
+	public static function get_form_style( $form ) {
485 485
 		$style = 1;
486 486
 		if ( empty( $form ) || 'default' == 'form' ) {
487 487
 			return $style;
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 		$style = ( $form && is_object( $form ) && isset( $form->options['custom_style'] ) ) ? $form->options['custom_style'] : $style;
502 502
 
503 503
 		return $style;
504
-    }
504
+	}
505 505
 
506 506
 	/**
507 507
 	 * Display the validation error messages when an entry is submitted
@@ -556,74 +556,74 @@  discard block
 block discarded – undo
556 556
 	}
557 557
 
558 558
 	public static function get_scroll_js( $form_id ) {
559
-        ?><script type="text/javascript">document.addEventListener('DOMContentLoaded',function(){frmFrontForm.scrollMsg(<?php echo (int) $form_id ?>);})</script><?php
560
-    }
559
+		?><script type="text/javascript">document.addEventListener('DOMContentLoaded',function(){frmFrontForm.scrollMsg(<?php echo (int) $form_id ?>);})</script><?php
560
+	}
561 561
 
562 562
 	public static function edit_form_link( $form_id ) {
563
-        if ( is_object($form_id) ) {
564
-            $form = $form_id;
565
-            $name = $form->name;
566
-            $form_id = $form->id;
567
-        } else {
568
-            $name = FrmForm::getName($form_id);
569
-        }
570
-
571
-        if ( $form_id ) {
563
+		if ( is_object($form_id) ) {
564
+			$form = $form_id;
565
+			$name = $form->name;
566
+			$form_id = $form->id;
567
+		} else {
568
+			$name = FrmForm::getName($form_id);
569
+		}
570
+
571
+		if ( $form_id ) {
572 572
 			$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>';
573
-	    } else {
574
-	        $val = '';
575
-	    }
573
+		} else {
574
+			$val = '';
575
+		}
576 576
 
577
-	    return $val;
577
+		return $val;
578 578
 	}
579 579
 
580 580
 	public static function delete_trash_link( $id, $status, $length = 'long' ) {
581
-        $link = '';
582
-        $labels = array(
583
-            'restore' => array(
584
-                'long'  => __( 'Restore from Trash', 'formidable' ),
585
-                'short' => __( 'Restore', 'formidable' ),
586
-            ),
587
-            'trash' => array(
588
-                'long'  => __( 'Move to Trash', 'formidable' ),
589
-                'short' => __( 'Trash', 'formidable' ),
590
-            ),
591
-            'delete' => array(
592
-                'long'  => __( 'Delete Permanently', 'formidable' ),
593
-                'short' => __( 'Delete', 'formidable' ),
594
-            ),
595
-        );
596
-
597
-        $current_page = isset( $_REQUEST['form_type'] ) ? $_REQUEST['form_type'] : '';
581
+		$link = '';
582
+		$labels = array(
583
+			'restore' => array(
584
+				'long'  => __( 'Restore from Trash', 'formidable' ),
585
+				'short' => __( 'Restore', 'formidable' ),
586
+			),
587
+			'trash' => array(
588
+				'long'  => __( 'Move to Trash', 'formidable' ),
589
+				'short' => __( 'Trash', 'formidable' ),
590
+			),
591
+			'delete' => array(
592
+				'long'  => __( 'Delete Permanently', 'formidable' ),
593
+				'short' => __( 'Delete', 'formidable' ),
594
+			),
595
+		);
596
+
597
+		$current_page = isset( $_REQUEST['form_type'] ) ? $_REQUEST['form_type'] : '';
598 598
 		$base_url = '?page=formidable&form_type=' . $current_page . '&id=' . $id;
599
-        if ( 'trash' == $status ) {
599
+		if ( 'trash' == $status ) {
600 600
 			$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=untrash', 'untrash_form_' . $id ) ) . '" class="submitdelete deletion">' . $labels['restore'][ $length ] . '</a>';
601
-        } else if ( current_user_can('frm_delete_forms') ) {
602
-            if ( EMPTY_TRASH_DAYS ) {
601
+		} else if ( current_user_can('frm_delete_forms') ) {
602
+			if ( EMPTY_TRASH_DAYS ) {
603 603
 				$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=trash', 'trash_form_' . $id ) ) . '" class="submitdelete deletion">' . $labels['trash'][ $length ] . '</a>';
604
-            } else {
604
+			} else {
605 605
 				$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=destroy', 'destroy_form_' . $id ) ) . '" class="submitdelete deletion" onclick="return confirm(\'' . esc_attr( __( 'Are you sure you want to delete this form and all its entries?', 'formidable' ) ) . '\')">' . $labels['delete'][ $length ] . '</a>';
606
-            }
607
-        }
606
+			}
607
+		}
608 608
 
609
-        return $link;
610
-    }
609
+		return $link;
610
+	}
611 611
 
612 612
 	public static function status_nice_name( $status ) {
613
-        $nice_names = array(
614
-            'draft'     => __( 'Draft', 'formidable' ),
615
-            'trash'     => __( 'Trash', 'formidable' ),
616
-            'publish'   => __( 'Published', 'formidable' ),
617
-        );
618
-
619
-        if ( ! in_array($status, array_keys($nice_names)) ) {
620
-            $status = 'publish';
621
-        }
613
+		$nice_names = array(
614
+			'draft'     => __( 'Draft', 'formidable' ),
615
+			'trash'     => __( 'Trash', 'formidable' ),
616
+			'publish'   => __( 'Published', 'formidable' ),
617
+		);
618
+
619
+		if ( ! in_array($status, array_keys($nice_names)) ) {
620
+			$status = 'publish';
621
+		}
622 622
 
623 623
 		$name = $nice_names[ $status ];
624 624
 
625
-        return $name;
626
-    }
625
+		return $name;
626
+	}
627 627
 
628 628
 	public static function get_params() {
629 629
 		_deprecated_function( __FUNCTION__, '2.0.9', 'FrmForm::list_page_params' );
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 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
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 	public static function get_direct_link( $key, $form = false ) {
21 21
 		$target_url = esc_url( admin_url( 'admin-ajax.php?action=frm_forms_preview&form=' . $key ) );
22
-        $target_url = apply_filters('frm_direct_link', $target_url, $key, $form);
22
+        $target_url = apply_filters( 'frm_direct_link', $target_url, $key, $form );
23 23
 
24 24
         return $target_url;
25 25
     }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$query['id !'] = $args['exclude'];
45 45
         }
46 46
 
47
-        $where = apply_filters('frm_forms_dropdown', $query, $field_name);
47
+        $where = apply_filters( 'frm_forms_dropdown', $query, $field_name );
48 48
 		$forms = FrmForm::get_published_forms( $where, 999, $args['inc_children'] );
49 49
 		$add_html = array();
50 50
 		self::add_html_attr( $args['onchange'], 'onchange', $add_html );
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		<?php } ?>
58 58
 		<?php foreach ( $forms as $form ) { ?>
59 59
 			<option value="<?php echo esc_attr( $form->id ); ?>" <?php selected( $field_value, $form->id ); ?>><?php
60
-				echo ( '' == $form->name ) ? esc_html__( '(no title)', 'formidable' ) : esc_html( FrmAppHelper::truncate( $form->name, 50 ) ) . ( $form->parent_form_id ? esc_html__( ' (child)', 'formidable' ) : '' ) ;
60
+				echo ( '' == $form->name ) ? esc_html__( '(no title)', 'formidable' ) : esc_html( FrmAppHelper::truncate( $form->name, 50 ) ) . ( $form->parent_form_id ? esc_html__( ' (child)', 'formidable' ) : '' );
61 61
 			?></option>
62 62
 		<?php } ?>
63 63
         </select>
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public static function add_html_attr( $class, $param, &$add_html ) {
75 75
 		if ( ! empty( $class ) ) {
76
-			$add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
76
+			$add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
77 77
 		}
78 78
 	}
79 79
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		$args = array( 'id' => 0, 'form' => 0 );
85 85
 		if ( isset( $_GET['id'] ) && ! isset( $_GET['form'] ) ) {
86 86
 			unset( $args['form'] );
87
-		} else if ( isset( $_GET['form']) && ! isset( $_GET['id'] ) ) {
87
+		} else if ( isset( $_GET['form'] ) && ! isset( $_GET['id'] ) ) {
88 88
 			unset( $args['id'] );
89 89
         }
90 90
 
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
 		if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) && in_array( $frm_action, array( 'edit', 'show', 'destroy_all' ) ) ) {
93 93
             $args['frm_action'] = 'list';
94 94
             $args['form'] = 0;
95
-		} else if ( FrmAppHelper::is_admin_page('formidable' ) && in_array( $frm_action, array( 'new', 'duplicate' ) ) ) {
95
+		} else if ( FrmAppHelper::is_admin_page( 'formidable' ) && in_array( $frm_action, array( 'new', 'duplicate' ) ) ) {
96 96
             $args['frm_action'] = 'edit';
97 97
 		} else if ( isset( $_GET['post'] ) ) {
98 98
             $args['form'] = 0;
99
-            $base = admin_url('edit.php?post_type=frm_display');
99
+            $base = admin_url( 'edit.php?post_type=frm_display' );
100 100
         }
101 101
 
102 102
         ?>
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			        $args['form'] = $form->id;
113 113
 				}
114 114
                 ?>
115
-				<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>
115
+				<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>
116 116
 			<?php
117 117
 				unset( $form );
118 118
 			} ?>
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
     }
123 123
 
124 124
 	public static function get_sortable_classes( $col, $sort_col, $sort_dir ) {
125
-        echo ($sort_col == $col) ? 'sorted' : 'sortable';
126
-        echo ($sort_col == $col && $sort_dir == 'desc') ? ' asc' : ' desc';
125
+        echo ( $sort_col == $col ) ? 'sorted' : 'sortable';
126
+        echo ( $sort_col == $col && $sort_dir == 'desc' ) ? ' asc' : ' desc';
127 127
     }
128 128
 
129 129
 	/**
@@ -158,20 +158,20 @@  discard block
 block discarded – undo
158 158
             $post_values = $values;
159 159
         } else {
160 160
             $values = array();
161
-            $post_values = isset($_POST) ? $_POST : array();
161
+            $post_values = isset( $_POST ) ? $_POST : array();
162 162
         }
163 163
 
164 164
 		foreach ( array( 'name' => '', 'description' => '' ) as $var => $default ) {
165
-			if ( ! isset( $values[ $var ] ) ) {
166
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default );
165
+			if ( ! isset( $values[$var] ) ) {
166
+				$values[$var] = FrmAppHelper::get_param( $var, $default );
167 167
             }
168 168
         }
169 169
 
170
-        $values['description'] = FrmAppHelper::use_wpautop($values['description']);
170
+        $values['description'] = FrmAppHelper::use_wpautop( $values['description'] );
171 171
 
172 172
 		foreach ( array( 'form_id' => '', 'logged_in' => '', 'editable' => '', 'default_template' => 0, 'is_template' => 0, 'status' => 'draft', 'parent_form_id' => 0 ) as $var => $default ) {
173
-            if ( ! isset( $values[ $var ] ) ) {
174
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default );
173
+            if ( ! isset( $values[$var] ) ) {
174
+				$values[$var] = FrmAppHelper::get_param( $var, $default );
175 175
             }
176 176
         }
177 177
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 		$values = self::fill_default_opts( $values, false, $post_values );
183 183
 		$values['custom_style'] = FrmAppHelper::custom_style_value( $values, $post_values );
184 184
 
185
-        return apply_filters('frm_setup_new_form_vars', $values);
185
+        return apply_filters( 'frm_setup_new_form_vars', $values );
186 186
     }
187 187
 
188 188
     /**
@@ -193,42 +193,42 @@  discard block
 block discarded – undo
193 193
 			$post_values = stripslashes_deep( $_POST );
194 194
 		}
195 195
 
196
-        $values['form_key'] = isset($post_values['form_key']) ? $post_values['form_key'] : $record->form_key;
197
-        $values['default_template'] = isset($post_values['default_template']) ? $post_values['default_template'] : $record->default_template;
198
-        $values['is_template'] = isset($post_values['is_template']) ? $post_values['is_template'] : $record->is_template;
196
+        $values['form_key'] = isset( $post_values['form_key'] ) ? $post_values['form_key'] : $record->form_key;
197
+        $values['default_template'] = isset( $post_values['default_template'] ) ? $post_values['default_template'] : $record->default_template;
198
+        $values['is_template'] = isset( $post_values['is_template'] ) ? $post_values['is_template'] : $record->is_template;
199 199
         $values['status'] = $record->status;
200 200
 
201
-        $values = self::fill_default_opts($values, $record, $post_values);
201
+        $values = self::fill_default_opts( $values, $record, $post_values );
202 202
 
203
-        return apply_filters('frm_setup_edit_form_vars', $values);
203
+        return apply_filters( 'frm_setup_edit_form_vars', $values );
204 204
     }
205 205
 
206 206
 	public static function fill_default_opts( $values, $record, $post_values ) {
207 207
 
208 208
         $defaults = self::get_default_opts();
209 209
 		foreach ( $defaults as $var => $default ) {
210
-            if ( is_array($default) ) {
211
-                if ( ! isset( $values[ $var ] ) ) {
212
-					$values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array();
210
+            if ( is_array( $default ) ) {
211
+                if ( ! isset( $values[$var] ) ) {
212
+					$values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array();
213 213
                 }
214 214
 
215 215
                 foreach ( $default as $k => $v ) {
216
-					$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);
216
+					$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 );
217 217
 
218 218
                     if ( is_array( $v ) ) {
219 219
                         foreach ( $v as $k1 => $v1 ) {
220
-							$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 );
220
+							$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 );
221 221
                             unset( $k1, $v1 );
222 222
                         }
223 223
                     }
224 224
 
225
-                    unset($k, $v);
225
+                    unset( $k, $v );
226 226
                 }
227 227
             } else {
228
-				$values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default );
228
+				$values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default );
229 229
             }
230 230
 
231
-            unset($var, $default);
231
+            unset( $var, $default );
232 232
         }
233 233
 
234 234
         return $values;
@@ -241,9 +241,9 @@  discard block
 block discarded – undo
241 241
             'submit_value' => $frm_settings->submit_value, 'success_action' => 'message',
242 242
             'success_msg' => $frm_settings->success_msg, 'show_form' => 0, 'akismet' => '',
243 243
             'no_save' => 0, 'ajax_load' => 0, 'form_class' => '', 'custom_style' => 1,
244
-            'before_html' => self::get_default_html('before'),
244
+            'before_html' => self::get_default_html( 'before' ),
245 245
             'after_html' => '',
246
-            'submit_html' => self::get_default_html('submit'),
246
+            'submit_html' => self::get_default_html( 'submit' ),
247 247
         );
248 248
     }
249 249
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	public static function fill_form_options( &$options, $values ) {
256 256
 		$defaults = self::get_default_opts();
257 257
 		foreach ( $defaults as $var => $default ) {
258
-			$options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default;
258
+			$options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default;
259 259
 			unset( $var, $default );
260 260
 		}
261 261
 	}
@@ -295,21 +295,21 @@  discard block
 block discarded – undo
295 295
     }
296 296
 
297 297
 	public static function get_custom_submit( $html, $form, $submit, $form_action, $values ) {
298
-        $button = self::replace_shortcodes($html, $form, $submit, $form_action, $values);
299
-        if ( ! strpos($button, '[button_action]') ) {
298
+        $button = self::replace_shortcodes( $html, $form, $submit, $form_action, $values );
299
+        if ( ! strpos( $button, '[button_action]' ) ) {
300 300
             return;
301 301
         }
302 302
 
303
-        $button_parts = explode('[button_action]', $button);
303
+        $button_parts = explode( '[button_action]', $button );
304 304
         echo $button_parts[0];
305 305
         //echo ' id="frm_submit_"';
306 306
 
307
-        $classes = apply_filters('frm_submit_button_class', array(), $form);
308
-        if ( ! empty($classes) ) {
307
+        $classes = apply_filters( 'frm_submit_button_class', array(), $form );
308
+        if ( ! empty( $classes ) ) {
309 309
 			echo ' class="' . esc_attr( implode( ' ', $classes ) ) . '"';
310 310
         }
311 311
 
312
-        do_action('frm_submit_button_action', $form, $form_action);
312
+        do_action( 'frm_submit_button_action', $form, $form_action );
313 313
         echo $button_parts[1];
314 314
     }
315 315
 
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 		$last_field = false;
331 331
         foreach ( $fields as $field ) {
332 332
 			if ( $prev_order === $field->field_order ) {
333
-				$add_order++;
333
+				$add_order ++;
334 334
 			}
335 335
 
336 336
 			if ( $add_order ) {
@@ -397,21 +397,21 @@  discard block
 block discarded – undo
397 397
             if ( $code == 'form_name' ) {
398 398
                 $replace_with = $form->name;
399 399
             } else if ( $code == 'form_description' ) {
400
-                $replace_with = FrmAppHelper::use_wpautop($form->description);
401
-            } else if ( $code == 'entry_key' && isset($_GET) && isset($_GET['entry']) ) {
400
+                $replace_with = FrmAppHelper::use_wpautop( $form->description );
401
+            } else if ( $code == 'entry_key' && isset( $_GET ) && isset( $_GET['entry'] ) ) {
402 402
                 $replace_with = FrmAppHelper::simple_get( 'entry' );
403 403
             } else {
404 404
                 $replace_with = '';
405 405
             }
406 406
 
407
-            FrmFieldsHelper::remove_inline_conditions( ( FrmAppHelper::is_true($show) && $replace_with != '' ), $code, $replace_with, $html );
407
+            FrmFieldsHelper::remove_inline_conditions( ( FrmAppHelper::is_true( $show ) && $replace_with != '' ), $code, $replace_with, $html );
408 408
         }
409 409
 
410 410
         //replace [form_key]
411
-        $html = str_replace('[form_key]', $form->form_key, $html);
411
+        $html = str_replace( '[form_key]', $form->form_key, $html );
412 412
 
413 413
         //replace [frmurl]
414
-        $html = str_replace('[frmurl]', FrmFieldsHelper::dynamic_default_values( 'frmurl' ), $html);
414
+        $html = str_replace( '[frmurl]', FrmFieldsHelper::dynamic_default_values( 'frmurl' ), $html );
415 415
 
416 416
 		if ( strpos( $html, '[button_label]' ) ) {
417 417
 			add_filter( 'frm_submit_button', 'FrmFormsHelper::submit_button_label', 1 );
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 			$html = str_replace( '[button_label]', $submit_label, $html );
421 421
         }
422 422
 
423
-        $html = apply_filters('frm_form_replace_shortcodes', $html, $form, $values);
423
+        $html = apply_filters( 'frm_form_replace_shortcodes', $html, $form, $values );
424 424
 
425 425
 		if ( strpos( $html, '[if back_button]' ) ) {
426 426
 			$html = preg_replace( '/(\[if\s+back_button\])(.*?)(\[\/if\s+back_button\])/mis', '', $html );
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
     }
439 439
 
440 440
 	public static function submit_button_label( $submit ) {
441
-        if ( ! $submit || empty($submit) ) {
441
+        if ( ! $submit || empty( $submit ) ) {
442 442
             $frm_settings = FrmAppHelper::get_settings();
443 443
             $submit = $frm_settings->submit_value;
444 444
         }
@@ -447,11 +447,11 @@  discard block
 block discarded – undo
447 447
     }
448 448
 
449 449
 	public static function get_form_style_class( $form = false ) {
450
-        $style = self::get_form_style($form);
450
+        $style = self::get_form_style( $form );
451 451
         $class = ' with_frm_style';
452 452
 
453
-        if ( empty($style) ) {
454
-            if ( FrmAppHelper::is_admin_page('formidable-entries') ) {
453
+        if ( empty( $style ) ) {
454
+            if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) ) {
455 455
                 return $class;
456 456
             } else {
457 457
                 return;
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
         }
460 460
 
461 461
         //If submit button needs to be inline or centered
462
-        if ( is_object($form) ) {
462
+        if ( is_object( $form ) ) {
463 463
 			$form = $form->options;
464 464
 		}
465 465
 
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 			$class .= ' frm_center_submit';
472 472
 		}
473 473
 
474
-        $class = apply_filters('frm_add_form_style_class', $class, $style);
474
+        $class = apply_filters( 'frm_add_form_style_class', $class, $style );
475 475
 
476 476
         return $class;
477 477
     }
@@ -560,12 +560,12 @@  discard block
 block discarded – undo
560 560
     }
561 561
 
562 562
 	public static function edit_form_link( $form_id ) {
563
-        if ( is_object($form_id) ) {
563
+        if ( is_object( $form_id ) ) {
564 564
             $form = $form_id;
565 565
             $name = $form->name;
566 566
             $form_id = $form->id;
567 567
         } else {
568
-            $name = FrmForm::getName($form_id);
568
+            $name = FrmForm::getName( $form_id );
569 569
         }
570 570
 
571 571
         if ( $form_id ) {
@@ -597,12 +597,12 @@  discard block
 block discarded – undo
597 597
         $current_page = isset( $_REQUEST['form_type'] ) ? $_REQUEST['form_type'] : '';
598 598
 		$base_url = '?page=formidable&form_type=' . $current_page . '&id=' . $id;
599 599
         if ( 'trash' == $status ) {
600
-			$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=untrash', 'untrash_form_' . $id ) ) . '" class="submitdelete deletion">' . $labels['restore'][ $length ] . '</a>';
601
-        } else if ( current_user_can('frm_delete_forms') ) {
600
+			$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=untrash', 'untrash_form_' . $id ) ) . '" class="submitdelete deletion">' . $labels['restore'][$length] . '</a>';
601
+        } else if ( current_user_can( 'frm_delete_forms' ) ) {
602 602
             if ( EMPTY_TRASH_DAYS ) {
603
-				$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=trash', 'trash_form_' . $id ) ) . '" class="submitdelete deletion">' . $labels['trash'][ $length ] . '</a>';
603
+				$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=trash', 'trash_form_' . $id ) ) . '" class="submitdelete deletion">' . $labels['trash'][$length] . '</a>';
604 604
             } else {
605
-				$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=destroy', 'destroy_form_' . $id ) ) . '" class="submitdelete deletion" onclick="return confirm(\'' . esc_attr( __( 'Are you sure you want to delete this form and all its entries?', 'formidable' ) ) . '\')">' . $labels['delete'][ $length ] . '</a>';
605
+				$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=destroy', 'destroy_form_' . $id ) ) . '" class="submitdelete deletion" onclick="return confirm(\'' . esc_attr( __( 'Are you sure you want to delete this form and all its entries?', 'formidable' ) ) . '\')">' . $labels['delete'][$length] . '</a>';
606 606
             }
607 607
         }
608 608
 
@@ -616,11 +616,11 @@  discard block
 block discarded – undo
616 616
             'publish'   => __( 'Published', 'formidable' ),
617 617
         );
618 618
 
619
-        if ( ! in_array($status, array_keys($nice_names)) ) {
619
+        if ( ! in_array( $status, array_keys( $nice_names ) ) ) {
620 620
             $status = 'publish';
621 621
         }
622 622
 
623
-		$name = $nice_names[ $status ];
623
+		$name = $nice_names[$status];
624 624
 
625 625
         return $name;
626 626
     }
Please login to merge, or discard this patch.
classes/helpers/FrmListHelper.php 3 patches
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()
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
 		'single_row_columns' );
88 88
 
89 89
 	/**
90
-	* Construct the table object
91
-	*/
90
+	 * Construct the table object
91
+	 */
92 92
 	public function __construct( $args ) {
93
-	    $args = wp_parse_args( $args, array(
93
+		$args = wp_parse_args( $args, array(
94 94
 			'params' => array(),
95 95
 			'plural' => '',
96 96
 			'singular' => '',
Please login to merge, or discard this patch.
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -253,6 +253,9 @@  discard block
 block discarded – undo
253 253
 <?php
254 254
 	}
255 255
 
256
+	/**
257
+	 * @param string $param_name
258
+	 */
256 259
 	private function hidden_search_inputs( $param_name ) {
257 260
 		if ( ! empty( $_REQUEST[ $param_name ] ) ) {
258 261
 			echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $_REQUEST[ $param_name ] ) . '" />';
@@ -389,6 +392,9 @@  discard block
 block discarded – undo
389 392
 		return $action;
390 393
 	}
391 394
 
395
+	/**
396
+	 * @param string $action_name
397
+	 */
392 398
 	private static function get_bulk_action( $action_name ) {
393 399
 		$action = false;
394 400
 		if ( isset( $_REQUEST[ $action_name ] ) && -1 != sanitize_text_field( $_REQUEST[ $action_name ] ) ) {
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 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
 
@@ -197,8 +197,8 @@  discard block
 block discarded – undo
197 197
 			return $this->get_pagenum();
198 198
 		}
199 199
 
200
-		if ( isset( $this->_pagination_args[ $key ] ) ) {
201
-			return $this->_pagination_args[ $key ];
200
+		if ( isset( $this->_pagination_args[$key] ) ) {
201
+			return $this->_pagination_args[$key];
202 202
 		}
203 203
 	}
204 204
 
@@ -253,8 +253,8 @@  discard block
 block discarded – undo
253 253
 	}
254 254
 
255 255
 	private function hidden_search_inputs( $param_name ) {
256
-		if ( ! empty( $_REQUEST[ $param_name ] ) ) {
257
-			echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $_REQUEST[ $param_name ] ) . '" />';
256
+		if ( ! empty( $_REQUEST[$param_name] ) ) {
257
+			echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $_REQUEST[$param_name] ) . '" />';
258 258
 		}
259 259
 	}
260 260
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 
298 298
 		echo "<ul class='subsubsub'>\n";
299 299
 		foreach ( $views as $class => $view ) {
300
-			$views[ $class ] = "\t<li class='$class'>$view";
300
+			$views[$class] = "\t<li class='$class'>$view";
301 301
 		}
302 302
 		echo implode( " |</li>\n", $views ) . "</li>\n";
303 303
 		echo '</ul>';
@@ -390,8 +390,8 @@  discard block
 block discarded – undo
390 390
 
391 391
 	private static function get_bulk_action( $action_name ) {
392 392
 		$action = false;
393
-		if ( isset( $_REQUEST[ $action_name ] ) && -1 != sanitize_text_field( $_REQUEST[ $action_name ] ) ) {
394
-			$action = sanitize_text_field( $_REQUEST[ $action_name ] );
393
+		if ( isset( $_REQUEST[$action_name] ) && -1 != sanitize_text_field( $_REQUEST[$action_name] ) ) {
394
+			$action = sanitize_text_field( $_REQUEST[$action_name] );
395 395
 		}
396 396
 		return $action;
397 397
 	}
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 
417 417
 		$out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
418 418
 		foreach ( $actions as $action => $link ) {
419
-			++$i;
419
+			++ $i;
420 420
 			( $i == $action_count ) ? $sep = '' : $sep = ' | ';
421 421
 			$out .= "<span class='$action'>$link$sep</span>";
422 422
 		}
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 
685 685
 		// If the primary column doesn't exist fall back to the
686 686
 		// first non-checkbox column.
687
-		if ( ! isset( $columns[ $default ] ) ) {
687
+		if ( ! isset( $columns[$default] ) ) {
688 688
 			$default = FrmListHelper::get_default_primary_column_name();
689 689
 		}
690 690
 
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 		 */
699 699
 		$column  = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
700 700
 
701
-		if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
701
+		if ( empty( $column ) || ! isset( $columns[$column] ) ) {
702 702
 			$column = $default;
703 703
 		}
704 704
 
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
 			// In 4.3, we added a fourth argument for primary column.
721 721
 			$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
722 722
 			foreach ( $this->_column_headers as $key => $value ) {
723
-				$column_headers[ $key ] = $value;
723
+				$column_headers[$key] = $value;
724 724
 			}
725 725
 
726 726
 			return $column_headers;
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 				$data[1] = false;
754 754
 			}
755 755
 
756
-			$sortable[ $id ] = $data;
756
+			$sortable[$id] = $data;
757 757
 		}
758 758
 
759 759
 		$primary = $this->get_primary_column_name();
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 			static $cb_counter = 1;
809 809
 			$columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
810 810
 				. '<input id="cb-select-all-' . esc_attr( $cb_counter ) . '" type="checkbox" />';
811
-			$cb_counter++;
811
+			$cb_counter ++;
812 812
 		}
813 813
 
814 814
 		foreach ( $columns as $column_key => $column_display_name ) {
@@ -828,8 +828,8 @@  discard block
 block discarded – undo
828 828
 				$class[] = 'column-primary';
829 829
 			}
830 830
 
831
-			if ( isset( $sortable[ $column_key ] ) ) {
832
-				list( $orderby, $desc_first ) = $sortable[ $column_key ];
831
+			if ( isset( $sortable[$column_key] ) ) {
832
+				list( $orderby, $desc_first ) = $sortable[$column_key];
833 833
 
834 834
 				if ( $current_orderby == $orderby ) {
835 835
 					$order = 'asc' == $current_order ? 'desc' : 'asc';
Please login to merge, or discard this patch.
classes/views/shared/form-nav.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,6 +17,6 @@
 block discarded – undo
17 17
 </ul>
18 18
 
19 19
 <?php if ( $form && $title == 'show' ) { ?>
20
-    <input id="title" type="text" value="<?php echo esc_attr( $form->name == '' ? __( '(no title)') : $form->name ) ?>" readonly="readonly" disabled="disabled" />
20
+    <input id="title" type="text" value="<?php echo esc_attr( $form->name == '' ? __( '(no title)' ) : $form->name ) ?>" readonly="readonly" disabled="disabled" />
21 21
 <?php } ?>
22 22
 </div>
Please login to merge, or discard this patch.
classes/views/xml/import_form.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,9 +87,9 @@
 block discarded – undo
87 87
 								} else if ( $form->is_template ) {
88 88
 									echo ' ' . __( '(template)', 'formidable' );
89 89
 								}
90
-                        ?></option>
90
+						?></option>
91 91
                         <?php
92
-                        } ?>
92
+						} ?>
93 93
                         </select>
94 94
                         <p class="howto"><?php _e( 'Hold down the CTRL/Command button to select multiple forms', 'formidable' ); ?></p>
95 95
                     </td>
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,16 +10,16 @@  discard block
 block discarded – undo
10 10
     <div class="postbox ">
11 11
     <h3 class="hndle"><span><?php _e( 'Import', 'formidable' ) ?></span></h3>
12 12
     <div class="inside">
13
-        <p class="howto"><?php echo apply_filters('frm_upload_instructions1', __( 'Upload your Formidable XML file to import forms into this site. If your imported form key and creation date match a form on your site, that form will be updated.', 'formidable' )) ?></p>
13
+        <p class="howto"><?php echo apply_filters( 'frm_upload_instructions1', __( 'Upload your Formidable XML file to import forms into this site. If your imported form key and creation date match a form on your site, that form will be updated.', 'formidable' ) ) ?></p>
14 14
         <br/>
15 15
         <form enctype="multipart/form-data" method="post">
16 16
             <input type="hidden" name="frm_action" value="import_xml" />
17
-            <?php wp_nonce_field('import-xml-nonce', 'import-xml'); ?>
18
-            <p><label><?php echo apply_filters('frm_upload_instructions2', __( 'Choose a Formidable XML file', 'formidable' )) ?> (<?php printf(__( 'Maximum size: %s', 'formidable' ), ini_get('upload_max_filesize')) ?>)</label>
17
+            <?php wp_nonce_field( 'import-xml-nonce', 'import-xml' ); ?>
18
+            <p><label><?php echo apply_filters( 'frm_upload_instructions2', __( 'Choose a Formidable XML file', 'formidable' ) ) ?> (<?php printf( __( 'Maximum size: %s', 'formidable' ), ini_get( 'upload_max_filesize' ) ) ?>)</label>
19 19
             <input type="file" name="frm_import_file" size="25" />
20 20
             </p>
21 21
 
22
-            <?php do_action('frm_csv_opts', $forms) ?>
22
+            <?php do_action( 'frm_csv_opts', $forms ) ?>
23 23
 
24 24
             <p class="submit">
25 25
 				<input type="submit" value="<?php esc_attr_e( 'Upload file and import', 'formidable' ) ?>" class="button-primary" />
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     <div class="inside with_frm_style">
36 36
 		<form method="post" action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>" id="frm_export_xml">
37 37
             <input type="hidden" name="action" value="frm_export_xml" />
38
-            <?php wp_nonce_field('export-xml-nonce', 'export-xml'); ?>
38
+            <?php wp_nonce_field( 'export-xml-nonce', 'export-xml' ); ?>
39 39
 
40 40
             <table class="form-table">
41 41
                 <tr class="form-field">
Please login to merge, or discard this patch.
classes/helpers/FrmCSVExportHelper.php 2 patches
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -235,50 +235,50 @@  discard block
 block discarded – undo
235 235
 			return $line;
236 236
 		}
237 237
 
238
-        $convmap = false;
238
+		$convmap = false;
239 239
 
240 240
 		switch ( self::$to_encoding ) {
241
-            case 'macintosh':
241
+			case 'macintosh':
242 242
 				// this map was derived from the differences between the MacRoman and UTF-8 Charsets
243 243
 				// Reference:
244 244
 				//   - http://www.alanwood.net/demos/macroman.html
245
-                $convmap = array(
246
-                    256, 304, 0, 0xffff,
247
-                    306, 337, 0, 0xffff,
248
-                    340, 375, 0, 0xffff,
249
-                    377, 401, 0, 0xffff,
250
-                    403, 709, 0, 0xffff,
251
-                    712, 727, 0, 0xffff,
252
-                    734, 936, 0, 0xffff,
253
-                    938, 959, 0, 0xffff,
254
-                    961, 8210, 0, 0xffff,
255
-                    8213, 8215, 0, 0xffff,
256
-                    8219, 8219, 0, 0xffff,
257
-                    8227, 8229, 0, 0xffff,
258
-                    8231, 8239, 0, 0xffff,
259
-                    8241, 8248, 0, 0xffff,
260
-                    8251, 8259, 0, 0xffff,
261
-                    8261, 8363, 0, 0xffff,
262
-                    8365, 8481, 0, 0xffff,
263
-                    8483, 8705, 0, 0xffff,
264
-                    8707, 8709, 0, 0xffff,
265
-                    8711, 8718, 0, 0xffff,
266
-                    8720, 8720, 0, 0xffff,
267
-                    8722, 8729, 0, 0xffff,
268
-                    8731, 8733, 0, 0xffff,
269
-                    8735, 8746, 0, 0xffff,
270
-                    8748, 8775, 0, 0xffff,
271
-                    8777, 8799, 0, 0xffff,
272
-                    8801, 8803, 0, 0xffff,
273
-                    8806, 9673, 0, 0xffff,
274
-                    9675, 63742, 0, 0xffff,
275
-                    63744, 64256, 0, 0xffff,
276
-                );
277
-            break;
278
-            case 'ISO-8859-1':
279
-                $convmap = array( 256, 10000, 0, 0xffff );
280
-            break;
281
-        }
245
+				$convmap = array(
246
+					256, 304, 0, 0xffff,
247
+					306, 337, 0, 0xffff,
248
+					340, 375, 0, 0xffff,
249
+					377, 401, 0, 0xffff,
250
+					403, 709, 0, 0xffff,
251
+					712, 727, 0, 0xffff,
252
+					734, 936, 0, 0xffff,
253
+					938, 959, 0, 0xffff,
254
+					961, 8210, 0, 0xffff,
255
+					8213, 8215, 0, 0xffff,
256
+					8219, 8219, 0, 0xffff,
257
+					8227, 8229, 0, 0xffff,
258
+					8231, 8239, 0, 0xffff,
259
+					8241, 8248, 0, 0xffff,
260
+					8251, 8259, 0, 0xffff,
261
+					8261, 8363, 0, 0xffff,
262
+					8365, 8481, 0, 0xffff,
263
+					8483, 8705, 0, 0xffff,
264
+					8707, 8709, 0, 0xffff,
265
+					8711, 8718, 0, 0xffff,
266
+					8720, 8720, 0, 0xffff,
267
+					8722, 8729, 0, 0xffff,
268
+					8731, 8733, 0, 0xffff,
269
+					8735, 8746, 0, 0xffff,
270
+					8748, 8775, 0, 0xffff,
271
+					8777, 8799, 0, 0xffff,
272
+					8801, 8803, 0, 0xffff,
273
+					8806, 9673, 0, 0xffff,
274
+					9675, 63742, 0, 0xffff,
275
+					63744, 64256, 0, 0xffff,
276
+				);
277
+			break;
278
+			case 'ISO-8859-1':
279
+				$convmap = array( 256, 10000, 0, 0xffff );
280
+			break;
281
+		}
282 282
 
283 283
 		if ( is_array( $convmap ) ) {
284 284
 			$line = mb_encode_numericentity( $line, $convmap, self::$charset );
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 		}
290 290
 
291 291
 		return self::escape_csv( $line );
292
-    }
292
+	}
293 293
 
294 294
 	/**
295 295
 	 * Escape a " in a csv with another "
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 		header( 'Content-Description: File Transfer' );
65 65
 		header( 'Content-Disposition: attachment; filename="' . esc_attr( $filename ) . '"' );
66 66
 		header( 'Content-Type: text/csv; charset=' . self::$charset, true );
67
-		header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', mktime( date( 'H' ) + 2, date( 'i' ), date( 's' ), date( 'm' ), date( 'd' ), date('Y' ) ) ) . ' GMT' );
67
+		header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', mktime( date( 'H' ) + 2, date( 'i' ), date( 's' ), date( 'm' ), date( 'd' ), date( 'Y' ) ) ) . ' GMT' );
68 68
 		header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
69 69
 		header( 'Cache-Control: no-cache, must-revalidate' );
70 70
 		header( 'Pragma: no-cache' );
@@ -91,21 +91,21 @@  discard block
 block discarded – undo
91 91
 		foreach ( self::$fields as $col ) {
92 92
 			$field_headings = array();
93 93
 			if ( isset( $col->field_options['separate_value'] ) && $col->field_options['separate_value'] && ! in_array( $col->type, array( 'user_id', 'file', 'data', 'date' ) ) ) {
94
-				$field_headings[ $col->id . '_label' ] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) );
94
+				$field_headings[$col->id . '_label'] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) );
95 95
 			}
96 96
 
97
-			$field_headings[ $col->id ] = strip_tags( $col->name );
97
+			$field_headings[$col->id] = strip_tags( $col->name );
98 98
 			$field_headings = apply_filters( 'frm_csv_field_columns', $field_headings, array( 'field' => $col ) );
99 99
 			$headings += $field_headings;
100 100
 		}
101 101
 
102 102
 		if ( self::$comment_count ) {
103
-			for ( $i = 0; $i < self::$comment_count; $i++ ) {
104
-				$headings[ 'comment' . $i ] = __( 'Comment', 'formidable' );
105
-				$headings[ 'comment_user_id' . $i ] = __( 'Comment User', 'formidable' );
106
-				$headings[ 'comment_created_at' . $i ] = __( 'Comment Date', 'formidable' );
103
+			for ( $i = 0; $i < self::$comment_count; $i ++ ) {
104
+				$headings['comment' . $i] = __( 'Comment', 'formidable' );
105
+				$headings['comment_user_id' . $i] = __( 'Comment User', 'formidable' );
106
+				$headings['comment_created_at' . $i] = __( 'Comment Date', 'formidable' );
107 107
 			}
108
-			unset($i);
108
+			unset( $i );
109 109
 		}
110 110
 
111 111
 		$headings['created_at'] = __( 'Timestamp', 'formidable' );
@@ -152,30 +152,30 @@  discard block
 block discarded – undo
152 152
 					continue;
153 153
 				}
154 154
 
155
-				if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) {
156
-					$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = array();
157
-				} else if ( ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) {
155
+				if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) {
156
+					$entries[self::$entry->parent_item_id]->metas[$meta_id] = array();
157
+				} else if ( ! is_array( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) {
158 158
 					// if the data is here, it should be an array but if this field has collected data
159 159
 					// both while inside and outside of the repeating section, it's possible this is a string
160
-					$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = (array) $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ];
160
+					$entries[self::$entry->parent_item_id]->metas[$meta_id] = (array) $entries[self::$entry->parent_item_id]->metas[$meta_id];
161 161
 				}
162 162
 
163 163
 				//add the repeated values
164
-				$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ][] = $meta_value;
164
+				$entries[self::$entry->parent_item_id]->metas[$meta_id][] = $meta_value;
165 165
 			}
166
-			$entries[ self::$entry->parent_item_id ]->metas += self::$entry->metas;
166
+			$entries[self::$entry->parent_item_id]->metas += self::$entry->metas;
167 167
 		}
168 168
 
169 169
 		// add the embedded form id
170
-		if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) {
171
-			$entries[ self::$entry->parent_item_id ]->embedded_fields = array();
170
+		if ( ! isset( $entries[self::$entry->parent_item_id]->embedded_fields ) ) {
171
+			$entries[self::$entry->parent_item_id]->embedded_fields = array();
172 172
 		}
173
-		$entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id;
173
+		$entries[self::$entry->parent_item_id]->embedded_fields[self::$entry->id] = self::$entry->form_id;
174 174
 	}
175 175
 
176 176
 	private static function add_field_values_to_csv( &$row ) {
177 177
 		foreach ( self::$fields as $col ) {
178
-			$field_value = isset( self::$entry->metas[ $col->id ] ) ? self::$entry->metas[ $col->id ] : false;
178
+			$field_value = isset( self::$entry->metas[$col->id] ) ? self::$entry->metas[$col->id] : false;
179 179
 
180 180
 			$field_value = maybe_unserialize( $field_value );
181 181
 			self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) );
@@ -186,13 +186,13 @@  discard block
 block discarded – undo
186 186
 				$sep_value = FrmEntriesHelper::display_value( $field_value, $col, array(
187 187
 					'type' => $col->type, 'post_id' => self::$entry->post_id, 'show_icon' => false,
188 188
 					'entry_id' => self::$entry->id, 'sep' => self::$separator,
189
-					'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0,
189
+					'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[self::$entry->id] ) ) ? 'form' . self::$entry->embedded_fields[self::$entry->id] : 0,
190 190
 					) );
191
-				$row[ $col->id . '_label' ] = $sep_value;
191
+				$row[$col->id . '_label'] = $sep_value;
192 192
 				unset( $sep_value );
193 193
 			}
194 194
 
195
-			$row[ $col->id ] = $field_value;
195
+			$row[$col->id] = $field_value;
196 196
 
197 197
 			unset( $col, $field_value );
198 198
 		}
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
 		if ( is_array( $atts['field_value'] ) ) {
206 206
 			foreach ( $atts['field_value'] as $key => $sub_value ) {
207 207
 				$column_key = $atts['col']->id . '_' . $key;
208
-				if ( ! is_numeric( $key ) && isset( self::$headings[ $column_key ] ) ) {
209
-					$row[ $column_key ] = $sub_value;
208
+				if ( ! is_numeric( $key ) && isset( self::$headings[$column_key] ) ) {
209
+					$row[$column_key] = $sub_value;
210 210
 				}
211 211
 			}
212 212
 		}
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 		$sep = '';
228 228
 
229 229
 		foreach ( self::$headings as $k => $heading ) {
230
-			$row = isset( $rows[ $k ] ) ? $rows[ $k ] : '';
230
+			$row = isset( $rows[$k] ) ? $rows[$k] : '';
231 231
 			if ( is_array( $row ) ) {
232 232
 				// implode the repeated field values
233 233
 				$row = implode( self::$separator, FrmAppHelper::array_flatten( $row, 'reset' ) );
Please login to merge, or discard this patch.
classes/models/FrmPointers.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 	/**
46 46
 	 * Get the singleton instance of this class
47 47
 	 *
48
-	 * @return object
48
+	 * @return FrmPointers
49 49
 	 */
50 50
 	public static function get_instance() {
51 51
 		if ( ! ( self::$instance instanceof self ) ) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@
 block discarded – undo
184 184
 	private function do_page_pointer( $page ) {
185 185
 		$selector = 'h2';
186 186
 
187
-		$pointer = call_user_func( array( $this, $this->admin_pages[ $page ] ) );
187
+		$pointer = call_user_func( array( $this, $this->admin_pages[$page] ) );
188 188
 
189 189
 		$opt_arr = array(
190 190
 			'content'      => $pointer['content'],
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -239,16 +239,16 @@  discard block
 block discarded – undo
239 239
 
240 240
 		return array(
241 241
 			'content'   => '<h3>' . __( 'Forms', 'formidable' ) . '</h3>'
242
-			               . '<p>' . __( 'All your forms will be listed on this page. Create your first form by clicking on the "Add New" button.', 'formidable' ) . '</p>'
243
-			               . '<p><strong>' . __( 'Subscribe to our Newsletter', 'formidable' ) . '</strong><br/>'
244
-			               . sprintf( __( 'If you would like to hear about new features and updates for %1$s, subscribe to our newsletter:', 'formidable' ), 'Formidable' ) . '</p>'
245
-			               . '<form target="_blank" action="//formidablepro.us1.list-manage.com/subscribe/post?u=a4a913790ffb892daacc6f271&amp;id=7e7df15967" method="post" selector="newsletter-form" accept-charset="' . esc_attr( get_bloginfo( 'charset' ) ) . '">'
246
-			               . '<p>'
247
-			               . '<input style="margin: 5px; color:#666" name="EMAIL" value="' . esc_attr( $current_user->user_email ) . '" selector="newsletter-email" placeholder="' . esc_attr__( 'Email', 'formidable' ) . '"/>'
242
+						   . '<p>' . __( 'All your forms will be listed on this page. Create your first form by clicking on the "Add New" button.', 'formidable' ) . '</p>'
243
+						   . '<p><strong>' . __( 'Subscribe to our Newsletter', 'formidable' ) . '</strong><br/>'
244
+						   . sprintf( __( 'If you would like to hear about new features and updates for %1$s, subscribe to our newsletter:', 'formidable' ), 'Formidable' ) . '</p>'
245
+						   . '<form target="_blank" action="//formidablepro.us1.list-manage.com/subscribe/post?u=a4a913790ffb892daacc6f271&amp;id=7e7df15967" method="post" selector="newsletter-form" accept-charset="' . esc_attr( get_bloginfo( 'charset' ) ) . '">'
246
+						   . '<p>'
247
+						   . '<input style="margin: 5px; color:#666" name="EMAIL" value="' . esc_attr( $current_user->user_email ) . '" selector="newsletter-email" placeholder="' . esc_attr__( 'Email', 'formidable' ) . '"/>'
248 248
 						   . '<input type="hidden" name="group[4505]" value="4" />'
249
-			               . '<button type="submit" class="button-primary">' . esc_html__( 'Subscribe', 'formidable' ) . '</button>'
250
-			               . '</p>'
251
-			               . '</form>',
249
+						   . '<button type="submit" class="button-primary">' . esc_html__( 'Subscribe', 'formidable' ) . '</button>'
250
+						   . '</p>'
251
+						   . '</form>',
252 252
 			'next_page' => 'entries',
253 253
 		);
254 254
 	}
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	private function entries_pointer() {
262 262
 		return array(
263 263
 			'content'   => '<h3>' . __( 'Entries', 'formidable' ) . '</h3>'
264
-			               . '<p>' . __( 'Each time one of your forms is submitted, an entry is created. You will find every form submission listed here so you will always have a backup if an email fails.', 'formidable' ) . '</p>',
264
+						   . '<p>' . __( 'Each time one of your forms is submitted, an entry is created. You will find every form submission listed here so you will always have a backup if an email fails.', 'formidable' ) . '</p>',
265 265
 			'prev_page' => '',
266 266
 			'next_page' => 'styles',
267 267
 			'selector'  => '.wp-list-table',
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 	private function styles_pointer() {
278 278
 		return array(
279 279
 			'content'   => '<h3>' . __( 'Styles', 'formidable' ) . '</h3>'
280
-			               . '<p>' . __( 'Want to make changes to the way your forms look? Make all the changes you would like right here, and watch the sample form change before your eyes.', 'formidable' ) . '</p>',
280
+						   . '<p>' . __( 'Want to make changes to the way your forms look? Make all the changes you would like right here, and watch the sample form change before your eyes.', 'formidable' ) . '</p>',
281 281
 			'prev_page' => 'entries',
282 282
 			'next_page' => 'import',
283 283
 			'selector'  => '.general-style',
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 	private function import_pointer() {
294 294
 		return array(
295 295
 			'content'   => '<h3>' . __( 'Import/Export', 'formidable' ) . '</h3>'
296
-			               . '<p>' . __( 'Import and export forms and styles when copying from one site to another or sharing with someone else. Your entries can be exported to a CSV as well. The Premium version also includes the option to import entries to your site from a CSV.', 'formidable' ) . '</p>',
296
+						   . '<p>' . __( 'Import and export forms and styles when copying from one site to another or sharing with someone else. Your entries can be exported to a CSV as well. The Premium version also includes the option to import entries to your site from a CSV.', 'formidable' ) . '</p>',
297 297
 			'prev_page' => 'styles',
298 298
 			'next_page' => 'settings',
299 299
 			'selector'  => '.inside.with_frm_style',
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 				. __( 'Turn stylesheets and scripts off, set which user roles have access to change and create forms, setup your reCaptcha, and set default messages for new forms and fields.', 'formidable' )
314 314
 				. '<p><strong>' . __( 'Plugin Licenses', 'formidable' ) . '</strong><br/>'
315 315
 				. sprintf( __( 'Once you&#8217;ve purchased %1$s or any addons, you&#8217;ll have to enter a license key to get access to all of their powerful features. A Plugin Licenses tab will appear here for you to enter your license key.', 'formidable' ), 'Formidable Pro' )
316
-           	    . '</p>',
316
+		   		. '</p>',
317 317
 			'prev_page' => 'import',
318 318
 			'next_page' => 'addons',
319 319
 		);
@@ -327,10 +327,10 @@  discard block
 block discarded – undo
327 327
 	private function addons_pointer() {
328 328
 		return array(
329 329
 			'content'   => '<h3>' . __( 'Addons', 'formidable' ) . '</h3>'
330
-			               . '<p>' . sprintf( __( 'The powerful functions of %1$s can be extended with %2$spremium plugins%3$s. You can read all about the Formidable Premium Plugins %2$shere%3$s.', 'formidable' ), 'Formidable', '<a target="_blank" href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/' ) ) . '">', '</a>' )
330
+						   . '<p>' . sprintf( __( 'The powerful functions of %1$s can be extended with %2$spremium plugins%3$s. You can read all about the Formidable Premium Plugins %2$shere%3$s.', 'formidable' ), 'Formidable', '<a target="_blank" href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/' ) ) . '">', '</a>' )
331 331
 						   . '</p>'
332
-			               . '<p><strong>' . __( 'Like this plugin?', 'formidable' ) . '</strong><br/>' . sprintf( __( 'So, we&#8217;ve come to the end of the tour. If you like the plugin, please %1$srate it 5 stars on WordPress.org%2$s!', 'formidable' ), '<a target="_blank" href="https://wordpress.org/plugins/formidable/">', '</a>' ) . '</p>'
333
-			               . '<p>' . sprintf( __( 'Thank you for using our plugin and good luck with your forms!<br/><br/>Best,<br/>Team Formidable - %1$sformidableforms.com%2$s', 'formidable' ), '<a target="_blank" href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/' ) ) . '">', '</a>' ) . '</p>',
332
+						   . '<p><strong>' . __( 'Like this plugin?', 'formidable' ) . '</strong><br/>' . sprintf( __( 'So, we&#8217;ve come to the end of the tour. If you like the plugin, please %1$srate it 5 stars on WordPress.org%2$s!', 'formidable' ), '<a target="_blank" href="https://wordpress.org/plugins/formidable/">', '</a>' ) . '</p>'
333
+						   . '<p>' . sprintf( __( 'Thank you for using our plugin and good luck with your forms!<br/><br/>Best,<br/>Team Formidable - %1$sformidableforms.com%2$s', 'formidable' ), '<a target="_blank" href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/' ) ) . '">', '</a>' ) . '</p>',
334 334
 			'prev_page' => 'settings',
335 335
 		);
336 336
 	}
Please login to merge, or discard this patch.
classes/views/styles/_field-colors.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 				<a href="?page=formidable-styles&page-tab=default#tabs-panel-default-color" class="nav-tab-link" data-type="tabs-panel-default-color"><?php _e( 'Default', 'formidable' ) ?></a>
5 5
 			</li>
6 6
 			<li <?php echo ( 'active-color' == $current_tab ? ' class="tabs"' : '' ); ?>>
7
-				<a href="<?php echo esc_url('?page=formidable-styles&page-tab=active-color#page-active-color') ?>" class="nav-tab-link" data-type="tabs-panel-active-color"><?php _e( 'Active', 'formidable' ) ?></a>
7
+				<a href="<?php echo esc_url( '?page=formidable-styles&page-tab=active-color#page-active-color' ) ?>" class="nav-tab-link" data-type="tabs-panel-active-color"><?php _e( 'Active', 'formidable' ) ?></a>
8 8
 			</li>
9 9
 			<li <?php echo ( 'active-error' == $current_tab ? ' class="tabs"' : '' ); ?>>
10 10
 				<a href="?page=formidable-styles&page-tab=active-error#tabs-panel-active-error" class="nav-tab-link" data-type="tabs-panel-active-error"><?php _e( 'Error', 'formidable' ) ?></a>
@@ -19,34 +19,34 @@  discard block
 block discarded – undo
19 19
 		?>">
20 20
 			<div class="field-group field-group-border clearfix">
21 21
             	<label class="background"><?php _e( 'BG color', 'formidable' ) ?></label>
22
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color') ) ?>" id="frm_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color'] ) ?>" />
22
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color' ) ) ?>" id="frm_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color'] ) ?>" />
23 23
             </div>
24 24
             <div class="field-group clearfix">
25 25
             	<label><?php _e( 'Text', 'formidable' ) ?></label>
26
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('text_color') ) ?>" id="frm_text_color" class="hex" value="<?php echo esc_attr( $style->post_content['text_color'] ) ?>" />
26
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'text_color' ) ) ?>" id="frm_text_color" class="hex" value="<?php echo esc_attr( $style->post_content['text_color'] ) ?>" />
27 27
             </div>
28 28
 
29 29
             <div class="field-group field-group-border clearfix">
30 30
             	<label><?php _e( 'Border', 'formidable' ) ?></label>
31
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color') ) ?>" id="frm_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['border_color'] ) ?>" />
31
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color' ) ) ?>" id="frm_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['border_color'] ) ?>" />
32 32
             </div>
33 33
             <div class="field-group clearfix">
34 34
             	<label><?php _e( 'Thickness', 'formidable' ) ?></label>
35
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_border_width') ) ?>" id="frm_field_border_width" value="<?php echo esc_attr( $style->post_content['field_border_width'] ) ?>" size="4" />
35
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_border_width' ) ) ?>" id="frm_field_border_width" value="<?php echo esc_attr( $style->post_content['field_border_width'] ) ?>" size="4" />
36 36
             </div>
37 37
             <div class="field-group clearfix">
38 38
 				<label><?php _e( 'Style', 'formidable' ) ?></label>
39
-            	<select name="<?php echo esc_attr( $frm_style->get_field_name('field_border_style') ) ?>" id="frm_field_border_style">
40
-            	    <option value="solid" <?php selected($style->post_content['field_border_style'], 'solid') ?>><?php _e( 'solid', 'formidable' ) ?></option>
41
-            		<option value="dotted" <?php selected($style->post_content['field_border_style'], 'dotted') ?>><?php _e( 'dotted', 'formidable' ) ?></option>
42
-            		<option value="dashed" <?php selected($style->post_content['field_border_style'], 'dashed') ?>><?php _e( 'dashed', 'formidable' ) ?></option>
43
-            		<option value="double" <?php selected($style->post_content['field_border_style'], 'double') ?>><?php _e( 'double', 'formidable' ) ?></option>
39
+            	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'field_border_style' ) ) ?>" id="frm_field_border_style">
40
+            	    <option value="solid" <?php selected( $style->post_content['field_border_style'], 'solid' ) ?>><?php _e( 'solid', 'formidable' ) ?></option>
41
+            		<option value="dotted" <?php selected( $style->post_content['field_border_style'], 'dotted' ) ?>><?php _e( 'dotted', 'formidable' ) ?></option>
42
+            		<option value="dashed" <?php selected( $style->post_content['field_border_style'], 'dashed' ) ?>><?php _e( 'dashed', 'formidable' ) ?></option>
43
+            		<option value="double" <?php selected( $style->post_content['field_border_style'], 'double' ) ?>><?php _e( 'double', 'formidable' ) ?></option>
44 44
             	</select>
45 45
             </div>
46 46
             <div class="clear"></div>
47 47
 			<p class="frm_no_bottom_margin">
48 48
 				<label>
49
-					<input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('remove_box_shadow') ) ?>" id="frm_remove_box_shadow" value="1" <?php checked($style->post_content['remove_box_shadow'], 1) ?> />
49
+					<input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'remove_box_shadow' ) ) ?>" id="frm_remove_box_shadow" value="1" <?php checked( $style->post_content['remove_box_shadow'], 1 ) ?> />
50 50
 					<?php _e( 'Remove box shadow', 'formidable' ) ?>
51 51
 				</label>
52 52
 			</p>
@@ -57,16 +57,16 @@  discard block
 block discarded – undo
57 57
 		?>">
58 58
             <div class="field-group field-group-border clearfix">
59 59
             	<label class="background"><?php _e( 'BG color', 'formidable' ) ?></label>
60
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color_active') ) ?>" id="frm_bg_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_active'] ) ?>" />
60
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color_active' ) ) ?>" id="frm_bg_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_active'] ) ?>" />
61 61
             </div>
62 62
             <div class="field-group clearfix">
63 63
             	<label><?php _e( 'Border', 'formidable' ) ?></label>
64
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color_active') ) ?>" id="frm_border_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_active'] ) ?>" />
64
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color_active' ) ) ?>" id="frm_border_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_active'] ) ?>" />
65 65
             </div>
66 66
 			<div class="clear"></div>
67 67
 			<p class="frm_no_bottom_margin">
68 68
 				<label>
69
-					<input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('remove_box_shadow_active') ) ?>" id="frm_remove_box_shadow_active" value="1" <?php checked($style->post_content['remove_box_shadow_active'], 1) ?> />
69
+					<input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'remove_box_shadow_active' ) ) ?>" id="frm_remove_box_shadow_active" value="1" <?php checked( $style->post_content['remove_box_shadow_active'], 1 ) ?> />
70 70
 					<?php _e( 'Remove box shadow', 'formidable' ) ?>
71 71
 				</label>
72 72
 			</p>
@@ -77,28 +77,28 @@  discard block
 block discarded – undo
77 77
 		?>">
78 78
 		    <div class="field-group field-group-border clearfix">
79 79
         	    <label class="background"><?php _e( 'BG color', 'formidable' ) ?></label>
80
-        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color_error') ) ?>" id="frm_bg_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_error'] ) ?>" />
80
+        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color_error' ) ) ?>" id="frm_bg_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_error'] ) ?>" />
81 81
             </div>
82 82
             <div class="field-group clearfix">
83 83
         	    <label><?php _e( 'Text', 'formidable' ) ?></label>
84
-        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('text_color_error') ) ?>" id="frm_text_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_error'] ) ?>" />
84
+        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'text_color_error' ) ) ?>" id="frm_text_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_error'] ) ?>" />
85 85
             </div>
86 86
 
87 87
             <div class="field-group field-group-border clearfix">
88 88
                 <label><?php _e( 'Border', 'formidable' ) ?></label>
89
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color_error') ) ?>" id="frm_border_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_error'] ) ?>" />
89
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color_error' ) ) ?>" id="frm_border_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_error'] ) ?>" />
90 90
             </div>
91 91
             <div class="field-group clearfix">
92 92
             	<label><?php _e( 'Thickness', 'formidable' ) ?></label>
93
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_width_error') ) ?>" id="frm_border_width_error" value="<?php echo esc_attr( $style->post_content['border_width_error'] ) ?>" size="4" />
93
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_width_error' ) ) ?>" id="frm_border_width_error" value="<?php echo esc_attr( $style->post_content['border_width_error'] ) ?>" size="4" />
94 94
             </div>
95 95
             <div class="field-group clearfix">
96 96
             	<label><?php _e( 'Style', 'formidable' ) ?></label>
97
-            	<select name="<?php echo esc_attr( $frm_style->get_field_name('border_style_error') ) ?>" id="frm_border_style_error">
98
-            	    <option value="solid" <?php selected($style->post_content['border_style_error'], 'solid') ?>><?php _e( 'solid', 'formidable' ) ?></option>
99
-            		<option value="dotted" <?php selected($style->post_content['border_style_error'], 'dotted') ?>><?php _e( 'dotted', 'formidable' ) ?></option>
100
-            		<option value="dashed" <?php selected($style->post_content['border_style_error'], 'dashed') ?>><?php _e( 'dashed', 'formidable' ) ?></option>
101
-            		<option value="double" <?php selected($style->post_content['border_style_error'], 'double') ?>><?php _e( 'double', 'formidable' ) ?></option>
97
+            	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'border_style_error' ) ) ?>" id="frm_border_style_error">
98
+            	    <option value="solid" <?php selected( $style->post_content['border_style_error'], 'solid' ) ?>><?php _e( 'solid', 'formidable' ) ?></option>
99
+            		<option value="dotted" <?php selected( $style->post_content['border_style_error'], 'dotted' ) ?>><?php _e( 'dotted', 'formidable' ) ?></option>
100
+            		<option value="dashed" <?php selected( $style->post_content['border_style_error'], 'dashed' ) ?>><?php _e( 'dashed', 'formidable' ) ?></option>
101
+            		<option value="double" <?php selected( $style->post_content['border_style_error'], 'double' ) ?>><?php _e( 'double', 'formidable' ) ?></option>
102 102
             	</select>
103 103
             </div>
104 104
 
@@ -110,16 +110,16 @@  discard block
 block discarded – undo
110 110
 		?>">
111 111
 		    <div class="field-group field-group-border clearfix">
112 112
         	    <label class="background"><?php _e( 'BG color', 'formidable' ) ?></label>
113
-        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color_disabled') ) ?>" id="frm_bg_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_disabled'] ) ?>" />
113
+        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color_disabled' ) ) ?>" id="frm_bg_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_disabled'] ) ?>" />
114 114
             </div>
115 115
             <div class="field-group clearfix">
116 116
         	    <label><?php _e( 'Text', 'formidable' ) ?></label>
117
-        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('text_color_disabled') ) ?>" id="frm_text_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_disabled'] ) ?>" />
117
+        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'text_color_disabled' ) ) ?>" id="frm_text_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_disabled'] ) ?>" />
118 118
             </div>
119 119
 
120 120
             <div class="field-group clearfix">
121 121
                 <label><?php _e( 'Border', 'formidable' ) ?></label>
122
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color_disabled') ) ?>" id="frm_border_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_disabled'] ) ?>" />
122
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color_disabled' ) ) ?>" id="frm_border_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_disabled'] ) ?>" />
123 123
             </div>
124 124
             <div class="clear"></div>
125 125
 		</div><!-- /.tabs-panel -->
Please login to merge, or discard this patch.
classes/views/styles/_field-sizes.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,42 +1,42 @@
 block discarded – undo
1 1
 <div class="field-group clearfix frm-first-row">
2 2
 	<label><?php _e( 'Size', 'formidable' ) ?></label>
3
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_font_size') ) ?>" id="frm_field_font_size" value="<?php echo esc_attr( $style->post_content['field_font_size'] ) ?>" />
3
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_font_size' ) ) ?>" id="frm_field_font_size" value="<?php echo esc_attr( $style->post_content['field_font_size'] ) ?>" />
4 4
 </div>
5 5
 
6 6
 <div class="field-group clearfix frm-first-row">
7 7
 	<label><?php _e( 'Height', 'formidable' ) ?></label>
8
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_height') ) ?>" id="frm_field_height" value="<?php echo esc_attr( $style->post_content['field_height'] ) ?>" />
8
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_height' ) ) ?>" id="frm_field_height" value="<?php echo esc_attr( $style->post_content['field_height'] ) ?>" />
9 9
 </div>
10 10
 
11 11
 <div class="field-group clearfix frm-first-row">
12 12
 	<label><?php _e( 'Width', 'formidable' ) ?></label>
13
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_width') ) ?>" id="frm_field_width" value="<?php echo esc_attr( $style->post_content['field_width'] ) ?>" />
13
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_width' ) ) ?>" id="frm_field_width" value="<?php echo esc_attr( $style->post_content['field_width'] ) ?>" />
14 14
 </div>
15 15
 
16 16
 <div class="clear"></div>
17 17
 <p class="frm_no_bottom_margin">
18
-    <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('auto_width') ) ?>" id="frm_auto_width" value="1" <?php checked( $style->post_content['auto_width'], 1 ) ?> />
18
+    <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'auto_width' ) ) ?>" id="frm_auto_width" value="1" <?php checked( $style->post_content['auto_width'], 1 ) ?> />
19 19
 	<?php _e( 'Automatic Width for drop-down fields', 'formidable' ) ?></label>
20 20
 </p>
21 21
 
22 22
 <div class="field-group clearfix">
23 23
 	<label><?php _e( 'Padding', 'formidable' ) ?></label>
24
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_pad') ) ?>" id="frm_field_pad" value="<?php echo esc_attr( $style->post_content['field_pad'] ) ?>" />
24
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_pad' ) ) ?>" id="frm_field_pad" value="<?php echo esc_attr( $style->post_content['field_pad'] ) ?>" />
25 25
 </div>
26 26
 
27 27
 <div class="field-group clearfix">
28 28
 	<label><?php _e( 'Margin', 'formidable' ) ?></label>
29
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_margin') ) ?>" id="frm_field_margin" value="<?php echo esc_attr( $style->post_content['field_margin'] ) ?>" />
29
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_margin' ) ) ?>" id="frm_field_margin" value="<?php echo esc_attr( $style->post_content['field_margin'] ) ?>" />
30 30
 </div>
31 31
 
32 32
 <div class="field-group clearfix">
33 33
 	<label><?php _e( 'Corners', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Formidable uses CSS3 border-radius for corner rounding, which is not currently supported by Internet Explorer.', 'formidable' ) ?>" ></span></label>
34
-	<input type="text" value="<?php echo esc_attr( $style->post_content['border_radius'] ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name('border_radius') ) ?>" id="frm_border_radius" />
34
+	<input type="text" value="<?php echo esc_attr( $style->post_content['border_radius'] ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_radius' ) ) ?>" id="frm_border_radius" />
35 35
 </div>
36 36
 
37 37
 <div class="field-group clearfix frm-first-row">
38 38
 	<label><?php _e( 'Weight', 'formidable' ) ?></label>
39
-	<select name="<?php echo esc_attr( $frm_style->get_field_name('field_weight') ) ?>" id="frm_field_weight">
39
+	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'field_weight' ) ) ?>" id="frm_field_weight">
40 40
 		<?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?>
41 41
 			<option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['field_weight'], $value ) ?>><?php echo $name ?></option>
42 42
 		<?php } ?>
Please login to merge, or discard this patch.
classes/views/styles/_general.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,59 +1,59 @@
 block discarded – undo
1 1
 <p>
2
-    <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('center_form') ) ?>" id="frm_center_form" value="1" <?php checked($style->post_content['center_form'], 1) ?> />
2
+    <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'center_form' ) ) ?>" id="frm_center_form" value="1" <?php checked( $style->post_content['center_form'], 1 ) ?> />
3 3
 	    <?php _e( 'Center form on page', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'This will center your form on the page where it is published if the form width is less than the available width on the page.', 'formidable' ) ?>" ></span>
4 4
 	</label>
5 5
 </p>
6 6
 
7 7
 <div class="field-group clearfix frm-first-row">
8 8
 	<label><?php _e( 'Alignment', 'formidable' ) ?></label>
9
-	<select name="<?php echo esc_attr( $frm_style->get_field_name('form_align') ) ?>" id="frm_form_align">
10
-		<option value="left" <?php selected($style->post_content['form_align'], 'left') ?>><?php _e( 'left', 'formidable' ) ?></option>
11
-		<option value="right" <?php selected($style->post_content['form_align'], 'right') ?>><?php _e( 'right', 'formidable' ) ?></option>
12
-		<option value="center" <?php selected($style->post_content['form_align'], 'center') ?>><?php _e( 'center', 'formidable' ) ?></option>
9
+	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'form_align' ) ) ?>" id="frm_form_align">
10
+		<option value="left" <?php selected( $style->post_content['form_align'], 'left' ) ?>><?php _e( 'left', 'formidable' ) ?></option>
11
+		<option value="right" <?php selected( $style->post_content['form_align'], 'right' ) ?>><?php _e( 'right', 'formidable' ) ?></option>
12
+		<option value="center" <?php selected( $style->post_content['form_align'], 'center' ) ?>><?php _e( 'center', 'formidable' ) ?></option>
13 13
 	</select>
14 14
 </div>
15 15
 
16 16
 <div class="field-group clearfix frm-first-row">
17 17
 	<label><?php _e( 'Max Width', 'formidable' ) ?></label>
18
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_width') ) ?>" value="<?php echo esc_attr( $style->post_content['form_width'] ) ?>"/>
18
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'form_width' ) ) ?>" value="<?php echo esc_attr( $style->post_content['form_width'] ) ?>"/>
19 19
 </div>
20 20
 
21 21
 <div class="field-group clearfix frm-first-row">
22 22
 	<label><?php _e( 'Background', 'formidable' ) ?></label>
23
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset_bg_color') ) ?>" id="frm_fieldset_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_bg_color'] ) ?>" size="4" />
23
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset_bg_color' ) ) ?>" id="frm_fieldset_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_bg_color'] ) ?>" size="4" />
24 24
 </div>
25 25
 
26 26
 <div class="field-group field-group-border clearfix">
27 27
 	<label><?php _e( 'Border', 'formidable' ) ?></label>
28
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset') ) ?>" id="frm_fieldset" value="<?php echo esc_attr( $style->post_content['fieldset'] ) ?>" size="4" />
28
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset' ) ) ?>" id="frm_fieldset" value="<?php echo esc_attr( $style->post_content['fieldset'] ) ?>" size="4" />
29 29
 </div>
30 30
 
31 31
 <div class="field-group clearfix">
32 32
 	<label><?php _e( 'Color', 'formidable' ) ?></label>
33
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset_color') ) ?>" id="frm_fieldset_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_color'] ) ?>" />
33
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset_color' ) ) ?>" id="frm_fieldset_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_color'] ) ?>" />
34 34
 </div>
35 35
 
36 36
 <div class="field-group clearfix">
37 37
 	<label><?php _e( 'Padding', 'formidable' ) ?></label>
38
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset_padding') ) ?>" id="frm_fieldset_padding" value="<?php echo esc_attr( $style->post_content['fieldset_padding'] ) ?>" size="4" />
38
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset_padding' ) ) ?>" id="frm_fieldset_padding" value="<?php echo esc_attr( $style->post_content['fieldset_padding'] ) ?>" size="4" />
39 39
 </div>
40 40
 
41 41
 <div id="frm_gen_font_box" class="field-group clearfix">
42 42
 	<label><?php _e( 'Font Family', 'formidable' ) ?></label>
43
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('font') ) ?>" id="frm_font" value="<?php echo esc_attr( $style->post_content['font'] ) ?>"  class="frm_full_width" />
43
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'font' ) ) ?>" id="frm_font" value="<?php echo esc_attr( $style->post_content['font'] ) ?>"  class="frm_full_width" />
44 44
 </div>
45 45
 
46 46
 <div class="field-group clearfix frm-half">
47 47
 	<label><?php _e( 'Direction', 'formidable' ) ?></label>
48
-	<select name="<?php echo esc_attr( $frm_style->get_field_name('direction') ) ?>" id="frm_direction">
49
-		<option value="ltr" <?php selected($style->post_content['direction'], 'ltr') ?>><?php _e( 'Left to Right', 'formidable' ) ?></option>
50
-		<option value="rtl" <?php selected($style->post_content['direction'], 'rtl') ?>><?php _e( 'Right to Left', 'formidable' ) ?></option>
48
+	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'direction' ) ) ?>" id="frm_direction">
49
+		<option value="ltr" <?php selected( $style->post_content['direction'], 'ltr' ) ?>><?php _e( 'Left to Right', 'formidable' ) ?></option>
50
+		<option value="rtl" <?php selected( $style->post_content['direction'], 'rtl' ) ?>><?php _e( 'Right to Left', 'formidable' ) ?></option>
51 51
 	</select>
52 52
 </div>
53 53
 
54 54
 <div class="clear"></div>
55 55
 <p class="frm_no_bottom_margin">
56
-    <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('important_style') ) ?>" id="frm_important_style" value="1" <?php checked($style->post_content['important_style'], 1) ?> />
56
+    <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'important_style' ) ) ?>" id="frm_important_style" value="1" <?php checked( $style->post_content['important_style'], 1 ) ?> />
57 57
 	    <?php _e( 'Override theme styling', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'This will add !important to many of the lines in the Formidable styling to make sure it will be used.', 'formidable' ) ?>" ></span>
58 58
 	</label>
59 59
 </p>
Please login to merge, or discard this patch.