Completed
Branch uploads (d47ab8)
by Stephanie
05:54 queued 01:03
created
classes/models/FrmEntryMeta.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -61,6 +61,9 @@  discard block
 block discarded – undo
61 61
         return $wpdb->update( $wpdb->prefix .'frm_item_metas', array( 'meta_value' => $meta_value ), $where_values );
62 62
     }
63 63
 
64
+	/**
65
+	 * @param integer $entry_id
66
+	 */
64 67
 	public static function update_entry_metas( $entry_id, $values ) {
65 68
         global $wpdb;
66 69
 
@@ -286,6 +289,7 @@  discard block
 block discarded – undo
286 289
      * @param string|array $where
287 290
      * @param string $order_by
288 291
      * @param string $limit
292
+     * @param boolean $unique
289 293
      */
290 294
 	private static function get_ids_query( $where, $order_by, $limit, $unique, $args, array &$query ) {
291 295
         global $wpdb;
Please login to merge, or discard this patch.
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined('ABSPATH') ) {
2
+if ( ! defined( 'ABSPATH' ) ) {
3 3
 	die( 'You are not allowed to call this page directly.' );
4 4
 }
5 5
 
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
 			'meta_value'    => is_array( $meta_value ) ? serialize( array_filter( $meta_value, 'FrmAppHelper::is_not_empty_value' ) ) : trim( $meta_value ),
21 21
             'item_id'       => $entry_id,
22 22
             'field_id'      => $field_id,
23
-            'created_at'    => current_time('mysql', 1),
23
+            'created_at'    => current_time( 'mysql', 1 ),
24 24
         );
25 25
 
26
-        $new_values = apply_filters('frm_add_entry_meta', $new_values);
26
+        $new_values = apply_filters( 'frm_add_entry_meta', $new_values );
27 27
 
28 28
 		$query_results = $wpdb->insert( $wpdb->prefix . 'frm_item_metas', $new_values );
29 29
 
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
 
50 50
         $values = $where_values = array( 'item_id' => $entry_id, 'field_id' => $field_id );
51 51
         $values['meta_value'] = $meta_value;
52
-        $values = apply_filters('frm_update_entry_meta', $values);
53
-		if ( is_array($values['meta_value']) ) {
52
+        $values = apply_filters( 'frm_update_entry_meta', $values );
53
+		if ( is_array( $values['meta_value'] ) ) {
54 54
 			$values['meta_value'] = array_filter( $values['meta_value'], 'FrmAppHelper::is_not_empty_value' );
55 55
 		}
56
-        $meta_value = maybe_serialize($values['meta_value']);
56
+        $meta_value = maybe_serialize( $values['meta_value'] );
57 57
 
58
-        wp_cache_delete( $entry_id, 'frm_entry');
58
+        wp_cache_delete( $entry_id, 'frm_entry' );
59 59
 		self::clear_cache();
60 60
 
61 61
 		return $wpdb->update( $wpdb->prefix . 'frm_item_metas', array( 'meta_value' => $meta_value ), $where_values );
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
             // set the value for the file upload field and add new tags (in Pro version)
71 71
 			$meta_value = apply_filters( 'frm_prepare_data_before_db', $meta_value, $field_id, $entry_id );
72 72
 
73
-			if ( $prev_values && in_array($field_id, $prev_values) ) {
73
+			if ( $prev_values && in_array( $field_id, $prev_values ) ) {
74 74
 
75 75
 				if ( ( is_array( $meta_value ) && empty( $meta_value ) ) || ( ! is_array( $meta_value ) && trim( $meta_value ) == '' ) ) {
76 76
 					// remove blank fields
77
-					unset( $values[ $field_id ] );
77
+					unset( $values[$field_id] );
78 78
 				} else {
79 79
 					// if value exists, then update it
80 80
 					self::update_entry_meta( $entry_id, $field_id, '', $meta_value );
@@ -85,13 +85,13 @@  discard block
 block discarded – undo
85 85
 			}
86 86
 		}
87 87
 
88
-        if ( empty($prev_values) ) {
88
+        if ( empty( $prev_values ) ) {
89 89
             return;
90 90
         }
91 91
 
92
-        $prev_values = array_diff($prev_values, array_keys($values));
92
+        $prev_values = array_diff( $prev_values, array_keys( $values ) );
93 93
 
94
-        if ( empty($prev_values) ) {
94
+        if ( empty( $prev_values ) ) {
95 95
             return;
96 96
         }
97 97
 
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
     }
106 106
 
107 107
 	public static function duplicate_entry_metas( $old_id, $new_id ) {
108
-        $metas = self::get_entry_meta_info($old_id);
108
+        $metas = self::get_entry_meta_info( $old_id );
109 109
         foreach ( $metas as $meta ) {
110
-            self::add_entry_meta($new_id, $meta->field_id, null, $meta->meta_value);
111
-            unset($meta);
110
+            self::add_entry_meta( $new_id, $meta->field_id, null, $meta->meta_value );
111
+            unset( $meta );
112 112
         }
113 113
 		self::clear_cache();
114 114
     }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	public static function delete_entry_meta( $entry_id, $field_id ) {
117 117
         global $wpdb;
118 118
 		self::clear_cache();
119
-        return $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->prefix}frm_item_metas WHERE field_id=%d AND item_id=%d", $field_id, $entry_id));
119
+        return $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}frm_item_metas WHERE field_id=%d AND item_id=%d", $field_id, $entry_id ) );
120 120
     }
121 121
 
122 122
 	/**
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	 */
136 136
 	public static function get_meta_value( $entry, $field_id ) {
137 137
 		if ( isset( $entry->metas ) ) {
138
-			return isset( $entry->metas[ $field_id ] ) ? $entry->metas[ $field_id ] : false;
138
+			return isset( $entry->metas[$field_id] ) ? $entry->metas[$field_id] : false;
139 139
 		} else {
140 140
 			return self::get_entry_meta_by_field( $entry->id, $field_id );
141 141
 		}
@@ -153,14 +153,14 @@  discard block
 block discarded – undo
153 153
 			$cached = FrmAppHelper::check_cache( $entry_id, 'frm_entry' );
154 154
 		}
155 155
 
156
-		if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) {
157
-			$result = $cached->metas[ $field_id ];
158
-            return stripslashes_deep($result);
156
+		if ( $cached && isset( $cached->metas ) && isset( $cached->metas[$field_id] ) ) {
157
+			$result = $cached->metas[$field_id];
158
+            return stripslashes_deep( $result );
159 159
         }
160 160
 
161 161
 		$get_table = $wpdb->prefix . 'frm_item_metas';
162 162
 		$query = array( 'item_id' => $entry_id );
163
-        if ( is_numeric($field_id) ) {
163
+        if ( is_numeric( $field_id ) ) {
164 164
 			$query['field_id'] = $field_id;
165 165
         } else {
166 166
 			$get_table .= ' it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id';
@@ -168,14 +168,14 @@  discard block
 block discarded – undo
168 168
         }
169 169
 
170 170
 		$result = FrmDb::get_var( $get_table, $query, 'meta_value' );
171
-        $result = maybe_unserialize($result);
172
-        $result = stripslashes_deep($result);
171
+        $result = maybe_unserialize( $result );
172
+        $result = stripslashes_deep( $result );
173 173
 
174 174
         return $result;
175 175
     }
176 176
 
177 177
 	public static function get_entry_metas( $entry_id ) {
178
-        _deprecated_function( __FUNCTION__, '1.07.10');
178
+        _deprecated_function( __FUNCTION__, '1.07.10' );
179 179
 
180 180
         global $wpdb;
181 181
 		return FrmDb::get_col( $wpdb->prefix . 'frm_item_metas', array( 'item_id' => $entry_id ), 'meta_value' );
@@ -186,22 +186,22 @@  discard block
 block discarded – undo
186 186
         $args = wp_parse_args( $args, $defaults );
187 187
 
188 188
         $query = array();
189
-        self::meta_field_query($field_id, $order, $limit, $args, $query);
190
-        $query = implode(' ', $query);
189
+        self::meta_field_query( $field_id, $order, $limit, $args, $query );
190
+        $query = implode( ' ', $query );
191 191
 
192 192
 		$cache_key = 'entry_metas_for_field_' . $field_id . $order . $limit . maybe_serialize( $args );
193
-        $values = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, 'get_col');
193
+        $values = FrmAppHelper::check_cache( $cache_key, 'frm_entry', $query, 'get_col' );
194 194
 
195 195
         if ( ! $args['stripslashes'] ) {
196 196
             return $values;
197 197
         }
198 198
 
199 199
 		foreach ( $values as $k => $v ) {
200
-			$values[ $k ] = maybe_unserialize( $v );
201
-            unset($k, $v);
200
+			$values[$k] = maybe_unserialize( $v );
201
+            unset( $k, $v );
202 202
         }
203 203
 
204
-        return stripslashes_deep($values);
204
+        return stripslashes_deep( $values );
205 205
     }
206 206
 
207 207
     /**
@@ -218,8 +218,8 @@  discard block
 block discarded – undo
218 218
 			$query[] = 'INNER JOIN ' . $wpdb->prefix . 'frm_items e ON (e.id=em.item_id)';
219 219
         }
220 220
 
221
-        if ( is_numeric($field_id) ) {
222
-            $query[] = $wpdb->prepare('WHERE em.field_id=%d', $field_id);
221
+        if ( is_numeric( $field_id ) ) {
222
+            $query[] = $wpdb->prepare( 'WHERE em.field_id=%d', $field_id );
223 223
         } else {
224 224
 			$query[] = $wpdb->prepare( 'LEFT JOIN ' . $wpdb->prefix . 'frm_fields fi ON (em.field_id = fi.id) WHERE fi.field_key=%s', $field_id );
225 225
         }
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         }
230 230
 
231 231
         if ( $args['value'] ) {
232
-            $query[] = $wpdb->prepare(' AND meta_value=%s', $args['value']);
232
+            $query[] = $wpdb->prepare( ' AND meta_value=%s', $args['value'] );
233 233
         }
234 234
         $query[] = $order . $limit;
235 235
     }
@@ -243,18 +243,18 @@  discard block
 block discarded – undo
243 243
         $query = 'SELECT it.*, fi.type as field_type, fi.field_key as field_key,
244 244
             fi.required as required, fi.form_id as field_form_id, fi.name as field_name, fi.options as fi_options
245 245
 			FROM ' . $wpdb->prefix . 'frm_item_metas it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id' .
246
-            FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
246
+            FrmAppHelper::prepend_and_or_where( ' WHERE ', $where ) . $order_by . $limit;
247 247
 
248 248
 		$cache_key = 'all_' . maybe_serialize( $where ) . $order_by . $limit;
249
-        $results = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, ($limit == ' LIMIT 1' ? 'get_row' : 'get_results'));
249
+        $results = FrmAppHelper::check_cache( $cache_key, 'frm_entry', $query, ( $limit == ' LIMIT 1' ? 'get_row' : 'get_results' ) );
250 250
 
251 251
         if ( ! $results || ! $stripslashes ) {
252 252
             return $results;
253 253
         }
254 254
 
255 255
         foreach ( $results as $k => $result ) {
256
-			$results[ $k ]->meta_value = stripslashes_deep( maybe_unserialize( $result->meta_value ) );
257
-            unset($k, $result);
256
+			$results[$k]->meta_value = stripslashes_deep( maybe_unserialize( $result->meta_value ) );
257
+            unset( $k, $result );
258 258
         }
259 259
 
260 260
         return $results;
@@ -266,14 +266,14 @@  discard block
 block discarded – undo
266 266
 			'user_id'  => '',
267 267
 			'group_by' => '',
268 268
 		);
269
-        $args = wp_parse_args($args, $defaults);
269
+        $args = wp_parse_args( $args, $defaults );
270 270
 
271 271
         $query = array();
272
-        self::get_ids_query($where, $order_by, $limit, $unique, $args, $query );
273
-        $query = implode(' ', $query);
272
+        self::get_ids_query( $where, $order_by, $limit, $unique, $args, $query );
273
+        $query = implode( ' ', $query );
274 274
 
275 275
 		$cache_key = 'ids_' . maybe_serialize( $where ) . $order_by . 'l' . $limit . 'u' . $unique . maybe_serialize( $args );
276
-        $results = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, ($limit == ' LIMIT 1' ? 'get_var' : 'get_col'));
276
+        $results = FrmAppHelper::check_cache( $cache_key, 'frm_entry', $query, ( $limit == ' LIMIT 1' ? 'get_var' : 'get_col' ) );
277 277
 
278 278
         return $results;
279 279
     }
@@ -299,17 +299,17 @@  discard block
 block discarded – undo
299 299
 		$query[] = 'FROM ' . $wpdb->prefix . 'frm_item_metas it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id';
300 300
 
301 301
 		$query[] = 'INNER JOIN ' . $wpdb->prefix . 'frm_items e ON (e.id=it.item_id)';
302
-        if ( is_array($where) ) {
302
+        if ( is_array( $where ) ) {
303 303
             if ( ! $args['is_draft'] ) {
304 304
                 $where['e.is_draft'] = 0;
305 305
             } else if ( $args['is_draft'] == 1 ) {
306 306
                 $where['e.is_draft'] = 1;
307 307
             }
308 308
 
309
-            if ( ! empty($args['user_id']) ) {
309
+            if ( ! empty( $args['user_id'] ) ) {
310 310
                 $where['e.user_id'] = $args['user_id'];
311 311
             }
312
-            $query[] = FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
312
+            $query[] = FrmAppHelper::prepend_and_or_where( ' WHERE ', $where ) . $order_by . $limit;
313 313
 
314 314
 			if ( $args['group_by'] ) {
315 315
 				$query[] = ' GROUP BY ' . sanitize_text_field( $args['group_by'] );
@@ -324,13 +324,13 @@  discard block
 block discarded – undo
324 324
 			$draft_where = $wpdb->prepare( ' AND e.is_draft=%d', 1 );
325 325
         }
326 326
 
327
-        if ( ! empty($args['user_id']) ) {
328
-            $user_where = $wpdb->prepare(' AND e.user_id=%d', $args['user_id']);
327
+        if ( ! empty( $args['user_id'] ) ) {
328
+            $user_where = $wpdb->prepare( ' AND e.user_id=%d', $args['user_id'] );
329 329
         }
330 330
 
331
-        if ( strpos($where, ' GROUP BY ') ) {
331
+        if ( strpos( $where, ' GROUP BY ' ) ) {
332 332
             // don't inject WHERE filtering after GROUP BY
333
-            $parts = explode(' GROUP BY ', $where);
333
+            $parts = explode( ' GROUP BY ', $where );
334 334
             $where = $parts[0];
335 335
             $where .= $draft_where . $user_where;
336 336
 			$where .= ' GROUP BY ' . $parts[1];
@@ -339,12 +339,12 @@  discard block
 block discarded – undo
339 339
         }
340 340
 
341 341
 		// The query has already been prepared
342
-		$query[] = FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
342
+		$query[] = FrmAppHelper::prepend_and_or_where( ' WHERE ', $where ) . $order_by . $limit;
343 343
     }
344 344
 
345 345
     public static function search_entry_metas( $search, $field_id = '', $operator ) {
346 346
 		$cache_key = 'search_' . maybe_serialize( $search ) . $field_id . $operator;
347
-        $results = wp_cache_get($cache_key, 'frm_entry');
347
+        $results = wp_cache_get( $cache_key, 'frm_entry' );
348 348
         if ( false !== $results ) {
349 349
             return $results;
350 350
         }
@@ -367,18 +367,18 @@  discard block
 block discarded – undo
367 367
                     case 'day':
368 368
 						$value = '%' . $value . '%';
369 369
                 }
370
-				$where .= $wpdb->prepare(' meta_value ' . $operator . ' %s and', $value );
370
+				$where .= $wpdb->prepare( ' meta_value ' . $operator . ' %s and', $value );
371 371
             }
372
-            $where .= $wpdb->prepare(' field_id=%d', $field_id);
372
+            $where .= $wpdb->prepare( ' field_id=%d', $field_id );
373 373
 			$query = 'SELECT DISTINCT item_id FROM ' . $wpdb->prefix . 'frm_item_metas' . FrmAppHelper::prepend_and_or_where( ' WHERE ', $where );
374 374
         } else {
375 375
 			if ( $operator == 'LIKE' ) {
376 376
                 $search = '%' . $search . '%';
377 377
 			}
378
-            $query = $wpdb->prepare("SELECT DISTINCT item_id FROM {$wpdb->prefix}frm_item_metas WHERE meta_value {$operator} %s and field_id = %d", $search, $field_id);
378
+            $query = $wpdb->prepare( "SELECT DISTINCT item_id FROM {$wpdb->prefix}frm_item_metas WHERE meta_value {$operator} %s and field_id = %d", $search, $field_id );
379 379
         }
380 380
 
381
-        $results = $wpdb->get_col($query, 0);
381
+        $results = $wpdb->get_col( $query, 0 );
382 382
 		FrmAppHelper::set_cache( $cache_key, $results, 'frm_entry' );
383 383
 
384 384
         return $results;
Please login to merge, or discard this patch.
Indentation   +179 added lines, -179 removed lines patch added patch discarded remove patch
@@ -5,25 +5,25 @@  discard block
 block discarded – undo
5 5
 
6 6
 class FrmEntryMeta {
7 7
 
8
-    /**
9
-     * @param string $meta_key
10
-     */
8
+	/**
9
+	 * @param string $meta_key
10
+	 */
11 11
 	public static function add_entry_meta( $entry_id, $field_id, $meta_key = null, $meta_value ) {
12
-        global $wpdb;
12
+		global $wpdb;
13 13
 
14
-        if ( FrmAppHelper::is_empty_value( $meta_value ) ) {
15
-            // don't save blank fields
16
-            return 0;
17
-        }
14
+		if ( FrmAppHelper::is_empty_value( $meta_value ) ) {
15
+			// don't save blank fields
16
+			return 0;
17
+		}
18 18
 
19
-        $new_values = array(
19
+		$new_values = array(
20 20
 			'meta_value'    => is_array( $meta_value ) ? serialize( array_filter( $meta_value, 'FrmAppHelper::is_not_empty_value' ) ) : trim( $meta_value ),
21
-            'item_id'       => $entry_id,
22
-            'field_id'      => $field_id,
23
-            'created_at'    => current_time('mysql', 1),
24
-        );
21
+			'item_id'       => $entry_id,
22
+			'field_id'      => $field_id,
23
+			'created_at'    => current_time('mysql', 1),
24
+		);
25 25
 
26
-        $new_values = apply_filters('frm_add_entry_meta', $new_values);
26
+		$new_values = apply_filters('frm_add_entry_meta', $new_values);
27 27
 
28 28
 		$query_results = $wpdb->insert( $wpdb->prefix . 'frm_item_metas', $new_values );
29 29
 
@@ -34,39 +34,39 @@  discard block
 block discarded – undo
34 34
 			$id = 0;
35 35
 		}
36 36
 
37
-        return $id;
38
-    }
37
+		return $id;
38
+	}
39 39
 
40
-    /**
41
-     * @param string $meta_key
42
-     */
40
+	/**
41
+	 * @param string $meta_key
42
+	 */
43 43
 	public static function update_entry_meta( $entry_id, $field_id, $meta_key = null, $meta_value ) {
44
-        if ( ! $field_id ) {
45
-            return false;
46
-        }
44
+		if ( ! $field_id ) {
45
+			return false;
46
+		}
47 47
 
48
-        global $wpdb;
48
+		global $wpdb;
49 49
 
50
-        $values = $where_values = array( 'item_id' => $entry_id, 'field_id' => $field_id );
51
-        $values['meta_value'] = $meta_value;
52
-        $values = apply_filters('frm_update_entry_meta', $values);
50
+		$values = $where_values = array( 'item_id' => $entry_id, 'field_id' => $field_id );
51
+		$values['meta_value'] = $meta_value;
52
+		$values = apply_filters('frm_update_entry_meta', $values);
53 53
 		if ( is_array($values['meta_value']) ) {
54 54
 			$values['meta_value'] = array_filter( $values['meta_value'], 'FrmAppHelper::is_not_empty_value' );
55 55
 		}
56
-        $meta_value = maybe_serialize($values['meta_value']);
56
+		$meta_value = maybe_serialize($values['meta_value']);
57 57
 
58
-        wp_cache_delete( $entry_id, 'frm_entry');
58
+		wp_cache_delete( $entry_id, 'frm_entry');
59 59
 		self::clear_cache();
60 60
 
61 61
 		return $wpdb->update( $wpdb->prefix . 'frm_item_metas', array( 'meta_value' => $meta_value ), $where_values );
62
-    }
62
+	}
63 63
 
64 64
 	public static function update_entry_metas( $entry_id, $values ) {
65
-        global $wpdb;
65
+		global $wpdb;
66 66
 
67 67
 		$prev_values = FrmDb::get_col( $wpdb->prefix . 'frm_item_metas', array( 'item_id' => $entry_id, 'field_id !' => 0 ), 'field_id' );
68 68
 
69
-        foreach ( $values as $field_id => $meta_value ) {
69
+		foreach ( $values as $field_id => $meta_value ) {
70 70
 			$field = false;
71 71
 			if ( ! empty( $field_id ) ) {
72 72
 				$field = FrmField::getOne( $field_id );
@@ -90,39 +90,39 @@  discard block
 block discarded – undo
90 90
 			}
91 91
 		}
92 92
 
93
-        if ( empty($prev_values) ) {
94
-            return;
95
-        }
93
+		if ( empty($prev_values) ) {
94
+			return;
95
+		}
96 96
 
97
-        $prev_values = array_diff($prev_values, array_keys($values));
97
+		$prev_values = array_diff($prev_values, array_keys($values));
98 98
 
99
-        if ( empty($prev_values) ) {
100
-            return;
101
-        }
99
+		if ( empty($prev_values) ) {
100
+			return;
101
+		}
102 102
 
103 103
 		// prepare the query
104 104
 		$where = array( 'item_id' => $entry_id, 'field_id' => $prev_values );
105 105
 		FrmDb::get_where_clause_and_values( $where );
106 106
 
107
-        // Delete any leftovers
108
-        $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'frm_item_metas ' . $where['where'], $where['values'] ) );
107
+		// Delete any leftovers
108
+		$wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'frm_item_metas ' . $where['where'], $where['values'] ) );
109 109
 		self::clear_cache();
110
-    }
110
+	}
111 111
 
112 112
 	public static function duplicate_entry_metas( $old_id, $new_id ) {
113
-        $metas = self::get_entry_meta_info($old_id);
114
-        foreach ( $metas as $meta ) {
115
-            self::add_entry_meta($new_id, $meta->field_id, null, $meta->meta_value);
116
-            unset($meta);
117
-        }
113
+		$metas = self::get_entry_meta_info($old_id);
114
+		foreach ( $metas as $meta ) {
115
+			self::add_entry_meta($new_id, $meta->field_id, null, $meta->meta_value);
116
+			unset($meta);
117
+		}
118 118
 		self::clear_cache();
119
-    }
119
+	}
120 120
 
121 121
 	public static function delete_entry_meta( $entry_id, $field_id ) {
122
-        global $wpdb;
122
+		global $wpdb;
123 123
 		self::clear_cache();
124
-        return $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->prefix}frm_item_metas WHERE field_id=%d AND item_id=%d", $field_id, $entry_id));
125
-    }
124
+		return $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->prefix}frm_item_metas WHERE field_id=%d AND item_id=%d", $field_id, $entry_id));
125
+	}
126 126
 
127 127
 	/**
128 128
 	 * Clear entry meta caching
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	}
148 148
 
149 149
 	public static function get_entry_meta_by_field( $entry_id, $field_id ) {
150
-        global $wpdb;
150
+		global $wpdb;
151 151
 
152 152
 		if ( is_object( $entry_id ) ) {
153 153
 			$entry = $entry_id;
@@ -160,137 +160,137 @@  discard block
 block discarded – undo
160 160
 
161 161
 		if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) {
162 162
 			$result = $cached->metas[ $field_id ];
163
-            return stripslashes_deep($result);
164
-        }
163
+			return stripslashes_deep($result);
164
+		}
165 165
 
166 166
 		$get_table = $wpdb->prefix . 'frm_item_metas';
167 167
 		$query = array( 'item_id' => $entry_id );
168
-        if ( is_numeric($field_id) ) {
168
+		if ( is_numeric($field_id) ) {
169 169
 			$query['field_id'] = $field_id;
170
-        } else {
170
+		} else {
171 171
 			$get_table .= ' it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id';
172 172
 			$query['fi.field_key'] = $field_id;
173
-        }
173
+		}
174 174
 
175 175
 		$result = FrmDb::get_var( $get_table, $query, 'meta_value' );
176
-        $result = maybe_unserialize($result);
177
-        $result = stripslashes_deep($result);
176
+		$result = maybe_unserialize($result);
177
+		$result = stripslashes_deep($result);
178 178
 
179
-        return $result;
180
-    }
179
+		return $result;
180
+	}
181 181
 
182 182
 	public static function get_entry_metas( $entry_id ) {
183
-        _deprecated_function( __FUNCTION__, '1.07.10');
183
+		_deprecated_function( __FUNCTION__, '1.07.10');
184 184
 
185
-        global $wpdb;
185
+		global $wpdb;
186 186
 		return FrmDb::get_col( $wpdb->prefix . 'frm_item_metas', array( 'item_id' => $entry_id ), 'meta_value' );
187
-    }
187
+	}
188 188
 
189
-    public static function get_entry_metas_for_field( $field_id, $order = '', $limit = '', $args = array() ) {
189
+	public static function get_entry_metas_for_field( $field_id, $order = '', $limit = '', $args = array() ) {
190 190
 		$defaults = array( 'value' => false, 'unique' => false, 'stripslashes' => true, 'is_draft' => false );
191
-        $args = wp_parse_args( $args, $defaults );
191
+		$args = wp_parse_args( $args, $defaults );
192 192
 
193
-        $query = array();
194
-        self::meta_field_query($field_id, $order, $limit, $args, $query);
195
-        $query = implode(' ', $query);
193
+		$query = array();
194
+		self::meta_field_query($field_id, $order, $limit, $args, $query);
195
+		$query = implode(' ', $query);
196 196
 
197 197
 		$cache_key = 'entry_metas_for_field_' . $field_id . $order . $limit . maybe_serialize( $args );
198
-        $values = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, 'get_col');
198
+		$values = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, 'get_col');
199 199
 
200
-        if ( ! $args['stripslashes'] ) {
201
-            return $values;
202
-        }
200
+		if ( ! $args['stripslashes'] ) {
201
+			return $values;
202
+		}
203 203
 
204 204
 		foreach ( $values as $k => $v ) {
205 205
 			$values[ $k ] = maybe_unserialize( $v );
206
-            unset($k, $v);
207
-        }
206
+			unset($k, $v);
207
+		}
208 208
 
209
-        return stripslashes_deep($values);
210
-    }
209
+		return stripslashes_deep($values);
210
+	}
211 211
 
212
-    /**
213
-     * @param string $order
214
-     * @param string $limit
215
-     */
212
+	/**
213
+	 * @param string $order
214
+	 * @param string $limit
215
+	 */
216 216
 	private static function meta_field_query( $field_id, $order, $limit, $args, array &$query ) {
217
-        global $wpdb;
218
-        $query[] = 'SELECT';
219
-        $query[] = $args['unique'] ? 'DISTINCT(em.meta_value)' : 'em.meta_value';
217
+		global $wpdb;
218
+		$query[] = 'SELECT';
219
+		$query[] = $args['unique'] ? 'DISTINCT(em.meta_value)' : 'em.meta_value';
220 220
 		$query[] = 'FROM ' . $wpdb->prefix . 'frm_item_metas em ';
221 221
 
222
-        if ( ! $args['is_draft'] ) {
222
+		if ( ! $args['is_draft'] ) {
223 223
 			$query[] = 'INNER JOIN ' . $wpdb->prefix . 'frm_items e ON (e.id=em.item_id)';
224
-        }
224
+		}
225 225
 
226
-        if ( is_numeric($field_id) ) {
227
-            $query[] = $wpdb->prepare('WHERE em.field_id=%d', $field_id);
228
-        } else {
226
+		if ( is_numeric($field_id) ) {
227
+			$query[] = $wpdb->prepare('WHERE em.field_id=%d', $field_id);
228
+		} else {
229 229
 			$query[] = $wpdb->prepare( 'LEFT JOIN ' . $wpdb->prefix . 'frm_fields fi ON (em.field_id = fi.id) WHERE fi.field_key=%s', $field_id );
230
-        }
230
+		}
231 231
 
232
-        if ( ! $args['is_draft'] ) {
233
-            $query[] = 'AND e.is_draft=0';
234
-        }
232
+		if ( ! $args['is_draft'] ) {
233
+			$query[] = 'AND e.is_draft=0';
234
+		}
235 235
 
236
-        if ( $args['value'] ) {
237
-            $query[] = $wpdb->prepare(' AND meta_value=%s', $args['value']);
238
-        }
239
-        $query[] = $order . $limit;
240
-    }
236
+		if ( $args['value'] ) {
237
+			$query[] = $wpdb->prepare(' AND meta_value=%s', $args['value']);
238
+		}
239
+		$query[] = $order . $limit;
240
+	}
241 241
 
242 242
 	public static function get_entry_meta_info( $entry_id ) {
243 243
 		return FrmDb::get_results( 'frm_item_metas', array( 'item_id' => $entry_id ) );
244
-    }
244
+	}
245 245
 
246 246
 	public static function getAll( $where = array(), $order_by = '', $limit = '', $stripslashes = false ) {
247
-        global $wpdb;
248
-        $query = 'SELECT it.*, fi.type as field_type, fi.field_key as field_key,
247
+		global $wpdb;
248
+		$query = 'SELECT it.*, fi.type as field_type, fi.field_key as field_key,
249 249
             fi.required as required, fi.form_id as field_form_id, fi.name as field_name, fi.options as fi_options
250 250
 			FROM ' . $wpdb->prefix . 'frm_item_metas it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id' .
251
-            FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
251
+			FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
252 252
 
253 253
 		$cache_key = 'all_' . maybe_serialize( $where ) . $order_by . $limit;
254
-        $results = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, ($limit == ' LIMIT 1' ? 'get_row' : 'get_results'));
254
+		$results = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, ($limit == ' LIMIT 1' ? 'get_row' : 'get_results'));
255 255
 
256
-        if ( ! $results || ! $stripslashes ) {
257
-            return $results;
258
-        }
256
+		if ( ! $results || ! $stripslashes ) {
257
+			return $results;
258
+		}
259 259
 
260
-        foreach ( $results as $k => $result ) {
260
+		foreach ( $results as $k => $result ) {
261 261
 			$results[ $k ]->meta_value = stripslashes_deep( maybe_unserialize( $result->meta_value ) );
262
-            unset($k, $result);
263
-        }
262
+			unset($k, $result);
263
+		}
264 264
 
265
-        return $results;
266
-    }
265
+		return $results;
266
+	}
267 267
 
268
-    public static function getEntryIds( $where = array(), $order_by = '', $limit = '', $unique = true, $args = array() ) {
268
+	public static function getEntryIds( $where = array(), $order_by = '', $limit = '', $unique = true, $args = array() ) {
269 269
 		$defaults = array(
270 270
 			'is_draft' => false,
271 271
 			'user_id'  => '',
272 272
 			'group_by' => '',
273 273
 		);
274
-        $args = wp_parse_args($args, $defaults);
274
+		$args = wp_parse_args($args, $defaults);
275 275
 
276
-        $query = array();
277
-        self::get_ids_query($where, $order_by, $limit, $unique, $args, $query );
278
-        $query = implode(' ', $query);
276
+		$query = array();
277
+		self::get_ids_query($where, $order_by, $limit, $unique, $args, $query );
278
+		$query = implode(' ', $query);
279 279
 
280 280
 		$cache_key = 'ids_' . maybe_serialize( $where ) . $order_by . 'l' . $limit . 'u' . $unique . maybe_serialize( $args );
281
-        $results = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, ($limit == ' LIMIT 1' ? 'get_var' : 'get_col'));
281
+		$results = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, ($limit == ' LIMIT 1' ? 'get_var' : 'get_col'));
282 282
 
283
-        return $results;
284
-    }
283
+		return $results;
284
+	}
285 285
 
286
-    /**
287
-     * @param string|array $where
288
-     * @param string $order_by
289
-     * @param string $limit
290
-     */
286
+	/**
287
+	 * @param string|array $where
288
+	 * @param string $order_by
289
+	 * @param string $limit
290
+	 */
291 291
 	private static function get_ids_query( $where, $order_by, $limit, $unique, $args, array &$query ) {
292
-        global $wpdb;
293
-        $query[] = 'SELECT';
292
+		global $wpdb;
293
+		$query[] = 'SELECT';
294 294
 
295 295
 		$defaults = array( 'return_parent_id' => false );
296 296
 		$args = array_merge( $defaults, $args );
@@ -304,88 +304,88 @@  discard block
 block discarded – undo
304 304
 		$query[] = 'FROM ' . $wpdb->prefix . 'frm_item_metas it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id';
305 305
 
306 306
 		$query[] = 'INNER JOIN ' . $wpdb->prefix . 'frm_items e ON (e.id=it.item_id)';
307
-        if ( is_array($where) ) {
308
-            if ( ! $args['is_draft'] ) {
309
-                $where['e.is_draft'] = 0;
310
-            } else if ( $args['is_draft'] == 1 ) {
311
-                $where['e.is_draft'] = 1;
312
-            }
313
-
314
-            if ( ! empty($args['user_id']) ) {
315
-                $where['e.user_id'] = $args['user_id'];
316
-            }
317
-            $query[] = FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
307
+		if ( is_array($where) ) {
308
+			if ( ! $args['is_draft'] ) {
309
+				$where['e.is_draft'] = 0;
310
+			} else if ( $args['is_draft'] == 1 ) {
311
+				$where['e.is_draft'] = 1;
312
+			}
313
+
314
+			if ( ! empty($args['user_id']) ) {
315
+				$where['e.user_id'] = $args['user_id'];
316
+			}
317
+			$query[] = FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
318 318
 
319 319
 			if ( $args['group_by'] ) {
320 320
 				$query[] = ' GROUP BY ' . sanitize_text_field( $args['group_by'] );
321 321
 			}
322
-            return;
323
-        }
322
+			return;
323
+		}
324 324
 
325 325
 		$draft_where = $user_where = '';
326
-        if ( ! $args['is_draft'] ) {
326
+		if ( ! $args['is_draft'] ) {
327 327
 			$draft_where = $wpdb->prepare( ' AND e.is_draft=%d', 0 );
328
-        } else if ( $args['is_draft'] == 1 ) {
328
+		} else if ( $args['is_draft'] == 1 ) {
329 329
 			$draft_where = $wpdb->prepare( ' AND e.is_draft=%d', 1 );
330
-        }
330
+		}
331 331
 
332
-        if ( ! empty($args['user_id']) ) {
333
-            $user_where = $wpdb->prepare(' AND e.user_id=%d', $args['user_id']);
334
-        }
332
+		if ( ! empty($args['user_id']) ) {
333
+			$user_where = $wpdb->prepare(' AND e.user_id=%d', $args['user_id']);
334
+		}
335 335
 
336
-        if ( strpos($where, ' GROUP BY ') ) {
337
-            // don't inject WHERE filtering after GROUP BY
338
-            $parts = explode(' GROUP BY ', $where);
339
-            $where = $parts[0];
340
-            $where .= $draft_where . $user_where;
336
+		if ( strpos($where, ' GROUP BY ') ) {
337
+			// don't inject WHERE filtering after GROUP BY
338
+			$parts = explode(' GROUP BY ', $where);
339
+			$where = $parts[0];
340
+			$where .= $draft_where . $user_where;
341 341
 			$where .= ' GROUP BY ' . $parts[1];
342
-        } else {
343
-            $where .= $draft_where . $user_where;
344
-        }
342
+		} else {
343
+			$where .= $draft_where . $user_where;
344
+		}
345 345
 
346 346
 		// The query has already been prepared
347 347
 		$query[] = FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
348
-    }
348
+	}
349 349
 
350
-    public static function search_entry_metas( $search, $field_id = '', $operator ) {
350
+	public static function search_entry_metas( $search, $field_id = '', $operator ) {
351 351
 		$cache_key = 'search_' . maybe_serialize( $search ) . $field_id . $operator;
352
-        $results = wp_cache_get($cache_key, 'frm_entry');
353
-        if ( false !== $results ) {
354
-            return $results;
355
-        }
352
+		$results = wp_cache_get($cache_key, 'frm_entry');
353
+		if ( false !== $results ) {
354
+			return $results;
355
+		}
356 356
 
357
-        global $wpdb;
357
+		global $wpdb;
358 358
 		if ( is_array( $search ) ) {
359
-            $where = '';
359
+			$where = '';
360 360
 			foreach ( $search as $field => $value ) {
361 361
 				if ( $value <= 0 || ! in_array( $field, array( 'year', 'month', 'day' ) ) ) {
362
-                    continue;
363
-                }
362
+					continue;
363
+				}
364 364
 
365
-                switch ( $field ) {
366
-                    case 'year':
365
+				switch ( $field ) {
366
+					case 'year':
367 367
 						$value = '%' . $value;
368
-                    break;
369
-                    case 'month':
370
-                        $value .= '%';
371
-                    break;
372
-                    case 'day':
368
+					break;
369
+					case 'month':
370
+						$value .= '%';
371
+					break;
372
+					case 'day':
373 373
 						$value = '%' . $value . '%';
374
-                }
374
+				}
375 375
 				$where .= $wpdb->prepare(' meta_value ' . $operator . ' %s and', $value );
376
-            }
377
-            $where .= $wpdb->prepare(' field_id=%d', $field_id);
376
+			}
377
+			$where .= $wpdb->prepare(' field_id=%d', $field_id);
378 378
 			$query = 'SELECT DISTINCT item_id FROM ' . $wpdb->prefix . 'frm_item_metas' . FrmAppHelper::prepend_and_or_where( ' WHERE ', $where );
379
-        } else {
379
+		} else {
380 380
 			if ( $operator == 'LIKE' ) {
381
-                $search = '%' . $search . '%';
381
+				$search = '%' . $search . '%';
382 382
 			}
383
-            $query = $wpdb->prepare("SELECT DISTINCT item_id FROM {$wpdb->prefix}frm_item_metas WHERE meta_value {$operator} %s and field_id = %d", $search, $field_id);
384
-        }
383
+			$query = $wpdb->prepare("SELECT DISTINCT item_id FROM {$wpdb->prefix}frm_item_metas WHERE meta_value {$operator} %s and field_id = %d", $search, $field_id);
384
+		}
385 385
 
386
-        $results = $wpdb->get_col($query, 0);
386
+		$results = $wpdb->get_col($query, 0);
387 387
 		FrmAppHelper::set_cache( $cache_key, $results, 'frm_entry' );
388 388
 
389
-        return $results;
390
-    }
389
+		return $results;
390
+	}
391 391
 }
Please login to merge, or discard this patch.
classes/controllers/FrmHooksController.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -143,8 +143,8 @@
 block discarded – undo
143 143
         add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
144 144
 
145 145
 		// Addons Controller
146
-		add_action('wp_ajax_frm_addon_activate', 'FrmAddon::activate' );
147
-		add_action('wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' );
146
+		add_action( 'wp_ajax_frm_addon_activate', 'FrmAddon::activate' );
147
+		add_action( 'wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' );
148 148
 
149 149
         // Fields Controller
150 150
         add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' );
Please login to merge, or discard this patch.
Indentation   +138 added lines, -138 removed lines patch added patch discarded remove patch
@@ -1,91 +1,91 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 class FrmHooksController {
4
-    /**
5
-     * Trigger plugin-wide hook loading
6
-     */
7
-    public static function trigger_load_hook( $hooks = 'load_hooks' ) {
8
-        $controllers = apply_filters( 'frm_load_controllers', array( 'FrmHooksController' ) );
9
-
10
-        $trigger_hooks = $hooks;
11
-        $hooks = (array) $hooks;
12
-
13
-        if ( 'load_hooks' == $trigger_hooks ) {
14
-            if ( is_admin() ) {
15
-                $hooks[] = 'load_admin_hooks';
16
-                if ( defined( 'DOING_AJAX' ) ) {
17
-                    $hooks[] = 'load_ajax_hooks';
18
-                    $hooks[] = 'load_form_hooks';
19
-                }
20
-            }
21
-
22
-            if ( is_multisite() ) {
23
-                $hooks[] = 'load_multisite_hooks';
24
-            }
25
-        } else {
26
-            // Make sure the hooks are only triggered once
27
-            add_filter( 'frm' . str_replace( 'load', '', $trigger_hooks ) . '_loaded', '__return_true' );
28
-        }
29
-        unset( $trigger_hooks );
30
-
31
-        // Instansiate Controllers
32
-        foreach ( $controllers as $c ) {
33
-            foreach ( $hooks as $hook ) {
4
+	/**
5
+	 * Trigger plugin-wide hook loading
6
+	 */
7
+	public static function trigger_load_hook( $hooks = 'load_hooks' ) {
8
+		$controllers = apply_filters( 'frm_load_controllers', array( 'FrmHooksController' ) );
9
+
10
+		$trigger_hooks = $hooks;
11
+		$hooks = (array) $hooks;
12
+
13
+		if ( 'load_hooks' == $trigger_hooks ) {
14
+			if ( is_admin() ) {
15
+				$hooks[] = 'load_admin_hooks';
16
+				if ( defined( 'DOING_AJAX' ) ) {
17
+					$hooks[] = 'load_ajax_hooks';
18
+					$hooks[] = 'load_form_hooks';
19
+				}
20
+			}
21
+
22
+			if ( is_multisite() ) {
23
+				$hooks[] = 'load_multisite_hooks';
24
+			}
25
+		} else {
26
+			// Make sure the hooks are only triggered once
27
+			add_filter( 'frm' . str_replace( 'load', '', $trigger_hooks ) . '_loaded', '__return_true' );
28
+		}
29
+		unset( $trigger_hooks );
30
+
31
+		// Instansiate Controllers
32
+		foreach ( $controllers as $c ) {
33
+			foreach ( $hooks as $hook ) {
34 34
 				call_user_func( array( $c, $hook ) );
35 35
 				unset( $hook );
36
-            }
36
+			}
37 37
 			unset( $c );
38
-        }
38
+		}
39 39
 
40
-    }
40
+	}
41 41
 
42
-    public static function trigger_load_form_hooks() {
43
-        self::trigger_load_hook( 'load_form_hooks' );
44
-    }
42
+	public static function trigger_load_form_hooks() {
43
+		self::trigger_load_hook( 'load_form_hooks' );
44
+	}
45 45
 
46 46
 	public static function load_hooks() {
47
-        if ( ! is_admin() ) {
48
-            add_filter( 'the_content', 'FrmAppController::page_route', 10 );
49
-        }
47
+		if ( ! is_admin() ) {
48
+			add_filter( 'the_content', 'FrmAppController::page_route', 10 );
49
+		}
50 50
 
51
-        add_action( 'plugins_loaded', 'FrmAppController::load_lang' );
52
-        add_filter( 'widget_text', 'FrmAppController::widget_text_filter', 8 );
51
+		add_action( 'plugins_loaded', 'FrmAppController::load_lang' );
52
+		add_filter( 'widget_text', 'FrmAppController::widget_text_filter', 8 );
53 53
 
54
-        // Entries controller
55
-        add_action( 'wp_loaded', 'FrmEntriesController::process_entry', 10, 0 );
56
-        add_filter( 'frm_redirect_url', 'FrmEntriesController::delete_entry_before_redirect', 50, 3 );
57
-        add_action( 'frm_after_entry_processed', 'FrmEntriesController::delete_entry_after_save', 100 );
54
+		// Entries controller
55
+		add_action( 'wp_loaded', 'FrmEntriesController::process_entry', 10, 0 );
56
+		add_filter( 'frm_redirect_url', 'FrmEntriesController::delete_entry_before_redirect', 50, 3 );
57
+		add_action( 'frm_after_entry_processed', 'FrmEntriesController::delete_entry_after_save', 100 );
58 58
 		add_filter( 'frm_email_value', 'FrmEntriesController::filter_email_value', 10, 4 );
59
-        add_filter( 'frmpro_fields_replace_shortcodes', 'FrmEntriesController::filter_shortcode_value', 10, 4 );
59
+		add_filter( 'frmpro_fields_replace_shortcodes', 'FrmEntriesController::filter_shortcode_value', 10, 4 );
60 60
 
61
-        // Form Actions Controller
62
-        add_action( 'init', 'FrmFormActionsController::register_post_types', 1 );
61
+		// Form Actions Controller
62
+		add_action( 'init', 'FrmFormActionsController::register_post_types', 1 );
63 63
 		add_action( 'frm_after_create_entry', 'FrmFormActionsController::trigger_create_actions', 20, 3 );
64 64
 
65
-        // Forms Controller
66
-        add_action( 'widgets_init', 'FrmFormsController::register_widgets' );
65
+		// Forms Controller
66
+		add_action( 'widgets_init', 'FrmFormsController::register_widgets' );
67 67
 		add_action( 'init', 'FrmFormsController::front_head' );
68
-        add_filter( 'frm_content', 'FrmFormsController::filter_content', 10, 3 );
69
-        add_filter( 'frm_replace_content_shortcodes', 'FrmFormsController::replace_content_shortcodes', 20, 3 );
70
-        add_action( 'admin_bar_init', 'FrmFormsController::admin_bar_css' );
68
+		add_filter( 'frm_content', 'FrmFormsController::filter_content', 10, 3 );
69
+		add_filter( 'frm_replace_content_shortcodes', 'FrmFormsController::replace_content_shortcodes', 20, 3 );
70
+		add_action( 'admin_bar_init', 'FrmFormsController::admin_bar_css' );
71 71
 		add_action( 'wp_footer', 'FrmFormsController::footer_js', 1, 0 );
72 72
 
73 73
 		add_action( 'wp_scheduled_delete', 'FrmForm::scheduled_delete' );
74 74
 
75
-        // Form Shortcodes
76
-        add_shortcode( 'formidable', 'FrmFormsController::get_form_shortcode' );
75
+		// Form Shortcodes
76
+		add_shortcode( 'formidable', 'FrmFormsController::get_form_shortcode' );
77 77
 
78
-        // Styles Controller
79
-        add_action( 'init', 'FrmStylesController::register_post_types', 0 );
80
-        add_filter( 'frm_get_style_opts', 'FrmStylesController::get_style_opts' );
81
-        add_filter( 'frm_add_form_style_class', 'FrmStylesController::get_form_style_class', 10, 2 );
82
-        add_filter( 'frm_show_entry_styles', 'FrmStylesController::show_entry_styles' );
83
-    }
78
+		// Styles Controller
79
+		add_action( 'init', 'FrmStylesController::register_post_types', 0 );
80
+		add_filter( 'frm_get_style_opts', 'FrmStylesController::get_style_opts' );
81
+		add_filter( 'frm_add_form_style_class', 'FrmStylesController::get_form_style_class', 10, 2 );
82
+		add_filter( 'frm_show_entry_styles', 'FrmStylesController::show_entry_styles' );
83
+	}
84 84
 
85 85
 	public static function load_admin_hooks() {
86
-        add_action( 'admin_menu', 'FrmAppController::menu', 1 );
87
-        add_action( 'admin_enqueue_scripts', 'FrmAppController::load_wp_admin_style' );
88
-        add_action( 'admin_notices', 'FrmAppController::pro_get_started_headline' );
86
+		add_action( 'admin_menu', 'FrmAppController::menu', 1 );
87
+		add_action( 'admin_enqueue_scripts', 'FrmAppController::load_wp_admin_style' );
88
+		add_action( 'admin_notices', 'FrmAppController::pro_get_started_headline' );
89 89
 		add_action( 'admin_init', 'FrmAppController::admin_init', 11 );
90 90
 		add_filter( 'plugin_action_links_' . FrmAppHelper::plugin_folder() . '/formidable.php', 'FrmAppController::settings_link' );
91 91
 		register_activation_hook( FrmAppHelper::plugin_folder() . '/formidable.php', 'FrmAppController::activation_install' );
@@ -93,120 +93,120 @@  discard block
 block discarded – undo
93 93
 		// Addons Controller
94 94
 		add_action( 'admin_menu', 'FrmAddonsController::menu', 100 );
95 95
 
96
-        // Entries Controller
97
-        add_action( 'admin_menu', 'FrmEntriesController::menu', 12 );
98
-        add_filter( 'contextual_help', 'FrmEntriesController::contextual_help', 10, 3 );
99
-        add_filter( 'set-screen-option', 'FrmEntriesController::save_per_page', 10, 3 );
100
-        add_filter( 'update_user_metadata', 'FrmEntriesController::check_hidden_cols', 10, 5 );
101
-        add_action( 'updated_user_meta', 'FrmEntriesController::update_hidden_cols', 10, 4 );
96
+		// Entries Controller
97
+		add_action( 'admin_menu', 'FrmEntriesController::menu', 12 );
98
+		add_filter( 'contextual_help', 'FrmEntriesController::contextual_help', 10, 3 );
99
+		add_filter( 'set-screen-option', 'FrmEntriesController::save_per_page', 10, 3 );
100
+		add_filter( 'update_user_metadata', 'FrmEntriesController::check_hidden_cols', 10, 5 );
101
+		add_action( 'updated_user_meta', 'FrmEntriesController::update_hidden_cols', 10, 4 );
102 102
 
103
-        // Fields Controller
104
-        add_filter( 'frm_display_field_options', 'FrmFieldsController::display_field_options' );
103
+		// Fields Controller
104
+		add_filter( 'frm_display_field_options', 'FrmFieldsController::display_field_options' );
105 105
 
106
-        // Form Actions Controller
107
-        if ( FrmAppHelper::is_admin_page( 'formidable' ) ) {
108
-            add_action( 'frm_before_update_form_settings', 'FrmFormActionsController::update_settings' );
109
-        }
110
-        add_action( 'frm_after_duplicate_form', 'FrmFormActionsController::duplicate_form_actions', 20, 3 );
106
+		// Form Actions Controller
107
+		if ( FrmAppHelper::is_admin_page( 'formidable' ) ) {
108
+			add_action( 'frm_before_update_form_settings', 'FrmFormActionsController::update_settings' );
109
+		}
110
+		add_action( 'frm_after_duplicate_form', 'FrmFormActionsController::duplicate_form_actions', 20, 3 );
111 111
 
112
-        // Forms Controller
113
-        add_action( 'admin_menu', 'FrmFormsController::menu', 10 );
114
-        add_action( 'admin_head-toplevel_page_formidable', 'FrmFormsController::head' );
112
+		// Forms Controller
113
+		add_action( 'admin_menu', 'FrmFormsController::menu', 10 );
114
+		add_action( 'admin_head-toplevel_page_formidable', 'FrmFormsController::head' );
115 115
 
116
-        add_filter( 'set-screen-option', 'FrmFormsController::save_per_page', 10, 3 );
117
-        add_action( 'admin_footer', 'FrmFormsController::insert_form_popup' );
116
+		add_filter( 'set-screen-option', 'FrmFormsController::save_per_page', 10, 3 );
117
+		add_action( 'admin_footer', 'FrmFormsController::insert_form_popup' );
118 118
 		add_action( 'media_buttons', 'FrmFormsController::insert_form_button' );
119 119
 
120
-        // Forms Model
121
-        add_action( 'frm_after_duplicate_form', 'FrmForm::after_duplicate', 10, 2 );
120
+		// Forms Model
121
+		add_action( 'frm_after_duplicate_form', 'FrmForm::after_duplicate', 10, 2 );
122 122
 
123
-        // Settings Controller
124
-        add_action( 'admin_menu', 'FrmSettingsController::menu', 45 );
125
-        add_action( 'frm_before_settings', 'FrmSettingsController::license_box' );
123
+		// Settings Controller
124
+		add_action( 'admin_menu', 'FrmSettingsController::menu', 45 );
125
+		add_action( 'frm_before_settings', 'FrmSettingsController::license_box' );
126 126
 
127
-        // Styles Controller
128
-        add_action( 'admin_menu', 'FrmStylesController::menu', 14 );
129
-        add_action( 'admin_init', 'FrmStylesController::admin_init' );
127
+		// Styles Controller
128
+		add_action( 'admin_menu', 'FrmStylesController::menu', 14 );
129
+		add_action( 'admin_init', 'FrmStylesController::admin_init' );
130 130
 
131
-        // XML Controller
132
-        add_action( 'admin_menu', 'FrmXMLController::menu', 41 );
133
-    }
131
+		// XML Controller
132
+		add_action( 'admin_menu', 'FrmXMLController::menu', 41 );
133
+	}
134 134
 
135 135
 	public static function load_ajax_hooks() {
136 136
 		add_action( 'wp_ajax_frm_silent_upgrade', 'FrmAppController::ajax_install' );
137 137
 		add_action( 'wp_ajax_nopriv_frm_silent_upgrade', 'FrmAppController::ajax_install' );
138 138
 		add_action( 'wp_ajax_frm_install', 'FrmAppController::ajax_install' );
139
-        add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
140
-        add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
139
+		add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
140
+		add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
141 141
 
142 142
 		// Addons
143 143
 		add_action('wp_ajax_frm_addon_activate', 'FrmAddon::activate' );
144 144
 		add_action('wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' );
145 145
 		add_action( 'wp_ajax_frm_fill_licenses', 'FrmAddonsController::get_licenses' );
146 146
 
147
-        // Fields Controller
148
-        add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' );
149
-        add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' );
150
-        add_action( 'wp_ajax_frm_field_name_in_place_edit', 'FrmFieldsController::edit_name' );
151
-        add_action( 'wp_ajax_frm_update_ajax_option', 'FrmFieldsController::update_ajax_option' );
152
-        add_action( 'wp_ajax_frm_duplicate_field', 'FrmFieldsController::duplicate' );
153
-        add_action( 'wp_ajax_frm_delete_field', 'FrmFieldsController::destroy' );
154
-        add_action( 'wp_ajax_frm_add_field_option', 'FrmFieldsController::add_option' );
155
-        add_action( 'wp_ajax_frm_import_choices', 'FrmFieldsController::import_choices' );
156
-        add_action( 'wp_ajax_frm_import_options', 'FrmFieldsController::import_options' );
157
-        add_action( 'wp_ajax_frm_update_field_order', 'FrmFieldsController::update_order' );
158
-
159
-        // Form Actions Controller
160
-        add_action( 'wp_ajax_frm_add_form_action', 'FrmFormActionsController::add_form_action' );
161
-        add_action( 'wp_ajax_frm_form_action_fill', 'FrmFormActionsController::fill_action' );
162
-
163
-        // Forms Controller
147
+		// Fields Controller
148
+		add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' );
149
+		add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' );
150
+		add_action( 'wp_ajax_frm_field_name_in_place_edit', 'FrmFieldsController::edit_name' );
151
+		add_action( 'wp_ajax_frm_update_ajax_option', 'FrmFieldsController::update_ajax_option' );
152
+		add_action( 'wp_ajax_frm_duplicate_field', 'FrmFieldsController::duplicate' );
153
+		add_action( 'wp_ajax_frm_delete_field', 'FrmFieldsController::destroy' );
154
+		add_action( 'wp_ajax_frm_add_field_option', 'FrmFieldsController::add_option' );
155
+		add_action( 'wp_ajax_frm_import_choices', 'FrmFieldsController::import_choices' );
156
+		add_action( 'wp_ajax_frm_import_options', 'FrmFieldsController::import_options' );
157
+		add_action( 'wp_ajax_frm_update_field_order', 'FrmFieldsController::update_order' );
158
+
159
+		// Form Actions Controller
160
+		add_action( 'wp_ajax_frm_add_form_action', 'FrmFormActionsController::add_form_action' );
161
+		add_action( 'wp_ajax_frm_form_action_fill', 'FrmFormActionsController::fill_action' );
162
+
163
+		// Forms Controller
164 164
 		add_action( 'wp_ajax_frm_create_from_template', 'FrmFormsController::_create_from_template' );
165 165
 		add_action( 'wp_ajax_frm_save_form', 'FrmFormsController::route' );
166 166
 		add_action( 'wp_ajax_frm_form_key_in_place_edit', 'FrmFormsController::edit_key' );
167 167
 		add_action( 'wp_ajax_frm_form_desc_in_place_edit', 'FrmFormsController::edit_description' );
168
-        add_action( 'wp_ajax_frm_get_default_html', 'FrmFormsController::get_email_html' );
169
-        add_action( 'wp_ajax_frm_get_shortcode_opts', 'FrmFormsController::get_shortcode_opts' );
170
-        add_action( 'wp_ajax_frm_forms_preview', 'FrmFormsController::preview' );
171
-        add_action( 'wp_ajax_nopriv_frm_forms_preview', 'FrmFormsController::preview' );
172
-
173
-        // Styles Controller
174
-        add_action( 'wp_ajax_frm_settings_reset', 'FrmStylesController::reset_styling' );
175
-        add_action( 'wp_ajax_frm_change_styling', 'FrmStylesController::change_styling' );
176
-        add_action( 'wp_ajax_frmpro_load_css', 'FrmStylesController::load_css' );
177
-        add_action( 'wp_ajax_nopriv_frmpro_load_css', 'FrmStylesController::load_css' );
168
+		add_action( 'wp_ajax_frm_get_default_html', 'FrmFormsController::get_email_html' );
169
+		add_action( 'wp_ajax_frm_get_shortcode_opts', 'FrmFormsController::get_shortcode_opts' );
170
+		add_action( 'wp_ajax_frm_forms_preview', 'FrmFormsController::preview' );
171
+		add_action( 'wp_ajax_nopriv_frm_forms_preview', 'FrmFormsController::preview' );
172
+
173
+		// Styles Controller
174
+		add_action( 'wp_ajax_frm_settings_reset', 'FrmStylesController::reset_styling' );
175
+		add_action( 'wp_ajax_frm_change_styling', 'FrmStylesController::change_styling' );
176
+		add_action( 'wp_ajax_frmpro_load_css', 'FrmStylesController::load_css' );
177
+		add_action( 'wp_ajax_nopriv_frmpro_load_css', 'FrmStylesController::load_css' );
178 178
 		add_action( 'wp_ajax_frmpro_css', 'FrmStylesController::load_saved_css' );
179 179
 		add_action( 'wp_ajax_nopriv_frmpro_css', 'FrmStylesController::load_saved_css' );
180 180
 
181
-        // XML Controller
181
+		// XML Controller
182 182
 		add_action( 'wp_ajax_frm_entries_csv', 'FrmXMLController::csv' );
183 183
 		add_action( 'wp_ajax_nopriv_frm_entries_csv', 'FrmXMLController::csv' );
184
-        add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' );
185
-    }
184
+		add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' );
185
+	}
186 186
 
187 187
 	public static function load_form_hooks() {
188
-        // Fields Controller
189
-        add_filter( 'frm_field_type', 'FrmFieldsController::change_type' );
190
-        add_action( 'frm_field_input_html', 'FrmFieldsController::input_html' );
191
-        add_filter( 'frm_field_value_saved', 'FrmFieldsController::check_value', 50, 3 );
192
-        add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' );
188
+		// Fields Controller
189
+		add_filter( 'frm_field_type', 'FrmFieldsController::change_type' );
190
+		add_action( 'frm_field_input_html', 'FrmFieldsController::input_html' );
191
+		add_filter( 'frm_field_value_saved', 'FrmFieldsController::check_value', 50, 3 );
192
+		add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' );
193 193
 
194 194
 		// Forms Controller
195 195
 		add_filter( 'frm_form_classes', 'FrmFormsController::form_classes' );
196 196
 
197
-        // Styles Controller
198
-        add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 );
199
-    }
197
+		// Styles Controller
198
+		add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 );
199
+	}
200 200
 
201 201
 	public static function load_view_hooks() {
202
-        // Hooks go here when a view is loaded
203
-    }
202
+		// Hooks go here when a view is loaded
203
+	}
204 204
 
205 205
 	public static function load_multisite_hooks() {
206 206
 		add_action( 'init', 'FrmAppController::front_head' );
207 207
 		add_action( 'wpmu_upgrade_site', 'FrmAppController::network_upgrade_site' );
208 208
 
209
-        // drop tables when mu site is deleted
210
-        add_filter( 'wpmu_drop_tables', 'FrmAppController::drop_tables' );
211
-    }
209
+		// drop tables when mu site is deleted
210
+		add_filter( 'wpmu_drop_tables', 'FrmAppController::drop_tables' );
211
+	}
212 212
 }
Please login to merge, or discard this patch.
classes/models/FrmEntryFormat.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -126,19 +126,19 @@
 block discarded – undo
126 126
 	}
127 127
 
128 128
 	/**
129
-	* Flatten multi-dimensional array for multi-file upload fields
130
-	* @since 2.0.9
131
-	*/
129
+	 * Flatten multi-dimensional array for multi-file upload fields
130
+	 * @since 2.0.9
131
+	 */
132 132
 	public static function flatten_multi_file_upload( $field, &$val ) {
133 133
 		if ( $field->type == 'file' && FrmField::is_option_true( $field, 'multiple' ) ) {
134 134
 			$val = FrmAppHelper::array_flatten( $val );
135 135
 		}
136 136
 	}
137 137
 
138
-    /**
139
-     * Replace returns with HTML line breaks for display
140
-     * @since 2.0.9
141
-     */
138
+	/**
139
+	 * Replace returns with HTML line breaks for display
140
+	 * @since 2.0.9
141
+	 */
142 142
 	public static function textarea_display_value( $type, $plain_text, &$value ) {
143 143
 		if ( $type == 'textarea' && ! $plain_text ) {
144 144
 			$value = str_replace( array( "\r\n", "\r", "\n" ), ' <br/>', $value );
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -182,6 +182,9 @@
 block discarded – undo
182 182
 		$values = apply_filters( 'frm_prepare_entry_array', $values, $atts );
183 183
 	}
184 184
 
185
+	/**
186
+	 * @param string $val
187
+	 */
185 188
 	private static function get_field_value( $atts, &$val ) {
186 189
 		$f = $atts['field'];
187 190
 		if ( $atts['entry'] ) {
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 			if ( ! self::skip_field( $atts, $f ) ) {
53 53
 				self::fill_entry_values( $atts, $f, $values );
54 54
 			}
55
-			unset($f);
55
+			unset( $f );
56 56
 		}
57 57
 
58 58
 		self::fill_entry_user_info( $atts, $values );
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 			'type'  => $f->type,
122 122
 		);
123 123
 
124
-		$values[ $f->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $field_shortcodes, $f );
124
+		$values[$f->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $field_shortcodes, $f );
125 125
 	}
126 126
 
127 127
 	public static function fill_entry_values( $atts, $f, array &$values ) {
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
 
141 141
 		$atts['field'] = $f;
142 142
 
143
-		if ( $atts['entry'] && ! isset( $atts['entry']->metas[ $f->id ] ) ) {
143
+		if ( $atts['entry'] && ! isset( $atts['entry']->metas[$f->id] ) ) {
144 144
 			// In case include_blank is set
145
-			$atts['entry']->metas[ $f->id ] = '';
145
+			$atts['entry']->metas[$f->id] = '';
146 146
 			$atts['entry'] = apply_filters( 'frm_prepare_entry_content', $atts['entry'], array( 'field' => $atts['field'] ) );
147 147
 			self::fill_values_from_entry( $atts, $values );
148 148
 		}
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
 		self::maybe_strip_html( $atts['plain_text'], $val );
170 170
 
171 171
 		if ( $atts['format'] != 'text' ) {
172
-			$values[ $f->field_key ] = $val;
172
+			$values[$f->field_key] = $val;
173 173
 			if ( isset( $prev_val ) && $prev_val != $val && $f->type != 'textarea' ) {
174
-				$values[ $f->field_key . '-value' ] = $prev_val;
174
+				$values[$f->field_key . '-value'] = $prev_val;
175 175
 			}
176 176
 		} else {
177
-			$values[ $f->id ] = array( 'label' => $f->name, 'val' => $val, 'type' => $f->type );
177
+			$values[$f->id] = array( 'label' => $f->name, 'val' => $val, 'type' => $f->type );
178 178
 		}
179 179
 	}
180 180
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 	private static function get_field_value( $atts, &$val ) {
186 186
 		$f = $atts['field'];
187 187
 		if ( $atts['entry'] ) {
188
-			$prev_val = maybe_unserialize( $atts['entry']->metas[ $f->id ] );
188
+			$prev_val = maybe_unserialize( $atts['entry']->metas[$f->id] );
189 189
 			$meta = array( 'item_id' => $atts['id'], 'field_id' => $f->id, 'meta_value' => $prev_val, 'field_type' => $f->type );
190 190
 
191 191
 			//This filter applies to the default-message shortcode and frm-show-entry shortcode only
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 			return;
242 242
 		}
243 243
 
244
-		$data  = self::get_entry_description_data( $atts );
244
+		$data = self::get_entry_description_data( $atts );
245 245
 
246 246
 		if ( $atts['default_email'] ) {
247 247
 			$atts['entry']->ip = '[ip]';
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 		preg_match_all( $pattern, $u_agent, $matches ); // get the matching numbers
329 329
 
330 330
 		// see how many we have
331
-		$i = count($matches['browser']);
331
+		$i = count( $matches['browser'] );
332 332
 		if ( $i != 1 ) {
333 333
 			//we will have two since we are not using 'other' argument yet
334 334
 			//see if version is before or after the name
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 		self::convert_entry_to_content( $values, $atts, $content );
354 354
 
355 355
 		if ( 'text' == $atts['format'] ) {
356
-			$content = implode('', $content);
356
+			$content = implode( '', $content );
357 357
 		}
358 358
 
359 359
 		if ( $atts['clickable'] ) {
@@ -406,11 +406,11 @@  discard block
 block discarded – undo
406 406
 
407 407
 		// merge defaults, global settings, and shortcode options
408 408
 		foreach ( $default_settings as $key => $setting ) {
409
-			if ( $atts[ $key ] != '' ) {
409
+			if ( $atts[$key] != '' ) {
410 410
 				continue;
411 411
 			}
412 412
 
413
-			$atts[ $key ] = $setting;
413
+			$atts[$key] = $setting;
414 414
 			unset( $key, $setting );
415 415
 		}
416 416
 	}
Please login to merge, or discard this patch.
classes/views/frm-entries/_sidebar-shared-pub.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 if ( ! isset( $entry) ) {
3
-    $entry = $record;
3
+	$entry = $record;
4 4
 } ?>
5 5
 
6 6
 <div class="misc-pub-section curtime misc-pub-curtime">
7 7
     <span id="timestamp">
8 8
     <?php
9
-    $date_format = __( 'M j, Y @ G:i' );
9
+	$date_format = __( 'M j, Y @ G:i' );
10 10
 	printf( __( 'Published on: <b>%1$s</b>' ), FrmAppHelper::get_localized_date( $date_format, $entry->created_at ) ); ?>
11 11
     </span>
12 12
 </div>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! isset( $entry) ) {
2
+if ( ! isset( $entry ) ) {
3 3
     $entry = $record;
4 4
 } ?>
5 5
 
@@ -18,4 +18,4 @@  discard block
 block discarded – undo
18 18
 </div>
19 19
 <?php } ?>
20 20
 
21
-<?php do_action('frm_entry_shared_sidebar', $entry); ?>
21
+<?php do_action( 'frm_entry_shared_sidebar', $entry ); ?>
Please login to merge, or discard this patch.
classes/views/frm-entries/errors.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -4,30 +4,30 @@
 block discarded – undo
4 4
 <?php
5 5
 }
6 6
 if ( isset( $message ) && $message != '' ) {
7
-    if ( FrmAppHelper::is_admin() ) {
7
+	if ( FrmAppHelper::is_admin() ) {
8 8
 		?><div id="message" class="frm_message updated frm_msg_padding"><?php echo wp_kses_post( $message ) ?></div><?php
9 9
 	} else {
10
-        FrmFormsHelper::get_scroll_js($form->id);
10
+		FrmFormsHelper::get_scroll_js($form->id);
11 11
 
12 12
 		// we need to allow scripts here for javascript in the success message
13 13
 		echo $message;
14
-    }
14
+	}
15 15
 }
16 16
 
17 17
 if ( isset($errors) && is_array( $errors ) && ! empty( $errors ) ) {
18 18
 
19 19
 	if ( isset( $form ) && is_object( $form ) ) {
20
-    	FrmFormsHelper::get_scroll_js( $form->id );
20
+		FrmFormsHelper::get_scroll_js( $form->id );
21 21
 	} ?>
22 22
 <div class="frm_error_style">
23 23
 <?php
24 24
 $img = '';
25 25
 if ( ! FrmAppHelper::is_admin() ) {
26
-    $img = apply_filters('frm_error_icon', $img);
27
-    if ( $img && ! empty($img) ) {
28
-    ?><img src="<?php echo esc_attr( $img ) ?>" alt="" />
26
+	$img = apply_filters('frm_error_icon', $img);
27
+	if ( $img && ! empty($img) ) {
28
+	?><img src="<?php echo esc_attr( $img ) ?>" alt="" />
29 29
 <?php
30
-    }
30
+	}
31 31
 }
32 32
 
33 33
 FrmFormsHelper::show_errors( compact( 'img', 'errors' ) );
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( isset($include_extra_container) ) { ?>
2
+if ( isset( $include_extra_container ) ) { ?>
3 3
 <div class="<?php echo esc_attr( $include_extra_container ) ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container">
4 4
 <?php
5 5
 }
@@ -7,14 +7,14 @@  discard block
 block discarded – undo
7 7
     if ( FrmAppHelper::is_admin() ) {
8 8
 		?><div id="message" class="frm_message updated frm_msg_padding"><?php echo wp_kses_post( $message ) ?></div><?php
9 9
 	} else {
10
-        FrmFormsHelper::get_scroll_js($form->id);
10
+        FrmFormsHelper::get_scroll_js( $form->id );
11 11
 
12 12
 		// we need to allow scripts here for javascript in the success message
13 13
 		echo $message;
14 14
     }
15 15
 }
16 16
 
17
-if ( isset($errors) && is_array( $errors ) && ! empty( $errors ) ) {
17
+if ( isset( $errors ) && is_array( $errors ) && ! empty( $errors ) ) {
18 18
 
19 19
 	if ( isset( $form ) && is_object( $form ) ) {
20 20
     	FrmFormsHelper::get_scroll_js( $form->id );
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 <?php
24 24
 $img = '';
25 25
 if ( ! FrmAppHelper::is_admin() ) {
26
-    $img = apply_filters('frm_error_icon', $img);
27
-    if ( $img && ! empty($img) ) {
26
+    $img = apply_filters( 'frm_error_icon', $img );
27
+    if ( $img && ! empty( $img ) ) {
28 28
     ?><img src="<?php echo esc_attr( $img ) ?>" alt="" />
29 29
 <?php
30 30
     }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 <?php
38 38
 }
39 39
 
40
-if ( isset($include_extra_container) ) { ?>
40
+if ( isset( $include_extra_container ) ) { ?>
41 41
 </div>
42 42
 <?php
43 43
 }
Please login to merge, or discard this patch.
classes/views/frm-entries/form.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
     </div>
6 6
 </div>
7 7
 <?php
8
-    return;
8
+	return;
9 9
 }
10 10
 
11 11
 global $frm_vars;
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 		} else {
39 39
 			do_action( 'frm_show_other_field_type', $field, $form, array( 'action' => $form_action ) );
40 40
 		}
41
-    	do_action('frm_get_field_scripts', $field, $form, $form->id);
41
+		do_action('frm_get_field_scripts', $field, $form, $form->id);
42 42
 	}
43 43
 }
44 44
 
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 
64 64
 // close open collapsible toggle div
65 65
 if ( isset($frm_vars['collapse_div']) && $frm_vars['collapse_div'] ) {
66
-    echo "</div>\n";
67
-    unset($frm_vars['collapse_div']);
66
+	echo "</div>\n";
67
+	unset($frm_vars['collapse_div']);
68 68
 }
69 69
 
70 70
 echo FrmFormsHelper::replace_shortcodes($values['after_html'], $form);
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
 }
78 78
 
79 79
 if ( FrmForm::show_submit( $form ) ) {
80
-    unset($values['fields']);
81
-    FrmFormsHelper::get_custom_submit($values['submit_html'], $form, $submit, $form_action, $values);
80
+	unset($values['fields']);
81
+	FrmFormsHelper::get_custom_submit($values['submit_html'], $form, $submit, $form_action, $values);
82 82
 }
83 83
 ?>
84 84
 </fieldset>
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( empty($values) || ! isset($values['fields']) || empty($values['fields']) ) { ?>
3
-<div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class($form); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container">
2
+if ( empty( $values ) || ! isset( $values['fields'] ) || empty( $values['fields'] ) ) { ?>
3
+<div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class( $form ); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container">
4 4
 	<div class="frm_error_style"><strong><?php _e( 'Oops!', 'formidable' ) ?></strong> <?php printf( __( 'You did not add any fields to your form. %1$sGo back%2$s and add some.', 'formidable' ), '<a href="' . esc_url( admin_url( '?page=formidable&frm_action=edit&id=' . $form->id ) ) . '">', '</a>' ) ?>
5 5
     </div>
6 6
 </div>
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
 <div class="frm_form_fields <?php echo esc_attr( apply_filters( 'frm_form_fields_class', '', $values ) ); ?>">
19 19
 <fieldset>
20 20
 <?php echo FrmFormsHelper::replace_shortcodes( $values['before_html'], $form, $title, $description ); ?>
21
-<?php do_action( 'frm_after_title', compact('form') ) ?>
22
-<input type="hidden" name="frm_action" value="<?php echo esc_attr($form_action) ?>" />
23
-<input type="hidden" name="form_id" value="<?php echo esc_attr($form->id) ?>" />
24
-<input type="hidden" name="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" id="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" value="<?php echo esc_attr($frm_hide_fields) ?>" />
25
-<input type="hidden" name="form_key" value="<?php echo esc_attr($form->form_key) ?>" />
21
+<?php do_action( 'frm_after_title', compact( 'form' ) ) ?>
22
+<input type="hidden" name="frm_action" value="<?php echo esc_attr( $form_action ) ?>" />
23
+<input type="hidden" name="form_id" value="<?php echo esc_attr( $form->id ) ?>" />
24
+<input type="hidden" name="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" id="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" value="<?php echo esc_attr( $frm_hide_fields ) ?>" />
25
+<input type="hidden" name="form_key" value="<?php echo esc_attr( $form->form_key ) ?>" />
26 26
 <input type="hidden" name="item_meta[0]" value="" />
27 27
 <?php wp_nonce_field( 'frm_submit_entry_nonce', 'frm_submit_entry_' . $form->id ); ?>
28 28
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		} else {
36 36
 			do_action( 'frm_show_other_field_type', $field, $form, array( 'action' => $form_action ) );
37 37
 		}
38
-    	do_action('frm_get_field_scripts', $field, $form, $form->id);
38
+    	do_action( 'frm_get_field_scripts', $field, $form, $form->id );
39 39
 	}
40 40
 }
41 41
 
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 if ( FrmAppHelper::is_admin() ) { ?>
44 44
 <div class="frm_form_field form-field">
45 45
 <label class="frm_primary_label"><?php _e( 'Entry Key', 'formidable' ) ?></label>
46
-<input type="text" name="item_key" value="<?php echo esc_attr($values['item_key']) ?>" />
46
+<input type="text" name="item_key" value="<?php echo esc_attr( $values['item_key'] ) ?>" />
47 47
 </div>
48 48
 <?php } else { ?>
49
-<input type="hidden" name="item_key" value="<?php echo esc_attr($values['item_key']) ?>" />
49
+<input type="hidden" name="item_key" value="<?php echo esc_attr( $values['item_key'] ) ?>" />
50 50
 <?php }
51 51
 
52
-do_action('frm_entry_form', $form, $form_action, $errors);
52
+do_action( 'frm_entry_form', $form, $form_action, $errors );
53 53
 
54 54
 global $frm_vars;
55 55
 // close open section div
@@ -59,23 +59,23 @@  discard block
 block discarded – undo
59 59
 }
60 60
 
61 61
 // close open collapsible toggle div
62
-if ( isset($frm_vars['collapse_div']) && $frm_vars['collapse_div'] ) {
62
+if ( isset( $frm_vars['collapse_div'] ) && $frm_vars['collapse_div'] ) {
63 63
     echo "</div>\n";
64
-    unset($frm_vars['collapse_div']);
64
+    unset( $frm_vars['collapse_div'] );
65 65
 }
66 66
 
67
-echo FrmFormsHelper::replace_shortcodes($values['after_html'], $form);
67
+echo FrmFormsHelper::replace_shortcodes( $values['after_html'], $form );
68 68
 
69 69
 
70
-if ( has_action('frm_entries_footer_scripts') ) { ?>
70
+if ( has_action( 'frm_entries_footer_scripts' ) ) { ?>
71 71
 <script type="text/javascript">
72
-<?php do_action('frm_entries_footer_scripts', $values['fields'], $form); ?>
72
+<?php do_action( 'frm_entries_footer_scripts', $values['fields'], $form ); ?>
73 73
 </script><?php
74 74
 }
75 75
 
76 76
 if ( FrmForm::show_submit( $form ) ) {
77
-    unset($values['fields']);
78
-    FrmFormsHelper::get_custom_submit($values['submit_html'], $form, $submit, $form_action, $values);
77
+    unset( $values['fields'] );
78
+    FrmFormsHelper::get_custom_submit( $values['submit_html'], $form, $submit, $form_action, $values );
79 79
 }
80 80
 ?>
81 81
 </fieldset>
Please login to merge, or discard this patch.
classes/views/frm-entries/show.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -15,43 +15,43 @@
 block discarded – undo
15 15
                     <div class="inside">
16 16
                         <table class="form-table"><tbody>
17 17
                         <?php
18
-                        $first_h3 = 'frm_first_h3';
19
-                        foreach ( $fields as $field ) {
18
+						$first_h3 = 'frm_first_h3';
19
+						foreach ( $fields as $field ) {
20 20
 							if ( in_array( $field->type, array( 'captcha', 'html', 'end_divider', 'form' ) ) ) {
21
-                                continue;
22
-                            }
21
+								continue;
22
+							}
23 23
 
24
-                            if ( in_array($field->type, array( 'break', 'divider' ) ) ) {
25
-                            ?>
24
+							if ( in_array($field->type, array( 'break', 'divider' ) ) ) {
25
+							?>
26 26
                         </tbody></table>
27 27
                         <br/><h3 class="<?php echo esc_attr( $first_h3 ) ?>"><?php echo esc_html( $field->name ) ?></h3>
28 28
                         <table class="form-table"><tbody>
29 29
                         <?php
30
-                                $first_h3 = '';
31
-                            } else {
32
-                        ?>
30
+								$first_h3 = '';
31
+							} else {
32
+						?>
33 33
                         <tr>
34 34
                             <th scope="row"><?php echo esc_html( $field->name ) ?>:</th>
35 35
                             <td>
36 36
                             <?php
37 37
 							$embedded_field_id = ( $entry->form_id != $field->form_id ) ? 'form' . $field->form_id : 0;
38
-                            $atts = array(
39
-                                'type' => $field->type, 'post_id' => $entry->post_id,
40
-                                'show_filename' => true, 'show_icon' => true, 'entry_id' => $entry->id,
41
-                                'embedded_field_id' => $embedded_field_id,
42
-                            );
43
-                            echo $display_value = FrmEntriesHelper::prepare_display_value($entry, $field, $atts);
38
+							$atts = array(
39
+								'type' => $field->type, 'post_id' => $entry->post_id,
40
+								'show_filename' => true, 'show_icon' => true, 'entry_id' => $entry->id,
41
+								'embedded_field_id' => $embedded_field_id,
42
+							);
43
+							echo $display_value = FrmEntriesHelper::prepare_display_value($entry, $field, $atts);
44 44
 
45
-                            if ( is_email($display_value) && ! in_array($display_value, $to_emails) ) {
46
-                                $to_emails[] = $display_value;
47
-                            }
48
-                            ?>
45
+							if ( is_email($display_value) && ! in_array($display_value, $to_emails) ) {
46
+								$to_emails[] = $display_value;
47
+							}
48
+							?>
49 49
                             </td>
50 50
                         </tr>
51 51
                         <?php }
52
-                        }
52
+						}
53 53
 
54
-                        ?>
54
+						?>
55 55
 
56 56
                         <?php if ( $entry->parent_item_id ) { ?>
57 57
                         <tr><th><?php _e( 'Parent Entry ID', 'formidable' ) ?>:</th>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <div id="form_show_entry_page" class="wrap">
2 2
     <div class="frmicon icon32"><br/></div>
3 3
     <h2><?php _e( 'View Entry', 'formidable' ) ?>
4
-        <?php do_action('frm_entry_inside_h2', $entry->form_id); ?>
4
+        <?php do_action( 'frm_entry_inside_h2', $entry->form_id ); ?>
5 5
     </h2>
6 6
 
7 7
     <div class="frm_forms">
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
         <div id="poststuff">
10 10
             <div id="post-body" class="metabox-holder columns-2">
11 11
             <div id="post-body-content">
12
-                <?php FrmAppController::get_form_nav($entry->form_id, true); ?>
12
+                <?php FrmAppController::get_form_nav( $entry->form_id, true ); ?>
13 13
                 <div class="postbox">
14 14
                     <h3 class="hndle"><span><?php _e( 'Entry', 'formidable' ) ?></span></h3>
15 15
                     <div class="inside">
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
                                 continue;
22 22
                             }
23 23
 
24
-                            if ( in_array($field->type, array( 'break', 'divider' ) ) ) {
24
+                            if ( in_array( $field->type, array( 'break', 'divider' ) ) ) {
25 25
                             ?>
26 26
                         </tbody></table>
27 27
                         <br/><h3 class="<?php echo esc_attr( $first_h3 ) ?>"><?php echo esc_html( $field->name ) ?></h3>
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
                                 'show_filename' => true, 'show_icon' => true, 'entry_id' => $entry->id,
41 41
                                 'embedded_field_id' => $embedded_field_id,
42 42
                             );
43
-                            echo $display_value = FrmEntriesHelper::prepare_display_value($entry, $field, $atts);
43
+                            echo $display_value = FrmEntriesHelper::prepare_display_value( $entry, $field, $atts );
44 44
 
45
-                            if ( is_email($display_value) && ! in_array($display_value, $to_emails) ) {
45
+                            if ( is_email( $display_value ) && ! in_array( $display_value, $to_emails ) ) {
46 46
                                 $to_emails[] = $display_value;
47 47
                             }
48 48
                             ?>
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
                         </td></tr>
60 60
                         <?php } ?>
61 61
                         </tbody></table>
62
-                        <?php do_action('frm_show_entry', $entry); ?>
62
+                        <?php do_action( 'frm_show_entry', $entry ); ?>
63 63
                     </div>
64 64
                 </div>
65 65
 
66
-                <?php do_action('frm_after_show_entry', $entry); ?>
66
+                <?php do_action( 'frm_after_show_entry', $entry ); ?>
67 67
 
68 68
             </div>
69 69
 			<?php require( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/sidebar-show.php' ); ?>
Please login to merge, or discard this patch.
classes/views/frm-entries/sidebar-shared.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -66,18 +66,18 @@
 block discarded – undo
66 66
         <?php } ?>
67 67
 
68 68
         <?php
69
-        foreach ( (array) $data as $k => $d ) {
69
+		foreach ( (array) $data as $k => $d ) {
70 70
 			if ( in_array( $k, array( 'browser', 'referrer' ) ) ) {
71
-                continue;
72
-            }
73
-        ?>
71
+				continue;
72
+			}
73
+		?>
74 74
         <div class="misc-pub-section">
75 75
 			<b><?php echo sanitize_text_field( ucfirst( str_replace( '-', ' ', $k ) ) ); ?></b>:
76 76
 			<?php echo wp_kses_post( implode( ', ', (array) $d ) ); ?>
77 77
         </div>
78 78
         <?php
79
-            unset($k, $d);
80
-        }
81
-        ?>
79
+			unset($k, $d);
80
+		}
81
+		?>
82 82
     </div>
83 83
 </div>
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
         <div class="misc-pub-section">
7 7
             <span class="dashicons dashicons-admin-post wp-media-buttons-icon"></span>
8 8
             <?php _e( 'Post', 'formidable' ) ?>:
9
-            <b><?php echo get_the_title($entry->post_id) ?></b>
9
+            <b><?php echo get_the_title( $entry->post_id ) ?></b>
10 10
 			<span>
11 11
 				<a href="<?php echo esc_url( admin_url( 'post.php?post=' . $entry->post_id . '&action=edit' ) ) ?>">
12 12
 					<?php _e( 'Edit', 'formidable' ) ?>
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         <?php if ( $entry->updated_by && $entry->updated_by != $entry->user_id ) { ?>
42 42
         <div class="misc-pub-section">
43 43
             <span class="dashicons dashicons-admin-users wp-media-buttons-icon"></span>
44
-			<?php printf( __( 'Updated by: %1$s', 'formidable' ), FrmProFieldsHelper::get_display_name( $entry->updated_by,  'display_name', array( 'link' => true ) ) ); ?>
44
+			<?php printf( __( 'Updated by: %1$s', 'formidable' ), FrmProFieldsHelper::get_display_name( $entry->updated_by, 'display_name', array( 'link' => true ) ) ); ?>
45 45
         </div>
46 46
         <?php } ?>
47 47
         <?php } ?>
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
         </div>
65 65
         <?php } ?>
66 66
 
67
-        <?php if ( isset($data['referrer']) ) { ?>
67
+        <?php if ( isset( $data['referrer'] ) ) { ?>
68 68
         <div class="misc-pub-section">
69 69
             <b><?php _e( 'Referrer', 'formidable' ) ?></b>:<br/>
70
-			<?php echo wp_kses_post( str_replace( "\r\n", '<br/>', $data['referrer'] ) );  ?>
70
+			<?php echo wp_kses_post( str_replace( "\r\n", '<br/>', $data['referrer'] ) ); ?>
71 71
         </div>
72 72
         <?php } ?>
73 73
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 			<?php echo wp_kses_post( implode( ', ', (array) $d ) ); ?>
83 83
         </div>
84 84
         <?php
85
-            unset($k, $d);
85
+            unset( $k, $d );
86 86
         }
87 87
         ?>
88 88
     </div>
Please login to merge, or discard this patch.
classes/views/frm-form-actions/_action_inside.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1
-<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('post_excerpt', '') ) ?>" class="frm_action_name" value="<?php echo esc_attr( $form_action->post_excerpt ); ?>" />
2
-<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('ID', '') ) ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" />
1
+<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'post_excerpt', '' ) ) ?>" class="frm_action_name" value="<?php echo esc_attr( $form_action->post_excerpt ); ?>" />
2
+<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'ID', '' ) ) ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" />
3 3
 
4 4
 <table class="form-table">
5 5
     <tr>
6 6
         <th>
7
-            <label <?php FrmAppHelper::maybe_add_tooltip('action_title') ?>><?php _e( 'Label', 'formidable' ) ?></label>
7
+            <label <?php FrmAppHelper::maybe_add_tooltip( 'action_title' ) ?>><?php _e( 'Label', 'formidable' ) ?></label>
8 8
         </th>
9
-        <td><input type="text" name="<?php echo esc_attr( $action_control->get_field_name('post_title', '') ) ?>" value="<?php echo esc_attr($form_action->post_title); ?>" class="large-text <?php FrmAppHelper::maybe_add_tooltip('action_title', 'open') ?>" id="<?php echo esc_attr( $action_control->get_field_id('action_post_title') ) ?>" />
9
+        <td><input type="text" name="<?php echo esc_attr( $action_control->get_field_name( 'post_title', '' ) ) ?>" value="<?php echo esc_attr( $form_action->post_title ); ?>" class="large-text <?php FrmAppHelper::maybe_add_tooltip( 'action_title', 'open' ) ?>" id="<?php echo esc_attr( $action_control->get_field_id( 'action_post_title' ) ) ?>" />
10 10
         </td>
11 11
     </tr>
12 12
 </table>
13
-<?php $action_control->form($form_action, compact('form', 'action_key', 'values')); ?>
13
+<?php $action_control->form( $form_action, compact( 'form', 'action_key', 'values' ) ); ?>
14 14
 
15 15
 <table class="form-table frm-no-margin">
16 16
     <tr><td>
@@ -25,18 +25,18 @@  discard block
 block discarded – undo
25 25
 
26 26
 if ( count( $action_control->action_options['event'] ) == 1 || $action_control->action_options['force_event'] ) {
27 27
 	foreach ( $action_control->action_options['event'] as $e ) { ?>
28
-	<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" value="<?php echo esc_attr( $e ) ?>" />
28
+	<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ) ?>[]" value="<?php echo esc_attr( $e ) ?>" />
29 29
 <?php
30 30
 	}
31 31
 } else {
32 32
 ?>
33 33
 	<p><label class="frm_left_label"><?php _e( 'Trigger this action after', 'formidable' ) ?></label>
34
-		<select name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" multiple="multiple" class="frm_multiselect" id="<?php echo esc_attr( $action_control->get_field_id('event') ) ?>">
34
+		<select name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ) ?>[]" multiple="multiple" class="frm_multiselect" id="<?php echo esc_attr( $action_control->get_field_id( 'event' ) ) ?>">
35 35
 <?php
36 36
 
37 37
 	$event_labels = FrmFormAction::trigger_labels();
38 38
 	foreach ( $action_control->action_options['event'] as $event ) { ?>
39
-		<option value="<?php echo esc_attr( $event ) ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event; ?></option>
39
+		<option value="<?php echo esc_attr( $event ) ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo isset( $event_labels[$event] ) ? $event_labels[$event] : $event; ?></option>
40 40
 <?php
41 41
 	}
42 42
 ?>		</select>
@@ -47,6 +47,6 @@  discard block
 block discarded – undo
47 47
 do_action( 'frm_additional_action_settings', $form_action, compact( 'form', 'action_control', 'action_key', 'values' ) );
48 48
 
49 49
 ?>
50
-    <span class="alignright frm_action_id <?php echo empty( $form_action->ID ) ? 'frm_hidden' : ''; ?>"><?php printf( __( 'Action ID: %1$s', 'formidable' ), $form_action->ID); ?></span>
50
+    <span class="alignright frm_action_id <?php echo empty( $form_action->ID ) ? 'frm_hidden' : ''; ?>"><?php printf( __( 'Action ID: %1$s', 'formidable' ), $form_action->ID ); ?></span>
51 51
     </td></tr>
52 52
 </table>
Please login to merge, or discard this patch.