Completed
Branch 3.0 (afc7c2)
by Stephanie
03:55 queued 01:12
created
classes/views/frm-entries/form.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
     </div>
6 6
 </div>
7 7
 <?php
8
-    return;
8
+	return;
9 9
 }
10 10
 
11 11
 global $frm_vars;
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 
55 55
 // close open collapsible toggle div
56 56
 if ( isset($frm_vars['collapse_div']) && $frm_vars['collapse_div'] ) {
57
-    echo "</div>\n";
58
-    unset($frm_vars['collapse_div']);
57
+	echo "</div>\n";
58
+	unset($frm_vars['collapse_div']);
59 59
 }
60 60
 
61 61
 echo FrmFormsHelper::replace_shortcodes($values['after_html'], $form);
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( empty($values) || ! isset($values['fields']) || empty($values['fields']) ) { ?>
3
-<div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class($form); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container">
2
+if ( empty( $values ) || ! isset( $values['fields'] ) || empty( $values['fields'] ) ) { ?>
3
+<div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class( $form ); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container">
4 4
 	<div class="frm_error_style"><strong><?php _e( 'Oops!', 'formidable' ) ?></strong> <?php printf( __( 'You did not add any fields to your form. %1$sGo back%2$s and add some.', 'formidable' ), '<a href="' . esc_url( admin_url( '?page=formidable&frm_action=edit&id=' . $form->id ) ) . '">', '</a>' ) ?>
5 5
     </div>
6 6
 </div>
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
 <div class="frm_form_fields <?php echo esc_attr( apply_filters( 'frm_form_fields_class', '', $values ) ); ?>">
19 19
 <fieldset>
20 20
 <?php echo FrmFormsHelper::replace_shortcodes( $values['before_html'], $form, $title, $description ); ?>
21
-<?php do_action( 'frm_after_title', compact('form') ) ?>
22
-<input type="hidden" name="frm_action" value="<?php echo esc_attr($form_action) ?>" />
23
-<input type="hidden" name="form_id" value="<?php echo esc_attr($form->id) ?>" />
24
-<input type="hidden" name="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" id="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" value="<?php echo esc_attr($frm_hide_fields) ?>" />
25
-<input type="hidden" name="form_key" value="<?php echo esc_attr($form->form_key) ?>" />
21
+<?php do_action( 'frm_after_title', compact( 'form' ) ) ?>
22
+<input type="hidden" name="frm_action" value="<?php echo esc_attr( $form_action ) ?>" />
23
+<input type="hidden" name="form_id" value="<?php echo esc_attr( $form->id ) ?>" />
24
+<input type="hidden" name="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" id="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" value="<?php echo esc_attr( $frm_hide_fields ) ?>" />
25
+<input type="hidden" name="form_key" value="<?php echo esc_attr( $form->form_key ) ?>" />
26 26
 <input type="hidden" name="item_meta[0]" value="" />
27 27
 <?php wp_nonce_field( 'frm_submit_entry_nonce', 'frm_submit_entry_' . $form->id ); ?>
28
-<input type="text" class="frm_hidden frm_verify" id="frm_verify_<?php echo esc_attr( $form->id ) ?>" name="frm_verify" value="<?php echo esc_attr( FrmAppHelper::get_param('frm_verify' ) ) ?>" <?php FrmFormsHelper::maybe_hide_inline() ?> />
28
+<input type="text" class="frm_hidden frm_verify" id="frm_verify_<?php echo esc_attr( $form->id ) ?>" name="frm_verify" value="<?php echo esc_attr( FrmAppHelper::get_param( 'frm_verify' ) ) ?>" <?php FrmFormsHelper::maybe_hide_inline() ?> />
29 29
 
30 30
 <?php if ( isset( $id ) ) { ?><input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /><?php }
31 31
 
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 if ( FrmAppHelper::is_admin() ) { ?>
38 38
 <div class="frm_form_field form-field">
39 39
 <label class="frm_primary_label"><?php _e( 'Entry Key', 'formidable' ) ?></label>
40
-<input type="text" name="item_key" value="<?php echo esc_attr($values['item_key']) ?>" />
40
+<input type="text" name="item_key" value="<?php echo esc_attr( $values['item_key'] ) ?>" />
41 41
 </div>
42 42
 <?php } else { ?>
43
-<input type="hidden" name="item_key" value="<?php echo esc_attr($values['item_key']) ?>" />
43
+<input type="hidden" name="item_key" value="<?php echo esc_attr( $values['item_key'] ) ?>" />
44 44
 <?php }
45 45
 
46
-do_action('frm_entry_form', $form, $form_action, $errors);
46
+do_action( 'frm_entry_form', $form, $form_action, $errors );
47 47
 
48 48
 global $frm_vars;
49 49
 // close open section div
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 }
54 54
 
55 55
 // close open collapsible toggle div
56
-if ( isset($frm_vars['collapse_div']) && $frm_vars['collapse_div'] ) {
56
+if ( isset( $frm_vars['collapse_div'] ) && $frm_vars['collapse_div'] ) {
57 57
     echo "</div>\n";
58
-    unset($frm_vars['collapse_div']);
58
+    unset( $frm_vars['collapse_div'] );
59 59
 }
60 60
 
61
-echo FrmFormsHelper::replace_shortcodes($values['after_html'], $form);
61
+echo FrmFormsHelper::replace_shortcodes( $values['after_html'], $form );
62 62
 
63 63
 if ( FrmForm::show_submit( $form ) ) {
64 64
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 </fieldset>
72 72
 </div>
73 73
 <?php
74
-if ( has_action('frm_entries_footer_scripts') ) {
74
+if ( has_action( 'frm_entries_footer_scripts' ) ) {
75 75
 ?><script type="text/javascript"><?php
76 76
 do_action( 'frm_entries_footer_scripts', $values['fields'], $form );
77 77
 ?></script><?php
Please login to merge, or discard this patch.
classes/models/FrmEntryFormat.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -151,6 +151,7 @@
 block discarded – undo
151 151
 
152 152
 	/**
153 153
 	 * @deprecated 2.04
154
+	 * @param string $val
154 155
 	 */
155 156
 	private static function get_field_value( $atts, &$val ) {
156 157
 		_deprecated_function( __FUNCTION__, '2.04', 'instance of FrmEntryValues or FrmProEntryValues' );
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -98,15 +98,15 @@  discard block
 block discarded – undo
98 98
 		self::prepare_field_output( $atts, $val );
99 99
 
100 100
 		if ( $atts['format'] != 'text' ) {
101
-			$values[ $f->field_key ] = $val;
101
+			$values[$f->field_key] = $val;
102 102
 			if ( $atts['entry'] && $f->type != 'textarea' ) {
103
-				$prev_val = maybe_unserialize( $atts['entry']->metas[ $f->id ] );
103
+				$prev_val = maybe_unserialize( $atts['entry']->metas[$f->id] );
104 104
 				if ( $prev_val != $val ) {
105
-					$values[ $f->field_key . '-value' ] = $prev_val;
105
+					$values[$f->field_key . '-value'] = $prev_val;
106 106
 				}
107 107
 			}
108 108
 		} else {
109
-			$values[ $f->id ] = array( 'label' => $f->name, 'val' => $val, 'type' => $f->type );
109
+			$values[$f->id] = array( 'label' => $f->name, 'val' => $val, 'type' => $f->type );
110 110
 		}
111 111
 	}
112 112
 
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 	private static function fill_missing_fields( $atts, &$values ) {
117 117
 		_deprecated_function( __FUNCTION__, '2.04', 'instance of FrmEntryValues or FrmProEntryValues' );
118 118
 
119
-		if ( $atts['entry'] && ! isset( $atts['entry']->metas[ $atts['field']->id ] ) ) {
119
+		if ( $atts['entry'] && ! isset( $atts['entry']->metas[$atts['field']->id] ) ) {
120 120
 			// In case include_blank is set
121
-			$atts['entry']->metas[ $atts['field']->id ] = '';
121
+			$atts['entry']->metas[$atts['field']->id] = '';
122 122
 			$atts['entry'] = apply_filters( 'frm_prepare_entry_content', $atts['entry'], array( 'field' => $atts['field'] ) );
123 123
 			self::fill_values_from_entry( $atts, $values );
124 124
 		}
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 			'type'  => $f->type,
147 147
 		);
148 148
 
149
-		$values[ $f->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $field_shortcodes, $f );
149
+		$values[$f->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $field_shortcodes, $f );
150 150
 	}
151 151
 
152 152
 	/**
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
 		$f = $atts['field'];
159 159
 		if ( $atts['entry'] ) {
160
-			$prev_val = maybe_unserialize( $atts['entry']->metas[ $f->id ] );
160
+			$prev_val = maybe_unserialize( $atts['entry']->metas[$f->id] );
161 161
 			$meta = array( 'item_id' => $atts['id'], 'field_id' => $f->id, 'meta_value' => $prev_val, 'field_type' => $f->type );
162 162
 
163 163
 			//This filter applies to the default-message shortcode and frm-show-entry shortcode only
Please login to merge, or discard this patch.
classes/views/styles/_field-labels.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <div class="field-group field-group-background clearfix frm-first-row">
2 2
 	<label><?php _e( 'Color', 'formidable' ) ?></label>
3
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('label_color') ) ?>" id="frm_label_color" class="hex" value="<?php echo esc_attr( $style->post_content['label_color'] ) ?>" />
3
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'label_color' ) ) ?>" id="frm_label_color" class="hex" value="<?php echo esc_attr( $style->post_content['label_color'] ) ?>" />
4 4
 </div>
5 5
 <div class="field-group clearfix frm-first-row">
6 6
 	<label><?php _e( 'Weight', 'formidable' ) ?></label>
7
-	<select name="<?php echo esc_attr( $frm_style->get_field_name('weight') ) ?>" id="frm_weight">
7
+	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'weight' ) ) ?>" id="frm_weight">
8 8
 		<?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?>
9 9
 		<option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['weight'], $value ) ?>><?php echo esc_html( $name ) ?></option>
10 10
 		<?php } ?>
@@ -12,45 +12,45 @@  discard block
 block discarded – undo
12 12
 </div>
13 13
 <div class="field-group clearfix frm-first-row">
14 14
 	<label><?php _e( 'Size', 'formidable' ) ?></label>
15
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('font_size') ) ?>" id="frm_font_size" value="<?php echo esc_attr($style->post_content['font_size']) ?>"  size="3" />
15
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'font_size' ) ) ?>" id="frm_font_size" value="<?php echo esc_attr( $style->post_content['font_size'] ) ?>"  size="3" />
16 16
 </div>
17 17
 
18 18
 <div class="field-group clearfix frm_clear">
19 19
 	<label><?php _e( 'Position', 'formidable' ) ?></label>
20
-	<select name="<?php echo esc_attr( $frm_style->get_field_name('position') ) ?>" id="frm_position">
20
+	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'position' ) ) ?>" id="frm_position">
21 21
 	    <?php foreach ( FrmStylesHelper::get_css_label_positions() as $pos => $pos_label ) { ?>
22
-	        <option value="<?php echo esc_attr( $pos ) ?>" <?php selected($style->post_content['position'], $pos) ?>><?php echo esc_html( $pos_label ) ?></option>
22
+	        <option value="<?php echo esc_attr( $pos ) ?>" <?php selected( $style->post_content['position'], $pos ) ?>><?php echo esc_html( $pos_label ) ?></option>
23 23
 	    <?php } ?>
24 24
 	</select>
25 25
 </div>
26 26
 
27 27
 <div class="field-group clearfix">
28 28
 	<label><?php _e( 'Align', 'formidable' ) ?></label>
29
-	<select name="<?php echo esc_attr( $frm_style->get_field_name('align') ) ?>" id="frm_align">
30
-		<option value="left" <?php selected($style->post_content['align'], 'left') ?>><?php _e( 'left', 'formidable' ) ?></option>
31
-		<option value="right" <?php selected($style->post_content['align'], 'right') ?>><?php _e( 'right', 'formidable' ) ?></option>
29
+	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'align' ) ) ?>" id="frm_align">
30
+		<option value="left" <?php selected( $style->post_content['align'], 'left' ) ?>><?php _e( 'left', 'formidable' ) ?></option>
31
+		<option value="right" <?php selected( $style->post_content['align'], 'right' ) ?>><?php _e( 'right', 'formidable' ) ?></option>
32 32
 	</select>
33 33
 </div>
34 34
 
35 35
 <div class="field-group clearfix">
36 36
 	<label><?php _e( 'Width', 'formidable' ) ?></label>
37
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('width') ) ?>" id="frm_width" value="<?php echo esc_attr( $style->post_content['width'] ) ?>" />
37
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'width' ) ) ?>" id="frm_width" value="<?php echo esc_attr( $style->post_content['width'] ) ?>" />
38 38
 </div>
39 39
 
40 40
 <div class="field-group clearfix frm_clear">
41 41
 	<label><?php _e( 'Padding', 'formidable' ) ?></label>
42
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('label_padding') ) ?>" id="frm_label_padding" value="<?php echo esc_attr( $style->post_content['label_padding'] ) ?>" />
42
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'label_padding' ) ) ?>" id="frm_label_padding" value="<?php echo esc_attr( $style->post_content['label_padding'] ) ?>" />
43 43
 </div>
44 44
 
45 45
 <div class="clear"></div>
46 46
 <h3><?php _e( 'Required Indicator', 'formidable' ) ?></h3>
47 47
 <div class="field-group field-group-border clearfix after-h3">
48 48
 	<label class="background"><?php _e( 'Color', 'formidable' ) ?></label>
49
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('required_color') ) ?>" id="frm_required_color" class="hex" value="<?php echo esc_attr( $style->post_content['required_color'] ) ?>" />
49
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'required_color' ) ) ?>" id="frm_required_color" class="hex" value="<?php echo esc_attr( $style->post_content['required_color'] ) ?>" />
50 50
 </div>
51 51
 <div class="field-group clearfix after-h3">
52 52
 	<label><?php _e( 'Weight', 'formidable' ) ?></label>
53
-	<select name="<?php echo esc_attr( $frm_style->get_field_name('required_weight') ) ?>" id="frm_required_weight">
53
+	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'required_weight' ) ) ?>" id="frm_required_weight">
54 54
 		<?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?>
55 55
 		<option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['required_weight'], $value ) ?>><?php echo esc_html( $name ) ?></option>
56 56
 		<?php } ?>
Please login to merge, or discard this patch.
classes/models/FrmTableHTMLGenerator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,12 +83,12 @@  discard block
 block discarded – undo
83 83
 		) );
84 84
 
85 85
 		foreach ( $this->style_settings as $key => $setting ) {
86
-			if ( isset( $atts[ $key ] ) && $atts[ $key ] !== '' ) {
87
-				$this->style_settings[ $key ] = $atts[ $key ];
86
+			if ( isset( $atts[$key] ) && $atts[$key] !== '' ) {
87
+				$this->style_settings[$key] = $atts[$key];
88 88
 			}
89 89
 
90 90
 			if ( $this->is_color_setting( $key ) ) {
91
-				$this->style_settings[ $key ] = $this->get_color_markup( $this->style_settings[ $key ] );
91
+				$this->style_settings[$key] = $this->get_color_markup( $this->style_settings[$key] );
92 92
 			}
93 93
 		}
94 94
 	}
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 *
159 159
 	 * @return boolean
160 160
 	 */
161
-	private function is_color_setting ( $setting_key ) {
161
+	private function is_color_setting( $setting_key ) {
162 162
 		return strpos( $setting_key, 'color' ) !== false;
163 163
 	}
164 164
 
Please login to merge, or discard this patch.
classes/helpers/FrmEntriesListHelper.php 2 patches
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -6,10 +6,10 @@  discard block
 block discarded – undo
6 6
 	protected $field;
7 7
 
8 8
 	public function prepare_items() {
9
-        global $per_page;
9
+		global $per_page;
10 10
 
11 11
 		$per_page = $this->get_items_per_page( 'formidable_page_formidable_entries_per_page' );
12
-        $form_id = $this->params['form'];
12
+		$form_id = $this->params['form'];
13 13
 
14 14
 		$default_orderby = 'id';
15 15
 		$default_order = 'DESC';
@@ -25,27 +25,27 @@  discard block
 block discarded – undo
25 25
 
26 26
 		$s = isset( $_REQUEST['s'] ) ? stripslashes($_REQUEST['s']) : '';
27 27
 
28
-	    if ( $s != '' && FrmAppHelper::pro_is_installed() ) {
29
-	        $fid = isset( $_REQUEST['fid'] ) ? sanitize_title( $_REQUEST['fid'] ) : '';
30
-	        $s_query = FrmProEntriesHelper::get_search_str( $s_query, $s, $form_id, $fid );
31
-	    }
28
+		if ( $s != '' && FrmAppHelper::pro_is_installed() ) {
29
+			$fid = isset( $_REQUEST['fid'] ) ? sanitize_title( $_REQUEST['fid'] ) : '';
30
+			$s_query = FrmProEntriesHelper::get_search_str( $s_query, $s, $form_id, $fid );
31
+		}
32 32
 
33 33
 		$s_query = apply_filters( 'frm_entries_list_query', $s_query, compact( 'form_id' ) );
34 34
 
35
-        $orderby = isset( $_REQUEST['orderby'] ) ? sanitize_title( $_REQUEST['orderby'] ) : $default_orderby;
36
-        if ( strpos($orderby, 'meta') !== false ) {
37
-            $order_field_type = FrmField::get_type( str_replace( 'meta_', '', $orderby ) );
35
+		$orderby = isset( $_REQUEST['orderby'] ) ? sanitize_title( $_REQUEST['orderby'] ) : $default_orderby;
36
+		if ( strpos($orderby, 'meta') !== false ) {
37
+			$order_field_type = FrmField::get_type( str_replace( 'meta_', '', $orderby ) );
38 38
 			$orderby .= in_array( $order_field_type, array( 'number', 'scale' ) ) ? ' +0 ' : '';
39
-        }
39
+		}
40 40
 
41 41
 		$order = isset( $_REQUEST['order'] ) ? sanitize_title( $_REQUEST['order'] ) : $default_order;
42 42
 		$order = ' ORDER BY ' . $orderby . ' ' . $order;
43 43
 
44
-        $page = $this->get_pagenum();
44
+		$page = $this->get_pagenum();
45 45
 		$start = (int) isset( $_REQUEST['start'] ) ? absint( $_REQUEST['start'] ) : ( ( $page - 1 ) * $per_page );
46 46
 
47 47
 		$this->items = FrmEntry::getAll( $s_query, $order, ' LIMIT ' . $start . ',' . $per_page, true, $join_form_in_query );
48
-        $total_items = FrmEntry::getRecordCount($s_query);
48
+		$total_items = FrmEntry::getRecordCount($s_query);
49 49
 
50 50
 		$this->set_pagination_args( array(
51 51
 			'total_items' => $total_items,
@@ -54,19 +54,19 @@  discard block
 block discarded – undo
54 54
 	}
55 55
 
56 56
 	public function no_items() {
57
-        $s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
58
-	    if ( ! empty($s) ) {
59
-            _e( 'No Entries Found', 'formidable' );
60
-            return;
61
-        }
57
+		$s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
58
+		if ( ! empty($s) ) {
59
+			_e( 'No Entries Found', 'formidable' );
60
+			return;
61
+		}
62 62
 
63 63
 		$form_id = $this->params['form'];
64 64
 		$form = $this->params['form'];
65 65
 
66
-        if ( $form_id ) {
67
-            $form = FrmForm::getOne($form_id);
68
-        }
69
-        $colspan = $this->get_column_count();
66
+		if ( $form_id ) {
67
+			$form = FrmForm::getOne($form_id);
68
+		}
69
+		$colspan = $this->get_column_count();
70 70
 
71 71
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/no_entries.php' );
72 72
 	}
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
 	}
87 87
 
88 88
 	/**
89
-	* Gets the name of the primary column in the Entries screen
90
-	*
91
-	* @since 2.0.14
92
-	*
93
-	* @return string $primary_column
94
-	*/
89
+	 * Gets the name of the primary column in the Entries screen
90
+	 *
91
+	 * @since 2.0.14
92
+	 *
93
+	 * @return string $primary_column
94
+	 */
95 95
 	protected function get_primary_column_name() {
96 96
 		$columns = get_column_headers( $this->screen );
97 97
 		$hidden = get_hidden_columns( $this->screen );
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
 		$this->get_actions( $actions, $item, $view_link );
117 117
 
118
-        $action_links = $this->row_actions( $actions );
118
+		$action_links = $this->row_actions( $actions );
119 119
 
120 120
 		// Set up the checkbox ( because the user is editable, otherwise its empty )
121 121
 		$checkbox = "<input type='checkbox' name='item-action[]' id='cb-item-action-{$item->id}' value='{$item->id}' />";
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		$r = "<tr id='item-action-{$item->id}'$style>";
124 124
 
125 125
 		list( $columns, $hidden, , $primary ) = $this->get_column_info();
126
-        $action_col = false;
126
+		$action_col = false;
127 127
 
128 128
 		foreach ( $columns as $column_name => $column_display_name ) {
129 129
 			$class = $column_name . ' column-' . $column_name;
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 			if ( in_array( $column_name, $hidden ) ) {
136 136
 				$class .= ' frm_hidden';
137 137
 			} else if ( ! $action_col && ! in_array( $column_name, array( 'cb', 'id', 'form_id', 'post_id' ) ) ) {
138
-			    $action_col = $column_name;
139
-            }
138
+				$action_col = $column_name;
139
+			}
140 140
 
141 141
 			$attributes = 'class="' . esc_attr( $class ) . '"';
142 142
 			unset($class);
@@ -154,30 +154,30 @@  discard block
 block discarded – undo
154 154
 				case 'ip':
155 155
 				case 'id':
156 156
 				case 'item_key':
157
-				    $val = $item->{$col_name};
158
-				    break;
157
+					$val = $item->{$col_name};
158
+					break;
159 159
 				case 'name':
160 160
 				case 'description':
161
-				    $val = FrmAppHelper::truncate(strip_tags($item->{$col_name}), 100);
162
-				    break;
161
+					$val = FrmAppHelper::truncate(strip_tags($item->{$col_name}), 100);
162
+					break;
163 163
 				case 'created_at':
164 164
 				case 'updated_at':
165
-				    $date = FrmAppHelper::get_formatted_time($item->{$col_name});
165
+					$date = FrmAppHelper::get_formatted_time($item->{$col_name});
166 166
 					$val = '<abbr title="' . esc_attr( FrmAppHelper::get_formatted_time( $item->{$col_name}, '', 'g:i:s A' ) ) . '">' . $date . '</abbr>';
167 167
 					break;
168 168
 				case 'is_draft':
169
-				    $val = empty($item->is_draft) ? __( 'No') : __( 'Yes');
170
-			        break;
169
+					$val = empty($item->is_draft) ? __( 'No') : __( 'Yes');
170
+					break;
171 171
 				case 'form_id':
172
-				    $val = FrmFormsHelper::edit_form_link($item->form_id);
173
-    				break;
172
+					$val = FrmFormsHelper::edit_form_link($item->form_id);
173
+					break;
174 174
 				case 'post_id':
175
-				    $val = FrmAppHelper::post_edit_link($item->post_id);
176
-				    break;
175
+					$val = FrmAppHelper::post_edit_link($item->post_id);
176
+					break;
177 177
 				case 'user_id':
178
-				    $user = get_userdata($item->user_id);
179
-				    $val = $user ? $user->user_login : '';
180
-				    break;
178
+					$user = get_userdata($item->user_id);
179
+					$val = $user ? $user->user_login : '';
180
+					break;
181 181
 				case 'parent_item_id':
182 182
 					$val = $item->parent_item_id;
183 183
 					break;
@@ -190,15 +190,15 @@  discard block
 block discarded – undo
190 190
 			}
191 191
 
192 192
 			if ( $col_name != 'cb' ) {
193
-			    $r .= "<td $attributes>";
193
+				$r .= "<td $attributes>";
194 194
 				if ( $column_name == $action_col ) {
195 195
 					$edit_link = '?page=formidable-entries&frm_action=edit&id=' . $item->id;
196 196
 					$r .= '<a href="' . esc_url( isset( $actions['edit'] ) ? $edit_link : $view_link ) . '" class="row-title" >' . $val . '</a> ';
197
-			        $r .= $action_links;
197
+					$r .= $action_links;
198 198
 				} else {
199
-			        $r .= $val;
200
-			    }
201
-			    $r .= '</td>';
199
+					$r .= $val;
200
+				}
201
+				$r .= '</td>';
202 202
 			}
203 203
 			unset($val);
204 204
 		}
@@ -207,19 +207,19 @@  discard block
 block discarded – undo
207 207
 		return $r;
208 208
 	}
209 209
 
210
-    /**
211
-     * @param string $view_link
212
-     */
213
-    private function get_actions( &$actions, $item, $view_link ) {
210
+	/**
211
+	 * @param string $view_link
212
+	 */
213
+	private function get_actions( &$actions, $item, $view_link ) {
214 214
 		$actions['view'] = '<a href="' . esc_url( $view_link ) . '">' . __( 'View', 'formidable' ) . '</a>';
215 215
 
216
-        if ( current_user_can('frm_delete_entries') ) {
216
+		if ( current_user_can('frm_delete_entries') ) {
217 217
 			$delete_link = '?page=formidable-entries&frm_action=destroy&id=' . $item->id . '&form=' . $this->params['form'];
218 218
 			$actions['delete'] = '<a href="' . esc_url( wp_nonce_url( $delete_link ) ) . '" class="submitdelete" onclick="return confirm(\'' . esc_attr( __( 'Are you sure you want to delete that?', 'formidable' ) ) . '\')">' . __( 'Delete' ) . '</a>';
219
-	    }
219
+		}
220 220
 
221
-        $actions = apply_filters('frm_row_actions', $actions, $item);
222
-    }
221
+		$actions = apply_filters('frm_row_actions', $actions, $item);
222
+	}
223 223
 
224 224
 	private function get_column_value( $item, &$val ) {
225 225
 		$col_name = $this->column_name;
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 			$join_form_in_query = true;
24 24
 		}
25 25
 
26
-		$s = isset( $_REQUEST['s'] ) ? stripslashes($_REQUEST['s']) : '';
26
+		$s = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
27 27
 
28 28
 	    if ( $s != '' && FrmAppHelper::pro_is_installed() ) {
29 29
 	        $fid = isset( $_REQUEST['fid'] ) ? sanitize_title( $_REQUEST['fid'] ) : '';
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 		$s_query = apply_filters( 'frm_entries_list_query', $s_query, compact( 'form_id' ) );
34 34
 
35 35
         $orderby = isset( $_REQUEST['orderby'] ) ? sanitize_title( $_REQUEST['orderby'] ) : $default_orderby;
36
-        if ( strpos($orderby, 'meta') !== false ) {
36
+        if ( strpos( $orderby, 'meta' ) !== false ) {
37 37
             $order_field_type = FrmField::get_type( str_replace( 'meta_', '', $orderby ) );
38 38
 			$orderby .= in_array( $order_field_type, array( 'number', 'scale' ) ) ? ' +0 ' : '';
39 39
         }
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		$start = (int) isset( $_REQUEST['start'] ) ? absint( $_REQUEST['start'] ) : ( ( $page - 1 ) * $per_page );
46 46
 
47 47
 		$this->items = FrmEntry::getAll( $s_query, $order, ' LIMIT ' . $start . ',' . $per_page, true, $join_form_in_query );
48
-        $total_items = FrmEntry::getRecordCount($s_query);
48
+        $total_items = FrmEntry::getRecordCount( $s_query );
49 49
 
50 50
 		$this->set_pagination_args( array(
51 51
 			'total_items' => $total_items,
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
 	public function no_items() {
57 57
         $s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
58
-	    if ( ! empty($s) ) {
58
+	    if ( ! empty( $s ) ) {
59 59
             _e( 'No Entries Found', 'formidable' );
60 60
             return;
61 61
         }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 		$form = $this->params['form'];
65 65
 
66 66
         if ( $form_id ) {
67
-            $form = FrmForm::getOne($form_id);
67
+            $form = FrmForm::getOne( $form_id );
68 68
         }
69 69
         $colspan = $this->get_column_count();
70 70
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
 		$r = "<tr id='item-action-{$item->id}'$style>";
124 124
 
125
-		list( $columns, $hidden, , $primary ) = $this->get_column_info();
125
+		list( $columns, $hidden,, $primary ) = $this->get_column_info();
126 126
         $action_col = false;
127 127
 
128 128
 		foreach ( $columns as $column_name => $column_display_name ) {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             }
140 140
 
141 141
 			$attributes = 'class="' . esc_attr( $class ) . '"';
142
-			unset($class);
142
+			unset( $class );
143 143
 			$attributes .= ' data-colname="' . $column_display_name . '"';
144 144
 
145 145
 			$form_id = $this->params['form'] ? $this->params['form'] : 0;
@@ -158,24 +158,24 @@  discard block
 block discarded – undo
158 158
 				    break;
159 159
 				case 'name':
160 160
 				case 'description':
161
-				    $val = FrmAppHelper::truncate(strip_tags($item->{$col_name}), 100);
161
+				    $val = FrmAppHelper::truncate( strip_tags( $item->{$col_name}), 100 );
162 162
 				    break;
163 163
 				case 'created_at':
164 164
 				case 'updated_at':
165
-				    $date = FrmAppHelper::get_formatted_time($item->{$col_name});
165
+				    $date = FrmAppHelper::get_formatted_time( $item->{$col_name});
166 166
 					$val = '<abbr title="' . esc_attr( FrmAppHelper::get_formatted_time( $item->{$col_name}, '', 'g:i:s A' ) ) . '">' . $date . '</abbr>';
167 167
 					break;
168 168
 				case 'is_draft':
169
-				    $val = empty($item->is_draft) ? __( 'No') : __( 'Yes');
169
+				    $val = empty( $item->is_draft ) ? __( 'No' ) : __( 'Yes' );
170 170
 			        break;
171 171
 				case 'form_id':
172
-				    $val = FrmFormsHelper::edit_form_link($item->form_id);
172
+				    $val = FrmFormsHelper::edit_form_link( $item->form_id );
173 173
     				break;
174 174
 				case 'post_id':
175
-				    $val = FrmAppHelper::post_edit_link($item->post_id);
175
+				    $val = FrmAppHelper::post_edit_link( $item->post_id );
176 176
 				    break;
177 177
 				case 'user_id':
178
-				    $user = get_userdata($item->user_id);
178
+				    $user = get_userdata( $item->user_id );
179 179
 				    $val = $user ? $user->user_login : '';
180 180
 				    break;
181 181
 				case 'parent_item_id':
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 			    }
201 201
 			    $r .= '</td>';
202 202
 			}
203
-			unset($val);
203
+			unset( $val );
204 204
 		}
205 205
 		$r .= '</tr>';
206 206
 
@@ -213,12 +213,12 @@  discard block
 block discarded – undo
213 213
     private function get_actions( &$actions, $item, $view_link ) {
214 214
 		$actions['view'] = '<a href="' . esc_url( $view_link ) . '">' . __( 'View', 'formidable' ) . '</a>';
215 215
 
216
-        if ( current_user_can('frm_delete_entries') ) {
216
+        if ( current_user_can( 'frm_delete_entries' ) ) {
217 217
 			$delete_link = '?page=formidable-entries&frm_action=destroy&id=' . $item->id . '&form=' . $this->params['form'];
218 218
 			$actions['delete'] = '<a href="' . esc_url( wp_nonce_url( $delete_link ) ) . '" class="submitdelete" onclick="return confirm(\'' . esc_attr( __( 'Are you sure you want to delete that?', 'formidable' ) ) . '\')">' . __( 'Delete' ) . '</a>';
219 219
 	    }
220 220
 
221
-        $actions = apply_filters('frm_row_actions', $actions, $item);
221
+        $actions = apply_filters( 'frm_row_actions', $actions, $item );
222 222
     }
223 223
 
224 224
 	private function get_column_value( $item, &$val ) {
Please login to merge, or discard this patch.
classes/models/FrmEntryShortcodeFormatter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -285,7 +285,7 @@
 block discarded – undo
285 285
 			'type'  => $field->type,
286 286
 		);
287 287
 
288
-		$this->array_content[ $field->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field );
288
+		$this->array_content[$field->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field );
289 289
 	}
290 290
 
291 291
 	/**
Please login to merge, or discard this patch.
classes/controllers/FrmEntriesController.php 2 patches
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
     public static function menu() {
6 6
 		FrmAppHelper::force_capability( 'frm_view_entries' );
7 7
 
8
-        add_submenu_page('formidable', 'Formidable | ' . __( 'Entries', 'formidable' ), __( 'Entries', 'formidable' ), 'frm_view_entries', 'formidable-entries', 'FrmEntriesController::route' );
8
+        add_submenu_page( 'formidable', 'Formidable | ' . __( 'Entries', 'formidable' ), __( 'Entries', 'formidable' ), 'frm_view_entries', 'formidable-entries', 'FrmEntriesController::route' );
9 9
 
10 10
 		if ( ! in_array( FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' ), array( 'edit', 'show' ) ) ) {
11 11
 			$menu_name = FrmAppHelper::get_menu_name();
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
             'id'      => 'formidable-entries-tab',
54 54
             'title'   => __( 'Overview', 'formidable' ),
55 55
 			'content' => '<p>' . esc_html__( 'This screen provides access to all of your entries. You can customize the display of this screen to suit your workflow.', 'formidable' ) . '</p> <p>' . esc_html__( 'Hovering over a row in the entries list will display action links that allow you to manage your entry.', 'formidable' ) . '</p>',
56
-        ));
56
+        ) );
57 57
 
58 58
         $screen->set_help_sidebar(
59 59
 			'<p><strong>' . esc_html__( 'For more information:', 'formidable' ) . '</strong></p>' .
@@ -68,19 +68,19 @@  discard block
 block discarded – undo
68 68
         global $frm_vars;
69 69
 		$form_id = FrmForm::get_current_form_id();
70 70
 
71
-		$columns[ $form_id . '_id' ] = 'ID';
72
-		$columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' );
71
+		$columns[$form_id . '_id'] = 'ID';
72
+		$columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' );
73 73
 
74 74
 		if ( $form_id ) {
75 75
 			self::get_columns_for_form( $form_id, $columns );
76 76
 		} else {
77
-			$columns[ $form_id . '_form_id' ] = __( 'Form', 'formidable' );
78
-			$columns[ $form_id . '_name' ] = __( 'Entry Name', 'formidable' );
79
-			$columns[ $form_id . '_user_id' ] = __( 'Created By', 'formidable' );
77
+			$columns[$form_id . '_form_id'] = __( 'Form', 'formidable' );
78
+			$columns[$form_id . '_name'] = __( 'Entry Name', 'formidable' );
79
+			$columns[$form_id . '_user_id'] = __( 'Created By', 'formidable' );
80 80
 		}
81 81
 
82
-		$columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' );
83
-		$columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' );
82
+		$columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' );
83
+		$columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' );
84 84
 		self::maybe_add_ip_col( $form_id, $columns );
85 85
 
86 86
         $frm_vars['cols'] = $columns;
@@ -107,14 +107,14 @@  discard block
 block discarded – undo
107 107
 				if ( $sub_form_cols ) {
108 108
 					foreach ( $sub_form_cols as $k => $sub_form_col ) {
109 109
 						if ( FrmField::is_no_save_field( $sub_form_col->type ) ) {
110
-							unset( $sub_form_cols[ $k ] );
110
+							unset( $sub_form_cols[$k] );
111 111
 							continue;
112 112
 						}
113
-						$columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $form_col->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
114
-						unset($sub_form_col);
113
+						$columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $form_col->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
114
+						unset( $sub_form_col );
115 115
 					}
116 116
 				}
117
-				unset($sub_form_cols);
117
+				unset( $sub_form_cols );
118 118
 			} else {
119 119
 				$col_id = $form_col->field_key;
120 120
 				if ( $form_col->form_id != $form_id ) {
@@ -124,16 +124,16 @@  discard block
 block discarded – undo
124 124
 				$has_separate_value = ! FrmField::is_option_empty( $form_col, 'separate_value' );
125 125
 				$is_post_status     = FrmField::is_option_true( $form_col, 'post_field' ) && $form_col->field_options['post_field'] == 'post_status';
126 126
 				if ( $has_separate_value && ! $is_post_status ) {
127
-					$columns[ $form_id . '_frmsep_' . $col_id ] = FrmAppHelper::truncate( $form_col->name, 35 );
127
+					$columns[$form_id . '_frmsep_' . $col_id] = FrmAppHelper::truncate( $form_col->name, 35 );
128 128
 				}
129
-				$columns[ $form_id . '_' . $col_id ] = FrmAppHelper::truncate( $form_col->name, 35 );
129
+				$columns[$form_id . '_' . $col_id] = FrmAppHelper::truncate( $form_col->name, 35 );
130 130
 			}
131 131
 		}
132 132
 	}
133 133
 
134 134
 	private static function maybe_add_ip_col( $form_id, &$columns ) {
135 135
 		if ( FrmAppHelper::ips_saved() ) {
136
-			$columns[ $form_id . '_ip' ] = 'IP';
136
+			$columns[$form_id . '_ip'] = 'IP';
137 137
 		}
138 138
 	}
139 139
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 
151 151
         global $frm_vars;
152 152
         //add a check so we don't create a loop
153
-        $frm_vars['prev_hidden_cols'] = ( isset($frm_vars['prev_hidden_cols']) && $frm_vars['prev_hidden_cols'] ) ? false : $prev_value;
153
+        $frm_vars['prev_hidden_cols'] = ( isset( $frm_vars['prev_hidden_cols'] ) && $frm_vars['prev_hidden_cols'] ) ? false : $prev_value;
154 154
 
155 155
         return $check;
156 156
     }
@@ -165,19 +165,19 @@  discard block
 block discarded – undo
165 165
         }
166 166
 
167 167
         global $frm_vars;
168
-        if ( ! isset($frm_vars['prev_hidden_cols']) || ! $frm_vars['prev_hidden_cols'] ) {
168
+        if ( ! isset( $frm_vars['prev_hidden_cols'] ) || ! $frm_vars['prev_hidden_cols'] ) {
169 169
             return; //don't continue if there's no previous value
170 170
         }
171 171
 
172 172
         foreach ( $meta_value as $mk => $mv ) {
173 173
             //remove blank values
174 174
             if ( empty( $mv ) ) {
175
-                unset( $meta_value[ $mk ] );
175
+                unset( $meta_value[$mk] );
176 176
             }
177 177
         }
178 178
 
179
-        $cur_form_prefix = reset($meta_value);
180
-        $cur_form_prefix = explode('_', $cur_form_prefix);
179
+        $cur_form_prefix = reset( $meta_value );
180
+        $cur_form_prefix = explode( '_', $cur_form_prefix );
181 181
         $cur_form_prefix = $cur_form_prefix[0];
182 182
         $save = false;
183 183
 
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 
197 197
             $meta_value[] = $prev_hidden;
198 198
             $save = true;
199
-            unset($form_prefix);
199
+            unset( $form_prefix );
200 200
         }
201 201
 
202 202
 		if ( $save ) {
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 		foreach ( $fields as $field ) {
229 229
 			if ( $field->type != 'checkbox' && ( ! isset( $field->field_options['post_field'] ) || $field->field_options['post_field'] == '' ) ) {
230 230
 				// Can't sort on checkboxes because they are stored serialized, or post fields
231
-				$columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id;
231
+				$columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id;
232 232
 			}
233 233
 		}
234 234
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
                     break;
252 252
                 }
253 253
 
254
-                unset($form_prefix);
254
+                unset( $form_prefix );
255 255
             }
256 256
         }
257 257
 
@@ -259,15 +259,15 @@  discard block
 block discarded – undo
259 259
 			return $result;
260 260
 		}
261 261
 
262
-        $i = isset($frm_vars['cols']) ? count($frm_vars['cols']) : 0;
262
+        $i = isset( $frm_vars['cols'] ) ? count( $frm_vars['cols'] ) : 0;
263 263
         $max_columns = 8;
264 264
         if ( $i <= $max_columns ) {
265 265
 			return $result;
266 266
 		}
267 267
 
268 268
         global $frm_vars;
269
-        if ( isset($frm_vars['current_form']) && $frm_vars['current_form'] ) {
270
-            $frm_vars['current_form']->options = maybe_unserialize($frm_vars['current_form']->options);
269
+        if ( isset( $frm_vars['current_form'] ) && $frm_vars['current_form'] ) {
270
+            $frm_vars['current_form']->options = maybe_unserialize( $frm_vars['current_form']->options );
271 271
         }
272 272
 
273 273
 		$has_custom_hidden_columns = ( isset( $frm_vars['current_form'] ) && $frm_vars['current_form'] && isset( $frm_vars['current_form']->options['hidden_cols'] ) && ! empty( $frm_vars['current_form']->options['hidden_cols'] ) );
@@ -275,23 +275,23 @@  discard block
 block discarded – undo
275 275
             $result = $frm_vars['current_form']->options['hidden_cols'];
276 276
         } else {
277 277
             $cols = $frm_vars['cols'];
278
-            $cols = array_reverse($cols, true);
278
+            $cols = array_reverse( $cols, true );
279 279
 
280 280
 			if ( $form_id ) {
281 281
 				$result[] = $form_id . '_id';
282
-				$i--;
282
+				$i --;
283 283
 			}
284 284
 
285 285
 			$result[] = $form_id . '_item_key';
286
-            $i--;
286
+            $i --;
287 287
 
288 288
 			foreach ( $cols as $col_key => $col ) {
289 289
                 if ( $i > $max_columns ) {
290 290
 					$result[] = $col_key;
291 291
 				}
292 292
                 //remove some columns by default
293
-                $i--;
294
-                unset($col_key, $col);
293
+                $i --;
294
+                unset( $col_key, $col );
295 295
             }
296 296
         }
297 297
 
@@ -323,14 +323,14 @@  discard block
 block discarded – undo
323 323
         if ( $pagenum > $total_pages && $total_pages > 0 ) {
324 324
 			$url = add_query_arg( 'paged', $total_pages );
325 325
             if ( headers_sent() ) {
326
-                echo FrmAppHelper::js_redirect($url);
326
+                echo FrmAppHelper::js_redirect( $url );
327 327
             } else {
328 328
                 wp_redirect( esc_url_raw( $url ) );
329 329
             }
330 330
             die();
331 331
         }
332 332
 
333
-        if ( empty($message) && isset($_GET['import-message']) ) {
333
+        if ( empty( $message ) && isset( $_GET['import-message'] ) ) {
334 334
             $message = __( 'Your import is complete', 'formidable' );
335 335
         }
336 336
 
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 
348 348
     /* Back End CRUD */
349 349
 	public static function show( $id = 0 ) {
350
-        FrmAppHelper::permission_check('frm_view_entries');
350
+        FrmAppHelper::permission_check( 'frm_view_entries' );
351 351
 
352 352
         if ( ! $id ) {
353 353
 			$id = FrmAppHelper::get_param( 'id', 0, 'get', 'absint' );
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
             }
358 358
         }
359 359
 
360
-        $entry = FrmEntry::getOne($id, true);
360
+        $entry = FrmEntry::getOne( $id, true );
361 361
 		if ( ! $entry ) {
362 362
 			echo '<div id="form_show_entry_page" class="wrap">' .
363 363
 				__( 'You are trying to view an entry that does not exist.', 'formidable' ) .
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 			return;
366 366
 		}
367 367
 
368
-        $data = maybe_unserialize($entry->description);
368
+        $data = maybe_unserialize( $entry->description );
369 369
 		if ( ! is_array( $data ) || ! isset( $data['referrer'] ) ) {
370 370
 			$data = array( 'referrer' => $data );
371 371
 		}
@@ -377,11 +377,11 @@  discard block
 block discarded – undo
377 377
     }
378 378
 
379 379
     public static function destroy() {
380
-        FrmAppHelper::permission_check('frm_delete_entries');
380
+        FrmAppHelper::permission_check( 'frm_delete_entries' );
381 381
 
382 382
 		$params = FrmForm::get_admin_params();
383 383
 
384
-        if ( isset($params['keep_post']) && $params['keep_post'] ) {
384
+        if ( isset( $params['keep_post'] ) && $params['keep_post'] ) {
385 385
             //unlink entry from post
386 386
             global $wpdb;
387 387
 			$wpdb->update( $wpdb->prefix . 'frm_items', array( 'post_id' => '' ), array( 'id' => $params['id'] ) );
@@ -460,9 +460,9 @@  discard block
 block discarded – undo
460 460
         if ( ! isset( $frm_vars['form_params'] ) ) {
461 461
             $frm_vars['form_params'] = array();
462 462
         }
463
-		$frm_vars['form_params'][ $form->id ] = $params;
463
+		$frm_vars['form_params'][$form->id] = $params;
464 464
 
465
-		if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) {
465
+		if ( isset( $frm_vars['created_entries'][$form_id] ) ) {
466 466
             return;
467 467
         }
468 468
 
@@ -477,13 +477,13 @@  discard block
 block discarded – undo
477 477
 		 */
478 478
 		$errors = apply_filters( 'frm_entries_before_create', $errors, $form );
479 479
 
480
-		$frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors );
480
+		$frm_vars['created_entries'][$form_id] = array( 'errors' => $errors );
481 481
 
482 482
         if ( empty( $errors ) ) {
483 483
 			$_POST['frm_skip_cookie'] = 1;
484 484
             if ( $params['action'] == 'create' ) {
485
-				if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) {
486
-					$frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST );
485
+				if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) {
486
+					$frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST );
487 487
                 }
488 488
             }
489 489
 
@@ -566,9 +566,9 @@  discard block
 block discarded – undo
566 566
 	}
567 567
 
568 568
 	public static function entry_sidebar( $entry ) {
569
-        $data = maybe_unserialize($entry->description);
570
-        $date_format = get_option('date_format');
571
-        $time_format = get_option('time_format');
569
+        $data = maybe_unserialize( $entry->description );
570
+        $date_format = get_option( 'date_format' );
571
+        $time_format = get_option( 'time_format' );
572 572
 		if ( isset( $data['browser'] ) ) {
573 573
 			$browser = FrmEntriesHelper::get_browser( $data['browser'] );
574 574
 		}
Please login to merge, or discard this patch.
Indentation   +252 added lines, -252 removed lines patch added patch discarded remove patch
@@ -2,70 +2,70 @@  discard block
 block discarded – undo
2 2
 
3 3
 class FrmEntriesController {
4 4
 
5
-    public static function menu() {
5
+	public static function menu() {
6 6
 		FrmAppHelper::force_capability( 'frm_view_entries' );
7 7
 
8
-        add_submenu_page('formidable', 'Formidable | ' . __( 'Entries', 'formidable' ), __( 'Entries', 'formidable' ), 'frm_view_entries', 'formidable-entries', 'FrmEntriesController::route' );
8
+		add_submenu_page('formidable', 'Formidable | ' . __( 'Entries', 'formidable' ), __( 'Entries', 'formidable' ), 'frm_view_entries', 'formidable-entries', 'FrmEntriesController::route' );
9 9
 
10 10
 		if ( ! in_array( FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' ), array( 'edit', 'show' ) ) ) {
11 11
 			$menu_name = FrmAppHelper::get_menu_name();
12 12
 			add_filter( 'manage_' . sanitize_title( $menu_name ) . '_page_formidable-entries_columns', 'FrmEntriesController::manage_columns' );
13 13
 			add_filter( 'get_user_option_manage' . sanitize_title( $menu_name ) . '_page_formidable-entriescolumnshidden', 'FrmEntriesController::hidden_columns' );
14 14
 			add_filter( 'manage_' . sanitize_title( $menu_name ) . '_page_formidable-entries_sortable_columns', 'FrmEntriesController::sortable_columns' );
15
-        }
16
-    }
15
+		}
16
+	}
17 17
 
18
-    /* Display in Back End */
19
-    public static function route() {
18
+	/* Display in Back End */
19
+	public static function route() {
20 20
 		$action = FrmAppHelper::get_param( 'frm_action', '', 'get', 'sanitize_title' );
21 21
 
22
-        switch ( $action ) {
23
-            case 'show':
24
-            case 'destroy':
25
-            case 'destroy_all':
26
-                return self::$action();
22
+		switch ( $action ) {
23
+			case 'show':
24
+			case 'destroy':
25
+			case 'destroy_all':
26
+				return self::$action();
27 27
 
28
-            default:
29
-                do_action( 'frm_entry_action_route', $action );
30
-                if ( apply_filters( 'frm_entry_stop_action_route', false, $action ) ) {
31
-                    return;
32
-                }
28
+			default:
29
+				do_action( 'frm_entry_action_route', $action );
30
+				if ( apply_filters( 'frm_entry_stop_action_route', false, $action ) ) {
31
+					return;
32
+				}
33 33
 
34
-                return self::display_list();
35
-        }
36
-    }
34
+				return self::display_list();
35
+		}
36
+	}
37 37
 
38 38
 	public static function contextual_help( $help, $screen_id, $screen ) {
39
-        // Only add to certain screens. add_help_tab was introduced in WordPress 3.3
40
-        if ( ! method_exists( $screen, 'add_help_tab' ) ) {
41
-            return $help;
42
-        }
39
+		// Only add to certain screens. add_help_tab was introduced in WordPress 3.3
40
+		if ( ! method_exists( $screen, 'add_help_tab' ) ) {
41
+			return $help;
42
+		}
43 43
 
44 44
 		$action = FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' );
45 45
 		$page = FrmAppHelper::simple_get( 'page', 'sanitize_title' );
46 46
 		if ( $page != 'formidable-entries' || ( ! empty( $action ) && $action != 'list' ) ) {
47
-            return $help;
48
-        }
47
+			return $help;
48
+		}
49 49
 
50 50
 		unset( $action, $page );
51 51
 
52
-        $screen->add_help_tab( array(
53
-            'id'      => 'formidable-entries-tab',
54
-            'title'   => __( 'Overview', 'formidable' ),
52
+		$screen->add_help_tab( array(
53
+			'id'      => 'formidable-entries-tab',
54
+			'title'   => __( 'Overview', 'formidable' ),
55 55
 			'content' => '<p>' . esc_html__( 'This screen provides access to all of your entries. You can customize the display of this screen to suit your workflow.', 'formidable' ) . '</p> <p>' . esc_html__( 'Hovering over a row in the entries list will display action links that allow you to manage your entry.', 'formidable' ) . '</p>',
56
-        ));
56
+		));
57 57
 
58
-        $screen->set_help_sidebar(
58
+		$screen->set_help_sidebar(
59 59
 			'<p><strong>' . esc_html__( 'For more information:', 'formidable' ) . '</strong></p>' .
60 60
 			'<p><a href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/knowledgebase/manage-entries-from-the-back-end/' ) ) . '" target="_blank">' . esc_html__( 'Documentation on Entries', 'formidable' ) . '</a></p>' .
61 61
 			'<p><a href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/help-desk/' ) ) . '" target="_blank">' . esc_html__( 'Support', 'formidable' ) . '</a></p>'
62
-    	);
62
+		);
63 63
 
64
-        return $help;
65
-    }
64
+		return $help;
65
+	}
66 66
 
67 67
 	public static function manage_columns( $columns ) {
68
-        global $frm_vars;
68
+		global $frm_vars;
69 69
 		$form_id = FrmForm::get_current_form_id();
70 70
 
71 71
 		$columns[ $form_id . '_id' ] = 'ID';
@@ -83,15 +83,15 @@  discard block
 block discarded – undo
83 83
 		$columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' );
84 84
 		self::maybe_add_ip_col( $form_id, $columns );
85 85
 
86
-        $frm_vars['cols'] = $columns;
86
+		$frm_vars['cols'] = $columns;
87 87
 
88 88
 		$action = FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' );
89 89
 		if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) && in_array( $action, array( '', 'list', 'destroy' ) ) ) {
90 90
 			add_screen_option( 'per_page', array( 'label' => __( 'Entries', 'formidable' ), 'default' => 20, 'option' => 'formidable_page_formidable_entries_per_page' ) );
91
-        }
91
+		}
92 92
 
93
-        return $columns;
94
-    }
93
+		return $columns;
94
+	}
95 95
 
96 96
 	private static function get_columns_for_form( $form_id, &$columns ) {
97 97
 		$form_cols = FrmField::get_all_for_form( $form_id, '', 'include' );
@@ -141,76 +141,76 @@  discard block
 block discarded – undo
141 141
 		$menu_name = FrmAppHelper::get_menu_name();
142 142
 		$this_page_name = 'manage' . sanitize_title( $menu_name ) . '_page_formidable-entriescolumnshidden';
143 143
 		if ( $meta_key != $this_page_name || $meta_value == $prev_value ) {
144
-            return $check;
145
-        }
144
+			return $check;
145
+		}
146 146
 
147 147
 		if ( empty( $prev_value ) ) {
148 148
 			$prev_value = get_metadata( 'user', $object_id, $meta_key, true );
149 149
 		}
150 150
 
151
-        global $frm_vars;
152
-        //add a check so we don't create a loop
153
-        $frm_vars['prev_hidden_cols'] = ( isset($frm_vars['prev_hidden_cols']) && $frm_vars['prev_hidden_cols'] ) ? false : $prev_value;
151
+		global $frm_vars;
152
+		//add a check so we don't create a loop
153
+		$frm_vars['prev_hidden_cols'] = ( isset($frm_vars['prev_hidden_cols']) && $frm_vars['prev_hidden_cols'] ) ? false : $prev_value;
154 154
 
155
-        return $check;
156
-    }
155
+		return $check;
156
+	}
157 157
 
158
-    //add hidden columns back from other forms
158
+	//add hidden columns back from other forms
159 159
 	public static function update_hidden_cols( $meta_id, $object_id, $meta_key, $meta_value ) {
160 160
 		$menu_name = FrmAppHelper::get_menu_name();
161 161
 		$sanitized = sanitize_title( $menu_name );
162 162
 		$this_page_name = 'manage' . $sanitized . '_page_formidable-entriescolumnshidden';
163 163
 		if ( $meta_key != $this_page_name ) {
164
-            return;
165
-        }
166
-
167
-        global $frm_vars;
168
-        if ( ! isset($frm_vars['prev_hidden_cols']) || ! $frm_vars['prev_hidden_cols'] ) {
169
-            return; //don't continue if there's no previous value
170
-        }
171
-
172
-        foreach ( $meta_value as $mk => $mv ) {
173
-            //remove blank values
174
-            if ( empty( $mv ) ) {
175
-                unset( $meta_value[ $mk ] );
176
-            }
177
-        }
178
-
179
-        $cur_form_prefix = reset($meta_value);
180
-        $cur_form_prefix = explode('_', $cur_form_prefix);
181
-        $cur_form_prefix = $cur_form_prefix[0];
182
-        $save = false;
183
-
184
-        foreach ( (array) $frm_vars['prev_hidden_cols'] as $prev_hidden ) {
164
+			return;
165
+		}
166
+
167
+		global $frm_vars;
168
+		if ( ! isset($frm_vars['prev_hidden_cols']) || ! $frm_vars['prev_hidden_cols'] ) {
169
+			return; //don't continue if there's no previous value
170
+		}
171
+
172
+		foreach ( $meta_value as $mk => $mv ) {
173
+			//remove blank values
174
+			if ( empty( $mv ) ) {
175
+				unset( $meta_value[ $mk ] );
176
+			}
177
+		}
178
+
179
+		$cur_form_prefix = reset($meta_value);
180
+		$cur_form_prefix = explode('_', $cur_form_prefix);
181
+		$cur_form_prefix = $cur_form_prefix[0];
182
+		$save = false;
183
+
184
+		foreach ( (array) $frm_vars['prev_hidden_cols'] as $prev_hidden ) {
185 185
 			if ( empty( $prev_hidden ) || in_array( $prev_hidden, $meta_value ) ) {
186
-                //don't add blank cols or process included cols
187
-                continue;
188
-            }
186
+				//don't add blank cols or process included cols
187
+				continue;
188
+			}
189 189
 
190 190
 			$form_prefix = explode( '_', $prev_hidden );
191
-            $form_prefix = $form_prefix[0];
192
-            if ( $form_prefix == $cur_form_prefix ) {
193
-                //don't add back columns that are meant to be hidden
194
-                continue;
195
-            }
191
+			$form_prefix = $form_prefix[0];
192
+			if ( $form_prefix == $cur_form_prefix ) {
193
+				//don't add back columns that are meant to be hidden
194
+				continue;
195
+			}
196 196
 
197
-            $meta_value[] = $prev_hidden;
198
-            $save = true;
199
-            unset($form_prefix);
200
-        }
197
+			$meta_value[] = $prev_hidden;
198
+			$save = true;
199
+			unset($form_prefix);
200
+		}
201 201
 
202 202
 		if ( $save ) {
203
-            $user = wp_get_current_user();
203
+			$user = wp_get_current_user();
204 204
 			update_user_option( $user->ID, $this_page_name, $meta_value, true );
205
-        }
206
-    }
205
+		}
206
+	}
207 207
 
208 208
 	public static function save_per_page( $save, $option, $value ) {
209
-        if ( $option == 'formidable_page_formidable_entries_per_page' ) {
210
-            $save = (int) $value;
211
-        }
212
-        return $save;
213
-    }
209
+		if ( $option == 'formidable_page_formidable_entries_per_page' ) {
210
+			$save = (int) $value;
211
+		}
212
+		return $save;
213
+	}
214 214
 
215 215
 	public static function sortable_columns() {
216 216
 		$form_id = FrmForm::get_current_form_id();
@@ -236,46 +236,46 @@  discard block
 block discarded – undo
236 236
 	}
237 237
 
238 238
 	public static function hidden_columns( $result ) {
239
-        global $frm_vars;
239
+		global $frm_vars;
240 240
 
241 241
 		$form_id = FrmForm::get_current_form_id();
242 242
 
243
-        $return = false;
244
-        foreach ( (array) $result as $r ) {
245
-            if ( ! empty( $r ) ) {
246
-                $form_prefix = explode( '_', $r );
247
-                $form_prefix = $form_prefix[0];
243
+		$return = false;
244
+		foreach ( (array) $result as $r ) {
245
+			if ( ! empty( $r ) ) {
246
+				$form_prefix = explode( '_', $r );
247
+				$form_prefix = $form_prefix[0];
248 248
 
249
-                if ( (int) $form_prefix == (int) $form_id ) {
250
-                    $return = true;
251
-                    break;
252
-                }
249
+				if ( (int) $form_prefix == (int) $form_id ) {
250
+					$return = true;
251
+					break;
252
+				}
253 253
 
254
-                unset($form_prefix);
255
-            }
256
-        }
254
+				unset($form_prefix);
255
+			}
256
+		}
257 257
 
258
-        if ( $return ) {
258
+		if ( $return ) {
259 259
 			return $result;
260 260
 		}
261 261
 
262
-        $i = isset($frm_vars['cols']) ? count($frm_vars['cols']) : 0;
263
-        $max_columns = 8;
264
-        if ( $i <= $max_columns ) {
262
+		$i = isset($frm_vars['cols']) ? count($frm_vars['cols']) : 0;
263
+		$max_columns = 8;
264
+		if ( $i <= $max_columns ) {
265 265
 			return $result;
266 266
 		}
267 267
 
268
-        global $frm_vars;
269
-        if ( isset($frm_vars['current_form']) && $frm_vars['current_form'] ) {
270
-            $frm_vars['current_form']->options = maybe_unserialize($frm_vars['current_form']->options);
271
-        }
268
+		global $frm_vars;
269
+		if ( isset($frm_vars['current_form']) && $frm_vars['current_form'] ) {
270
+			$frm_vars['current_form']->options = maybe_unserialize($frm_vars['current_form']->options);
271
+		}
272 272
 
273 273
 		$has_custom_hidden_columns = ( isset( $frm_vars['current_form'] ) && $frm_vars['current_form'] && isset( $frm_vars['current_form']->options['hidden_cols'] ) && ! empty( $frm_vars['current_form']->options['hidden_cols'] ) );
274 274
 		if ( $has_custom_hidden_columns ) {
275
-            $result = $frm_vars['current_form']->options['hidden_cols'];
276
-        } else {
277
-            $cols = $frm_vars['cols'];
278
-            $cols = array_reverse($cols, true);
275
+			$result = $frm_vars['current_form']->options['hidden_cols'];
276
+		} else {
277
+			$cols = $frm_vars['cols'];
278
+			$cols = array_reverse($cols, true);
279 279
 
280 280
 			if ( $form_id ) {
281 281
 				$result[] = $form_id . '_id';
@@ -283,59 +283,59 @@  discard block
 block discarded – undo
283 283
 			}
284 284
 
285 285
 			$result[] = $form_id . '_item_key';
286
-            $i--;
286
+			$i--;
287 287
 
288 288
 			foreach ( $cols as $col_key => $col ) {
289
-                if ( $i > $max_columns ) {
289
+				if ( $i > $max_columns ) {
290 290
 					$result[] = $col_key;
291 291
 				}
292
-                //remove some columns by default
293
-                $i--;
294
-                unset($col_key, $col);
295
-            }
296
-        }
292
+				//remove some columns by default
293
+				$i--;
294
+				unset($col_key, $col);
295
+			}
296
+		}
297 297
 
298
-        return $result;
299
-    }
298
+		return $result;
299
+	}
300 300
 
301 301
 	public static function display_list( $message = '', $errors = array() ) {
302
-        global $wpdb, $frm_vars;
302
+		global $wpdb, $frm_vars;
303 303
 
304 304
 		$form = FrmForm::maybe_get_current_form();
305 305
 		$params = FrmForm::get_admin_params( $form );
306 306
 
307
-        if ( $form ) {
308
-            $params['form'] = $form->id;
309
-            $frm_vars['current_form'] = $form;
307
+		if ( $form ) {
308
+			$params['form'] = $form->id;
309
+			$frm_vars['current_form'] = $form;
310 310
 
311 311
 			self::get_delete_form_time( $form, $errors );
312 312
 		}
313 313
 
314
-        $table_class = apply_filters( 'frm_entries_list_class', 'FrmEntriesListHelper' );
314
+		$table_class = apply_filters( 'frm_entries_list_class', 'FrmEntriesListHelper' );
315 315
 
316
-        $wp_list_table = new $table_class( array( 'params' => $params ) );
316
+		$wp_list_table = new $table_class( array( 'params' => $params ) );
317 317
 
318
-        $pagenum = $wp_list_table->get_pagenum();
318
+		$pagenum = $wp_list_table->get_pagenum();
319 319
 
320
-        $wp_list_table->prepare_items();
320
+		$wp_list_table->prepare_items();
321 321
 
322
-        $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
323
-        if ( $pagenum > $total_pages && $total_pages > 0 ) {
322
+		$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
323
+		if ( $pagenum > $total_pages && $total_pages > 0 ) {
324 324
 			$url = add_query_arg( 'paged', $total_pages );
325
-            if ( headers_sent() ) {
326
-                echo FrmAppHelper::js_redirect($url);
327
-            } else {
328
-                wp_redirect( esc_url_raw( $url ) );
329
-            }
330
-            die();
331
-        }
332
-
333
-        if ( empty($message) && isset($_GET['import-message']) ) {
334
-            $message = __( 'Your import is complete', 'formidable' );
335
-        }
325
+			if ( headers_sent() ) {
326
+				echo FrmAppHelper::js_redirect($url);
327
+			} else {
328
+				wp_redirect( esc_url_raw( $url ) );
329
+			}
330
+			die();
331
+		}
332
+
333
+		if ( empty($message) && isset($_GET['import-message']) ) {
334
+			$message = __( 'Your import is complete', 'formidable' );
335
+		}
336 336
 
337 337
 		require( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/list.php' );
338
-    }
338
+	}
339 339
 
340 340
 	private static function get_delete_form_time( $form, &$errors ) {
341 341
 		if ( 'trash' == $form->status ) {
@@ -345,19 +345,19 @@  discard block
 block discarded – undo
345 345
 		}
346 346
 	}
347 347
 
348
-    /* Back End CRUD */
348
+	/* Back End CRUD */
349 349
 	public static function show( $id = 0 ) {
350
-        FrmAppHelper::permission_check('frm_view_entries');
350
+		FrmAppHelper::permission_check('frm_view_entries');
351 351
 
352
-        if ( ! $id ) {
352
+		if ( ! $id ) {
353 353
 			$id = FrmAppHelper::get_param( 'id', 0, 'get', 'absint' );
354 354
 
355
-            if ( ! $id ) {
355
+			if ( ! $id ) {
356 356
 				$id = FrmAppHelper::get_param( 'item_id', 0, 'get', 'absint' );
357
-            }
358
-        }
357
+			}
358
+		}
359 359
 
360
-        $entry = FrmEntry::getOne($id, true);
360
+		$entry = FrmEntry::getOne($id, true);
361 361
 		if ( ! $entry ) {
362 362
 			echo '<div id="form_show_entry_page" class="wrap">' .
363 363
 				__( 'You are trying to view an entry that does not exist.', 'formidable' ) .
@@ -365,110 +365,110 @@  discard block
 block discarded – undo
365 365
 			return;
366 366
 		}
367 367
 
368
-        $data = maybe_unserialize($entry->description);
368
+		$data = maybe_unserialize($entry->description);
369 369
 		if ( ! is_array( $data ) || ! isset( $data['referrer'] ) ) {
370 370
 			$data = array( 'referrer' => $data );
371 371
 		}
372 372
 
373 373
 		$fields = FrmField::get_all_for_form( $entry->form_id, '', 'include' );
374
-        $to_emails = array();
374
+		$to_emails = array();
375 375
 
376 376
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/show.php' );
377
-    }
377
+	}
378 378
 
379
-    public static function destroy() {
380
-        FrmAppHelper::permission_check('frm_delete_entries');
379
+	public static function destroy() {
380
+		FrmAppHelper::permission_check('frm_delete_entries');
381 381
 
382 382
 		$params = FrmForm::get_admin_params();
383 383
 
384
-        if ( isset($params['keep_post']) && $params['keep_post'] ) {
385
-            //unlink entry from post
386
-            global $wpdb;
384
+		if ( isset($params['keep_post']) && $params['keep_post'] ) {
385
+			//unlink entry from post
386
+			global $wpdb;
387 387
 			$wpdb->update( $wpdb->prefix . 'frm_items', array( 'post_id' => '' ), array( 'id' => $params['id'] ) );
388
-        }
388
+		}
389 389
 
390
-        $message = '';
391
-        if ( FrmEntry::destroy( $params['id'] ) ) {
392
-            $message = __( 'Entry was Successfully Destroyed', 'formidable' );
393
-        }
390
+		$message = '';
391
+		if ( FrmEntry::destroy( $params['id'] ) ) {
392
+			$message = __( 'Entry was Successfully Destroyed', 'formidable' );
393
+		}
394 394
 
395
-        self::display_list( $message );
396
-    }
395
+		self::display_list( $message );
396
+	}
397 397
 
398
-    public static function destroy_all() {
399
-        if ( ! current_user_can( 'frm_delete_entries' ) ) {
400
-            $frm_settings = FrmAppHelper::get_settings();
401
-            wp_die( $frm_settings->admin_permission );
402
-        }
398
+	public static function destroy_all() {
399
+		if ( ! current_user_can( 'frm_delete_entries' ) ) {
400
+			$frm_settings = FrmAppHelper::get_settings();
401
+			wp_die( $frm_settings->admin_permission );
402
+		}
403 403
 
404
-        global $wpdb;
404
+		global $wpdb;
405 405
 		$params = FrmForm::get_admin_params();
406
-        $message = '';
407
-        $errors = array();
408
-        $form_id = (int) $params['form'];
406
+		$message = '';
407
+		$errors = array();
408
+		$form_id = (int) $params['form'];
409 409
 
410
-        if ( $form_id ) {
411
-            $entry_ids = FrmDb::get_col( 'frm_items', array( 'form_id' => $form_id ) );
410
+		if ( $form_id ) {
411
+			$entry_ids = FrmDb::get_col( 'frm_items', array( 'form_id' => $form_id ) );
412 412
 			$action = FrmFormAction::get_action_for_form( $form_id, 'wppost', 1 );
413 413
 
414
-            if ( $action ) {
415
-                // this action takes a while, so only trigger it if there are posts to delete
416
-                foreach ( $entry_ids as $entry_id ) {
417
-                    do_action( 'frm_before_destroy_entry', $entry_id );
418
-                    unset( $entry_id );
419
-                }
420
-            }
421
-
422
-            $wpdb->query( $wpdb->prepare( "DELETE em.* FROM {$wpdb->prefix}frm_item_metas as em INNER JOIN {$wpdb->prefix}frm_items as e on (em.item_id=e.id) and form_id=%d", $form_id ) );
423
-            $results = $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}frm_items WHERE form_id=%d", $form_id ) );
424
-            if ( $results ) {
414
+			if ( $action ) {
415
+				// this action takes a while, so only trigger it if there are posts to delete
416
+				foreach ( $entry_ids as $entry_id ) {
417
+					do_action( 'frm_before_destroy_entry', $entry_id );
418
+					unset( $entry_id );
419
+				}
420
+			}
421
+
422
+			$wpdb->query( $wpdb->prepare( "DELETE em.* FROM {$wpdb->prefix}frm_item_metas as em INNER JOIN {$wpdb->prefix}frm_items as e on (em.item_id=e.id) and form_id=%d", $form_id ) );
423
+			$results = $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}frm_items WHERE form_id=%d", $form_id ) );
424
+			if ( $results ) {
425 425
 				FrmEntry::clear_cache();
426
-                $message = __( 'Entries were Successfully Destroyed', 'formidable' );
427
-            }
428
-        } else {
429
-            $errors = __( 'No entries were specified', 'formidable' );
430
-        }
431
-
432
-        self::display_list( $message, $errors );
433
-    }
434
-
435
-    public static function show_form( $id = '', $key = '', $title = false, $description = false ) {
436
-        _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::show_form()' );
437
-        return FrmFormsController::show_form( $id, $key, $title, $description );
438
-    }
439
-
440
-    public static function get_form( $filename, $form, $title, $description ) {
441
-        _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form()' );
442
-        return FrmFormsController::get_form( $form, $title, $description );
443
-    }
444
-
445
-    public static function process_entry( $errors = '', $ajax = false ) {
426
+				$message = __( 'Entries were Successfully Destroyed', 'formidable' );
427
+			}
428
+		} else {
429
+			$errors = __( 'No entries were specified', 'formidable' );
430
+		}
431
+
432
+		self::display_list( $message, $errors );
433
+	}
434
+
435
+	public static function show_form( $id = '', $key = '', $title = false, $description = false ) {
436
+		_deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::show_form()' );
437
+		return FrmFormsController::show_form( $id, $key, $title, $description );
438
+	}
439
+
440
+	public static function get_form( $filename, $form, $title, $description ) {
441
+		_deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form()' );
442
+		return FrmFormsController::get_form( $form, $title, $description );
443
+	}
444
+
445
+	public static function process_entry( $errors = '', $ajax = false ) {
446 446
 		$form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' );
447 447
 		if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) {
448
-            return;
449
-        }
448
+			return;
449
+		}
450 450
 
451
-        global $frm_vars;
451
+		global $frm_vars;
452 452
 
453 453
 		$form = FrmForm::getOne( $form_id );
454
-        if ( ! $form ) {
455
-            return;
456
-        }
454
+		if ( ! $form ) {
455
+			return;
456
+		}
457 457
 
458 458
 		$params = FrmForm::get_params( $form );
459 459
 
460
-        if ( ! isset( $frm_vars['form_params'] ) ) {
461
-            $frm_vars['form_params'] = array();
462
-        }
460
+		if ( ! isset( $frm_vars['form_params'] ) ) {
461
+			$frm_vars['form_params'] = array();
462
+		}
463 463
 		$frm_vars['form_params'][ $form->id ] = $params;
464 464
 
465 465
 		if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) {
466
-            return;
467
-        }
466
+			return;
467
+		}
468 468
 
469
-        if ( $errors == '' && ! $ajax ) {
469
+		if ( $errors == '' && ! $ajax ) {
470 470
 			$errors = FrmEntryValidate::validate( $_POST );
471
-        }
471
+		}
472 472
 
473 473
 		/**
474 474
 		 * Use this filter to add trigger actions and add errors after
@@ -479,39 +479,39 @@  discard block
 block discarded – undo
479 479
 
480 480
 		$frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors );
481 481
 
482
-        if ( empty( $errors ) ) {
482
+		if ( empty( $errors ) ) {
483 483
 			$_POST['frm_skip_cookie'] = 1;
484
-            if ( $params['action'] == 'create' ) {
484
+			if ( $params['action'] == 'create' ) {
485 485
 				if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) {
486 486
 					$frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST );
487
-                }
488
-            }
487
+				}
488
+			}
489 489
 
490
-            do_action( 'frm_process_entry', $params, $errors, $form, array( 'ajax' => $ajax ) );
490
+			do_action( 'frm_process_entry', $params, $errors, $form, array( 'ajax' => $ajax ) );
491 491
 			unset( $_POST['frm_skip_cookie'] );
492
-        }
493
-    }
494
-
495
-    public static function delete_entry_before_redirect( $url, $form, $atts ) {
496
-        self::_delete_entry( $atts['id'], $form );
497
-        return $url;
498
-    }
499
-
500
-    //Delete entry if not redirected
501
-    public static function delete_entry_after_save( $atts ) {
502
-        self::_delete_entry( $atts['entry_id'], $atts['form'] );
503
-    }
504
-
505
-    private static function _delete_entry( $entry_id, $form ) {
506
-        if ( ! $form ) {
507
-            return;
508
-        }
509
-
510
-        $form->options = maybe_unserialize( $form->options );
511
-        if ( isset( $form->options['no_save'] ) && $form->options['no_save'] ) {
512
-            FrmEntry::destroy( $entry_id );
513
-        }
514
-    }
492
+		}
493
+	}
494
+
495
+	public static function delete_entry_before_redirect( $url, $form, $atts ) {
496
+		self::_delete_entry( $atts['id'], $form );
497
+		return $url;
498
+	}
499
+
500
+	//Delete entry if not redirected
501
+	public static function delete_entry_after_save( $atts ) {
502
+		self::_delete_entry( $atts['entry_id'], $atts['form'] );
503
+	}
504
+
505
+	private static function _delete_entry( $entry_id, $form ) {
506
+		if ( ! $form ) {
507
+			return;
508
+		}
509
+
510
+		$form->options = maybe_unserialize( $form->options );
511
+		if ( isset( $form->options['no_save'] ) && $form->options['no_save'] ) {
512
+			FrmEntry::destroy( $entry_id );
513
+		}
514
+	}
515 515
 
516 516
 	/**
517 517
 	 * @param $atts
@@ -562,13 +562,13 @@  discard block
 block discarded – undo
562 562
 	}
563 563
 
564 564
 	public static function entry_sidebar( $entry ) {
565
-        $data = maybe_unserialize($entry->description);
566
-        $date_format = get_option('date_format');
567
-        $time_format = get_option('time_format');
565
+		$data = maybe_unserialize($entry->description);
566
+		$date_format = get_option('date_format');
567
+		$time_format = get_option('time_format');
568 568
 		if ( isset( $data['browser'] ) ) {
569 569
 			$browser = FrmEntriesHelper::get_browser( $data['browser'] );
570 570
 		}
571 571
 
572 572
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/sidebar-shared.php' );
573
-    }
573
+	}
574 574
 }
Please login to merge, or discard this patch.
classes/models/FrmEntryFormatter.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 	 *
364 364
 	 * @since 2.04
365 365
 	 *
366
-	 * @param array $field_values
366
+	 * @param FrmFieldValue[] $field_values
367 367
 	 * @param array $output
368 368
 	 */
369 369
 	protected function push_field_values_to_array( $field_values, &$output ) {
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 	 *
571 571
 	 * @param mixed $value
572 572
 	 *
573
-	 * @return mixed|string
573
+	 * @return FrmFieldValue
574 574
 	 */
575 575
 	protected function prepare_display_value_for_array( $value ) {
576 576
 		return $this->strip_html( $value );
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 	 * @param mixed $display_value
586 586
 	 * @param string $field_type
587 587
 	 *
588
-	 * @return mixed|string
588
+	 * @return string
589 589
 	 */
590 590
 	protected function prepare_display_value_for_html_table( $display_value, $field_type = '' ) {
591 591
 		$display_value = $this->flatten_array( $display_value );
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
 
161 161
 		$conditionally_add = array( 'include_fields', 'fields', 'exclude_fields' );
162 162
 		foreach ( $conditionally_add as $index ) {
163
-			if ( isset( $atts[ $index ] ) ) {
164
-				$entry_atts[ $index ] = $atts[ $index ];
163
+			if ( isset( $atts[$index] ) ) {
164
+				$entry_atts[$index] = $atts[$index];
165 165
 			}
166 166
 		}
167 167
 
@@ -473,10 +473,10 @@  discard block
 block discarded – undo
473 473
 		if ( $this->include_field_in_content( $field_value ) ) {
474 474
 
475 475
 			$displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() );
476
-			$output[ $this->get_key_or_id( $field_value ) ] = $displayed_value;
476
+			$output[$this->get_key_or_id( $field_value )] = $displayed_value;
477 477
 
478 478
 			if ( $displayed_value !== $field_value->get_saved_value() ) {
479
-				$output[ $this->get_key_or_id( $field_value ) . '-value' ] = $field_value->get_saved_value();
479
+				$output[$this->get_key_or_id( $field_value ) . '-value'] = $field_value->get_saved_value();
480 480
 			}
481 481
 		}
482 482
 	}
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
 
865 865
 			if ( is_array( $value ) ) {
866 866
 				foreach ( $value as $key => $single_value ) {
867
-					$value[ $key ] = $this->strip_html( $single_value );
867
+					$value[$key] = $this->strip_html( $single_value );
868 868
 				}
869 869
 			} else if ( $this->is_plain_text && ! is_array( $value ) ) {
870 870
 				if ( strpos( $value, '<img' ) !== false ) {
Please login to merge, or discard this patch.
classes/factories/FrmFieldFactory.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -102,6 +102,7 @@
 block discarded – undo
102 102
 
103 103
 	/**
104 104
 	 * @since 3.0
105
+	 * @param string $property
105 106
 	 */
106 107
 	public static function field_has_property( $type, $property ) {
107 108
 		$field = self::get_field_type( $type );
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
 			'captcha'  => 'FrmFieldCaptcha',
87 87
 		);
88 88
 
89
-		$class = isset( $type_classes[ $field_type ] ) ? $type_classes[ $field_type ] : '';
89
+		$class = isset( $type_classes[$field_type] ) ? $type_classes[$field_type] : '';
90 90
 		return apply_filters( 'frm_get_field_type_class', $class, $field_type );
91 91
 	}
92 92
 
Please login to merge, or discard this patch.