Completed
Branch 4.0Builder (9ef7e0)
by Stephanie
03:43
created
classes/views/frm-fields/back-end/field-multiple.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,6 +6,6 @@
 block discarded – undo
6 6
 	$type = $field['type'];
7 7
 	do_action( 'frm_after_checkbox', compact( 'field', 'field_name', 'type' ) );
8 8
 } else {
9
-	$read_only  = $field['read_only'];
9
+	$read_only = $field['read_only'];
10 10
 	include( dirname( __FILE__ ) . '/' . $field['type'] . '-field.php' );
11 11
 }
Please login to merge, or discard this patch.
classes/views/frm-forms/list-templates.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@
 block discarded – undo
148 148
 						<?php } ?>
149 149
 					</div>
150 150
 				</div>
151
-				<?php unset( $template, $templates[ $k ] ); ?>
151
+				<?php unset( $template, $templates[$k] ); ?>
152 152
 			<?php } ?>
153 153
 		</div>
154 154
 		<?php if ( $expired ) { ?>
Please login to merge, or discard this patch.
classes/views/frm-forms/form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 		if ( isset( $values['fields'] ) && ! empty( $values['fields'] ) ) {
23 23
 			$values['count'] = 0;
24 24
 			foreach ( $values['fields'] as $field ) {
25
-				$values['count']++;
25
+				$values['count'] ++;
26 26
 				FrmFieldsController::load_single_field( $field, $values );
27 27
 				unset( $field );
28 28
 			}
Please login to merge, or discard this patch.
classes/views/frm-form-actions/_action_inside.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 	$event_labels = FrmFormAction::trigger_labels();
37 37
 	foreach ( $action_control->action_options['event'] as $event ) {
38 38
 		?>
39
-		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event ); ?></option>
39
+		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( isset( $event_labels[$event] ) ? $event_labels[$event] : $event ); ?></option>
40 40
 <?php } ?>
41 41
 		</select>
42 42
 	</p>
Please login to merge, or discard this patch.
classes/views/frm-form-actions/default_actions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 class FrmDefPostAction extends FrmFormAction {
4 4
 	public function __construct() {
5 5
 		$action_ops = FrmFormAction::default_action_opts( 'frm_wordpress_icon frm-inverse frm_show_upgrade' );
6
-		$action_ops['color']   = 'rgb(0,160,210)';
6
+		$action_ops['color'] = 'rgb(0,160,210)';
7 7
 
8 8
 		parent::__construct( 'wppost', __( 'Create Post', 'formidable' ), $action_ops );
9 9
 	}
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 class FrmDefMlcmpAction extends FrmFormAction {
43 43
 	public function __construct() {
44 44
 		$action_ops = FrmFormAction::default_action_opts( 'frm_mailchimp_icon frm_show_upgrade frm-inverse' );
45
-		$action_ops['color']   = 'var(--dark-grey)';
45
+		$action_ops['color'] = 'var(--dark-grey)';
46 46
 
47 47
 		parent::__construct( 'mailchimp', 'MailChimp', $action_ops );
48 48
 	}
Please login to merge, or discard this patch.
classes/helpers/FrmEntriesListHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 			$s_query['it.form_id'] = $form_id;
18 18
 			$join_form_in_query    = false;
19 19
 		} else {
20
-			$s_query[]          = array(
20
+			$s_query[] = array(
21 21
 				'or'               => 1,
22 22
 				'parent_form_id'   => null,
23 23
 				'parent_form_id <' => 1,
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
 		if ( strpos( $orderby, 'meta' ) !== false ) {
50 50
 			$order_field_type = FrmField::get_type( str_replace( 'meta_', '', $orderby ) );
51
-			$orderby          .= in_array( $order_field_type, array( 'number', 'scale', 'star' ) ) ? '+0' : '';
51
+			$orderby .= in_array( $order_field_type, array( 'number', 'scale', 'star' ) ) ? '+0' : '';
52 52
 		}
53 53
 
54 54
 		$order = self::get_param(
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
 		$r = "<tr id='item-action-{$item->id}'$style>";
160 160
 
161
-		list( $columns, $hidden, , $primary ) = $this->get_column_info();
161
+		list( $columns, $hidden,, $primary ) = $this->get_column_info();
162 162
 		$action_col = false;
163 163
 
164 164
 		foreach ( $columns as $column_name => $column_display_name ) {
Please login to merge, or discard this patch.
classes/helpers/FrmTipsHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	}
297 297
 
298 298
 	public static function get_banner_tip() {
299
-		$tips       = array(
299
+		$tips = array(
300 300
 			array(
301 301
 				'link' => array(
302 302
 					'medium'  => 'banner',
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 			),
324 324
 		);
325 325
 		$random     = rand( 0, count( $tips ) - 1 );
326
-		$tip        = $tips[ $random ];
326
+		$tip        = $tips[$random];
327 327
 		$tip['num'] = $random;
328 328
 
329 329
 		return $tip;
@@ -332,6 +332,6 @@  discard block
 block discarded – undo
332 332
 	public static function get_random_tip( $tips ) {
333 333
 		$random = rand( 0, count( $tips ) - 1 );
334 334
 
335
-		return $tips[ $random ];
335
+		return $tips[$random];
336 336
 	}
337 337
 }
Please login to merge, or discard this patch.
classes/helpers/FrmFormsListHelper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 		$page     = $this->get_pagenum();
19 19
 		$per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' );
20 20
 
21
-		$mode    = self::get_param(
21
+		$mode = self::get_param(
22 22
 			array(
23 23
 				'param'   => 'mode',
24 24
 				'default' => 'list',
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 				'default' => 'name',
31 31
 			)
32 32
 		);
33
-		$order   = self::get_param(
33
+		$order = self::get_param(
34 34
 			array(
35 35
 				'param'   => 'order',
36 36
 				'default' => 'ASC',
37 37
 			)
38 38
 		);
39
-		$start   = self::get_param(
39
+		$start = self::get_param(
40 40
 			array(
41 41
 				'param'   => 'start',
42 42
 				'default' => ( $page - 1 ) * $per_page,
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
 			if ( $counts->{$status} || 'draft' !== $status ) {
179 179
 				/* translators: %1$s: Status, %2$s: Number of items */
180
-				$links[ $status ] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>';
180
+				$links[$status] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>';
181 181
 			}
182 182
 
183 183
 			unset( $status, $name );
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	private function get_actions( &$actions, $item, $edit_link ) {
283 283
 		$new_actions = FrmFormsHelper::get_action_links( $item->id, $item );
284 284
 		foreach ( $new_actions as $link => $action ) {
285
-			$new_actions[ $link ] = FrmFormsHelper::format_link_html( $action, 'short' );
285
+			$new_actions[$link] = FrmFormsHelper::format_link_html( $action, 'short' );
286 286
 		}
287 287
 
288 288
 		if ( 'trash' == $this->status ) {
Please login to merge, or discard this patch.
classes/helpers/FrmCSVExportHelper.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		self::print_file_headers( $filename );
38 38
 		unset( $filename );
39 39
 
40
-		$comment_count       = FrmDb::get_count(
40
+		$comment_count = FrmDb::get_count(
41 41
 			'frm_item_metas',
42 42
 			array(
43 43
 				'item_id'         => $atts['entry_ids'],
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	private static function prepare_csv_headings() {
104 104
 		$headings = array();
105 105
 		self::csv_headings( $headings );
106
-		$headings       = apply_filters(
106
+		$headings = apply_filters(
107 107
 			'frm_csv_columns',
108 108
 			$headings,
109 109
 			self::$form_id,
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
 			$field_headings = array();
122 122
 			$separate_values = array( 'user_id', 'file', 'data', 'date' );
123 123
 			if ( isset( $col->field_options['separate_value'] ) && $col->field_options['separate_value'] && ! in_array( $col->type, $separate_values, true ) ) {
124
-				$field_headings[ $col->id . '_label' ] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) );
124
+				$field_headings[$col->id . '_label'] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) );
125 125
 			}
126 126
 
127
-			$field_headings[ $col->id ] = strip_tags( $col->name );
127
+			$field_headings[$col->id] = strip_tags( $col->name );
128 128
 			$field_headings             = apply_filters(
129 129
 				'frm_csv_field_columns',
130 130
 				$field_headings,
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
 
139 139
 		if ( self::$comment_count ) {
140 140
 			for ( $i = 0; $i < self::$comment_count; $i ++ ) {
141
-				$headings[ 'comment' . $i ]            = __( 'Comment', 'formidable' );
142
-				$headings[ 'comment_user_id' . $i ]    = __( 'Comment User', 'formidable' );
143
-				$headings[ 'comment_created_at' . $i ] = __( 'Comment Date', 'formidable' );
141
+				$headings['comment' . $i]            = __( 'Comment', 'formidable' );
142
+				$headings['comment_user_id' . $i]    = __( 'Comment User', 'formidable' );
143
+				$headings['comment_created_at' . $i] = __( 'Comment Date', 'formidable' );
144 144
 			}
145 145
 			unset( $i );
146 146
 		}
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 
165 165
 	private static function prepare_next_csv_rows( $next_set ) {
166 166
 		// order by parent_item_id so children will be first
167
-		$where   = array(
167
+		$where = array(
168 168
 			'or'             => 1,
169 169
 			'id'             => $next_set,
170 170
 			'parent_item_id' => $next_set,
@@ -209,30 +209,30 @@  discard block
 block discarded – undo
209 209
 					continue;
210 210
 				}
211 211
 
212
-				if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) {
213
-					$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = array();
214
-				} elseif ( ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) {
212
+				if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) {
213
+					$entries[self::$entry->parent_item_id]->metas[$meta_id] = array();
214
+				} elseif ( ! is_array( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) {
215 215
 					// if the data is here, it should be an array but if this field has collected data
216 216
 					// both while inside and outside of the repeating section, it's possible this is a string
217
-					$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = (array) $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ];
217
+					$entries[self::$entry->parent_item_id]->metas[$meta_id] = (array) $entries[self::$entry->parent_item_id]->metas[$meta_id];
218 218
 				}
219 219
 
220 220
 				//add the repeated values
221
-				$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ][] = $meta_value;
221
+				$entries[self::$entry->parent_item_id]->metas[$meta_id][] = $meta_value;
222 222
 			}
223
-			$entries[ self::$entry->parent_item_id ]->metas += self::$entry->metas;
223
+			$entries[self::$entry->parent_item_id]->metas += self::$entry->metas;
224 224
 		}
225 225
 
226 226
 		// add the embedded form id
227
-		if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) {
228
-			$entries[ self::$entry->parent_item_id ]->embedded_fields = array();
227
+		if ( ! isset( $entries[self::$entry->parent_item_id]->embedded_fields ) ) {
228
+			$entries[self::$entry->parent_item_id]->embedded_fields = array();
229 229
 		}
230
-		$entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id;
230
+		$entries[self::$entry->parent_item_id]->embedded_fields[self::$entry->id] = self::$entry->form_id;
231 231
 	}
232 232
 
233 233
 	private static function add_field_values_to_csv( &$row ) {
234 234
 		foreach ( self::$fields as $col ) {
235
-			$field_value = isset( self::$entry->metas[ $col->id ] ) ? self::$entry->metas[ $col->id ] : false;
235
+			$field_value = isset( self::$entry->metas[$col->id] ) ? self::$entry->metas[$col->id] : false;
236 236
 
237 237
 			$field_value = maybe_unserialize( $field_value );
238 238
 			self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) );
@@ -257,15 +257,15 @@  discard block
 block discarded – undo
257 257
 						'show_icon'         => false,
258 258
 						'entry_id'          => self::$entry->id,
259 259
 						'sep'               => self::$separator,
260
-						'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0,
260
+						'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[self::$entry->id] ) ) ? 'form' . self::$entry->embedded_fields[self::$entry->id] : 0,
261 261
 					)
262 262
 				);
263 263
 
264
-				$row[ $col->id . '_label' ] = $sep_value;
264
+				$row[$col->id . '_label'] = $sep_value;
265 265
 				unset( $sep_value );
266 266
 			}
267 267
 
268
-			$row[ $col->id ] = $field_value;
268
+			$row[$col->id] = $field_value;
269 269
 
270 270
 			unset( $col, $field_value );
271 271
 		}
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
 		if ( is_array( $atts['field_value'] ) ) {
279 279
 			foreach ( $atts['field_value'] as $key => $sub_value ) {
280 280
 				$column_key = $atts['col']->id . '_' . $key;
281
-				if ( ! is_numeric( $key ) && isset( self::$headings[ $column_key ] ) ) {
282
-					$row[ $column_key ] = $sub_value;
281
+				if ( ! is_numeric( $key ) && isset( self::$headings[$column_key] ) ) {
282
+					$row[$column_key] = $sub_value;
283 283
 				}
284 284
 			}
285 285
 		}
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 		$sep = '';
304 304
 
305 305
 		foreach ( self::$headings as $k => $heading ) {
306
-			$row = isset( $rows[ $k ] ) ? $rows[ $k ] : '';
306
+			$row = isset( $rows[$k] ) ? $rows[$k] : '';
307 307
 			if ( is_array( $row ) ) {
308 308
 				// implode the repeated field values
309 309
 				$row = implode( self::$separator, FrmAppHelper::array_flatten( $row, 'reset' ) );
Please login to merge, or discard this patch.