Completed
Push — master ( 031d86...4b3e9c )
by Jamie
03:37
created
classes/controllers/FrmAddonsController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
 		$keyed_addons = array();
41 41
 		foreach ( $addons as $addon ) {
42
-			$keyed_addons[ $addon['info']['slug'] ] = $addon;
42
+			$keyed_addons[$addon['info']['slug']] = $addon;
43 43
 		}
44 44
 
45 45
 		$plugin_order = array(
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 		);
50 50
 		$ordered_addons = array();
51 51
 		foreach ( $plugin_order as $plugin ) {
52
-			if ( isset( $keyed_addons[ $plugin ] ) ) {
53
-				$ordered_addons[] = $keyed_addons[ $plugin ];
54
-				unset( $keyed_addons[ $plugin ] );
52
+			if ( isset( $keyed_addons[$plugin] ) ) {
53
+				$ordered_addons[] = $keyed_addons[$plugin];
54
+				unset( $keyed_addons[$plugin] );
55 55
 			}
56 56
 		}
57 57
 		$addons = $ordered_addons + $keyed_addons;
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
 	}
87 87
 
88 88
 	public static function get_licenses() {
89
-		FrmAppHelper::permission_check('frm_change_settings');
89
+		FrmAppHelper::permission_check( 'frm_change_settings' );
90 90
 		check_ajax_referer( 'frm_ajax', 'nonce' );
91 91
 
92
-		$license = get_option('frmpro-credentials');
92
+		$license = get_option( 'frmpro-credentials' );
93 93
 		if ( $license && is_array( $license ) && isset( $license['license'] ) ) {
94 94
 			$url = 'http://formidablepro.com/frm-edd-api/licenses?l=' . urlencode( base64_encode( $license['license'] ) );
95 95
 			$licenses = self::send_api_request( $url, array( 'name' => 'frm_api_licence', 'expires' => 60 * 60 * 5 ) );
Please login to merge, or discard this patch.
classes/controllers/FrmXMLController.php 2 patches
Indentation   +181 added lines, -181 removed lines patch added patch discarded remove patch
@@ -2,110 +2,110 @@  discard block
 block discarded – undo
2 2
 
3 3
 class FrmXMLController {
4 4
 
5
-    public static function menu() {
5
+	public static function menu() {
6 6
 		add_submenu_page( 'formidable', 'Formidable | ' . __( 'Import/Export', 'formidable' ), __( 'Import/Export', 'formidable' ), 'frm_edit_forms', 'formidable-import', 'FrmXMLController::route' );
7
-    }
7
+	}
8 8
 
9
-    public static function add_default_templates() {
9
+	public static function add_default_templates() {
10 10
 		if ( ! function_exists( 'libxml_disable_entity_loader' ) ) {
11
-    		// XML import is not enabled on your server
12
-    		return;
13
-    	}
11
+			// XML import is not enabled on your server
12
+			return;
13
+		}
14 14
 
15
-        $set_err = libxml_use_internal_errors(true);
16
-        $loader = libxml_disable_entity_loader( true );
15
+		$set_err = libxml_use_internal_errors(true);
16
+		$loader = libxml_disable_entity_loader( true );
17 17
 
18 18
 		$files = apply_filters( 'frm_default_templates_files', array( FrmAppHelper::plugin_path() . '/classes/views/xml/default-templates.xml' ) );
19 19
 
20
-        foreach ( (array) $files as $file ) {
21
-            FrmXMLHelper::import_xml($file);
22
-            unset($file);
23
-        }
24
-        /*
20
+		foreach ( (array) $files as $file ) {
21
+			FrmXMLHelper::import_xml($file);
22
+			unset($file);
23
+		}
24
+		/*
25 25
         if(is_wp_error($result))
26 26
             $errors[] = $result->get_error_message();
27 27
         else if($result)
28 28
             $message = $result;
29 29
         */
30 30
 
31
-        unset( $files );
31
+		unset( $files );
32 32
 
33
-        libxml_use_internal_errors( $set_err );
34
-    	libxml_disable_entity_loader( $loader );
35
-    }
33
+		libxml_use_internal_errors( $set_err );
34
+		libxml_disable_entity_loader( $loader );
35
+	}
36 36
 
37
-    public static function route() {
38
-        $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action';
37
+	public static function route() {
38
+		$action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action';
39 39
 		$action = FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' );
40 40
 		if ( $action == 'import_xml' ) {
41
-            return self::import_xml();
41
+			return self::import_xml();
42 42
 		} else if ( $action == 'export_xml' ) {
43
-            return self::export_xml();
44
-        } else {
45
-            if ( apply_filters( 'frm_xml_route', true, $action ) ) {
46
-                return self::form();
47
-            }
48
-        }
49
-    }
50
-
51
-    public static function form( $errors = array(), $message = '' ) {
43
+			return self::export_xml();
44
+		} else {
45
+			if ( apply_filters( 'frm_xml_route', true, $action ) ) {
46
+				return self::form();
47
+			}
48
+		}
49
+	}
50
+
51
+	public static function form( $errors = array(), $message = '' ) {
52 52
 		$where = array(
53 53
 			'parent_form_id' => array( null, 0 ),
54 54
 			'status' => array( null, '', 'published' ),
55 55
 		);
56 56
 		$forms = FrmForm::getAll( $where, 'name' );
57 57
 
58
-        $export_types = apply_filters( 'frm_xml_export_types',
59
-            array( 'forms' => __( 'Forms', 'formidable' ), 'items' => __( 'Entries', 'formidable' ) )
60
-        );
58
+		$export_types = apply_filters( 'frm_xml_export_types',
59
+			array( 'forms' => __( 'Forms', 'formidable' ), 'items' => __( 'Entries', 'formidable' ) )
60
+		);
61 61
 
62
-        $export_format = apply_filters( 'frm_export_formats', array(
63
-            'xml' => array( 'name' => 'XML', 'support' => 'forms', 'count' => 'multiple' ),
62
+		$export_format = apply_filters( 'frm_export_formats', array(
63
+			'xml' => array( 'name' => 'XML', 'support' => 'forms', 'count' => 'multiple' ),
64 64
 			'csv' => array( 'name' => 'CSV', 'support' => 'items', 'count' => 'single' ),
65
-        ) );
65
+		) );
66 66
 
67 67
 		include( FrmAppHelper::plugin_path() . '/classes/views/xml/import_form.php' );
68
-    }
68
+	}
69 69
 
70
-    public static function import_xml() {
71
-        $errors = array();
72
-        $message = '';
70
+	public static function import_xml() {
71
+		$errors = array();
72
+		$message = '';
73 73
 
74
-        $permission_error = FrmAppHelper::permission_nonce_error('frm_edit_forms', 'import-xml', 'import-xml-nonce');
75
-        if ( $permission_error !== false ) {
76
-            $errors[] = $permission_error;
77
-            self::form($errors);
78
-            return;
79
-        }
74
+		$permission_error = FrmAppHelper::permission_nonce_error('frm_edit_forms', 'import-xml', 'import-xml-nonce');
75
+		if ( $permission_error !== false ) {
76
+			$errors[] = $permission_error;
77
+			self::form($errors);
78
+			return;
79
+		}
80 80
 
81
-        if ( ! isset($_FILES) || ! isset($_FILES['frm_import_file']) || empty($_FILES['frm_import_file']['name']) || (int) $_FILES['frm_import_file']['size'] < 1 ) {
82
-            $errors[] = __( 'Oops, you didn\'t select a file.', 'formidable' );
83
-            self::form($errors);
84
-            return;
85
-        }
81
+		if ( ! isset($_FILES) || ! isset($_FILES['frm_import_file']) || empty($_FILES['frm_import_file']['name']) || (int) $_FILES['frm_import_file']['size'] < 1 ) {
82
+			$errors[] = __( 'Oops, you didn\'t select a file.', 'formidable' );
83
+			self::form($errors);
84
+			return;
85
+		}
86 86
 
87
-        $file = $_FILES['frm_import_file']['tmp_name'];
87
+		$file = $_FILES['frm_import_file']['tmp_name'];
88 88
 
89
-        if ( ! is_uploaded_file( $file ) ) {
90
-            unset($file);
91
-            $errors[] = __( 'The file does not exist, please try again.', 'formidable' );
92
-            self::form($errors);
93
-            return;
94
-        }
89
+		if ( ! is_uploaded_file( $file ) ) {
90
+			unset($file);
91
+			$errors[] = __( 'The file does not exist, please try again.', 'formidable' );
92
+			self::form($errors);
93
+			return;
94
+		}
95 95
 
96
-        //add_filter('upload_mimes', 'FrmXMLController::allow_mime');
96
+		//add_filter('upload_mimes', 'FrmXMLController::allow_mime');
97 97
 
98
-        $export_format = apply_filters('frm_export_formats', array(
98
+		$export_format = apply_filters('frm_export_formats', array(
99 99
 			'xml' => array( 'name' => 'XML', 'support' => 'forms', 'count' => 'multiple' ),
100 100
 		) );
101 101
 
102
-        $file_type = strtolower(pathinfo($_FILES['frm_import_file']['name'], PATHINFO_EXTENSION));
103
-        if ( $file_type != 'xml' && isset( $export_format[ $file_type ] ) ) {
104
-            // allow other file types to be imported
102
+		$file_type = strtolower(pathinfo($_FILES['frm_import_file']['name'], PATHINFO_EXTENSION));
103
+		if ( $file_type != 'xml' && isset( $export_format[ $file_type ] ) ) {
104
+			// allow other file types to be imported
105 105
 			do_action( 'frm_before_import_' . $file_type );
106
-            return;
107
-        }
108
-        unset($file_type);
106
+			return;
107
+		}
108
+		unset($file_type);
109 109
 
110 110
 		if ( ! function_exists( 'libxml_disable_entity_loader' ) ) {
111 111
 			$errors[] = __( 'XML import is not enabled on your server.', 'formidable' );
@@ -124,148 +124,148 @@  discard block
 block discarded – undo
124 124
 		libxml_use_internal_errors( $set_err );
125 125
 		libxml_disable_entity_loader( $loader );
126 126
 
127
-        self::form($errors, $message);
128
-    }
127
+		self::form($errors, $message);
128
+	}
129 129
 
130
-    public static function export_xml() {
131
-        $error = FrmAppHelper::permission_nonce_error( 'frm_edit_forms', 'export-xml', 'export-xml-nonce' );
132
-        if ( ! empty($error) ) {
133
-            wp_die( $error );
134
-        }
130
+	public static function export_xml() {
131
+		$error = FrmAppHelper::permission_nonce_error( 'frm_edit_forms', 'export-xml', 'export-xml-nonce' );
132
+		if ( ! empty($error) ) {
133
+			wp_die( $error );
134
+		}
135 135
 
136 136
 		$ids = FrmAppHelper::get_post_param( 'frm_export_forms', array() );
137 137
 		$type = FrmAppHelper::get_post_param( 'type', array() );
138 138
 		$format = FrmAppHelper::get_post_param( 'format', 'xml', 'sanitize_title' );
139 139
 
140
-        if ( ! headers_sent() && ! $type ) {
141
-            wp_redirect( esc_url_raw( admin_url( 'admin.php?page=formidable-import' ) ) );
142
-            die();
143
-        }
140
+		if ( ! headers_sent() && ! $type ) {
141
+			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=formidable-import' ) ) );
142
+			die();
143
+		}
144 144
 
145
-        if ( $format == 'xml' ) {
146
-            self::generate_xml($type, compact('ids'));
145
+		if ( $format == 'xml' ) {
146
+			self::generate_xml($type, compact('ids'));
147 147
 		} if ( $format == 'csv' ) {
148 148
 			self::generate_csv( compact('ids') );
149
-        } else {
149
+		} else {
150 150
 			do_action( 'frm_export_format_' . $format, compact('ids') );
151
-        }
151
+		}
152 152
 
153
-        wp_die();
154
-    }
153
+		wp_die();
154
+	}
155 155
 
156 156
 	public static function generate_xml( $type, $args = array() ) {
157
-    	global $wpdb;
157
+		global $wpdb;
158 158
 
159
-	    $type = (array) $type;
160
-        if ( in_array( 'items', $type) && ! in_array( 'forms', $type) ) {
161
-            // make sure the form is included if there are entries
162
-            $type[] = 'forms';
163
-        }
159
+		$type = (array) $type;
160
+		if ( in_array( 'items', $type) && ! in_array( 'forms', $type) ) {
161
+			// make sure the form is included if there are entries
162
+			$type[] = 'forms';
163
+		}
164 164
 
165
-	    if ( in_array( 'forms', $type) ) {
166
-            // include actions with forms
167
-	        $type[] = 'actions';
168
-	    }
165
+		if ( in_array( 'forms', $type) ) {
166
+			// include actions with forms
167
+			$type[] = 'actions';
168
+		}
169 169
 
170
-	    $tables = array(
170
+		$tables = array(
171 171
 			'items'     => $wpdb->prefix . 'frm_items',
172 172
 			'forms'     => $wpdb->prefix . 'frm_forms',
173
-	        'posts'     => $wpdb->posts,
174
-	        'styles'    => $wpdb->posts,
175
-	        'actions'   => $wpdb->posts,
176
-	    );
173
+			'posts'     => $wpdb->posts,
174
+			'styles'    => $wpdb->posts,
175
+			'actions'   => $wpdb->posts,
176
+		);
177 177
 
178 178
 		$defaults = array( 'ids' => false );
179
-	    $args = wp_parse_args( $args, $defaults );
179
+		$args = wp_parse_args( $args, $defaults );
180 180
 
181
-        $sitename = sanitize_key( get_bloginfo( 'name' ) );
181
+		$sitename = sanitize_key( get_bloginfo( 'name' ) );
182 182
 
183
-    	if ( ! empty( $sitename ) ) {
183
+		if ( ! empty( $sitename ) ) {
184 184
 			$sitename .= '.';
185 185
 		}
186
-    	$filename = $sitename . 'formidable.' . date( 'Y-m-d' ) . '.xml';
186
+		$filename = $sitename . 'formidable.' . date( 'Y-m-d' ) . '.xml';
187 187
 
188
-    	header( 'Content-Description: File Transfer' );
189
-    	header( 'Content-Disposition: attachment; filename=' . $filename );
190
-    	header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
188
+		header( 'Content-Description: File Transfer' );
189
+		header( 'Content-Disposition: attachment; filename=' . $filename );
190
+		header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
191 191
 
192
-        //make sure ids are numeric
193
-    	if ( is_array( $args['ids'] ) && ! empty( $args['ids'] ) ) {
194
-	        $args['ids'] = array_filter( $args['ids'], 'is_numeric' );
195
-	    }
192
+		//make sure ids are numeric
193
+		if ( is_array( $args['ids'] ) && ! empty( $args['ids'] ) ) {
194
+			$args['ids'] = array_filter( $args['ids'], 'is_numeric' );
195
+		}
196 196
 
197
-	    $records = array();
197
+		$records = array();
198 198
 
199 199
 		foreach ( $type as $tb_type ) {
200
-            $where = array();
200
+			$where = array();
201 201
 			$join = '';
202
-            $table = $tables[ $tb_type ];
202
+			$table = $tables[ $tb_type ];
203 203
 
204 204
 			$select = $table . '.id';
205
-            $query_vars = array();
205
+			$query_vars = array();
206 206
 
207
-            switch ( $tb_type ) {
208
-                case 'forms':
209
-                    //add forms
210
-                    if ( $args['ids'] ) {
207
+			switch ( $tb_type ) {
208
+				case 'forms':
209
+					//add forms
210
+					if ( $args['ids'] ) {
211 211
 						$where[] = array( 'or' => 1, $table . '.id' => $args['ids'], $table . '.parent_form_id' => $args['ids'] );
212
-                	} else {
212
+					} else {
213 213
 						$where[ $table . '.status !' ] = 'draft';
214
-                	}
215
-                break;
216
-                case 'actions':
214
+					}
215
+				break;
216
+				case 'actions':
217 217
 					$select = $table . '.ID';
218 218
 					$where['post_type'] = FrmFormActionsController::$action_post_type;
219
-                    if ( ! empty($args['ids']) ) {
219
+					if ( ! empty($args['ids']) ) {
220 220
 						$where['menu_order'] = $args['ids'];
221
-                    }
222
-                break;
223
-                case 'items':
224
-                    //$join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)";
225
-                    if ( $args['ids'] ) {
221
+					}
222
+				break;
223
+				case 'items':
224
+					//$join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)";
225
+					if ( $args['ids'] ) {
226 226
 						$where[ $table . '.form_id' ] = $args['ids'];
227
-                    }
228
-                break;
229
-                case 'styles':
230
-                    // Loop through all exported forms and get their selected style IDs
231
-                    $form_ids = $args['ids'];
232
-                    $style_ids = array();
233
-                    foreach ( $form_ids as $form_id ) {
234
-                        $form_data = FrmForm::getOne( $form_id );
235
-                        // For forms that have not been updated while running 2.0, check if custom_style is set
236
-                        if ( isset( $form_data->options['custom_style'] ) ) {
237
-                            $style_ids[] = $form_data->options['custom_style'];
238
-                        }
239
-                        unset( $form_id, $form_data );
240
-                    }
227
+					}
228
+				break;
229
+				case 'styles':
230
+					// Loop through all exported forms and get their selected style IDs
231
+					$form_ids = $args['ids'];
232
+					$style_ids = array();
233
+					foreach ( $form_ids as $form_id ) {
234
+						$form_data = FrmForm::getOne( $form_id );
235
+						// For forms that have not been updated while running 2.0, check if custom_style is set
236
+						if ( isset( $form_data->options['custom_style'] ) ) {
237
+							$style_ids[] = $form_data->options['custom_style'];
238
+						}
239
+						unset( $form_id, $form_data );
240
+					}
241 241
 					$select = $table . '.ID';
242
-                    $where['post_type'] = 'frm_styles';
243
-
244
-                    // Only export selected styles
245
-                    if ( ! empty( $style_ids ) ) {
246
-                        $where['ID'] = $style_ids;
247
-                    }
248
-                break;
249
-                default:
242
+					$where['post_type'] = 'frm_styles';
243
+
244
+					// Only export selected styles
245
+					if ( ! empty( $style_ids ) ) {
246
+						$where['ID'] = $style_ids;
247
+					}
248
+				break;
249
+				default:
250 250
 					$select = $table . '.ID';
251
-                    $join = ' INNER JOIN ' . $wpdb->postmeta . ' pm ON (pm.post_id=' . $table . '.ID)';
252
-                    $where['pm.meta_key'] = 'frm_form_id';
253
-
254
-                    if ( empty($args['ids']) ) {
255
-                        $where['pm.meta_value >'] = 1;
256
-                    } else {
257
-                        $where['pm.meta_value'] = $args['ids'];
258
-                    }
259
-                break;
260
-            }
251
+					$join = ' INNER JOIN ' . $wpdb->postmeta . ' pm ON (pm.post_id=' . $table . '.ID)';
252
+					$where['pm.meta_key'] = 'frm_form_id';
253
+
254
+					if ( empty($args['ids']) ) {
255
+						$where['pm.meta_value >'] = 1;
256
+					} else {
257
+						$where['pm.meta_value'] = $args['ids'];
258
+					}
259
+				break;
260
+			}
261 261
 
262 262
 			$records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select );
263
-            unset($tb_type);
264
-        }
263
+			unset($tb_type);
264
+		}
265 265
 
266 266
 		echo '<?xml version="1.0" encoding="' . esc_attr( get_bloginfo('charset') ) . "\" ?>\n";
267 267
 		include( FrmAppHelper::plugin_path() . '/classes/views/xml/xml.php' );
268
-    }
268
+	}
269 269
 
270 270
 
271 271
 	public static function generate_csv( $atts ) {
@@ -336,14 +336,14 @@  discard block
 block discarded – undo
336 336
 	}
337 337
 
338 338
 	/**
339
-	* Get the fields that should be included in the CSV export
340
-	*
341
-	* @since 2.0.19
342
-	*
343
-	* @param int $form_id
344
-	* @param object $form
345
-	* @return array $csv_fields
346
-	*/
339
+	 * Get the fields that should be included in the CSV export
340
+	 *
341
+	 * @since 2.0.19
342
+	 *
343
+	 * @param int $form_id
344
+	 * @param object $form
345
+	 * @return array $csv_fields
346
+	 */
347 347
 	private static function get_fields_for_csv_export( $form_id, $form ) {
348 348
 		// Phase frm_csv_field_ids out by 2.01.05
349 349
 		$csv_field_ids = apply_filters( 'frm_csv_field_ids', '', $form_id, array( 'form' => $form ) );
@@ -373,16 +373,16 @@  discard block
 block discarded – undo
373 373
 	}
374 374
 
375 375
 	public static function allow_mime( $mimes ) {
376
-        if ( ! isset( $mimes['csv'] ) ) {
377
-            // allow csv files
378
-            $mimes['csv'] = 'text/csv';
379
-        }
380
-
381
-        if ( ! isset( $mimes['xml'] ) ) {
382
-            // allow xml
383
-            $mimes['xml'] = 'text/xml';
384
-        }
385
-
386
-        return $mimes;
387
-    }
376
+		if ( ! isset( $mimes['csv'] ) ) {
377
+			// allow csv files
378
+			$mimes['csv'] = 'text/csv';
379
+		}
380
+
381
+		if ( ! isset( $mimes['xml'] ) ) {
382
+			// allow xml
383
+			$mimes['xml'] = 'text/xml';
384
+		}
385
+
386
+		return $mimes;
387
+	}
388 388
 }
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -12,14 +12,14 @@  discard block
 block discarded – undo
12 12
     		return;
13 13
     	}
14 14
 
15
-        $set_err = libxml_use_internal_errors(true);
15
+        $set_err = libxml_use_internal_errors( true );
16 16
         $loader = libxml_disable_entity_loader( true );
17 17
 
18 18
 		$files = apply_filters( 'frm_default_templates_files', array( FrmAppHelper::plugin_path() . '/classes/views/xml/default-templates.xml' ) );
19 19
 
20 20
         foreach ( (array) $files as $file ) {
21
-            FrmXMLHelper::import_xml($file);
22
-            unset($file);
21
+            FrmXMLHelper::import_xml( $file );
22
+            unset( $file );
23 23
         }
24 24
         /*
25 25
         if(is_wp_error($result))
@@ -71,41 +71,41 @@  discard block
 block discarded – undo
71 71
         $errors = array();
72 72
         $message = '';
73 73
 
74
-        $permission_error = FrmAppHelper::permission_nonce_error('frm_edit_forms', 'import-xml', 'import-xml-nonce');
74
+        $permission_error = FrmAppHelper::permission_nonce_error( 'frm_edit_forms', 'import-xml', 'import-xml-nonce' );
75 75
         if ( $permission_error !== false ) {
76 76
             $errors[] = $permission_error;
77
-            self::form($errors);
77
+            self::form( $errors );
78 78
             return;
79 79
         }
80 80
 
81
-        if ( ! isset($_FILES) || ! isset($_FILES['frm_import_file']) || empty($_FILES['frm_import_file']['name']) || (int) $_FILES['frm_import_file']['size'] < 1 ) {
81
+        if ( ! isset( $_FILES ) || ! isset( $_FILES['frm_import_file'] ) || empty( $_FILES['frm_import_file']['name'] ) || (int) $_FILES['frm_import_file']['size'] < 1 ) {
82 82
             $errors[] = __( 'Oops, you didn\'t select a file.', 'formidable' );
83
-            self::form($errors);
83
+            self::form( $errors );
84 84
             return;
85 85
         }
86 86
 
87 87
         $file = $_FILES['frm_import_file']['tmp_name'];
88 88
 
89 89
         if ( ! is_uploaded_file( $file ) ) {
90
-            unset($file);
90
+            unset( $file );
91 91
             $errors[] = __( 'The file does not exist, please try again.', 'formidable' );
92
-            self::form($errors);
92
+            self::form( $errors );
93 93
             return;
94 94
         }
95 95
 
96 96
         //add_filter('upload_mimes', 'FrmXMLController::allow_mime');
97 97
 
98
-        $export_format = apply_filters('frm_export_formats', array(
98
+        $export_format = apply_filters( 'frm_export_formats', array(
99 99
 			'xml' => array( 'name' => 'XML', 'support' => 'forms', 'count' => 'multiple' ),
100 100
 		) );
101 101
 
102
-        $file_type = strtolower(pathinfo($_FILES['frm_import_file']['name'], PATHINFO_EXTENSION));
103
-        if ( $file_type != 'xml' && isset( $export_format[ $file_type ] ) ) {
102
+        $file_type = strtolower( pathinfo( $_FILES['frm_import_file']['name'], PATHINFO_EXTENSION ) );
103
+        if ( $file_type != 'xml' && isset( $export_format[$file_type] ) ) {
104 104
             // allow other file types to be imported
105 105
 			do_action( 'frm_before_import_' . $file_type );
106 106
             return;
107 107
         }
108
-        unset($file_type);
108
+        unset( $file_type );
109 109
 
110 110
 		if ( ! function_exists( 'libxml_disable_entity_loader' ) ) {
111 111
 			$errors[] = __( 'XML import is not enabled on your server.', 'formidable' );
@@ -124,12 +124,12 @@  discard block
 block discarded – undo
124 124
 		libxml_use_internal_errors( $set_err );
125 125
 		libxml_disable_entity_loader( $loader );
126 126
 
127
-        self::form($errors, $message);
127
+        self::form( $errors, $message );
128 128
     }
129 129
 
130 130
     public static function export_xml() {
131 131
         $error = FrmAppHelper::permission_nonce_error( 'frm_edit_forms', 'export-xml', 'export-xml-nonce' );
132
-        if ( ! empty($error) ) {
132
+        if ( ! empty( $error ) ) {
133 133
             wp_die( $error );
134 134
         }
135 135
 
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
         }
144 144
 
145 145
         if ( $format == 'xml' ) {
146
-            self::generate_xml($type, compact('ids'));
146
+            self::generate_xml( $type, compact( 'ids' ) );
147 147
 		} if ( $format == 'csv' ) {
148
-			self::generate_csv( compact('ids') );
148
+			self::generate_csv( compact( 'ids' ) );
149 149
         } else {
150
-			do_action( 'frm_export_format_' . $format, compact('ids') );
150
+			do_action( 'frm_export_format_' . $format, compact( 'ids' ) );
151 151
         }
152 152
 
153 153
         wp_die();
@@ -157,12 +157,12 @@  discard block
 block discarded – undo
157 157
     	global $wpdb;
158 158
 
159 159
 	    $type = (array) $type;
160
-        if ( in_array( 'items', $type) && ! in_array( 'forms', $type) ) {
160
+        if ( in_array( 'items', $type ) && ! in_array( 'forms', $type ) ) {
161 161
             // make sure the form is included if there are entries
162 162
             $type[] = 'forms';
163 163
         }
164 164
 
165
-	    if ( in_array( 'forms', $type) ) {
165
+	    if ( in_array( 'forms', $type ) ) {
166 166
             // include actions with forms
167 167
 	        $type[] = 'actions';
168 168
 	    }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 		foreach ( $type as $tb_type ) {
200 200
             $where = array();
201 201
 			$join = '';
202
-            $table = $tables[ $tb_type ];
202
+            $table = $tables[$tb_type];
203 203
 
204 204
 			$select = $table . '.id';
205 205
             $query_vars = array();
@@ -210,20 +210,20 @@  discard block
 block discarded – undo
210 210
                     if ( $args['ids'] ) {
211 211
 						$where[] = array( 'or' => 1, $table . '.id' => $args['ids'], $table . '.parent_form_id' => $args['ids'] );
212 212
                 	} else {
213
-						$where[ $table . '.status !' ] = 'draft';
213
+						$where[$table . '.status !'] = 'draft';
214 214
                 	}
215 215
                 break;
216 216
                 case 'actions':
217 217
 					$select = $table . '.ID';
218 218
 					$where['post_type'] = FrmFormActionsController::$action_post_type;
219
-                    if ( ! empty($args['ids']) ) {
219
+                    if ( ! empty( $args['ids'] ) ) {
220 220
 						$where['menu_order'] = $args['ids'];
221 221
                     }
222 222
                 break;
223 223
                 case 'items':
224 224
                     //$join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)";
225 225
                     if ( $args['ids'] ) {
226
-						$where[ $table . '.form_id' ] = $args['ids'];
226
+						$where[$table . '.form_id'] = $args['ids'];
227 227
                     }
228 228
                 break;
229 229
                 case 'styles':
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
                     $join = ' INNER JOIN ' . $wpdb->postmeta . ' pm ON (pm.post_id=' . $table . '.ID)';
252 252
                     $where['pm.meta_key'] = 'frm_form_id';
253 253
 
254
-                    if ( empty($args['ids']) ) {
254
+                    if ( empty( $args['ids'] ) ) {
255 255
                         $where['pm.meta_value >'] = 1;
256 256
                     } else {
257 257
                         $where['pm.meta_value'] = $args['ids'];
@@ -259,11 +259,11 @@  discard block
 block discarded – undo
259 259
                 break;
260 260
             }
261 261
 
262
-			$records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select );
263
-            unset($tb_type);
262
+			$records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select );
263
+            unset( $tb_type );
264 264
         }
265 265
 
266
-		echo '<?xml version="1.0" encoding="' . esc_attr( get_bloginfo('charset') ) . "\" ?>\n";
266
+		echo '<?xml version="1.0" encoding="' . esc_attr( get_bloginfo( 'charset' ) ) . "\" ?>\n";
267 267
 		include( FrmAppHelper::plugin_path() . '/classes/views/xml/xml.php' );
268 268
     }
269 269
 
@@ -289,11 +289,11 @@  discard block
 block discarded – undo
289 289
 			$fid = FrmAppHelper::get_param( 'fid', '', 'get', 'sanitize_text_field' );
290 290
 		}
291 291
 
292
-		if ( ! ini_get('safe_mode') ) {
293
-			set_time_limit(0); //Remove time limit to execute this function
294
-			$mem_limit = str_replace('M', '', ini_get('memory_limit'));
292
+		if ( ! ini_get( 'safe_mode' ) ) {
293
+			set_time_limit( 0 ); //Remove time limit to execute this function
294
+			$mem_limit = str_replace( 'M', '', ini_get( 'memory_limit' ) );
295 295
 			if ( (int) $mem_limit < 256 ) {
296
-				ini_set('memory_limit', '256M');
296
+				ini_set( 'memory_limit', '256M' );
297 297
 			}
298 298
 		}
299 299
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 			$no_export_fields = FrmField::no_save_fields();
365 365
 			foreach ( $csv_fields as $k => $f ) {
366 366
 				if ( in_array( $f->type, $no_export_fields ) ) {
367
-					unset( $csv_fields[ $k ] );
367
+					unset( $csv_fields[$k] );
368 368
 				}
369 369
 			}
370 370
 		}
Please login to merge, or discard this patch.
classes/controllers/FrmFormActionsController.php 2 patches
Indentation   +218 added lines, -218 removed lines patch added patch discarded remove patch
@@ -1,109 +1,109 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 class FrmFormActionsController {
4
-    public static $action_post_type = 'frm_form_actions';
5
-    public static $registered_actions;
6
-
7
-    public static function register_post_types() {
8
-        register_post_type( self::$action_post_type, array(
9
-            'label' => __( 'Form Actions', 'formidable' ),
10
-            'description' => '',
11
-            'public' => false,
12
-            'show_ui' => false,
13
-            'exclude_from_search' => true,
14
-            'show_in_nav_menus' => false,
15
-            'show_in_menu' => true,
16
-            'capability_type' => 'page',
17
-            'supports' => array(
4
+	public static $action_post_type = 'frm_form_actions';
5
+	public static $registered_actions;
6
+
7
+	public static function register_post_types() {
8
+		register_post_type( self::$action_post_type, array(
9
+			'label' => __( 'Form Actions', 'formidable' ),
10
+			'description' => '',
11
+			'public' => false,
12
+			'show_ui' => false,
13
+			'exclude_from_search' => true,
14
+			'show_in_nav_menus' => false,
15
+			'show_in_menu' => true,
16
+			'capability_type' => 'page',
17
+			'supports' => array(
18 18
 				'title', 'editor', 'excerpt', 'custom-fields',
19 19
 				'page-attributes',
20
-            ),
21
-            'has_archive' => false,
22
-        ) );
23
-
24
-        /**
25
-         * post_content: json settings
26
-         * menu_order: form id
27
-         * post_excerpt: action type
28
-         */
29
-
30
-        self::actions_init();
31
-    }
32
-
33
-    public static function actions_init() {
34
-        self::$registered_actions = new Frm_Form_Action_Factory();
35
-        self::register_actions();
36
-        do_action( 'frm_form_actions_init' );
37
-    }
38
-
39
-    public static function register_actions() {
40
-        $action_classes = apply_filters( 'frm_registered_form_actions', array(
41
-            'email'     => 'FrmEmailAction',
42
-            'wppost'    => 'FrmDefPostAction',
43
-            'register'  => 'FrmDefRegAction',
44
-            'paypal'    => 'FrmDefPayPalAction',
45
-            //'aweber'    => 'FrmDefAweberAction',
46
-            'mailchimp' => 'FrmDefMlcmpAction',
47
-            'twilio'    => 'FrmDefTwilioAction',
48
-            'highrise'  => 'FrmDefHrsAction',
49
-        ) );
50
-
51
-        include_once(FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php');
52
-        include_once(FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php');
53
-
54
-        foreach ( $action_classes as $action_class ) {
55
-            self::$registered_actions->register($action_class);
56
-        }
57
-    }
20
+			),
21
+			'has_archive' => false,
22
+		) );
23
+
24
+		/**
25
+		 * post_content: json settings
26
+		 * menu_order: form id
27
+		 * post_excerpt: action type
28
+		 */
29
+
30
+		self::actions_init();
31
+	}
32
+
33
+	public static function actions_init() {
34
+		self::$registered_actions = new Frm_Form_Action_Factory();
35
+		self::register_actions();
36
+		do_action( 'frm_form_actions_init' );
37
+	}
38
+
39
+	public static function register_actions() {
40
+		$action_classes = apply_filters( 'frm_registered_form_actions', array(
41
+			'email'     => 'FrmEmailAction',
42
+			'wppost'    => 'FrmDefPostAction',
43
+			'register'  => 'FrmDefRegAction',
44
+			'paypal'    => 'FrmDefPayPalAction',
45
+			//'aweber'    => 'FrmDefAweberAction',
46
+			'mailchimp' => 'FrmDefMlcmpAction',
47
+			'twilio'    => 'FrmDefTwilioAction',
48
+			'highrise'  => 'FrmDefHrsAction',
49
+		) );
50
+
51
+		include_once(FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php');
52
+		include_once(FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php');
53
+
54
+		foreach ( $action_classes as $action_class ) {
55
+			self::$registered_actions->register($action_class);
56
+		}
57
+	}
58 58
 
59 59
 	public static function get_form_actions( $action = 'all' ) {
60
-        $temp_actions = self::$registered_actions;
61
-        if ( empty($temp_actions) ) {
62
-            self::actions_init();
63
-            $temp_actions = self::$registered_actions->actions;
64
-        } else {
65
-            $temp_actions = $temp_actions->actions;
66
-        }
60
+		$temp_actions = self::$registered_actions;
61
+		if ( empty($temp_actions) ) {
62
+			self::actions_init();
63
+			$temp_actions = self::$registered_actions->actions;
64
+		} else {
65
+			$temp_actions = $temp_actions->actions;
66
+		}
67 67
 
68
-        $actions = array();
68
+		$actions = array();
69 69
 
70
-        foreach ( $temp_actions as $a ) {
71
-            if ( 'all' != $action && $a->id_base == $action ) {
72
-                return $a;
73
-            }
70
+		foreach ( $temp_actions as $a ) {
71
+			if ( 'all' != $action && $a->id_base == $action ) {
72
+				return $a;
73
+			}
74 74
 
75 75
 			$actions[ $a->id_base ] = $a;
76
-        }
77
-        unset( $temp_actions, $a );
78
-
79
-        $action_limit = 10;
80
-        if ( count( $actions ) <= $action_limit ) {
81
-            return $actions;
82
-        }
83
-
84
-        // remove the last few inactive icons if there are too many
85
-        $temp_actions = $actions;
86
-        arsort( $temp_actions );
87
-        foreach ( $temp_actions as $type => $a ) {
88
-            if ( ! isset( $a->action_options['active'] ) || empty( $a->action_options['active'] ) ) {
76
+		}
77
+		unset( $temp_actions, $a );
78
+
79
+		$action_limit = 10;
80
+		if ( count( $actions ) <= $action_limit ) {
81
+			return $actions;
82
+		}
83
+
84
+		// remove the last few inactive icons if there are too many
85
+		$temp_actions = $actions;
86
+		arsort( $temp_actions );
87
+		foreach ( $temp_actions as $type => $a ) {
88
+			if ( ! isset( $a->action_options['active'] ) || empty( $a->action_options['active'] ) ) {
89 89
 				unset( $actions[ $type ] );
90
-                if ( count( $actions ) <= $action_limit ) {
91
-                    break;
92
-                }
93
-            }
94
-            unset( $type, $a );
95
-        }
90
+				if ( count( $actions ) <= $action_limit ) {
91
+					break;
92
+				}
93
+			}
94
+			unset( $type, $a );
95
+		}
96 96
 
97
-        return $actions;
98
-    }
97
+		return $actions;
98
+	}
99 99
 
100 100
 	/**
101 101
 	 * @since 2.0
102 102
 	 */
103
-    public static function list_actions( $form, $values ) {
104
-        if ( empty( $form ) ) {
105
-            return;
106
-        }
103
+	public static function list_actions( $form, $values ) {
104
+		if ( empty( $form ) ) {
105
+			return;
106
+		}
107 107
 
108 108
 		/**
109 109
 		 * use this hook to migrate old settings into a new action
@@ -113,116 +113,116 @@  discard block
 block discarded – undo
113 113
 
114 114
 		$form_actions = FrmFormAction::get_action_for_form( $form->id );
115 115
 
116
-        $action_controls = self::get_form_actions();
116
+		$action_controls = self::get_form_actions();
117 117
 
118
-        $action_map = array();
118
+		$action_map = array();
119 119
 
120 120
 		foreach ( $action_controls as $key => $control ) {
121
-            $action_map[ $control->id_base ] = $key;
122
-        }
121
+			$action_map[ $control->id_base ] = $key;
122
+		}
123 123
 
124
-    	foreach ( $form_actions as $action ) {
125
-    	    if ( ! isset( $action_map[ $action->post_excerpt ] ) ) {
126
-    	        // don't try and show settings if action no longer exists
127
-    	        continue;
128
-    	    }
124
+		foreach ( $form_actions as $action ) {
125
+			if ( ! isset( $action_map[ $action->post_excerpt ] ) ) {
126
+				// don't try and show settings if action no longer exists
127
+				continue;
128
+			}
129 129
 
130
-    		self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values );
131
-    	}
132
-    }
130
+			self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values );
131
+		}
132
+	}
133 133
 
134 134
 	public static function action_control( $form_action, $form, $action_key, $action_control, $values ) {
135
-        $action_control->_set($action_key);
135
+		$action_control->_set($action_key);
136 136
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/form_action.php' );
137
-    }
137
+	}
138 138
 
139
-    public static function add_form_action() {
139
+	public static function add_form_action() {
140 140
 		FrmAppHelper::permission_check('frm_edit_forms');
141
-        check_ajax_referer( 'frm_ajax', 'nonce' );
141
+		check_ajax_referer( 'frm_ajax', 'nonce' );
142 142
 
143
-        global $frm_vars;
143
+		global $frm_vars;
144 144
 
145 145
 		$action_key = absint( $_POST['list_id'] );
146
-        $action_type = sanitize_text_field( $_POST['type'] );
146
+		$action_type = sanitize_text_field( $_POST['type'] );
147 147
 
148
-        $action_control = self::get_form_actions( $action_type );
149
-        $action_control->_set($action_key);
148
+		$action_control = self::get_form_actions( $action_type );
149
+		$action_control->_set($action_key);
150 150
 
151
-        $form_id = absint( $_POST['form_id'] );
151
+		$form_id = absint( $_POST['form_id'] );
152 152
 
153
-        $form_action = $action_control->prepare_new($form_id);
153
+		$form_action = $action_control->prepare_new($form_id);
154 154
 
155
-        $values = array();
156
-        $form = self::fields_to_values($form_id, $values);
155
+		$values = array();
156
+		$form = self::fields_to_values($form_id, $values);
157 157
 
158 158
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/form_action.php' );
159
-        wp_die();
160
-    }
159
+		wp_die();
160
+	}
161 161
 
162
-    public static function fill_action() {
162
+	public static function fill_action() {
163 163
 		FrmAppHelper::permission_check('frm_edit_forms');
164
-        check_ajax_referer( 'frm_ajax', 'nonce' );
164
+		check_ajax_referer( 'frm_ajax', 'nonce' );
165 165
 
166
-        $action_key = absint( $_POST['action_id'] );
167
-        $action_type = sanitize_text_field( $_POST['action_type'] );
166
+		$action_key = absint( $_POST['action_id'] );
167
+		$action_type = sanitize_text_field( $_POST['action_type'] );
168 168
 
169
-        $action_control = self::get_form_actions( $action_type );
170
-        if ( empty($action_control) ) {
171
-            wp_die();
172
-        }
169
+		$action_control = self::get_form_actions( $action_type );
170
+		if ( empty($action_control) ) {
171
+			wp_die();
172
+		}
173 173
 
174
-        $form_action = $action_control->get_single_action( $action_key );
174
+		$form_action = $action_control->get_single_action( $action_key );
175 175
 
176
-        $values = array();
177
-        $form = self::fields_to_values($form_action->menu_order, $values);
176
+		$values = array();
177
+		$form = self::fields_to_values($form_action->menu_order, $values);
178 178
 
179 179
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/_action_inside.php' );
180
-        wp_die();
181
-    }
180
+		wp_die();
181
+	}
182 182
 
183 183
 	private static function fields_to_values( $form_id, array &$values ) {
184
-        $form = FrmForm::getOne($form_id);
184
+		$form = FrmForm::getOne($form_id);
185 185
 
186 186
 		$values = array( 'fields' => array(), 'id' => $form->id );
187 187
 
188
-        $fields = FrmField::get_all_for_form($form->id);
189
-        foreach ( $fields as $k => $f ) {
190
-            $f = (array) $f;
191
-            $opts = (array) $f['field_options'];
192
-            $f = array_merge($opts, $f);
193
-            if ( ! isset( $f['post_field'] ) ) {
194
-                $f['post_field'] = '';
195
-            }
196
-            $values['fields'][] = $f;
197
-            unset($k, $f);
198
-        }
199
-
200
-        return $form;
201
-    }
188
+		$fields = FrmField::get_all_for_form($form->id);
189
+		foreach ( $fields as $k => $f ) {
190
+			$f = (array) $f;
191
+			$opts = (array) $f['field_options'];
192
+			$f = array_merge($opts, $f);
193
+			if ( ! isset( $f['post_field'] ) ) {
194
+				$f['post_field'] = '';
195
+			}
196
+			$values['fields'][] = $f;
197
+			unset($k, $f);
198
+		}
199
+
200
+		return $form;
201
+	}
202 202
 
203 203
 	public static function update_settings( $form_id ) {
204
-        global $wpdb;
204
+		global $wpdb;
205 205
 
206
-        $registered_actions = self::$registered_actions->actions;
206
+		$registered_actions = self::$registered_actions->actions;
207 207
 
208 208
 		$old_actions = FrmDb::get_col( $wpdb->posts, array( 'post_type' => self::$action_post_type, 'menu_order' => $form_id ), 'ID' );
209
-        $new_actions = array();
209
+		$new_actions = array();
210 210
 
211
-        foreach ( $registered_actions as $registered_action ) {
212
-            $action_ids = $registered_action->update_callback($form_id);
213
-            if ( ! empty( $action_ids ) ) {
214
-                $new_actions[] = $action_ids;
215
-            }
216
-        }
211
+		foreach ( $registered_actions as $registered_action ) {
212
+			$action_ids = $registered_action->update_callback($form_id);
213
+			if ( ! empty( $action_ids ) ) {
214
+				$new_actions[] = $action_ids;
215
+			}
216
+		}
217 217
 
218
-        //Only use array_merge if there are new actions
219
-        if ( ! empty( $new_actions ) ) {
220
-            $new_actions = call_user_func_array( 'array_merge', $new_actions );
221
-        }
222
-        $old_actions = array_diff( $old_actions, $new_actions );
218
+		//Only use array_merge if there are new actions
219
+		if ( ! empty( $new_actions ) ) {
220
+			$new_actions = call_user_func_array( 'array_merge', $new_actions );
221
+		}
222
+		$old_actions = array_diff( $old_actions, $new_actions );
223 223
 
224 224
 		self::delete_missing_actions( $old_actions );
225
-    }
225
+	}
226 226
 
227 227
 	public static function delete_missing_actions( $old_actions ) {
228 228
 		if ( ! empty( $old_actions ) ) {
@@ -242,36 +242,36 @@  discard block
 block discarded – undo
242 242
 		self::trigger_actions( $event, $form_id, $entry_id, 'all', $args );
243 243
 	}
244 244
 
245
-    /**
246
-     * @param string $event
247
-     */
245
+	/**
246
+	 * @param string $event
247
+	 */
248 248
 	public static function trigger_actions( $event, $form, $entry, $type = 'all', $args = array() ) {
249 249
 		$form_actions = FrmFormAction::get_action_for_form( ( is_object( $form ) ? $form->id : $form ), $type );
250 250
 
251 251
 		if ( empty( $form_actions ) ) {
252
-            return;
253
-        }
252
+			return;
253
+		}
254 254
 
255 255
 		FrmForm::maybe_get_form( $form );
256 256
 
257
-        $link_settings = self::get_form_actions( $type );
258
-        if ( 'all' != $type ) {
259
-            $link_settings = array( $type => $link_settings );
260
-        }
257
+		$link_settings = self::get_form_actions( $type );
258
+		if ( 'all' != $type ) {
259
+			$link_settings = array( $type => $link_settings );
260
+		}
261 261
 
262
-        $stored_actions = $action_priority = array();
262
+		$stored_actions = $action_priority = array();
263 263
 
264 264
 		$importing = in_array( $event, array( 'create', 'update' ) ) && defined( 'WP_IMPORTING' ) && WP_IMPORTING;
265 265
 
266
-        foreach ( $form_actions as $action ) {
266
+		foreach ( $form_actions as $action ) {
267 267
 			$trigger_on_import = $importing && in_array( 'import', $action->post_content['event'] );
268 268
 			if ( ! in_array( $event, $action->post_content['event'] ) && ! $trigger_on_import ) {
269
-                continue;
270
-            }
269
+				continue;
270
+			}
271 271
 
272
-            if ( ! is_object( $entry ) ) {
273
-                $entry = FrmEntry::getOne( $entry, true );
274
-            }
272
+			if ( ! is_object( $entry ) ) {
273
+				$entry = FrmEntry::getOne( $entry, true );
274
+			}
275 275
 
276 276
 			if ( empty( $entry ) || ( $entry->is_draft && $event != 'draft' ) ) {
277 277
 				continue;
@@ -280,66 +280,66 @@  discard block
 block discarded – undo
280 280
 			$child_entry = ( ( $form && is_numeric( $form->parent_form_id ) && $form->parent_form_id ) || ( $entry && ( $entry->form_id != $form->id || $entry->parent_item_id ) ) || ( isset( $args['is_child'] ) && $args['is_child'] ) );
281 281
 
282 282
 			if ( $child_entry ) {
283
-                //don't trigger actions for sub forms
284
-                continue;
285
-            }
283
+				//don't trigger actions for sub forms
284
+				continue;
285
+			}
286 286
 
287
-            // check conditional logic
287
+			// check conditional logic
288 288
 			$stop = FrmFormAction::action_conditions_met( $action, $entry );
289
-            if ( $stop ) {
290
-                continue;
291
-            }
289
+			if ( $stop ) {
290
+				continue;
291
+			}
292 292
 
293
-            // store actions so they can be triggered with the correct priority
294
-            $stored_actions[ $action->ID ] = $action;
295
-            $action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority'];
293
+			// store actions so they can be triggered with the correct priority
294
+			$stored_actions[ $action->ID ] = $action;
295
+			$action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority'];
296 296
 
297
-            unset($action);
298
-        }
297
+			unset($action);
298
+		}
299 299
 
300
-        if ( ! empty( $stored_actions ) ) {
301
-            asort($action_priority);
300
+		if ( ! empty( $stored_actions ) ) {
301
+			asort($action_priority);
302 302
 
303
-            // make sure hooks are loaded
304
-            new FrmNotification();
303
+			// make sure hooks are loaded
304
+			new FrmNotification();
305 305
 
306
-            foreach ( $action_priority as $action_id => $priority ) {
307
-                $action = $stored_actions[ $action_id ];
306
+			foreach ( $action_priority as $action_id => $priority ) {
307
+				$action = $stored_actions[ $action_id ];
308 308
 				do_action( 'frm_trigger_' . $action->post_excerpt . '_action', $action, $entry, $form, $event );
309 309
 				do_action( 'frm_trigger_' . $action->post_excerpt . '_' . $event . '_action', $action, $entry, $form );
310 310
 
311
-                // If post is created, get updated $entry object
312
-                if ( $action->post_excerpt == 'wppost' && $event == 'create' ) {
313
-                    $entry = FrmEntry::getOne($entry->id, true);
314
-                }
315
-            }
316
-        }
317
-    }
311
+				// If post is created, get updated $entry object
312
+				if ( $action->post_excerpt == 'wppost' && $event == 'create' ) {
313
+					$entry = FrmEntry::getOne($entry->id, true);
314
+				}
315
+			}
316
+		}
317
+	}
318 318
 
319 319
 	public static function duplicate_form_actions( $form_id, $values, $args = array() ) {
320
-        if ( ! isset($args['old_id']) || empty($args['old_id']) ) {
321
-            // continue if we know which actions to copy
322
-            return;
323
-        }
320
+		if ( ! isset($args['old_id']) || empty($args['old_id']) ) {
321
+			// continue if we know which actions to copy
322
+			return;
323
+		}
324 324
 
325
-        $action_controls = self::get_form_actions( );
325
+		$action_controls = self::get_form_actions( );
326 326
 
327
-        foreach ( $action_controls as $action_control ) {
328
-            $action_control->duplicate_form_actions( $form_id, $args['old_id'] );
329
-            unset( $action_control );
330
-        }
331
-    }
327
+		foreach ( $action_controls as $action_control ) {
328
+			$action_control->duplicate_form_actions( $form_id, $args['old_id'] );
329
+			unset( $action_control );
330
+		}
331
+	}
332 332
 
333
-    public static function limit_by_type( $where ) {
334
-        global $frm_vars, $wpdb;
333
+	public static function limit_by_type( $where ) {
334
+		global $frm_vars, $wpdb;
335 335
 
336
-        if ( ! isset( $frm_vars['action_type'] ) ) {
337
-            return $where;
338
-        }
336
+		if ( ! isset( $frm_vars['action_type'] ) ) {
337
+			return $where;
338
+		}
339 339
 
340
-        $where .= $wpdb->prepare( ' AND post_excerpt = %s ', $frm_vars['action_type'] );
341
-        return $where;
342
-    }
340
+		$where .= $wpdb->prepare( ' AND post_excerpt = %s ', $frm_vars['action_type'] );
341
+		return $where;
342
+	}
343 343
 }
344 344
 
345 345
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 		foreach ( $keys as $key ) {
367 367
 			// don't register new action if old action with the same id is already registered
368 368
 			if ( ! isset( $this->actions[ $key ] ) ) {
369
-			    $this->actions[ $key ]->_register();
369
+				$this->actions[ $key ]->_register();
370 370
 			}
371 371
 		}
372 372
 	}
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -48,17 +48,17 @@  discard block
 block discarded – undo
48 48
             'highrise'  => 'FrmDefHrsAction',
49 49
         ) );
50 50
 
51
-        include_once(FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php');
52
-        include_once(FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php');
51
+        include_once( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php' );
52
+        include_once( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php' );
53 53
 
54 54
         foreach ( $action_classes as $action_class ) {
55
-            self::$registered_actions->register($action_class);
55
+            self::$registered_actions->register( $action_class );
56 56
         }
57 57
     }
58 58
 
59 59
 	public static function get_form_actions( $action = 'all' ) {
60 60
         $temp_actions = self::$registered_actions;
61
-        if ( empty($temp_actions) ) {
61
+        if ( empty( $temp_actions ) ) {
62 62
             self::actions_init();
63 63
             $temp_actions = self::$registered_actions->actions;
64 64
         } else {
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                 return $a;
73 73
             }
74 74
 
75
-			$actions[ $a->id_base ] = $a;
75
+			$actions[$a->id_base] = $a;
76 76
         }
77 77
         unset( $temp_actions, $a );
78 78
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         arsort( $temp_actions );
87 87
         foreach ( $temp_actions as $type => $a ) {
88 88
             if ( ! isset( $a->action_options['active'] ) || empty( $a->action_options['active'] ) ) {
89
-				unset( $actions[ $type ] );
89
+				unset( $actions[$type] );
90 90
                 if ( count( $actions ) <= $action_limit ) {
91 91
                     break;
92 92
                 }
@@ -118,26 +118,26 @@  discard block
 block discarded – undo
118 118
         $action_map = array();
119 119
 
120 120
 		foreach ( $action_controls as $key => $control ) {
121
-            $action_map[ $control->id_base ] = $key;
121
+            $action_map[$control->id_base] = $key;
122 122
         }
123 123
 
124 124
     	foreach ( $form_actions as $action ) {
125
-    	    if ( ! isset( $action_map[ $action->post_excerpt ] ) ) {
125
+    	    if ( ! isset( $action_map[$action->post_excerpt] ) ) {
126 126
     	        // don't try and show settings if action no longer exists
127 127
     	        continue;
128 128
     	    }
129 129
 
130
-    		self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values );
130
+    		self::action_control( $action, $form, $action->ID, $action_controls[$action_map[$action->post_excerpt]], $values );
131 131
     	}
132 132
     }
133 133
 
134 134
 	public static function action_control( $form_action, $form, $action_key, $action_control, $values ) {
135
-        $action_control->_set($action_key);
135
+        $action_control->_set( $action_key );
136 136
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/form_action.php' );
137 137
     }
138 138
 
139 139
     public static function add_form_action() {
140
-		FrmAppHelper::permission_check('frm_edit_forms');
140
+		FrmAppHelper::permission_check( 'frm_edit_forms' );
141 141
         check_ajax_referer( 'frm_ajax', 'nonce' );
142 142
 
143 143
         global $frm_vars;
@@ -146,55 +146,55 @@  discard block
 block discarded – undo
146 146
         $action_type = sanitize_text_field( $_POST['type'] );
147 147
 
148 148
         $action_control = self::get_form_actions( $action_type );
149
-        $action_control->_set($action_key);
149
+        $action_control->_set( $action_key );
150 150
 
151 151
         $form_id = absint( $_POST['form_id'] );
152 152
 
153
-        $form_action = $action_control->prepare_new($form_id);
153
+        $form_action = $action_control->prepare_new( $form_id );
154 154
 
155 155
         $values = array();
156
-        $form = self::fields_to_values($form_id, $values);
156
+        $form = self::fields_to_values( $form_id, $values );
157 157
 
158 158
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/form_action.php' );
159 159
         wp_die();
160 160
     }
161 161
 
162 162
     public static function fill_action() {
163
-		FrmAppHelper::permission_check('frm_edit_forms');
163
+		FrmAppHelper::permission_check( 'frm_edit_forms' );
164 164
         check_ajax_referer( 'frm_ajax', 'nonce' );
165 165
 
166 166
         $action_key = absint( $_POST['action_id'] );
167 167
         $action_type = sanitize_text_field( $_POST['action_type'] );
168 168
 
169 169
         $action_control = self::get_form_actions( $action_type );
170
-        if ( empty($action_control) ) {
170
+        if ( empty( $action_control ) ) {
171 171
             wp_die();
172 172
         }
173 173
 
174 174
         $form_action = $action_control->get_single_action( $action_key );
175 175
 
176 176
         $values = array();
177
-        $form = self::fields_to_values($form_action->menu_order, $values);
177
+        $form = self::fields_to_values( $form_action->menu_order, $values );
178 178
 
179 179
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/_action_inside.php' );
180 180
         wp_die();
181 181
     }
182 182
 
183 183
 	private static function fields_to_values( $form_id, array &$values ) {
184
-        $form = FrmForm::getOne($form_id);
184
+        $form = FrmForm::getOne( $form_id );
185 185
 
186 186
 		$values = array( 'fields' => array(), 'id' => $form->id );
187 187
 
188
-        $fields = FrmField::get_all_for_form($form->id);
188
+        $fields = FrmField::get_all_for_form( $form->id );
189 189
         foreach ( $fields as $k => $f ) {
190 190
             $f = (array) $f;
191 191
             $opts = (array) $f['field_options'];
192
-            $f = array_merge($opts, $f);
192
+            $f = array_merge( $opts, $f );
193 193
             if ( ! isset( $f['post_field'] ) ) {
194 194
                 $f['post_field'] = '';
195 195
             }
196 196
             $values['fields'][] = $f;
197
-            unset($k, $f);
197
+            unset( $k, $f );
198 198
         }
199 199
 
200 200
         return $form;
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
         $new_actions = array();
210 210
 
211 211
         foreach ( $registered_actions as $registered_action ) {
212
-            $action_ids = $registered_action->update_callback($form_id);
212
+            $action_ids = $registered_action->update_callback( $form_id );
213 213
             if ( ! empty( $action_ids ) ) {
214 214
                 $new_actions[] = $action_ids;
215 215
             }
@@ -291,33 +291,33 @@  discard block
 block discarded – undo
291 291
             }
292 292
 
293 293
             // store actions so they can be triggered with the correct priority
294
-            $stored_actions[ $action->ID ] = $action;
295
-            $action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority'];
294
+            $stored_actions[$action->ID] = $action;
295
+            $action_priority[$action->ID] = $link_settings[$action->post_excerpt]->action_options['priority'];
296 296
 
297
-            unset($action);
297
+            unset( $action );
298 298
         }
299 299
 
300 300
         if ( ! empty( $stored_actions ) ) {
301
-            asort($action_priority);
301
+            asort( $action_priority );
302 302
 
303 303
             // make sure hooks are loaded
304 304
             new FrmNotification();
305 305
 
306 306
             foreach ( $action_priority as $action_id => $priority ) {
307
-                $action = $stored_actions[ $action_id ];
307
+                $action = $stored_actions[$action_id];
308 308
 				do_action( 'frm_trigger_' . $action->post_excerpt . '_action', $action, $entry, $form, $event );
309 309
 				do_action( 'frm_trigger_' . $action->post_excerpt . '_' . $event . '_action', $action, $entry, $form );
310 310
 
311 311
                 // If post is created, get updated $entry object
312 312
                 if ( $action->post_excerpt == 'wppost' && $event == 'create' ) {
313
-                    $entry = FrmEntry::getOne($entry->id, true);
313
+                    $entry = FrmEntry::getOne( $entry->id, true );
314 314
                 }
315 315
             }
316 316
         }
317 317
     }
318 318
 
319 319
 	public static function duplicate_form_actions( $form_id, $values, $args = array() ) {
320
-        if ( ! isset($args['old_id']) || empty($args['old_id']) ) {
320
+        if ( ! isset( $args['old_id'] ) || empty( $args['old_id'] ) ) {
321 321
             // continue if we know which actions to copy
322 322
             return;
323 323
         }
@@ -351,22 +351,22 @@  discard block
 block discarded – undo
351 351
 	}
352 352
 
353 353
 	public function register( $action_class ) {
354
-		$this->actions[ $action_class ] = new $action_class();
354
+		$this->actions[$action_class] = new $action_class();
355 355
 	}
356 356
 
357 357
 	public function unregister( $action_class ) {
358
-		if ( isset( $this->actions[ $action_class ] ) ) {
359
-			unset($this->actions[ $action_class ]);
358
+		if ( isset( $this->actions[$action_class] ) ) {
359
+			unset( $this->actions[$action_class] );
360 360
 		}
361 361
 	}
362 362
 
363 363
 	public function _register_actions() {
364
-		$keys = array_keys($this->actions);
364
+		$keys = array_keys( $this->actions );
365 365
 
366 366
 		foreach ( $keys as $key ) {
367 367
 			// don't register new action if old action with the same id is already registered
368
-			if ( ! isset( $this->actions[ $key ] ) ) {
369
-			    $this->actions[ $key ]->_register();
368
+			if ( ! isset( $this->actions[$key] ) ) {
369
+			    $this->actions[$key]->_register();
370 370
 			}
371 371
 		}
372 372
 	}
Please login to merge, or discard this patch.
formidable.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -23,41 +23,41 @@
 block discarded – undo
23 23
 
24 24
 global $frm_vars;
25 25
 $frm_vars = array(
26
-    'load_css' => false, 'forms_loaded' => array(),
27
-    'created_entries'   => array(),
28
-    'pro_is_authorized' => false,
26
+	'load_css' => false, 'forms_loaded' => array(),
27
+	'created_entries'   => array(),
28
+	'pro_is_authorized' => false,
29 29
 );
30 30
 
31 31
 function frm_forms_autoloader( $class_name ) {
32
-    // Only load Frm classes here
32
+	// Only load Frm classes here
33 33
 	if ( ! preg_match( '/^Frm.+$/', $class_name ) ) {
34
-        return;
35
-    }
34
+		return;
35
+	}
36 36
 
37
-    $filepath = dirname(__FILE__);
37
+	$filepath = dirname(__FILE__);
38 38
 	if ( preg_match( '/^FrmPro.+$/', $class_name ) || 'FrmUpdatesController' == $class_name ) {
39
-        $filepath .= '/pro';
40
-    }
41
-    $filepath .= '/classes';
39
+		$filepath .= '/pro';
40
+	}
41
+	$filepath .= '/classes';
42 42
 
43 43
 	if ( preg_match( '/^.+Helper$/', $class_name ) ) {
44
-        $filepath .= '/helpers/';
44
+		$filepath .= '/helpers/';
45 45
 	} else if ( preg_match( '/^.+Controller$/', $class_name ) ) {
46
-        $filepath .= '/controllers/';
47
-    } else {
48
-        $filepath .= '/models/';
49
-    }
46
+		$filepath .= '/controllers/';
47
+	} else {
48
+		$filepath .= '/models/';
49
+	}
50 50
 
51 51
 	$filepath .= $class_name . '.php';
52 52
 
53
-    if ( file_exists($filepath) ) {
54
-        include($filepath);
55
-    }
53
+	if ( file_exists($filepath) ) {
54
+		include($filepath);
55
+	}
56 56
 }
57 57
 
58 58
 // if __autoload is active, put it on the spl_autoload stack
59 59
 if ( is_array(spl_autoload_functions()) && in_array( '__autoload', spl_autoload_functions()) ) {
60
-    spl_autoload_register('__autoload');
60
+	spl_autoload_register('__autoload');
61 61
 }
62 62
 
63 63
 // Add the autoloader
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         return;
35 35
     }
36 36
 
37
-    $filepath = dirname(__FILE__);
37
+    $filepath = dirname( __FILE__ );
38 38
 	if ( preg_match( '/^FrmPro.+$/', $class_name ) || 'FrmUpdatesController' == $class_name ) {
39 39
         $filepath .= '/pro';
40 40
     }
@@ -50,25 +50,25 @@  discard block
 block discarded – undo
50 50
 
51 51
 	$filepath .= $class_name . '.php';
52 52
 
53
-    if ( file_exists($filepath) ) {
54
-        include($filepath);
53
+    if ( file_exists( $filepath ) ) {
54
+        include( $filepath );
55 55
     }
56 56
 }
57 57
 
58 58
 // if __autoload is active, put it on the spl_autoload stack
59
-if ( is_array(spl_autoload_functions()) && in_array( '__autoload', spl_autoload_functions()) ) {
60
-    spl_autoload_register('__autoload');
59
+if ( is_array( spl_autoload_functions() ) && in_array( '__autoload', spl_autoload_functions() ) ) {
60
+    spl_autoload_register( '__autoload' );
61 61
 }
62 62
 
63 63
 // Add the autoloader
64
-spl_autoload_register('frm_forms_autoloader');
64
+spl_autoload_register( 'frm_forms_autoloader' );
65 65
 
66
-$frm_path = dirname(__FILE__);
67
-if ( file_exists($frm_path . '/pro/formidable-pro.php') ) {
66
+$frm_path = dirname( __FILE__ );
67
+if ( file_exists( $frm_path . '/pro/formidable-pro.php' ) ) {
68 68
 	include( $frm_path . '/pro/formidable-pro.php' );
69 69
 }
70 70
 
71 71
 FrmHooksController::trigger_load_hook();
72 72
 
73 73
 include_once( $frm_path . '/deprecated.php' );
74
-unset($frm_path);
74
+unset( $frm_path );
Please login to merge, or discard this patch.
classes/views/frm-fields/radio.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@
 block discarded – undo
1 1
 <?php
2 2
 if ( ! is_array($field['options']) ) {
3
-    return;
3
+	return;
4 4
 }
5 5
 
6 6
 foreach ( $field['options'] as $opt_key => $opt ) {
7
-    $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field);
8
-    $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field);
7
+	$field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field);
8
+	$opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field);
9 9
 
10
-    // Get string for Other text field, if needed
10
+	// Get string for Other text field, if needed
11 11
 	$other_val = FrmFieldsHelper::get_other_val( compact( 'opt_key', 'field' ) );
12 12
 
13
-    $checked = ( $other_val || isset($field['value']) &&  (( ! is_array($field['value']) && $field['value'] == $field_val ) || (is_array($field['value']) && in_array($field_val, $field['value']) ) ) ) ? ' checked="checked"':'';
13
+	$checked = ( $other_val || isset($field['value']) &&  (( ! is_array($field['value']) && $field['value'] == $field_val ) || (is_array($field['value']) && in_array($field_val, $field['value']) ) ) ) ? ' checked="checked"':'';
14 14
 
15 15
 	if ( FrmFieldsHelper::is_other_opt( $opt_key ) ) {
16 16
 		include( FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-fields/other-option.php' );
17
-    } else {
17
+	} else {
18 18
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/single-option.php' );
19
-    }
19
+	}
20 20
 
21
-    unset($checked, $other_val);
21
+	unset($checked, $other_val);
22 22
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! is_array($field['options']) ) {
2
+if ( ! is_array( $field['options'] ) ) {
3 3
     return;
4 4
 }
5 5
 
6 6
 foreach ( $field['options'] as $opt_key => $opt ) {
7
-    $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field);
8
-    $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field);
7
+    $field_val = apply_filters( 'frm_field_value_saved', $opt, $opt_key, $field );
8
+    $opt = apply_filters( 'frm_field_label_seen', $opt, $opt_key, $field );
9 9
 
10 10
     // Get string for Other text field, if needed
11 11
 	$other_val = FrmFieldsHelper::get_other_val( compact( 'opt_key', 'field' ) );
12 12
 
13
-    $checked = ( $other_val || isset($field['value']) &&  (( ! is_array($field['value']) && $field['value'] == $field_val ) || (is_array($field['value']) && in_array($field_val, $field['value']) ) ) ) ? ' checked="checked"':'';
13
+    $checked = ( $other_val || isset( $field['value'] ) && ( ( ! is_array( $field['value'] ) && $field['value'] == $field_val ) || ( is_array( $field['value'] ) && in_array( $field_val, $field['value'] ) ) ) ) ? ' checked="checked"' : '';
14 14
 
15 15
 	if ( FrmFieldsHelper::is_other_opt( $opt_key ) ) {
16 16
 		include( FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-fields/other-option.php' );
@@ -18,5 +18,5 @@  discard block
 block discarded – undo
18 18
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/single-option.php' );
19 19
     }
20 20
 
21
-    unset($checked, $other_val);
21
+    unset( $checked, $other_val );
22 22
 }
Please login to merge, or discard this patch.
classes/views/frm-fields/show-build.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -3,38 +3,38 @@  discard block
 block discarded – undo
3 3
 <?php } else if ( $field['type'] == 'textarea' ) { ?>
4 4
     <textarea name="<?php echo esc_attr( $field_name ) ?>" <?php
5 5
 		echo ( FrmField::is_option_true( $field, 'size' ) ) ? esc_attr( 'style="width:'. $field['size'] . ( is_numeric( $field['size'] ) ? 'px' : '') . ';"' ) : '';
6
-    ?> rows="<?php echo esc_attr( $field['max'] ); ?>" id="<?php echo esc_attr( $html_id ) ?>" class="dyn_default_value"><?php echo FrmAppHelper::esc_textarea(force_balance_tags($field['default_value'])); ?></textarea>
6
+	?> rows="<?php echo esc_attr( $field['max'] ); ?>" id="<?php echo esc_attr( $html_id ) ?>" class="dyn_default_value"><?php echo FrmAppHelper::esc_textarea(force_balance_tags($field['default_value'])); ?></textarea>
7 7
 
8 8
 <?php
9 9
 
10 10
 } else if ( $field['type'] == 'radio' || $field['type'] == 'checkbox' ) {
11
-    $field['default_value'] = maybe_unserialize($field['default_value']);
12
-    if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) {
11
+	$field['default_value'] = maybe_unserialize($field['default_value']);
12
+	if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) {
13 13
 		do_action( 'frm_after_checkbox', array( 'field' => $field, 'field_name' => $field_name, 'type' => $field['type'] ) );
14
-    } else {
15
-        do_action('frm_add_multiple_opts_labels', $field); ?>
14
+	} else {
15
+		do_action('frm_add_multiple_opts_labels', $field); ?>
16 16
         <ul id="frm_field_<?php echo esc_attr( $field['id'] ) ?>_opts" class="frm_sortable_field_opts frm_clear<?php echo (count($field['options']) > 10) ? ' frm_field_opts_list' : ''; ?>">
17 17
 			<?php include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/radio.php' ); ?>
18 18
         </ul>
19 19
     <?php
20
-    }
20
+	}
21 21
 } else if ( $field['type'] == 'select' ) {
22
-    if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) {
22
+	if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) {
23 23
 		echo FrmFieldsHelper::dropdown_categories( array( 'name' => $field_name, 'field' => $field ) );
24
-    } else { ?>
24
+	} else { ?>
25 25
 	<select name="<?php echo esc_attr( $field_name ) . ( FrmField::is_option_true( $field, 'multiple' ) ? '[]' : '' ); ?>" <?php
26 26
 		echo FrmField::is_option_true( $field, 'size' ) ? 'class="auto_width"' : '';
27 27
 		echo FrmField::is_option_true( $field, 'multiple' ) ? ' multiple="multiple"' : ''; ?> >
28 28
 		<?php foreach ( $field['options'] as $opt_key => $opt ) {
29
-            $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field);
30
-            $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field);
29
+			$field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field);
30
+			$opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field);
31 31
 			$selected = ( $field['default_value'] == $field_val || FrmFieldsHelper::get_other_val( array( 'opt_key', 'field' ) ) ) ? ' selected="selected"' : ''; ?>
32 32
             <option value="<?php echo esc_attr( $field_val ) ?>"<?php echo $selected ?>><?php echo esc_html( $opt ) ?> </option>
33 33
         <?php } ?>
34 34
     </select>
35 35
 <?php }
36 36
 
37
-    if ( $display['default_blank'] ) { ?>
37
+	if ( $display['default_blank'] ) { ?>
38 38
         <span id="frm_clear_on_focus_<?php echo esc_attr( $field['id'] ) ?>" class="frm_clear_on_focus frm-show-click">
39 39
 		<?php FrmFieldsHelper::show_default_blank_js( $field['default_blank'] ); ?>
40 40
         </span>
@@ -50,18 +50,18 @@  discard block
 block discarded – undo
50 50
         <?php FrmFieldsHelper::show_single_option($field); ?>
51 51
         </ul>
52 52
 <?php
53
-    } ?>
53
+	} ?>
54 54
     </div>
55 55
 <?php
56 56
 } else if ( $field['type'] == 'captcha' ) {
57 57
 	if ( empty($frm_settings->pubkey) ) { ?>
58 58
     <div class="howto frm_no_captcha_text"><?php printf(__( 'Your captcha will not appear on your form until you %1$sset up%2$s the Site and Private Keys', 'formidable' ), '<a href="?page=formidable-settings">', '</a>') ?></div>
59 59
     <?php
60
-    } ?>
60
+	} ?>
61 61
 	<img src="<?php echo esc_url( FrmAppHelper::plugin_url() . '/images/recaptcha.png' ) ?>" class="recaptcha_placeholder" alt="reCaptcha"/>
62 62
     <input type="hidden" name="<?php echo esc_attr( $field_name ) ?>" value="1" />
63 63
 <?php
64 64
 } else {
65
-    do_action( 'frm_display_added_fields', $field );
65
+	do_action( 'frm_display_added_fields', $field );
66 66
 	do_action( 'frm_display_added_' . $field['type'] . '_field', $field );
67 67
 }
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,33 +1,33 @@  discard block
 block discarded – undo
1 1
 <?php if ( in_array( $display['type'], array( 'text', 'website', 'email', 'url' ) ) ) { ?>
2
-	<input type="text" name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id ) ?>" value="<?php echo esc_attr( $field['default_value'] ); ?>" <?php echo ( FrmField::is_option_true( $field, 'size' ) ) ? esc_attr( 'style="width:' . $field['size'] . ( is_numeric( $field['size'] ) ? 'px' : '') . ';"' ) : ''; ?> class="dyn_default_value" />
2
+	<input type="text" name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id ) ?>" value="<?php echo esc_attr( $field['default_value'] ); ?>" <?php echo ( FrmField::is_option_true( $field, 'size' ) ) ? esc_attr( 'style="width:' . $field['size'] . ( is_numeric( $field['size'] ) ? 'px' : '' ) . ';"' ) : ''; ?> class="dyn_default_value" />
3 3
 <?php } else if ( $field['type'] == 'textarea' ) { ?>
4 4
     <textarea name="<?php echo esc_attr( $field_name ) ?>" <?php
5 5
 		echo ( FrmField::is_option_true( $field, 'size' ) ) ? esc_attr( 'style="width:' . $field['size'] . ( is_numeric( $field['size'] ) ? 'px' : '' ) . ';"' ) : '';
6
-    ?> rows="<?php echo esc_attr( $field['max'] ); ?>" id="<?php echo esc_attr( $html_id ) ?>" class="dyn_default_value"><?php echo FrmAppHelper::esc_textarea(force_balance_tags($field['default_value'])); ?></textarea>
6
+    ?> rows="<?php echo esc_attr( $field['max'] ); ?>" id="<?php echo esc_attr( $html_id ) ?>" class="dyn_default_value"><?php echo FrmAppHelper::esc_textarea( force_balance_tags( $field['default_value'] ) ); ?></textarea>
7 7
 
8 8
 <?php
9 9
 
10 10
 } else if ( $field['type'] == 'radio' || $field['type'] == 'checkbox' ) {
11
-    $field['default_value'] = maybe_unserialize($field['default_value']);
12
-    if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) {
11
+    $field['default_value'] = maybe_unserialize( $field['default_value'] );
12
+    if ( isset( $field['post_field'] ) && $field['post_field'] == 'post_category' ) {
13 13
 		do_action( 'frm_after_checkbox', array( 'field' => $field, 'field_name' => $field_name, 'type' => $field['type'] ) );
14 14
     } else {
15
-        do_action('frm_add_multiple_opts_labels', $field); ?>
16
-        <ul id="frm_field_<?php echo esc_attr( $field['id'] ) ?>_opts" class="frm_sortable_field_opts frm_clear<?php echo (count($field['options']) > 10) ? ' frm_field_opts_list' : ''; ?>">
15
+        do_action( 'frm_add_multiple_opts_labels', $field ); ?>
16
+        <ul id="frm_field_<?php echo esc_attr( $field['id'] ) ?>_opts" class="frm_sortable_field_opts frm_clear<?php echo ( count( $field['options'] ) > 10 ) ? ' frm_field_opts_list' : ''; ?>">
17 17
 			<?php include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/radio.php' ); ?>
18 18
         </ul>
19 19
     <?php
20 20
     }
21 21
 } else if ( $field['type'] == 'select' ) {
22
-    if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) {
22
+    if ( isset( $field['post_field'] ) && $field['post_field'] == 'post_category' ) {
23 23
 		echo FrmFieldsHelper::dropdown_categories( array( 'name' => $field_name, 'field' => $field ) );
24 24
     } else { ?>
25 25
 	<select name="<?php echo esc_attr( $field_name ) . ( FrmField::is_option_true( $field, 'multiple' ) ? '[]' : '' ); ?>" <?php
26 26
 		echo FrmField::is_option_true( $field, 'size' ) ? 'class="auto_width"' : '';
27 27
 		echo FrmField::is_option_true( $field, 'multiple' ) ? ' multiple="multiple"' : ''; ?> >
28 28
 		<?php foreach ( $field['options'] as $opt_key => $opt ) {
29
-            $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field);
30
-            $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field);
29
+            $field_val = apply_filters( 'frm_field_value_saved', $opt, $opt_key, $field );
30
+            $opt = apply_filters( 'frm_field_label_seen', $opt, $opt_key, $field );
31 31
 			$selected = ( $field['default_value'] == $field_val || FrmFieldsHelper::get_other_val( array( 'opt_key', 'field' ) ) ) ? ' selected="selected"' : ''; ?>
32 32
             <option value="<?php echo esc_attr( $field_val ) ?>"<?php echo $selected ?>><?php echo esc_html( $opt ) ?> </option>
33 33
         <?php } ?>
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
     <?php
46 46
 
47 47
 	if ( ! isset( $field['post_field'] ) || ! in_array( $field['post_field'], array( 'post_category' ) ) ) { ?>
48
-        <?php do_action('frm_add_multiple_opts_labels', $field); ?>
49
-        <ul id="frm_field_<?php echo esc_attr( $field['id'] ) ?>_opts" class="frm_sortable_field_opts<?php echo ( count($field['options']) > 10 ) ? ' frm_field_opts_list' : ''; ?>">
50
-        <?php FrmFieldsHelper::show_single_option($field); ?>
48
+        <?php do_action( 'frm_add_multiple_opts_labels', $field ); ?>
49
+        <ul id="frm_field_<?php echo esc_attr( $field['id'] ) ?>_opts" class="frm_sortable_field_opts<?php echo ( count( $field['options'] ) > 10 ) ? ' frm_field_opts_list' : ''; ?>">
50
+        <?php FrmFieldsHelper::show_single_option( $field ); ?>
51 51
         </ul>
52 52
 <?php
53 53
     } ?>
54 54
     </div>
55 55
 <?php
56 56
 } else if ( $field['type'] == 'captcha' ) {
57
-	if ( empty($frm_settings->pubkey) ) { ?>
58
-    <div class="howto frm_no_captcha_text"><?php printf(__( 'Your captcha will not appear on your form until you %1$sset up%2$s the Site and Private Keys', 'formidable' ), '<a href="?page=formidable-settings">', '</a>') ?></div>
57
+	if ( empty( $frm_settings->pubkey ) ) { ?>
58
+    <div class="howto frm_no_captcha_text"><?php printf( __( 'Your captcha will not appear on your form until you %1$sset up%2$s the Site and Private Keys', 'formidable' ), '<a href="?page=formidable-settings">', '</a>' ) ?></div>
59 59
     <?php
60 60
     } ?>
61 61
 	<img src="<?php echo esc_url( FrmAppHelper::plugin_url() . '/images/recaptcha.png' ) ?>" class="recaptcha_placeholder" alt="reCaptcha"/>
Please login to merge, or discard this patch.
classes/views/frm-fields/import_choices.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@  discard block
 block discarded – undo
4 4
     <meta charset="<?php bloginfo( 'charset' ); ?>" />
5 5
     <title><?php bloginfo('name'); ?></title>
6 6
     <?php
7
-    wp_admin_css( 'global' );
8
-    wp_admin_css();
9
-    wp_admin_css( 'colors' );
10
-    wp_admin_css( 'ie' );
7
+	wp_admin_css( 'global' );
8
+	wp_admin_css();
9
+	wp_admin_css( 'colors' );
10
+	wp_admin_css( 'ie' );
11 11
 	if ( is_multisite() ) {
12
-    	wp_admin_css( 'ms' );
12
+		wp_admin_css( 'ms' );
13 13
 	}
14 14
 
15
-    do_action('admin_print_styles');
16
-    do_action('admin_print_scripts');
15
+	do_action('admin_print_styles');
16
+	do_action('admin_print_scripts');
17 17
 
18
-    ?>
18
+	?>
19 19
 </head>
20 20
 <body class="wp-admin no-js wp-core-ui frm_field_opts_popup <?php echo esc_attr( apply_filters( 'admin_body_class', '' ) . ' ' . $admin_body_class ); ?>">
21 21
 <div class="frm_med_padding">
@@ -29,21 +29,21 @@  discard block
 block discarded – undo
29 29
 <?php
30 30
 $other_array = array();
31 31
 foreach ( $field->options as $fkey => $fopt ) {
32
-    //If it is an other option, don't include it
33
-    if ( $fkey && strpos( $fkey, 'other') !== false ) {
34
-        continue;
35
-    }
32
+	//If it is an other option, don't include it
33
+	if ( $fkey && strpos( $fkey, 'other') !== false ) {
34
+		continue;
35
+	}
36 36
 	if ( is_array( $fopt ) ) {
37
-        $label = (isset($fopt['label'])) ? $fopt['label'] : reset($fopt);
38
-        $value = (isset($fopt['value'])) ? $fopt['value'] : $label;
37
+		$label = (isset($fopt['label'])) ? $fopt['label'] : reset($fopt);
38
+		$value = (isset($fopt['value'])) ? $fopt['value'] : $label;
39 39
 		if ( $label != $value && FrmField::is_option_true( $field, 'separate_value' ) ) {
40
-            echo "$label|$value\n";
40
+			echo "$label|$value\n";
41 41
 		} else {
42 42
 			echo $label . "\n";
43
-        }
43
+		}
44 44
 	} else {
45 45
 		echo $fopt . "\n";
46
-    }
46
+	}
47 47
 } ?>
48 48
 </textarea>
49 49
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 <html <?php language_attributes(); ?>>
3 3
 <head>
4 4
     <meta charset="<?php bloginfo( 'charset' ); ?>" />
5
-    <title><?php bloginfo('name'); ?></title>
5
+    <title><?php bloginfo( 'name' ); ?></title>
6 6
     <?php
7 7
     wp_admin_css( 'global' );
8 8
     wp_admin_css();
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
     	wp_admin_css( 'ms' );
13 13
 	}
14 14
 
15
-    do_action('admin_print_styles');
16
-    do_action('admin_print_scripts');
15
+    do_action( 'admin_print_styles' );
16
+    do_action( 'admin_print_scripts' );
17 17
 
18 18
     ?>
19 19
 </head>
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 <p class="howto"><?php _e( 'Edit or add field options (one per line)', 'formidable' ) ?></p>
23 23
 <ul class="frm_prepop">
24 24
 	<?php foreach ( $prepop as $label => $pop ) { ?>
25
-    <li><a href="javascript:void(0)" onclick='frmPrePop(<?php echo str_replace("'", '&#145;', json_encode($pop)) ?>); return false;'><?php echo esc_html( $label ) ?></a></li>
25
+    <li><a href="javascript:void(0)" onclick='frmPrePop(<?php echo str_replace( "'", '&#145;', json_encode( $pop ) ) ?>); return false;'><?php echo esc_html( $label ) ?></a></li>
26 26
     <?php } ?>
27 27
 </ul>
28 28
 <textarea name="frm_bulk_options" id="frm_bulk_options">
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
 $other_array = array();
31 31
 foreach ( $field->options as $fkey => $fopt ) {
32 32
     //If it is an other option, don't include it
33
-    if ( $fkey && strpos( $fkey, 'other') !== false ) {
33
+    if ( $fkey && strpos( $fkey, 'other' ) !== false ) {
34 34
         continue;
35 35
     }
36 36
 	if ( is_array( $fopt ) ) {
37
-        $label = (isset($fopt['label'])) ? $fopt['label'] : reset($fopt);
38
-        $value = (isset($fopt['value'])) ? $fopt['value'] : $label;
37
+        $label = ( isset( $fopt['label'] ) ) ? $fopt['label'] : reset( $fopt );
38
+        $value = ( isset( $fopt['value'] ) ) ? $fopt['value'] : $label;
39 39
 		if ( $label != $value && FrmField::is_option_true( $field, 'separate_value' ) ) {
40 40
             echo "$label|$value\n";
41 41
 		} else {
Please login to merge, or discard this patch.
classes/views/shared/mb_adv_info.php 2 patches
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -42,51 +42,51 @@  discard block
 block discarded – undo
42 42
 
43 43
 				if ( $f->type == 'data' ) {
44 44
 					//get all fields from linked form
45
-                    if ( isset($f->field_options['form_select']) && is_numeric($f->field_options['form_select']) ) {
45
+					if ( isset($f->field_options['form_select']) && is_numeric($f->field_options['form_select']) ) {
46 46
 						$linked_form = FrmDb::get_var( $wpdb->prefix . 'frm_fields', array( 'id' => $f->field_options['form_select'] ), 'form_id' );
47
-                        if ( ! in_array( $linked_form, $linked_forms ) ) {
48
-                            $linked_forms[] = $linked_form;
47
+						if ( ! in_array( $linked_form, $linked_forms ) ) {
48
+							$linked_forms[] = $linked_form;
49 49
 							$linked_fields = FrmField::getAll( array( 'fi.type not' => FrmField::no_save_fields(), 'fi.form_id' => $linked_form ) );
50
-                            $ldfe = '';
50
+							$ldfe = '';
51 51
 							if ( $linked_fields ) {
52 52
 								foreach ( $linked_fields as $linked_field ) {
53
-                                    FrmAppHelper::insert_opt_html( array( 'id' => $f->id . ' show=' . $linked_field->id, 'key' => $f->field_key . ' show=' . $linked_field->field_key, 'name' => $linked_field->name, 'type' => $linked_field->type ) );
54
-
55
-                                    $ldfe = $linked_field->id;
56
-                                    unset($linked_field);
57
-                                }
58
-                            }
59
-                        }
60
-                    }
61
-                    $dfe = $f->id;
62
-        	    }
63
-                unset($f);
64
-                }
65
-            } ?>
53
+									FrmAppHelper::insert_opt_html( array( 'id' => $f->id . ' show=' . $linked_field->id, 'key' => $f->field_key . ' show=' . $linked_field->field_key, 'name' => $linked_field->name, 'type' => $linked_field->type ) );
54
+
55
+									$ldfe = $linked_field->id;
56
+									unset($linked_field);
57
+								}
58
+							}
59
+						}
60
+					}
61
+					$dfe = $f->id;
62
+				}
63
+				unset($f);
64
+				}
65
+			} ?>
66 66
         </ul>
67 67
 
68 68
         <?php _e( 'Helpers', 'formidable' ) ?>:
69 69
         <ul class="frm_code_list">
70 70
         <?php
71
-        $col = 'one';
71
+		$col = 'one';
72 72
 		foreach ( $entry_shortcodes as $skey => $sname ) {
73 73
 			if ( empty( $skey ) ) {
74
-                 $col = 'one';
75
-                 echo '<li class="clear frm_block"></li>';
76
-                 continue;
77
-            }
78
-        ?>
74
+				 $col = 'one';
75
+				 echo '<li class="clear frm_block"></li>';
76
+				 continue;
77
+			}
78
+		?>
79 79
         <li class="frm_col_<?php echo esc_attr( $col ) ?>">
80 80
             <a href="javascript:void(0)" class="frmbutton button <?php
81 81
 			echo ( in_array( $skey, array( 'siteurl', 'sitename', 'entry_count' ) ) ) ? 'show_before_content show_after_content' : '';
82
-            echo ( strpos( $skey, 'default-' ) === 0 ) ? 'hide_frm_not_email_subject' : '';
83
-            ?> frm_insert_code" data-code="<?php echo esc_attr( $skey ) ?>"><?php echo esc_html( $sname ) ?></a>
82
+			echo ( strpos( $skey, 'default-' ) === 0 ) ? 'hide_frm_not_email_subject' : '';
83
+			?> frm_insert_code" data-code="<?php echo esc_attr( $skey ) ?>"><?php echo esc_html( $sname ) ?></a>
84 84
         </li>
85 85
         <?php
86
-            $col = ( $col == 'one' ) ? 'two' : 'one';
87
-            unset($skey, $sname);
88
-        }
89
-        ?>
86
+			$col = ( $col == 'one' ) ? 'two' : 'one';
87
+			unset($skey, $sname);
88
+		}
89
+		?>
90 90
         </ul>
91 91
 	</div>
92 92
 
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
 	    <ul class="alignleft"><li><?php _e( 'Fields from your form', 'formidable' ) ?>:</li></ul>
100 100
 	    <ul class="frm_code_list frm_full_width">
101 101
 		    <?php if ( ! empty( $fields ) ) {
102
-		        foreach ( $fields as $f ) {
102
+				foreach ( $fields as $f ) {
103 103
 					if ( FrmField::is_no_save_field( $f->type ) || ( $f->type == 'data' && ( ! isset( $f->field_options['data_type'] ) || $f->field_options['data_type'] == 'data' || $f->field_options['data_type'] == '' ) ) ) {
104
-                        continue;
105
-                }
106
-            ?>
104
+						continue;
105
+				}
106
+			?>
107 107
                 <li>
108 108
                     <a href="javascript:void(0)" class="frmids alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->id ) ?>]<?php esc_attr_e( 'Conditional text here', 'formidable' ) ?>[/if <?php echo esc_attr( $f->id ) ?>">[if <?php echo (int) $f->id ?>]</a>
109 109
                 	<a href="javascript:void(0)" class="frmkeys alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->field_key ) ?>]something[/if <?php echo esc_attr( $f->field_key ) ?>">[if <?php echo FrmAppHelper::truncate($f->field_key, 10) ?>]</a>
@@ -111,30 +111,30 @@  discard block
 block discarded – undo
111 111
                 </li>
112 112
                 <?php
113 113
 
114
-                    if ( $f->type == 'user_id' ) {
115
-                        $uid = $f;
116
-                    } else if ( $f->type == 'file' ) {
117
-                        $file = $f;
118
-                    }
119
-        		    unset($f);
120
-		        }
121
-		    } ?>
114
+					if ( $f->type == 'user_id' ) {
115
+						$uid = $f;
116
+					} else if ( $f->type == 'file' ) {
117
+						$file = $f;
118
+					}
119
+					unset($f);
120
+				}
121
+			} ?>
122 122
         </ul>
123 123
 
124 124
         <p class="howto"><?php _e( 'Click a button below to insert sample logic into your view', 'formidable' ) ?></p>
125 125
         <ul class="frm_code_list">
126 126
         <?php
127
-        $col = 'one';
127
+		$col = 'one';
128 128
 		foreach ( $cond_shortcodes as $skey => $sname ) {
129
-	    ?>
129
+		?>
130 130
 	    <li class="frm_col_<?php echo esc_attr( $col ) ?>">
131 131
 	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="if x <?php echo esc_attr($skey) ?>][/if x"><?php echo esc_html( $sname ) ?></a>
132 132
 	    </li>
133 133
 	    <?php
134
-	        $col = ( $col == 'one' ) ? 'two' : 'one';
135
-	        unset($skey, $sname);
136
-	    }
137
-        ?>
134
+			$col = ( $col == 'one' ) ? 'two' : 'one';
135
+			unset($skey, $sname);
136
+		}
137
+		?>
138 138
         </ul>
139 139
 	</div>
140 140
 	<?php } ?>
@@ -142,19 +142,19 @@  discard block
 block discarded – undo
142 142
 	<div id="frm-adv-info-tab" class="tabs-panel">
143 143
 		<ul class="frm_code_list">
144 144
         <?php
145
-        $col = 'one';
145
+		$col = 'one';
146 146
 		foreach ( $adv_shortcodes as $skey => $sname ) {
147
-	    ?>
147
+		?>
148 148
 	    <li class="frm_col_<?php echo esc_attr( $col ) ?>">
149 149
 			<a href="javascript:void(0)" class="frmbutton button frm_insert_code <?php echo is_array( $sname ) ? 'frm_help' : ''; ?>" data-code="x <?php echo esc_attr( $skey ) ?>" <?php echo is_array( $sname ) ? 'title="' . esc_attr( $sname['title'] ) . '"' : ''; ?>>
150 150
 				<?php echo is_array( $sname ) ? $sname['label'] : $sname; ?>
151 151
 			</a>
152 152
 	    </li>
153 153
 	    <?php
154
-	        $col = ($col == 'one') ? 'two' : 'one';
155
-	        unset($skey, $sname);
156
-	    }
157
-        ?>
154
+			$col = ($col == 'one') ? 'two' : 'one';
155
+			unset($skey, $sname);
156
+		}
157
+		?>
158 158
         <?php if ( isset($file) ) { ?>
159 159
         <li class="frm_col_<?php echo esc_attr( $col ) ?>">
160 160
 	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show_image=1"><?php _e( 'Show image', 'formidable' ) ?></a>
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
         <div class="clear"></div>
172 172
         <?php
173 173
 
174
-        if ( isset($uid) && ! empty($user_fields) ) {
175
-            $col = 'one'; ?>
174
+		if ( isset($uid) && ! empty($user_fields) ) {
175
+			$col = 'one'; ?>
176 176
         <p class="howto"><?php _e( 'Insert user information', 'formidable' ) ?></p>
177 177
         <ul class="frm_code_list">
178 178
         <?php foreach ( $user_fields as $uk => $uf ) { ?>
@@ -180,14 +180,14 @@  discard block
 block discarded – undo
180 180
 				<a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $uid->id . ' show="' . $uk . '"' ) ?>"><?php echo esc_html( $uf ) ?></a>
181 181
     	    </li>
182 182
         <?php
183
-            $col = ($col == 'one') ? 'two' : 'one';
184
-            unset($uf, $uk);
185
-        }
186
-        unset($uid); ?>
183
+			$col = ($col == 'one') ? 'two' : 'one';
184
+			unset($uf, $uk);
185
+		}
186
+		unset($uid); ?>
187 187
         </ul>
188 188
         <?php }
189 189
 
190
-        if ( isset($repeat_field) ) { ?>
190
+		if ( isset($repeat_field) ) { ?>
191 191
         <div class="clear"></div>
192 192
         <p class="howto"><?php _e( 'Repeating field options', 'formidable' ) ?></p>
193 193
             <ul class="frm_code_list">
@@ -196,9 +196,9 @@  discard block
 block discarded – undo
196 196
         	    </li>
197 197
             </ul>
198 198
         <?php
199
-        }
199
+		}
200 200
 
201
-        if ( isset($dfe) ) { ?>
201
+		if ( isset($dfe) ) { ?>
202 202
 
203 203
         <div class="clear"></div>
204 204
         <p class="howto"><?php _e( 'Dynamic field options', 'formidable' ) ?></p>
@@ -217,8 +217,8 @@  discard block
 block discarded – undo
217 217
 	</div>
218 218
 
219 219
     <?php
220
-    if ( $settings_tab ) {
220
+	if ( $settings_tab ) {
221 221
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-forms/mb_html_tab.php' );
222
-    }
223
-    ?>
222
+	}
223
+	?>
224 224
 </div>
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 				if ( $f->type == 'data' ) {
44 44
 					//get all fields from linked form
45
-                    if ( isset($f->field_options['form_select']) && is_numeric($f->field_options['form_select']) ) {
45
+                    if ( isset( $f->field_options['form_select'] ) && is_numeric( $f->field_options['form_select'] ) ) {
46 46
 						$linked_form = FrmDb::get_var( $wpdb->prefix . 'frm_fields', array( 'id' => $f->field_options['form_select'] ), 'form_id' );
47 47
                         if ( ! in_array( $linked_form, $linked_forms ) ) {
48 48
                             $linked_forms[] = $linked_form;
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
                                     FrmAppHelper::insert_opt_html( array( 'id' => $f->id . ' show=' . $linked_field->id, 'key' => $f->field_key . ' show=' . $linked_field->field_key, 'name' => $linked_field->name, 'type' => $linked_field->type ) );
54 54
 
55 55
                                     $ldfe = $linked_field->id;
56
-                                    unset($linked_field);
56
+                                    unset( $linked_field );
57 57
                                 }
58 58
                             }
59 59
                         }
60 60
                     }
61 61
                     $dfe = $f->id;
62 62
         	    }
63
-                unset($f);
63
+                unset( $f );
64 64
                 }
65 65
             } ?>
66 66
         </ul>
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         </li>
85 85
         <?php
86 86
             $col = ( $col == 'one' ) ? 'two' : 'one';
87
-            unset($skey, $sname);
87
+            unset( $skey, $sname );
88 88
         }
89 89
         ?>
90 90
         </ul>
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
             ?>
107 107
                 <li>
108 108
                     <a href="javascript:void(0)" class="frmids alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->id ) ?>]<?php esc_attr_e( 'Conditional text here', 'formidable' ) ?>[/if <?php echo esc_attr( $f->id ) ?>">[if <?php echo (int) $f->id ?>]</a>
109
-                	<a href="javascript:void(0)" class="frmkeys alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->field_key ) ?>]something[/if <?php echo esc_attr( $f->field_key ) ?>">[if <?php echo FrmAppHelper::truncate($f->field_key, 10) ?>]</a>
110
-                	<a href="javascript:void(0)" class="frm_insert_code" data-code="<?php echo esc_attr($f->id) ?>"><?php echo FrmAppHelper::truncate($f->name, 60) ?></a>
109
+                	<a href="javascript:void(0)" class="frmkeys alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->field_key ) ?>]something[/if <?php echo esc_attr( $f->field_key ) ?>">[if <?php echo FrmAppHelper::truncate( $f->field_key, 10 ) ?>]</a>
110
+                	<a href="javascript:void(0)" class="frm_insert_code" data-code="<?php echo esc_attr( $f->id ) ?>"><?php echo FrmAppHelper::truncate( $f->name, 60 ) ?></a>
111 111
                 </li>
112 112
                 <?php
113 113
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
                     } else if ( $f->type == 'file' ) {
117 117
                         $file = $f;
118 118
                     }
119
-        		    unset($f);
119
+        		    unset( $f );
120 120
 		        }
121 121
 		    } ?>
122 122
         </ul>
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
 		foreach ( $cond_shortcodes as $skey => $sname ) {
129 129
 	    ?>
130 130
 	    <li class="frm_col_<?php echo esc_attr( $col ) ?>">
131
-	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="if x <?php echo esc_attr($skey) ?>][/if x"><?php echo esc_html( $sname ) ?></a>
131
+	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="if x <?php echo esc_attr( $skey ) ?>][/if x"><?php echo esc_html( $sname ) ?></a>
132 132
 	    </li>
133 133
 	    <?php
134 134
 	        $col = ( $col == 'one' ) ? 'two' : 'one';
135
-	        unset($skey, $sname);
135
+	        unset( $skey, $sname );
136 136
 	    }
137 137
         ?>
138 138
         </ul>
@@ -151,19 +151,19 @@  discard block
 block discarded – undo
151 151
 			</a>
152 152
 	    </li>
153 153
 	    <?php
154
-	        $col = ($col == 'one') ? 'two' : 'one';
155
-	        unset($skey, $sname);
154
+	        $col = ( $col == 'one' ) ? 'two' : 'one';
155
+	        unset( $skey, $sname );
156 156
 	    }
157 157
         ?>
158
-        <?php if ( isset($file) ) { ?>
158
+        <?php if ( isset( $file ) ) { ?>
159 159
         <li class="frm_col_<?php echo esc_attr( $col ) ?>">
160
-	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show_image=1"><?php _e( 'Show image', 'formidable' ) ?></a>
160
+	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $file->id ) ?> show_image=1"><?php _e( 'Show image', 'formidable' ) ?></a>
161 161
 	    </li>
162
-	    <li class="frm_col_<?php echo $col = (($col == 'one') ? 'two' : 'one') ?>">
163
-	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show=id"><?php _e( 'Image ID', 'formidable' ) ?></a>
162
+	    <li class="frm_col_<?php echo $col = ( ( $col == 'one' ) ? 'two' : 'one' ) ?>">
163
+	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $file->id ) ?> show=id"><?php _e( 'Image ID', 'formidable' ) ?></a>
164 164
 	    </li>
165
-	    <li class="frm_col_<?php echo $col = (($col == 'one') ? 'two' : 'one') ?>">
166
-	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show_filename=1"><?php _e( 'Image Name', 'formidable' ) ?></a>
165
+	    <li class="frm_col_<?php echo $col = ( ( $col == 'one' ) ? 'two' : 'one' ) ?>">
166
+	        <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $file->id ) ?> show_filename=1"><?php _e( 'Image Name', 'formidable' ) ?></a>
167 167
 	    </li>
168 168
 	    <?php } ?>
169 169
         </ul>
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         <div class="clear"></div>
172 172
         <?php
173 173
 
174
-        if ( isset($uid) && ! empty($user_fields) ) {
174
+        if ( isset( $uid ) && ! empty( $user_fields ) ) {
175 175
             $col = 'one'; ?>
176 176
         <p class="howto"><?php _e( 'Insert user information', 'formidable' ) ?></p>
177 177
         <ul class="frm_code_list">
@@ -180,14 +180,14 @@  discard block
 block discarded – undo
180 180
 				<a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $uid->id . ' show="' . $uk . '"' ) ?>"><?php echo esc_html( $uf ) ?></a>
181 181
     	    </li>
182 182
         <?php
183
-            $col = ($col == 'one') ? 'two' : 'one';
184
-            unset($uf, $uk);
183
+            $col = ( $col == 'one' ) ? 'two' : 'one';
184
+            unset( $uf, $uk );
185 185
         }
186
-        unset($uid); ?>
186
+        unset( $uid ); ?>
187 187
         </ul>
188 188
         <?php }
189 189
 
190
-        if ( isset($repeat_field) ) { ?>
190
+        if ( isset( $repeat_field ) ) { ?>
191 191
         <div class="clear"></div>
192 192
         <p class="howto"><?php _e( 'Repeating field options', 'formidable' ) ?></p>
193 193
             <ul class="frm_code_list">
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         <?php
199 199
         }
200 200
 
201
-        if ( isset($dfe) ) { ?>
201
+        if ( isset( $dfe ) ) { ?>
202 202
 
203 203
         <div class="clear"></div>
204 204
         <p class="howto"><?php _e( 'Dynamic field options', 'formidable' ) ?></p>
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
         	    <li class="frm_col_one">
207 207
 					<a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $dfe . ' show="created-at"' ) ?>"><?php _e( 'Creation Date', 'formidable' ) ?></a>
208 208
         	    </li>
209
-        	    <?php if ( isset($ldfe) ) { ?>
209
+        	    <?php if ( isset( $ldfe ) ) { ?>
210 210
         	    <li class="frm_col_two">
211 211
 					<a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $dfe . ' show="' . $ldfe . '"' ) ?>"><?php _e( 'Field From Entry', 'formidable' ) ?></a>
212 212
         	    </li>
Please login to merge, or discard this patch.
classes/views/frm-entries/no_entries.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <div class="frmcenter frm_no_entries_form">
2 2
 <?php
3
-if ( $form && isset($form->options['no_save']) && $form->options['no_save'] ) { ?>
3
+if ( $form && isset( $form->options['no_save'] ) && $form->options['no_save'] ) { ?>
4 4
 <h3><?php _e( 'This form is not set to save any entries.', 'formidable' ) ?></h3>
5 5
 <p>If you would like entries in this form to be saved, go to the <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable' ) . '&frm_action=settings&id=' . $form->id ) ?>">form Settings</a> page and uncheck the "Do not store any entries submitted from this form" box.</p>
6 6
 <?php
7 7
 } else if ( $form ) {
8 8
 ?>
9
-<div class="frm_no_entries_header"><?php printf(__( 'No Entries for form: %s', 'formidable' ), $form->name); ?></div>
10
-<p class="frm_no_entries_text"><?php printf( __( 'For instructions on publishing your form see %1$sthis page%2$s <br/> or click "%3$sAdd New%4$s" above to add an entry from here (Requires License)', 'formidable' ), '<a href="https://formidablepro.com/knowledgebase/publish-your-forms/" target="_blank">', '</a>', '<a href="' . esc_url( admin_url('admin.php?page=formidable-entries&frm_action=new&form=' . $form->id ) ) . '">', '</a>' ); ?></p>
9
+<div class="frm_no_entries_header"><?php printf( __( 'No Entries for form: %s', 'formidable' ), $form->name ); ?></div>
10
+<p class="frm_no_entries_text"><?php printf( __( 'For instructions on publishing your form see %1$sthis page%2$s <br/> or click "%3$sAdd New%4$s" above to add an entry from here (Requires License)', 'formidable' ), '<a href="https://formidablepro.com/knowledgebase/publish-your-forms/" target="_blank">', '</a>', '<a href="' . esc_url( admin_url( 'admin.php?page=formidable-entries&frm_action=new&form=' . $form->id ) ) . '">', '</a>' ); ?></p>
11 11
 <?php
12 12
 } else {
13 13
 ?>
Please login to merge, or discard this patch.