Completed
Push — master ( cc771e...1305f3 )
by Stephanie
02:46
created
classes/controllers/FrmEntriesController.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
             'id'      => 'formidable-entries-tab',
66 66
             'title'   => __( 'Overview', 'formidable' ),
67 67
 			'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>',
68
-        ));
68
+        ) );
69 69
 
70 70
         $screen->set_help_sidebar(
71 71
 			'<p><strong>' . esc_html__( 'For more information:', 'formidable' ) . '</strong></p>' .
@@ -95,19 +95,19 @@  discard block
 block discarded – undo
95 95
         global $frm_vars;
96 96
 		$form_id = FrmForm::get_current_form_id();
97 97
 
98
-		$columns[ $form_id . '_id' ] = 'ID';
99
-		$columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' );
98
+		$columns[$form_id . '_id'] = 'ID';
99
+		$columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' );
100 100
 
101 101
 		if ( $form_id ) {
102 102
 			self::get_columns_for_form( $form_id, $columns );
103 103
 		} else {
104
-			$columns[ $form_id . '_form_id' ] = __( 'Form', 'formidable' );
105
-			$columns[ $form_id . '_name' ] = __( 'Entry Name', 'formidable' );
106
-			$columns[ $form_id . '_user_id' ] = __( 'Created By', 'formidable' );
104
+			$columns[$form_id . '_form_id'] = __( 'Form', 'formidable' );
105
+			$columns[$form_id . '_name'] = __( 'Entry Name', 'formidable' );
106
+			$columns[$form_id . '_user_id'] = __( 'Created By', 'formidable' );
107 107
 		}
108 108
 
109
-		$columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' );
110
-		$columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' );
109
+		$columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' );
110
+		$columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' );
111 111
 		self::maybe_add_ip_col( $form_id, $columns );
112 112
 
113 113
         $frm_vars['cols'] = $columns;
@@ -152,10 +152,10 @@  discard block
 block discarded – undo
152 152
 
153 153
 		foreach ( $sub_form_cols as $k => $sub_form_col ) {
154 154
 			if ( FrmField::is_no_save_field( $sub_form_col->type ) ) {
155
-				unset( $sub_form_cols[ $k ] );
155
+				unset( $sub_form_cols[$k] );
156 156
 				continue;
157 157
 			}
158
-			$columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
158
+			$columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
159 159
 			unset( $sub_form_col );
160 160
 		}
161 161
 	}
@@ -172,15 +172,15 @@  discard block
 block discarded – undo
172 172
 		$has_separate_value = ! FrmField::is_option_empty( $field, 'separate_value' );
173 173
 		$is_post_status     = FrmField::is_option_true( $field, 'post_field' ) && $field->field_options['post_field'] == 'post_status';
174 174
 		if ( $has_separate_value && ! $is_post_status ) {
175
-			$columns[ $form_id . '_frmsep_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 );
175
+			$columns[$form_id . '_frmsep_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 );
176 176
 		}
177 177
 
178
-		$columns[ $form_id . '_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 );
178
+		$columns[$form_id . '_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 );
179 179
 	}
180 180
 
181 181
 	private static function maybe_add_ip_col( $form_id, &$columns ) {
182 182
 		if ( FrmAppHelper::ips_saved() ) {
183
-			$columns[ $form_id . '_ip' ] = 'IP';
183
+			$columns[$form_id . '_ip'] = 'IP';
184 184
 		}
185 185
 	}
186 186
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         foreach ( $meta_value as $mk => $mv ) {
217 217
             //remove blank values
218 218
             if ( empty( $mv ) ) {
219
-                unset( $meta_value[ $mk ] );
219
+                unset( $meta_value[$mk] );
220 220
             }
221 221
         }
222 222
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 		foreach ( $fields as $field ) {
291 291
 			if ( $field->type != 'checkbox' && ( ! isset( $field->field_options['post_field'] ) || $field->field_options['post_field'] == '' ) ) {
292 292
 				// Can't sort on checkboxes because they are stored serialized, or post fields
293
-				$columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id;
293
+				$columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id;
294 294
 			}
295 295
 		}
296 296
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 
365 365
 			if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) {
366 366
 				$result[] = $col_key;
367
-				$i--;
367
+				$i --;
368 368
 			}
369 369
 
370 370
 			unset( $col_key, $col );
@@ -578,9 +578,9 @@  discard block
 block discarded – undo
578 578
         if ( ! isset( $frm_vars['form_params'] ) ) {
579 579
             $frm_vars['form_params'] = array();
580 580
         }
581
-		$frm_vars['form_params'][ $form->id ] = $params;
581
+		$frm_vars['form_params'][$form->id] = $params;
582 582
 
583
-		if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) {
583
+		if ( isset( $frm_vars['created_entries'][$form_id] ) ) {
584 584
             return;
585 585
         }
586 586
 
@@ -595,15 +595,15 @@  discard block
 block discarded – undo
595 595
 		 */
596 596
 		$errors = apply_filters( 'frm_entries_before_create', $errors, $form );
597 597
 
598
-		$frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors );
598
+		$frm_vars['created_entries'][$form_id] = array( 'errors' => $errors );
599 599
 
600 600
         if ( empty( $errors ) ) {
601 601
 			$_POST['frm_skip_cookie'] = 1;
602 602
 			$do_success = false;
603 603
             if ( $params['action'] == 'create' ) {
604
-				if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) {
605
-					$frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST );
606
-					$params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id'];
604
+				if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) {
605
+					$frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST );
606
+					$params['id'] = $frm_vars['created_entries'][$form_id]['entry_id'];
607 607
 					$do_success = true;
608 608
                 }
609 609
             }
Please login to merge, or discard this patch.