Completed
Push — master ( 7e4ecf...9ba442 )
by Jamie
03:13
created
classes/views/styles/manage.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@  discard block
 block discarded – undo
19 19
 
20 20
 			<tbody class="menu-locations">
21 21
 			    <?php
22
-			    if ( $forms ) {
23
-			        foreach ( $forms as $form ) {
24
-			            $this_style = isset($form->options['custom_style']) ? (int) $form->options['custom_style'] : 1;
25
-			            if ( 1 == $this_style ) {
26
-			                // use the default style
27
-			                $this_style = $default_style->ID;
28
-			            }
29
-			        ?>
22
+				if ( $forms ) {
23
+					foreach ( $forms as $form ) {
24
+						$this_style = isset($form->options['custom_style']) ? (int) $form->options['custom_style'] : 1;
25
+						if ( 1 == $this_style ) {
26
+							// use the default style
27
+							$this_style = $default_style->ID;
28
+						}
29
+					?>
30 30
 				<tr id="menu-locations-row">
31 31
 					<td class="menu-location-title"><strong><?php echo empty($form->name) ? __( '(no title)') : $form->name ?></strong></td>
32 32
 					<td class="menu-location-menus">
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 					</td><!-- .menu-location-menus -->
42 42
 				</tr><!-- #menu-locations-row -->
43 43
 				<?php
44
-				    }
44
+					}
45 45
 				} else {
46 46
 				?>
47 47
 				<tr>
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <div class="nav-menus-php">
2 2
 <div class="wrap">
3
-    <?php FrmStylesHelper::style_menu('manage'); ?>
3
+    <?php FrmStylesHelper::style_menu( 'manage' ); ?>
4 4
 
5
-	<p><?php printf(__( 'Easily change which template your forms are using by making changes below.', 'formidable' ), '<a href="?page=formidable-styles&frm_action=new_style">', '</a>'); ?></p>
5
+	<p><?php printf( __( 'Easily change which template your forms are using by making changes below.', 'formidable' ), '<a href="?page=formidable-styles&frm_action=new_style">', '</a>' ); ?></p>
6 6
 
7 7
 	<?php include( FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php' ); ?>
8 8
 
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
 			    <?php
22 22
 			    if ( $forms ) {
23 23
 			        foreach ( $forms as $form ) {
24
-			            $this_style = isset($form->options['custom_style']) ? (int) $form->options['custom_style'] : 1;
24
+			            $this_style = isset( $form->options['custom_style'] ) ? (int) $form->options['custom_style'] : 1;
25 25
 			            if ( 1 == $this_style ) {
26 26
 			                // use the default style
27 27
 			                $this_style = $default_style->ID;
28 28
 			            }
29 29
 			        ?>
30 30
 				<tr id="menu-locations-row">
31
-					<td class="menu-location-title"><strong><?php echo empty($form->name) ? __( '(no title)') : $form->name ?></strong></td>
31
+					<td class="menu-location-title"><strong><?php echo empty( $form->name ) ? __( '(no title)' ) : $form->name ?></strong></td>
32 32
 					<td class="menu-location-menus">
33 33
 					    <input type="hidden" name="prev_style[<?php echo esc_attr( $form->id ) ?>]" value="<?php echo esc_attr( $this_style ) ?>" />
34 34
 					    <select name="style[<?php echo esc_attr( $form->id ) ?>]">
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 									<?php echo esc_html( $s->post_title . ( empty( $s->menu_order ) ? '' : ' (' . __( 'default', 'formidable' ) . ')' ) ) ?>
38 38
 								</option>
39 39
          		            <?php } ?>
40
-         		            <option value="" <?php selected(0, $this_style) ?>><?php _e( 'Styling disabled', 'formidable' ) ?></option>
40
+         		            <option value="" <?php selected( 0, $this_style ) ?>><?php _e( 'Styling disabled', 'formidable' ) ?></option>
41 41
          		        </select>
42 42
 
43 43
 					</td><!-- .menu-location-menus -->
Please login to merge, or discard this patch.
classes/views/xml/forms_xml.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if ( ! $item_ids ) {
4
-    return;
4
+	return;
5 5
 }
6 6
 
7 7
 // fetch 20 posts at a time rather than loading the entire table into memory
@@ -45,6 +45,6 @@  discard block
 block discarded – undo
45 45
 <?php	} ?>
46 46
 	</form>
47 47
 <?php
48
-    	unset( $fields );
48
+		unset( $fields );
49 49
 	}
50 50
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,16 +13,16 @@  discard block
 block discarded – undo
13 13
 ?>
14 14
 	<form>
15 15
 		<id><?php echo $form->id ?></id>
16
-		<form_key><?php echo FrmXMLHelper::cdata($form->form_key) ?></form_key>
17
-		<name><?php echo FrmXMLHelper::cdata($form->name) ?></name>
18
-		<description><?php echo FrmXMLHelper::cdata($form->description) ?></description>
16
+		<form_key><?php echo FrmXMLHelper::cdata( $form->form_key ) ?></form_key>
17
+		<name><?php echo FrmXMLHelper::cdata( $form->name ) ?></name>
18
+		<description><?php echo FrmXMLHelper::cdata( $form->description ) ?></description>
19 19
 		<created_at><?php echo $form->created_at ?></created_at>
20 20
 		<logged_in><?php echo $form->logged_in ?></logged_in>
21 21
 		<is_template><?php echo $form->is_template ?></is_template>
22 22
 		<default_template><?php echo $form->default_template ?></default_template>
23 23
 		<editable><?php echo $form->editable ?></editable>
24
-		<options><?php echo FrmXMLHelper::prepare_form_options_for_export($form->options) ?></options>
25
-		<status><?php echo FrmXMLHelper::cdata($form->status) ?></status>
24
+		<options><?php echo FrmXMLHelper::prepare_form_options_for_export( $form->options ) ?></options>
25
+		<status><?php echo FrmXMLHelper::cdata( $form->status ) ?></status>
26 26
         <parent_form_id><?php echo $form->parent_form_id ?></parent_form_id>
27 27
 <?php
28 28
 
@@ -31,16 +31,16 @@  discard block
 block discarded – undo
31 31
 		foreach ( $fields as $field ) { ?>
32 32
 		<field>
33 33
 		    <id><?php echo $field->id ?></id>
34
-            <field_key><?php echo FrmXMLHelper::cdata($field->field_key) ?></field_key>
35
-            <name><?php echo FrmXMLHelper::cdata($field->name) ?></name>
36
-            <description><?php echo FrmXMLHelper::cdata($field->description) ?></description>
37
-            <type><?php echo FrmXMLHelper::cdata($field->type) ?></type>
38
-            <default_value><?php echo FrmXMLHelper::cdata($field->default_value) ?></default_value>
34
+            <field_key><?php echo FrmXMLHelper::cdata( $field->field_key ) ?></field_key>
35
+            <name><?php echo FrmXMLHelper::cdata( $field->name ) ?></name>
36
+            <description><?php echo FrmXMLHelper::cdata( $field->description ) ?></description>
37
+            <type><?php echo FrmXMLHelper::cdata( $field->type ) ?></type>
38
+            <default_value><?php echo FrmXMLHelper::cdata( $field->default_value ) ?></default_value>
39 39
             <field_order><?php echo $field->field_order ?></field_order>
40 40
             <form_id><?php echo $field->form_id ?></form_id>
41 41
             <required><?php echo (bool) $field->required ?></required>
42
-            <options><?php echo FrmXMLHelper::cdata($field->options) ?></options>
43
-            <field_options><?php echo FrmXMLHelper::cdata($field->field_options) ?></field_options>
42
+            <options><?php echo FrmXMLHelper::cdata( $field->options ) ?></options>
43
+            <field_options><?php echo FrmXMLHelper::cdata( $field->field_options ) ?></field_options>
44 44
 		</field>
45 45
 <?php	} ?>
46 46
 	</form>
Please login to merge, or discard this patch.
classes/views/xml/posts_xml.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
 	}
80 80
 
81 81
     $frm_inc_tax[] = $term->term_id;
82
-    $label = ($term->taxonomy == 'category' || $term->taxonomy == 'tag') ? $term->taxonomy : 'term'; ?>
82
+    $label = ( $term->taxonomy == 'category' || $term->taxonomy == 'tag' ) ? $term->taxonomy : 'term'; ?>
83 83
 	<term><term_id><?php echo $term->term_id ?></term_id><term_taxonomy><?php echo $term->taxonomy; ?></term_taxonomy><?php
84 84
     if ( ! empty( $term->name ) ) {
85 85
         echo '<term_name>' . FrmXMLHelper::cdata( $term->name ) . '</term_name>';
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if ( ! $item_ids ) {
4
-    return;
4
+	return;
5 5
 }
6 6
 
7 7
 global $wp_query;
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 }
66 66
 
67 67
 if ( empty( $taxonomies ) ) {
68
-    return;
68
+	return;
69 69
 }
70 70
 
71 71
 global $frm_inc_tax;
@@ -75,18 +75,18 @@  discard block
 block discarded – undo
75 75
 
76 76
 foreach ( (array) $terms as $term ) {
77 77
 	if ( in_array( $term->term_id, $frm_inc_tax ) ) {
78
-        return;
78
+		return;
79 79
 	}
80 80
 
81
-    $frm_inc_tax[] = $term->term_id;
82
-    $label = ($term->taxonomy == 'category' || $term->taxonomy == 'tag') ? $term->taxonomy : 'term'; ?>
81
+	$frm_inc_tax[] = $term->term_id;
82
+	$label = ($term->taxonomy == 'category' || $term->taxonomy == 'tag') ? $term->taxonomy : 'term'; ?>
83 83
 	<term><term_id><?php echo esc_html( $term->term_id ) ?></term_id><term_taxonomy><?php echo esc_html( $term->taxonomy ); ?></term_taxonomy><?php
84
-    if ( ! empty( $term->name ) ) {
85
-        echo '<term_name>' . FrmXMLHelper::cdata( $term->name ) . '</term_name>';
86
-    }
87
-    if ( ! empty( $term->description ) ) {
88
-    ?><term_description><?php echo FrmXMLHelper::cdata( $term->description ) ?></term_description><?php
89
-    }
90
-    ?><term_slug><?php echo esc_html( $term->slug ); ?></term_slug></term>
84
+	if ( ! empty( $term->name ) ) {
85
+		echo '<term_name>' . FrmXMLHelper::cdata( $term->name ) . '</term_name>';
86
+	}
87
+	if ( ! empty( $term->description ) ) {
88
+	?><term_description><?php echo FrmXMLHelper::cdata( $term->description ) ?></term_description><?php
89
+	}
90
+	?><term_slug><?php echo esc_html( $term->slug ); ?></term_slug></term>
91 91
 <?php
92 92
 }
Please login to merge, or discard this patch.
classes/widgets/FrmShowForm.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,14 +8,14 @@  discard block
 block discarded – undo
8 8
 	}
9 9
 
10 10
 	public function widget( $args, $instance ) {
11
-        if ( empty($instance['title']) ) {
12
-            $title = FrmForm::getName( $instance['form'] );
13
-        } else {
14
-            $title = $instance['title'];
15
-        }
16
-        $title = apply_filters('widget_title', $title);
11
+		if ( empty($instance['title']) ) {
12
+			$title = FrmForm::getName( $instance['form'] );
13
+		} else {
14
+			$title = $instance['title'];
15
+		}
16
+		$title = apply_filters('widget_title', $title);
17 17
 
18
-        $instance['description'] = isset($instance['description']) ? $instance['description'] : false;
18
+		$instance['description'] = isset($instance['description']) ? $instance['description'] : false;
19 19
 
20 20
 		echo $args['before_widget'];
21 21
 
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 	}
36 36
 
37 37
 	public function form( $instance ) {
38
-	    //Defaults
38
+		//Defaults
39 39
 		$instance = wp_parse_args( (array) $instance, array(
40
-		    'title' => false, 'form' => false, 'description' => false,
40
+			'title' => false, 'form' => false, 'description' => false,
41 41
 		) );
42 42
 ?>
43 43
 	<p><label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php _e( 'Title', 'formidable' ) ?>:</label><br/>
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
 
46 46
 	<p><label for="<?php echo esc_attr( $this->get_field_id('form') ); ?>"><?php _e( 'Form', 'formidable' ) ?>:</label><br/>
47 47
 <?php
48
-	    FrmFormsHelper::forms_dropdown( $this->get_field_name('form'), $instance['form'], array(
49
-	        'blank' => false, 'field_id' => $this->get_field_id('form'),
50
-            'class' => 'widefat',
51
-	    ) );
48
+		FrmFormsHelper::forms_dropdown( $this->get_field_name('form'), $instance['form'], array(
49
+			'blank' => false, 'field_id' => $this->get_field_id('form'),
50
+			'class' => 'widefat',
51
+		) );
52 52
 ?>
53 53
 	</p>
54 54
 
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,27 +4,27 @@  discard block
 block discarded – undo
4 4
 
5 5
 	public function __construct() {
6 6
 		$widget_ops = array( 'description' => __( 'Display a Formidable Form', 'formidable' ) );
7
-		parent::__construct('frm_show_form', __( 'Formidable Form', 'formidable' ), $widget_ops);
7
+		parent::__construct( 'frm_show_form', __( 'Formidable Form', 'formidable' ), $widget_ops );
8 8
 	}
9 9
 
10 10
 	public function widget( $args, $instance ) {
11
-        if ( empty($instance['title']) ) {
11
+        if ( empty( $instance['title'] ) ) {
12 12
             $title = FrmForm::getName( $instance['form'] );
13 13
         } else {
14 14
             $title = $instance['title'];
15 15
         }
16
-        $title = apply_filters('widget_title', $title);
16
+        $title = apply_filters( 'widget_title', $title );
17 17
 
18
-        $instance['description'] = isset($instance['description']) ? $instance['description'] : false;
18
+        $instance['description'] = isset( $instance['description'] ) ? $instance['description'] : false;
19 19
 
20 20
 		echo $args['before_widget'];
21 21
 
22 22
 		echo '<div class="frm_form_widget">';
23 23
 		if ( $title ) {
24
-			echo $args['before_title'] . stripslashes($title) . $args['after_title'];
24
+			echo $args['before_title'] . stripslashes( $title ) . $args['after_title'];
25 25
 		}
26 26
 
27
-		echo FrmFormsController::show_form($instance['form'], '', false, $instance['description']);
27
+		echo FrmFormsController::show_form( $instance['form'], '', false, $instance['description'] );
28 28
 
29 29
 		echo '</div>';
30 30
 		echo $args['after_widget'];
@@ -40,19 +40,19 @@  discard block
 block discarded – undo
40 40
 		    'title' => false, 'form' => false, 'description' => false,
41 41
 		) );
42 42
 ?>
43
-	<p><label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php _e( 'Title', 'formidable' ) ?>:</label><br/>
44
-	<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id('title') ); ?>" name="<?php echo esc_attr( $this->get_field_name('title') ); ?>" value="<?php echo esc_attr( stripslashes($instance['title']) ); ?>" /></p>
43
+	<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title', 'formidable' ) ?>:</label><br/>
44
+	<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( stripslashes( $instance['title'] ) ); ?>" /></p>
45 45
 
46
-	<p><label for="<?php echo esc_attr( $this->get_field_id('form') ); ?>"><?php _e( 'Form', 'formidable' ) ?>:</label><br/>
46
+	<p><label for="<?php echo esc_attr( $this->get_field_id( 'form' ) ); ?>"><?php _e( 'Form', 'formidable' ) ?>:</label><br/>
47 47
 <?php
48
-	    FrmFormsHelper::forms_dropdown( $this->get_field_name('form'), $instance['form'], array(
49
-	        'blank' => false, 'field_id' => $this->get_field_id('form'),
48
+	    FrmFormsHelper::forms_dropdown( $this->get_field_name( 'form' ), $instance['form'], array(
49
+	        'blank' => false, 'field_id' => $this->get_field_id( 'form' ),
50 50
             'class' => 'widefat',
51 51
 	    ) );
52 52
 ?>
53 53
 	</p>
54 54
 
55
-	<p><label for="<?php echo esc_attr( $this->get_field_id('description') ); ?>"><input class="checkbox" type="checkbox" <?php checked($instance['description'], true) ?> id="<?php echo esc_attr( $this->get_field_id('description') ); ?>" name="<?php echo esc_attr( $this->get_field_name('description') ); ?>" value="1" />
55
+	<p><label for="<?php echo esc_attr( $this->get_field_id( 'description' ) ); ?>"><input class="checkbox" type="checkbox" <?php checked( $instance['description'], true ) ?> id="<?php echo esc_attr( $this->get_field_id( 'description' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'description' ) ); ?>" value="1" />
56 56
 	<?php _e( 'Show Description', 'formidable' ) ?></label></p>
57 57
 <?php
58 58
 	}
Please login to merge, or discard this patch.
deprecated.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 // 2.0
4 4
 if ( ! isset($frm_vars['pro_is_installed']) ) {
5
-    $frm_vars['pro_is_installed'] = false;
5
+	$frm_vars['pro_is_installed'] = false;
6 6
 }
7 7
 
8 8
 // Instansiate Models
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // 2.0
4
-if ( ! isset($frm_vars['pro_is_installed']) ) {
4
+if ( ! isset( $frm_vars['pro_is_installed'] ) ) {
5 5
     $frm_vars['pro_is_installed'] = false;
6 6
 }
7 7
 
Please login to merge, or discard this patch.
classes/helpers/FrmFormActionsHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if ( ! defined('ABSPATH') ) {
2
+if ( ! defined( 'ABSPATH' ) ) {
3 3
 	die( 'You are not allowed to call this page directly.' );
4 4
 }
5 5
 
Please login to merge, or discard this patch.
classes/helpers/FrmFormsHelper.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -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.
Spacing   +55 added lines, -55 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( $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
 	}
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 		$last_field = false;
336 336
         foreach ( $fields as $field ) {
337 337
 			if ( $prev_order === $field->field_order ) {
338
-				$add_order++;
338
+				$add_order ++;
339 339
 			}
340 340
 
341 341
 			if ( $add_order ) {
@@ -402,21 +402,21 @@  discard block
 block discarded – undo
402 402
             if ( $code == 'form_name' ) {
403 403
                 $replace_with = $form->name;
404 404
             } else if ( $code == 'form_description' ) {
405
-                $replace_with = FrmAppHelper::use_wpautop($form->description);
406
-            } else if ( $code == 'entry_key' && isset($_GET) && isset($_GET['entry']) ) {
405
+                $replace_with = FrmAppHelper::use_wpautop( $form->description );
406
+            } else if ( $code == 'entry_key' && isset( $_GET ) && isset( $_GET['entry'] ) ) {
407 407
                 $replace_with = FrmAppHelper::simple_get( 'entry' );
408 408
             } else {
409 409
                 $replace_with = '';
410 410
             }
411 411
 
412
-            FrmFieldsHelper::remove_inline_conditions( ( FrmAppHelper::is_true($show) && $replace_with != '' ), $code, $replace_with, $html );
412
+            FrmFieldsHelper::remove_inline_conditions( ( FrmAppHelper::is_true( $show ) && $replace_with != '' ), $code, $replace_with, $html );
413 413
         }
414 414
 
415 415
         //replace [form_key]
416
-        $html = str_replace('[form_key]', $form->form_key, $html);
416
+        $html = str_replace( '[form_key]', $form->form_key, $html );
417 417
 
418 418
         //replace [frmurl]
419
-        $html = str_replace('[frmurl]', FrmFieldsHelper::dynamic_default_values( 'frmurl' ), $html);
419
+        $html = str_replace( '[frmurl]', FrmFieldsHelper::dynamic_default_values( 'frmurl' ), $html );
420 420
 
421 421
 		if ( strpos( $html, '[button_label]' ) ) {
422 422
 			add_filter( 'frm_submit_button', 'FrmFormsHelper::submit_button_label', 1 );
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 			$html = str_replace( '[button_label]', $submit_label, $html );
426 426
         }
427 427
 
428
-        $html = apply_filters('frm_form_replace_shortcodes', $html, $form, $values);
428
+        $html = apply_filters( 'frm_form_replace_shortcodes', $html, $form, $values );
429 429
 
430 430
 		if ( strpos( $html, '[if back_button]' ) ) {
431 431
 			$html = preg_replace( '/(\[if\s+back_button\])(.*?)(\[\/if\s+back_button\])/mis', '', $html );
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
     }
444 444
 
445 445
 	public static function submit_button_label( $submit ) {
446
-        if ( ! $submit || empty($submit) ) {
446
+        if ( ! $submit || empty( $submit ) ) {
447 447
             $frm_settings = FrmAppHelper::get_settings();
448 448
             $submit = $frm_settings->submit_value;
449 449
         }
@@ -452,11 +452,11 @@  discard block
 block discarded – undo
452 452
     }
453 453
 
454 454
 	public static function get_form_style_class( $form = false ) {
455
-        $style = self::get_form_style($form);
455
+        $style = self::get_form_style( $form );
456 456
         $class = ' with_frm_style';
457 457
 
458
-        if ( empty($style) ) {
459
-            if ( FrmAppHelper::is_admin_page('formidable-entries') ) {
458
+        if ( empty( $style ) ) {
459
+            if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) ) {
460 460
                 return $class;
461 461
             } else {
462 462
                 return;
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
         }
465 465
 
466 466
         //If submit button needs to be inline or centered
467
-        if ( is_object($form) ) {
467
+        if ( is_object( $form ) ) {
468 468
 			$form = $form->options;
469 469
 		}
470 470
 
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
 			$class .= ' frm_center_submit';
477 477
 		}
478 478
 
479
-        $class = apply_filters('frm_add_form_style_class', $class, $style);
479
+        $class = apply_filters( 'frm_add_form_style_class', $class, $style );
480 480
 
481 481
         return $class;
482 482
     }
@@ -572,12 +572,12 @@  discard block
 block discarded – undo
572 572
     }
573 573
 
574 574
 	public static function edit_form_link( $form_id ) {
575
-        if ( is_object($form_id) ) {
575
+        if ( is_object( $form_id ) ) {
576 576
             $form = $form_id;
577 577
             $name = $form->name;
578 578
             $form_id = $form->id;
579 579
         } else {
580
-            $name = FrmForm::getName($form_id);
580
+            $name = FrmForm::getName( $form_id );
581 581
         }
582 582
 
583 583
         if ( $form_id ) {
@@ -609,12 +609,12 @@  discard block
 block discarded – undo
609 609
         $current_page = isset( $_REQUEST['form_type'] ) ? $_REQUEST['form_type'] : '';
610 610
 		$base_url = '?page=formidable&form_type=' . $current_page . '&id=' . $id;
611 611
         if ( 'trash' == $status ) {
612
-			$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=untrash', 'untrash_form_' . $id ) ) . '" class="submitdelete deletion">' . $labels['restore'][ $length ] . '</a>';
613
-        } else if ( current_user_can('frm_delete_forms') ) {
612
+			$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=untrash', 'untrash_form_' . $id ) ) . '" class="submitdelete deletion">' . $labels['restore'][$length] . '</a>';
613
+        } else if ( current_user_can( 'frm_delete_forms' ) ) {
614 614
             if ( EMPTY_TRASH_DAYS ) {
615
-				$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=trash', 'trash_form_' . $id ) ) . '" class="submitdelete deletion">' . $labels['trash'][ $length ] . '</a>';
615
+				$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=trash', 'trash_form_' . $id ) ) . '" class="submitdelete deletion">' . $labels['trash'][$length] . '</a>';
616 616
             } else {
617
-				$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>';
617
+				$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>';
618 618
             }
619 619
         }
620 620
 
@@ -628,11 +628,11 @@  discard block
 block discarded – undo
628 628
             'publish'   => __( 'Published', 'formidable' ),
629 629
         );
630 630
 
631
-        if ( ! in_array($status, array_keys($nice_names)) ) {
631
+        if ( ! in_array( $status, array_keys( $nice_names ) ) ) {
632 632
             $status = 'publish';
633 633
         }
634 634
 
635
-		$name = $nice_names[ $status ];
635
+		$name = $nice_names[$status];
636 636
 
637 637
         return $name;
638 638
     }
Please login to merge, or discard this patch.
Indentation   +249 added lines, -249 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( $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,13 +260,13 @@  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
-            $draft_link = self::get_draft_link();
269
-            $default_html = <<<SUBMIT_HTML
268
+			$draft_link = self::get_draft_link();
269
+			$default_html = <<<SUBMIT_HTML
270 270
 <div class="frm_submit">
271 271
 [if back_button]<button type="submit" name="frm_prev_page" formnovalidate="formnovalidate" class="frm_prev_page" [back_hook]>[back_label]</button>[/if back_button]
272 272
 <button class="frm_button_submit" type="submit"  [button_action]>[button_label]</button>
@@ -274,22 +274,22 @@  discard block
 block discarded – undo
274 274
 </div>
275 275
 SUBMIT_HTML;
276 276
 		} else if ( $loc == 'before' ) {
277
-            $default_html = <<<BEFORE_HTML
277
+			$default_html = <<<BEFORE_HTML
278 278
 <legend class="frm_hidden">[form_name]</legend>
279 279
 [if form_name]<h3 class="frm_form_title">[form_name]</h3>[/if form_name]
280 280
 [if form_description]<div class="frm_description">[form_description]</div>[/if form_description]
281 281
 BEFORE_HTML;
282 282
 		} else {
283
-            $default_html = '';
284
-        }
283
+			$default_html = '';
284
+		}
285 285
 
286
-        return $default_html;
287
-    }
286
+		return $default_html;
287
+	}
288 288
 
289
-    public static function get_draft_link() {
290
-        $link = '[if save_draft]<a href="#" class="frm_save_draft" [draft_hook]>[draft_label]</a>[/if save_draft]';
291
-        return $link;
292
-    }
289
+	public static function get_draft_link() {
290
+		$link = '[if save_draft]<a href="#" class="frm_save_draft" [draft_hook]>[draft_label]</a>[/if save_draft]';
291
+		return $link;
292
+	}
293 293
 
294 294
 	public static function get_custom_submit( $html, $form, $submit, $form_action, $values ) {
295 295
 		$button = self::replace_shortcodes( $html, $form, $submit, $form_action, $values );
@@ -316,13 +316,13 @@  discard block
 block discarded – undo
316 316
 		echo $button_parts[1];
317 317
 	}
318 318
 
319
-    /**
320
-     * Automatically add end section fields if they don't exist (2.0 migration)
321
-     * @since 2.0
322
-     *
323
-     * @param boolean $reset_fields
324
-     */
325
-    public static function auto_add_end_section_fields( $form, $fields, &$reset_fields ) {
319
+	/**
320
+	 * Automatically add end section fields if they don't exist (2.0 migration)
321
+	 * @since 2.0
322
+	 *
323
+	 * @param boolean $reset_fields
324
+	 */
325
+	public static function auto_add_end_section_fields( $form, $fields, &$reset_fields ) {
326 326
 		if ( empty( $fields ) ) {
327 327
 			return;
328 328
 		}
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 		$prev_order = false;
333 333
 		$add_order = 0;
334 334
 		$last_field = false;
335
-        foreach ( $fields as $field ) {
335
+		foreach ( $fields as $field ) {
336 336
 			if ( $prev_order === $field->field_order ) {
337 337
 				$add_order++;
338 338
 			}
@@ -343,48 +343,48 @@  discard block
 block discarded – undo
343 343
 				FrmField::update( $field->id, array( 'field_order' => $field->field_order ) );
344 344
 			}
345 345
 
346
-            switch ( $field->type ) {
347
-                case 'divider':
348
-                    // create an end section if open
346
+			switch ( $field->type ) {
347
+				case 'divider':
348
+					// create an end section if open
349 349
 					self::maybe_create_end_section( $open, $reset_fields, $add_order, $end_section_values, $field, 'move' );
350 350
 
351
-                    // mark it open for the next end section
352
-                    $open = true;
353
-                break;
354
-                case 'break';
351
+					// mark it open for the next end section
352
+					$open = true;
353
+				break;
354
+				case 'break';
355 355
 					self::maybe_create_end_section( $open, $reset_fields, $add_order, $end_section_values, $field, 'move' );
356
-                break;
357
-                case 'end_divider':
358
-                    if ( ! $open ) {
359
-                        // the section isn't open, so this is an extra field that needs to be removed
360
-                        FrmField::destroy( $field->id );
361
-                        $reset_fields = true;
362
-                    }
363
-
364
-                    // There is already an end section here, so there is no need to create one
365
-                    $open = false;
366
-            }
356
+				break;
357
+				case 'end_divider':
358
+					if ( ! $open ) {
359
+						// the section isn't open, so this is an extra field that needs to be removed
360
+						FrmField::destroy( $field->id );
361
+						$reset_fields = true;
362
+					}
363
+
364
+					// There is already an end section here, so there is no need to create one
365
+					$open = false;
366
+			}
367 367
 			$prev_order = $field->field_order;
368 368
 
369 369
 			$last_field = $field;
370 370
 			unset( $field );
371
-        }
371
+		}
372 372
 
373 373
 		self::maybe_create_end_section( $open, $reset_fields, $add_order, $end_section_values, $last_field );
374
-    }
374
+	}
375 375
 
376 376
 	/**
377 377
 	 * Create end section field if it doesn't exist. This is for migration from < 2.0
378 378
 	 * Fix any ordering that may be messed up
379 379
 	 */
380 380
 	public static function maybe_create_end_section( &$open, &$reset_fields, &$add_order, $end_section_values, $field, $move = 'no' ) {
381
-        if ( ! $open ) {
382
-            return;
383
-        }
381
+		if ( ! $open ) {
382
+			return;
383
+		}
384 384
 
385 385
 		$end_section_values['field_order'] = $field->field_order + 1;
386 386
 
387
-        FrmField::create( $end_section_values );
387
+		FrmField::create( $end_section_values );
388 388
 
389 389
 		if ( $move == 'move' ) {
390 390
 			// bump the order of current field unless we're at the end of the form
@@ -392,39 +392,39 @@  discard block
 block discarded – undo
392 392
 		}
393 393
 
394 394
 		$add_order += 2;
395
-        $open = false;
396
-        $reset_fields = true;
397
-    }
395
+		$open = false;
396
+		$reset_fields = true;
397
+	}
398 398
 
399
-    public static function replace_shortcodes( $html, $form, $title = false, $description = false, $values = array() ) {
399
+	public static function replace_shortcodes( $html, $form, $title = false, $description = false, $values = array() ) {
400 400
 		foreach ( array( 'form_name' => $title, 'form_description' => $description, 'entry_key' => true ) as $code => $show ) {
401
-            if ( $code == 'form_name' ) {
402
-                $replace_with = $form->name;
403
-            } else if ( $code == 'form_description' ) {
404
-                $replace_with = FrmAppHelper::use_wpautop($form->description);
405
-            } else if ( $code == 'entry_key' && isset($_GET) && isset($_GET['entry']) ) {
406
-                $replace_with = FrmAppHelper::simple_get( 'entry' );
407
-            } else {
408
-                $replace_with = '';
409
-            }
401
+			if ( $code == 'form_name' ) {
402
+				$replace_with = $form->name;
403
+			} else if ( $code == 'form_description' ) {
404
+				$replace_with = FrmAppHelper::use_wpautop($form->description);
405
+			} else if ( $code == 'entry_key' && isset($_GET) && isset($_GET['entry']) ) {
406
+				$replace_with = FrmAppHelper::simple_get( 'entry' );
407
+			} else {
408
+				$replace_with = '';
409
+			}
410 410
 
411
-            FrmFieldsHelper::remove_inline_conditions( ( FrmAppHelper::is_true($show) && $replace_with != '' ), $code, $replace_with, $html );
412
-        }
411
+			FrmFieldsHelper::remove_inline_conditions( ( FrmAppHelper::is_true($show) && $replace_with != '' ), $code, $replace_with, $html );
412
+		}
413 413
 
414
-        //replace [form_key]
415
-        $html = str_replace('[form_key]', $form->form_key, $html);
414
+		//replace [form_key]
415
+		$html = str_replace('[form_key]', $form->form_key, $html);
416 416
 
417
-        //replace [frmurl]
418
-        $html = str_replace('[frmurl]', FrmFieldsHelper::dynamic_default_values( 'frmurl' ), $html);
417
+		//replace [frmurl]
418
+		$html = str_replace('[frmurl]', FrmFieldsHelper::dynamic_default_values( 'frmurl' ), $html);
419 419
 
420 420
 		if ( strpos( $html, '[button_label]' ) ) {
421 421
 			add_filter( 'frm_submit_button', 'FrmFormsHelper::submit_button_label', 1 );
422 422
 			$submit_label = apply_filters( 'frm_submit_button', $title, $form );
423 423
 			$submit_label = esc_attr( do_shortcode( $submit_label ) );
424 424
 			$html = str_replace( '[button_label]', $submit_label, $html );
425
-        }
425
+		}
426 426
 
427
-        $html = apply_filters('frm_form_replace_shortcodes', $html, $form, $values);
427
+		$html = apply_filters('frm_form_replace_shortcodes', $html, $form, $values);
428 428
 
429 429
 		if ( strpos( $html, '[if back_button]' ) ) {
430 430
 			$html = preg_replace( '/(\[if\s+back_button\])(.*?)(\[\/if\s+back_button\])/mis', '', $html );
@@ -438,32 +438,32 @@  discard block
 block discarded – undo
438 438
 			$html = do_shortcode( $html );
439 439
 		}
440 440
 
441
-        return $html;
442
-    }
441
+		return $html;
442
+	}
443 443
 
444 444
 	public static function submit_button_label( $submit ) {
445
-        if ( ! $submit || empty($submit) ) {
446
-            $frm_settings = FrmAppHelper::get_settings();
447
-            $submit = $frm_settings->submit_value;
448
-        }
445
+		if ( ! $submit || empty($submit) ) {
446
+			$frm_settings = FrmAppHelper::get_settings();
447
+			$submit = $frm_settings->submit_value;
448
+		}
449 449
 
450
-        return $submit;
451
-    }
450
+		return $submit;
451
+	}
452 452
 
453 453
 	public static function get_form_style_class( $form = false ) {
454
-        $style = self::get_form_style($form);
455
-        $class = ' with_frm_style';
456
-
457
-        if ( empty($style) ) {
458
-            if ( FrmAppHelper::is_admin_page('formidable-entries') ) {
459
-                return $class;
460
-            } else {
461
-                return;
462
-            }
463
-        }
464
-
465
-        //If submit button needs to be inline or centered
466
-        if ( is_object($form) ) {
454
+		$style = self::get_form_style($form);
455
+		$class = ' with_frm_style';
456
+
457
+		if ( empty($style) ) {
458
+			if ( FrmAppHelper::is_admin_page('formidable-entries') ) {
459
+				return $class;
460
+			} else {
461
+				return;
462
+			}
463
+		}
464
+
465
+		//If submit button needs to be inline or centered
466
+		if ( is_object($form) ) {
467 467
 			$form = $form->options;
468 468
 		}
469 469
 
@@ -475,17 +475,17 @@  discard block
 block discarded – undo
475 475
 			$class .= ' frm_center_submit';
476 476
 		}
477 477
 
478
-        $class = apply_filters('frm_add_form_style_class', $class, $style);
478
+		$class = apply_filters('frm_add_form_style_class', $class, $style);
479 479
 
480
-        return $class;
481
-    }
480
+		return $class;
481
+	}
482 482
 
483
-    /**
484
-     * @param string|boolean $form
485
-     *
486
-     * @return string
487
-     */
488
-    public static function get_form_style( $form ) {
483
+	/**
484
+	 * @param string|boolean $form
485
+	 *
486
+	 * @return string
487
+	 */
488
+	public static function get_form_style( $form ) {
489 489
 		$style = 1;
490 490
 		if ( empty( $form ) || 'default' == 'form' ) {
491 491
 			return $style;
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 		$style = ( $form && is_object( $form ) && isset( $form->options['custom_style'] ) ) ? $form->options['custom_style'] : $style;
506 506
 
507 507
 		return $style;
508
-    }
508
+	}
509 509
 
510 510
 	/**
511 511
 	 * Display the validation error messages when an entry is submitted
@@ -567,74 +567,74 @@  discard block
 block discarded – undo
567 567
 	}
568 568
 
569 569
 	public static function get_scroll_js( $form_id ) {
570
-        ?><script type="text/javascript">document.addEventListener('DOMContentLoaded',function(){frmFrontForm.scrollMsg(<?php echo (int) $form_id ?>);})</script><?php
571
-    }
570
+		?><script type="text/javascript">document.addEventListener('DOMContentLoaded',function(){frmFrontForm.scrollMsg(<?php echo (int) $form_id ?>);})</script><?php
571
+	}
572 572
 
573 573
 	public static function edit_form_link( $form_id ) {
574
-        if ( is_object($form_id) ) {
575
-            $form = $form_id;
576
-            $name = $form->name;
577
-            $form_id = $form->id;
578
-        } else {
579
-            $name = FrmForm::getName($form_id);
580
-        }
581
-
582
-        if ( $form_id ) {
574
+		if ( is_object($form_id) ) {
575
+			$form = $form_id;
576
+			$name = $form->name;
577
+			$form_id = $form->id;
578
+		} else {
579
+			$name = FrmForm::getName($form_id);
580
+		}
581
+
582
+		if ( $form_id ) {
583 583
 			$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>';
584
-	    } else {
585
-	        $val = '';
586
-	    }
584
+		} else {
585
+			$val = '';
586
+		}
587 587
 
588
-	    return $val;
588
+		return $val;
589 589
 	}
590 590
 
591 591
 	public static function delete_trash_link( $id, $status, $length = 'long' ) {
592
-        $link = '';
593
-        $labels = array(
594
-            'restore' => array(
595
-                'long'  => __( 'Restore from Trash', 'formidable' ),
596
-                'short' => __( 'Restore', 'formidable' ),
597
-            ),
598
-            'trash' => array(
599
-                'long'  => __( 'Move to Trash', 'formidable' ),
600
-                'short' => __( 'Trash', 'formidable' ),
601
-            ),
602
-            'delete' => array(
603
-                'long'  => __( 'Delete Permanently', 'formidable' ),
604
-                'short' => __( 'Delete', 'formidable' ),
605
-            ),
606
-        );
607
-
608
-        $current_page = isset( $_REQUEST['form_type'] ) ? $_REQUEST['form_type'] : '';
592
+		$link = '';
593
+		$labels = array(
594
+			'restore' => array(
595
+				'long'  => __( 'Restore from Trash', 'formidable' ),
596
+				'short' => __( 'Restore', 'formidable' ),
597
+			),
598
+			'trash' => array(
599
+				'long'  => __( 'Move to Trash', 'formidable' ),
600
+				'short' => __( 'Trash', 'formidable' ),
601
+			),
602
+			'delete' => array(
603
+				'long'  => __( 'Delete Permanently', 'formidable' ),
604
+				'short' => __( 'Delete', 'formidable' ),
605
+			),
606
+		);
607
+
608
+		$current_page = isset( $_REQUEST['form_type'] ) ? $_REQUEST['form_type'] : '';
609 609
 		$base_url = '?page=formidable&form_type=' . $current_page . '&id=' . $id;
610
-        if ( 'trash' == $status ) {
610
+		if ( 'trash' == $status ) {
611 611
 			$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=untrash', 'untrash_form_' . $id ) ) . '" class="submitdelete deletion">' . $labels['restore'][ $length ] . '</a>';
612
-        } else if ( current_user_can('frm_delete_forms') ) {
613
-            if ( EMPTY_TRASH_DAYS ) {
612
+		} else if ( current_user_can('frm_delete_forms') ) {
613
+			if ( EMPTY_TRASH_DAYS ) {
614 614
 				$link = '<a href="' . esc_url( wp_nonce_url( $base_url . '&frm_action=trash', 'trash_form_' . $id ) ) . '" class="submitdelete deletion">' . $labels['trash'][ $length ] . '</a>';
615
-            } else {
615
+			} else {
616 616
 				$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>';
617
-            }
618
-        }
617
+			}
618
+		}
619 619
 
620
-        return $link;
621
-    }
620
+		return $link;
621
+	}
622 622
 
623 623
 	public static function status_nice_name( $status ) {
624
-        $nice_names = array(
625
-            'draft'     => __( 'Draft', 'formidable' ),
626
-            'trash'     => __( 'Trash', 'formidable' ),
627
-            'publish'   => __( 'Published', 'formidable' ),
628
-        );
629
-
630
-        if ( ! in_array($status, array_keys($nice_names)) ) {
631
-            $status = 'publish';
632
-        }
624
+		$nice_names = array(
625
+			'draft'     => __( 'Draft', 'formidable' ),
626
+			'trash'     => __( 'Trash', 'formidable' ),
627
+			'publish'   => __( 'Published', 'formidable' ),
628
+		);
629
+
630
+		if ( ! in_array($status, array_keys($nice_names)) ) {
631
+			$status = 'publish';
632
+		}
633 633
 
634 634
 		$name = $nice_names[ $status ];
635 635
 
636
-        return $name;
637
-    }
636
+		return $name;
637
+	}
638 638
 
639 639
 	public static function get_params() {
640 640
 		_deprecated_function( __FUNCTION__, '2.0.9', 'FrmForm::list_page_params' );
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.