Completed
Push — master ( ea430e...236b06 )
by Jamie
03:00
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   +178 added lines, -178 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,40 +34,40 @@  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 50
 		$values = array( 'item_id' => $entry_id, 'field_id' => $field_id );
51 51
 		$where_values = $values;
52
-        $values['meta_value'] = $meta_value;
53
-        $values = apply_filters('frm_update_entry_meta', $values);
52
+		$values['meta_value'] = $meta_value;
53
+		$values = apply_filters('frm_update_entry_meta', $values);
54 54
 		if ( is_array($values['meta_value']) ) {
55 55
 			$values['meta_value'] = array_filter( $values['meta_value'], 'FrmAppHelper::is_not_empty_value' );
56 56
 		}
57
-        $meta_value = maybe_serialize($values['meta_value']);
57
+		$meta_value = maybe_serialize($values['meta_value']);
58 58
 
59
-        wp_cache_delete( $entry_id, 'frm_entry');
59
+		wp_cache_delete( $entry_id, 'frm_entry');
60 60
 		self::clear_cache();
61 61
 
62 62
 		return $wpdb->update( $wpdb->prefix . 'frm_item_metas', array( 'meta_value' => $meta_value ), $where_values );
63
-    }
63
+	}
64 64
 
65 65
 	public static function update_entry_metas( $entry_id, $values ) {
66
-        global $wpdb;
66
+		global $wpdb;
67 67
 
68 68
 		$prev_values = FrmDb::get_col( $wpdb->prefix . 'frm_item_metas', array( 'item_id' => $entry_id, 'field_id !' => 0 ), 'field_id' );
69 69
 
70
-        foreach ( $values as $field_id => $meta_value ) {
70
+		foreach ( $values as $field_id => $meta_value ) {
71 71
 			$field = false;
72 72
 			if ( ! empty( $field_id ) ) {
73 73
 				$field = FrmField::getOne( $field_id );
@@ -91,39 +91,39 @@  discard block
 block discarded – undo
91 91
 			}
92 92
 		}
93 93
 
94
-        if ( empty($prev_values) ) {
95
-            return;
96
-        }
94
+		if ( empty($prev_values) ) {
95
+			return;
96
+		}
97 97
 
98
-        $prev_values = array_diff($prev_values, array_keys($values));
98
+		$prev_values = array_diff($prev_values, array_keys($values));
99 99
 
100
-        if ( empty($prev_values) ) {
101
-            return;
102
-        }
100
+		if ( empty($prev_values) ) {
101
+			return;
102
+		}
103 103
 
104 104
 		// prepare the query
105 105
 		$where = array( 'item_id' => $entry_id, 'field_id' => $prev_values );
106 106
 		FrmDb::get_where_clause_and_values( $where );
107 107
 
108
-        // Delete any leftovers
109
-        $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'frm_item_metas ' . $where['where'], $where['values'] ) );
108
+		// Delete any leftovers
109
+		$wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'frm_item_metas ' . $where['where'], $where['values'] ) );
110 110
 		self::clear_cache();
111
-    }
111
+	}
112 112
 
113 113
 	public static function duplicate_entry_metas( $old_id, $new_id ) {
114
-        $metas = self::get_entry_meta_info($old_id);
115
-        foreach ( $metas as $meta ) {
116
-            self::add_entry_meta($new_id, $meta->field_id, null, $meta->meta_value);
117
-            unset($meta);
118
-        }
114
+		$metas = self::get_entry_meta_info($old_id);
115
+		foreach ( $metas as $meta ) {
116
+			self::add_entry_meta($new_id, $meta->field_id, null, $meta->meta_value);
117
+			unset($meta);
118
+		}
119 119
 		self::clear_cache();
120
-    }
120
+	}
121 121
 
122 122
 	public static function delete_entry_meta( $entry_id, $field_id ) {
123
-        global $wpdb;
123
+		global $wpdb;
124 124
 		self::clear_cache();
125
-        return $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->prefix}frm_item_metas WHERE field_id=%d AND item_id=%d", $field_id, $entry_id));
126
-    }
125
+		return $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->prefix}frm_item_metas WHERE field_id=%d AND item_id=%d", $field_id, $entry_id));
126
+	}
127 127
 
128 128
 	/**
129 129
 	 * Clear entry meta caching
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	}
149 149
 
150 150
 	public static function get_entry_meta_by_field( $entry_id, $field_id ) {
151
-        global $wpdb;
151
+		global $wpdb;
152 152
 
153 153
 		if ( is_object( $entry_id ) ) {
154 154
 			$entry = $entry_id;
@@ -161,137 +161,137 @@  discard block
 block discarded – undo
161 161
 
162 162
 		if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) {
163 163
 			$result = $cached->metas[ $field_id ];
164
-            return stripslashes_deep($result);
165
-        }
164
+			return stripslashes_deep($result);
165
+		}
166 166
 
167 167
 		$get_table = $wpdb->prefix . 'frm_item_metas';
168 168
 		$query = array( 'item_id' => $entry_id );
169
-        if ( is_numeric($field_id) ) {
169
+		if ( is_numeric($field_id) ) {
170 170
 			$query['field_id'] = $field_id;
171
-        } else {
171
+		} else {
172 172
 			$get_table .= ' it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id';
173 173
 			$query['fi.field_key'] = $field_id;
174
-        }
174
+		}
175 175
 
176 176
 		$result = FrmDb::get_var( $get_table, $query, 'meta_value' );
177
-        $result = maybe_unserialize($result);
178
-        $result = stripslashes_deep($result);
177
+		$result = maybe_unserialize($result);
178
+		$result = stripslashes_deep($result);
179 179
 
180
-        return $result;
181
-    }
180
+		return $result;
181
+	}
182 182
 
183 183
 	public static function get_entry_metas( $entry_id ) {
184
-        _deprecated_function( __FUNCTION__, '1.07.10');
184
+		_deprecated_function( __FUNCTION__, '1.07.10');
185 185
 
186
-        global $wpdb;
186
+		global $wpdb;
187 187
 		return FrmDb::get_col( $wpdb->prefix . 'frm_item_metas', array( 'item_id' => $entry_id ), 'meta_value' );
188
-    }
188
+	}
189 189
 
190
-    public static function get_entry_metas_for_field( $field_id, $order = '', $limit = '', $args = array() ) {
190
+	public static function get_entry_metas_for_field( $field_id, $order = '', $limit = '', $args = array() ) {
191 191
 		$defaults = array( 'value' => false, 'unique' => false, 'stripslashes' => true, 'is_draft' => false );
192
-        $args = wp_parse_args( $args, $defaults );
192
+		$args = wp_parse_args( $args, $defaults );
193 193
 
194
-        $query = array();
195
-        self::meta_field_query($field_id, $order, $limit, $args, $query);
196
-        $query = implode(' ', $query);
194
+		$query = array();
195
+		self::meta_field_query($field_id, $order, $limit, $args, $query);
196
+		$query = implode(' ', $query);
197 197
 
198 198
 		$cache_key = 'entry_metas_for_field_' . $field_id . $order . $limit . maybe_serialize( $args );
199
-        $values = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, 'get_col');
199
+		$values = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, 'get_col');
200 200
 
201
-        if ( ! $args['stripslashes'] ) {
202
-            return $values;
203
-        }
201
+		if ( ! $args['stripslashes'] ) {
202
+			return $values;
203
+		}
204 204
 
205 205
 		foreach ( $values as $k => $v ) {
206 206
 			$values[ $k ] = maybe_unserialize( $v );
207
-            unset($k, $v);
208
-        }
207
+			unset($k, $v);
208
+		}
209 209
 
210
-        return stripslashes_deep($values);
211
-    }
210
+		return stripslashes_deep($values);
211
+	}
212 212
 
213
-    /**
214
-     * @param string $order
215
-     * @param string $limit
216
-     */
213
+	/**
214
+	 * @param string $order
215
+	 * @param string $limit
216
+	 */
217 217
 	private static function meta_field_query( $field_id, $order, $limit, $args, array &$query ) {
218
-        global $wpdb;
219
-        $query[] = 'SELECT';
220
-        $query[] = $args['unique'] ? 'DISTINCT(em.meta_value)' : 'em.meta_value';
218
+		global $wpdb;
219
+		$query[] = 'SELECT';
220
+		$query[] = $args['unique'] ? 'DISTINCT(em.meta_value)' : 'em.meta_value';
221 221
 		$query[] = 'FROM ' . $wpdb->prefix . 'frm_item_metas em ';
222 222
 
223
-        if ( ! $args['is_draft'] ) {
223
+		if ( ! $args['is_draft'] ) {
224 224
 			$query[] = 'INNER JOIN ' . $wpdb->prefix . 'frm_items e ON (e.id=em.item_id)';
225
-        }
225
+		}
226 226
 
227
-        if ( is_numeric($field_id) ) {
228
-            $query[] = $wpdb->prepare('WHERE em.field_id=%d', $field_id);
229
-        } else {
227
+		if ( is_numeric($field_id) ) {
228
+			$query[] = $wpdb->prepare('WHERE em.field_id=%d', $field_id);
229
+		} else {
230 230
 			$query[] = $wpdb->prepare( 'LEFT JOIN ' . $wpdb->prefix . 'frm_fields fi ON (em.field_id = fi.id) WHERE fi.field_key=%s', $field_id );
231
-        }
231
+		}
232 232
 
233
-        if ( ! $args['is_draft'] ) {
234
-            $query[] = 'AND e.is_draft=0';
235
-        }
233
+		if ( ! $args['is_draft'] ) {
234
+			$query[] = 'AND e.is_draft=0';
235
+		}
236 236
 
237
-        if ( $args['value'] ) {
238
-            $query[] = $wpdb->prepare(' AND meta_value=%s', $args['value']);
239
-        }
240
-        $query[] = $order . $limit;
241
-    }
237
+		if ( $args['value'] ) {
238
+			$query[] = $wpdb->prepare(' AND meta_value=%s', $args['value']);
239
+		}
240
+		$query[] = $order . $limit;
241
+	}
242 242
 
243 243
 	public static function get_entry_meta_info( $entry_id ) {
244 244
 		return FrmDb::get_results( 'frm_item_metas', array( 'item_id' => $entry_id ) );
245
-    }
245
+	}
246 246
 
247 247
 	public static function getAll( $where = array(), $order_by = '', $limit = '', $stripslashes = false ) {
248
-        global $wpdb;
249
-        $query = 'SELECT it.*, fi.type as field_type, fi.field_key as field_key,
248
+		global $wpdb;
249
+		$query = 'SELECT it.*, fi.type as field_type, fi.field_key as field_key,
250 250
             fi.required as required, fi.form_id as field_form_id, fi.name as field_name, fi.options as fi_options
251 251
 			FROM ' . $wpdb->prefix . 'frm_item_metas it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id' .
252
-            FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
252
+			FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
253 253
 
254 254
 		$cache_key = 'all_' . maybe_serialize( $where ) . $order_by . $limit;
255
-        $results = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, ($limit == ' LIMIT 1' ? 'get_row' : 'get_results'));
255
+		$results = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, ($limit == ' LIMIT 1' ? 'get_row' : 'get_results'));
256 256
 
257
-        if ( ! $results || ! $stripslashes ) {
258
-            return $results;
259
-        }
257
+		if ( ! $results || ! $stripslashes ) {
258
+			return $results;
259
+		}
260 260
 
261
-        foreach ( $results as $k => $result ) {
261
+		foreach ( $results as $k => $result ) {
262 262
 			$results[ $k ]->meta_value = stripslashes_deep( maybe_unserialize( $result->meta_value ) );
263
-            unset($k, $result);
264
-        }
263
+			unset($k, $result);
264
+		}
265 265
 
266
-        return $results;
267
-    }
266
+		return $results;
267
+	}
268 268
 
269
-    public static function getEntryIds( $where = array(), $order_by = '', $limit = '', $unique = true, $args = array() ) {
269
+	public static function getEntryIds( $where = array(), $order_by = '', $limit = '', $unique = true, $args = array() ) {
270 270
 		$defaults = array(
271 271
 			'is_draft' => false,
272 272
 			'user_id'  => '',
273 273
 			'group_by' => '',
274 274
 		);
275
-        $args = wp_parse_args($args, $defaults);
275
+		$args = wp_parse_args($args, $defaults);
276 276
 
277
-        $query = array();
278
-        self::get_ids_query($where, $order_by, $limit, $unique, $args, $query );
279
-        $query = implode(' ', $query);
277
+		$query = array();
278
+		self::get_ids_query($where, $order_by, $limit, $unique, $args, $query );
279
+		$query = implode(' ', $query);
280 280
 
281 281
 		$cache_key = 'ids_' . maybe_serialize( $where ) . $order_by . 'l' . $limit . 'u' . $unique . maybe_serialize( $args );
282
-        $results = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, ($limit == ' LIMIT 1' ? 'get_var' : 'get_col'));
282
+		$results = FrmAppHelper::check_cache($cache_key, 'frm_entry', $query, ($limit == ' LIMIT 1' ? 'get_var' : 'get_col'));
283 283
 
284
-        return $results;
285
-    }
284
+		return $results;
285
+	}
286 286
 
287
-    /**
288
-     * @param string|array $where
289
-     * @param string $order_by
290
-     * @param string $limit
291
-     */
287
+	/**
288
+	 * @param string|array $where
289
+	 * @param string $order_by
290
+	 * @param string $limit
291
+	 */
292 292
 	private static function get_ids_query( $where, $order_by, $limit, $unique, $args, array &$query ) {
293
-        global $wpdb;
294
-        $query[] = 'SELECT';
293
+		global $wpdb;
294
+		$query[] = 'SELECT';
295 295
 
296 296
 		$defaults = array( 'return_parent_id' => false );
297 297
 		$args = array_merge( $defaults, $args );
@@ -305,89 +305,89 @@  discard block
 block discarded – undo
305 305
 		$query[] = 'FROM ' . $wpdb->prefix . 'frm_item_metas it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id';
306 306
 
307 307
 		$query[] = 'INNER JOIN ' . $wpdb->prefix . 'frm_items e ON (e.id=it.item_id)';
308
-        if ( is_array($where) ) {
309
-            if ( ! $args['is_draft'] ) {
310
-                $where['e.is_draft'] = 0;
311
-            } else if ( $args['is_draft'] == 1 ) {
312
-                $where['e.is_draft'] = 1;
313
-            }
314
-
315
-            if ( ! empty($args['user_id']) ) {
316
-                $where['e.user_id'] = $args['user_id'];
317
-            }
318
-            $query[] = FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
308
+		if ( is_array($where) ) {
309
+			if ( ! $args['is_draft'] ) {
310
+				$where['e.is_draft'] = 0;
311
+			} else if ( $args['is_draft'] == 1 ) {
312
+				$where['e.is_draft'] = 1;
313
+			}
314
+
315
+			if ( ! empty($args['user_id']) ) {
316
+				$where['e.user_id'] = $args['user_id'];
317
+			}
318
+			$query[] = FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
319 319
 
320 320
 			if ( $args['group_by'] ) {
321 321
 				$query[] = ' GROUP BY ' . sanitize_text_field( $args['group_by'] );
322 322
 			}
323
-            return;
324
-        }
323
+			return;
324
+		}
325 325
 
326 326
 		$draft_where = '';
327 327
 		$user_where = '';
328
-        if ( ! $args['is_draft'] ) {
328
+		if ( ! $args['is_draft'] ) {
329 329
 			$draft_where = $wpdb->prepare( ' AND e.is_draft=%d', 0 );
330
-        } else if ( $args['is_draft'] == 1 ) {
330
+		} else if ( $args['is_draft'] == 1 ) {
331 331
 			$draft_where = $wpdb->prepare( ' AND e.is_draft=%d', 1 );
332
-        }
332
+		}
333 333
 
334
-        if ( ! empty($args['user_id']) ) {
335
-            $user_where = $wpdb->prepare(' AND e.user_id=%d', $args['user_id']);
336
-        }
334
+		if ( ! empty($args['user_id']) ) {
335
+			$user_where = $wpdb->prepare(' AND e.user_id=%d', $args['user_id']);
336
+		}
337 337
 
338
-        if ( strpos($where, ' GROUP BY ') ) {
339
-            // don't inject WHERE filtering after GROUP BY
340
-            $parts = explode(' GROUP BY ', $where);
341
-            $where = $parts[0];
342
-            $where .= $draft_where . $user_where;
338
+		if ( strpos($where, ' GROUP BY ') ) {
339
+			// don't inject WHERE filtering after GROUP BY
340
+			$parts = explode(' GROUP BY ', $where);
341
+			$where = $parts[0];
342
+			$where .= $draft_where . $user_where;
343 343
 			$where .= ' GROUP BY ' . $parts[1];
344
-        } else {
345
-            $where .= $draft_where . $user_where;
346
-        }
344
+		} else {
345
+			$where .= $draft_where . $user_where;
346
+		}
347 347
 
348 348
 		// The query has already been prepared
349 349
 		$query[] = FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
350
-    }
350
+	}
351 351
 
352
-    public static function search_entry_metas( $search, $field_id = '', $operator ) {
352
+	public static function search_entry_metas( $search, $field_id = '', $operator ) {
353 353
 		$cache_key = 'search_' . maybe_serialize( $search ) . $field_id . $operator;
354
-        $results = wp_cache_get($cache_key, 'frm_entry');
355
-        if ( false !== $results ) {
356
-            return $results;
357
-        }
354
+		$results = wp_cache_get($cache_key, 'frm_entry');
355
+		if ( false !== $results ) {
356
+			return $results;
357
+		}
358 358
 
359
-        global $wpdb;
359
+		global $wpdb;
360 360
 		if ( is_array( $search ) ) {
361
-            $where = '';
361
+			$where = '';
362 362
 			foreach ( $search as $field => $value ) {
363 363
 				if ( $value <= 0 || ! in_array( $field, array( 'year', 'month', 'day' ) ) ) {
364
-                    continue;
365
-                }
364
+					continue;
365
+				}
366 366
 
367
-                switch ( $field ) {
368
-                    case 'year':
367
+				switch ( $field ) {
368
+					case 'year':
369 369
 						$value = '%' . $value;
370
-                    break;
371
-                    case 'month':
372
-                        $value .= '%';
373
-                    break;
374
-                    case 'day':
370
+					break;
371
+					case 'month':
372
+						$value .= '%';
373
+					break;
374
+					case 'day':
375 375
 						$value = '%' . $value . '%';
376
-                }
376
+				}
377 377
 				$where .= $wpdb->prepare(' meta_value ' . $operator . ' %s and', $value );
378
-            }
379
-            $where .= $wpdb->prepare(' field_id=%d', $field_id);
378
+			}
379
+			$where .= $wpdb->prepare(' field_id=%d', $field_id);
380 380
 			$query = 'SELECT DISTINCT item_id FROM ' . $wpdb->prefix . 'frm_item_metas' . FrmAppHelper::prepend_and_or_where( ' WHERE ', $where );
381
-        } else {
381
+		} else {
382 382
 			if ( $operator == 'LIKE' ) {
383
-                $search = '%' . $search . '%';
383
+				$search = '%' . $search . '%';
384 384
 			}
385
-            $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);
386
-        }
385
+			$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);
386
+		}
387 387
 
388
-        $results = $wpdb->get_col($query, 0);
388
+		$results = $wpdb->get_col($query, 0);
389 389
 		FrmAppHelper::set_cache( $cache_key, $results, 'frm_entry' );
390 390
 
391
-        return $results;
392
-    }
391
+		return $results;
392
+	}
393 393
 }
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   +140 added lines, -140 removed lines patch added patch discarded remove patch
@@ -1,90 +1,90 @@  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 );
58
-        add_filter( 'frmpro_fields_replace_shortcodes', 'FrmEntriesController::filter_shortcode_value', 10, 4 );
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
+		add_filter( 'frmpro_fields_replace_shortcodes', 'FrmEntriesController::filter_shortcode_value', 10, 4 );
59 59
 
60
-        // Form Actions Controller
61
-        add_action( 'init', 'FrmFormActionsController::register_post_types', 1 );
60
+		// Form Actions Controller
61
+		add_action( 'init', 'FrmFormActionsController::register_post_types', 1 );
62 62
 		add_action( 'frm_after_create_entry', 'FrmFormActionsController::trigger_create_actions', 20, 3 );
63 63
 
64
-        // Forms Controller
65
-        add_action( 'widgets_init', 'FrmFormsController::register_widgets' );
64
+		// Forms Controller
65
+		add_action( 'widgets_init', 'FrmFormsController::register_widgets' );
66 66
 		add_action( 'init', 'FrmFormsController::front_head' );
67
-        add_filter( 'frm_content', 'FrmFormsController::filter_content', 10, 3 );
68
-        add_filter( 'frm_replace_content_shortcodes', 'FrmFormsController::replace_content_shortcodes', 20, 3 );
69
-        add_action( 'admin_bar_init', 'FrmFormsController::admin_bar_css' );
67
+		add_filter( 'frm_content', 'FrmFormsController::filter_content', 10, 3 );
68
+		add_filter( 'frm_replace_content_shortcodes', 'FrmFormsController::replace_content_shortcodes', 20, 3 );
69
+		add_action( 'admin_bar_init', 'FrmFormsController::admin_bar_css' );
70 70
 		add_action( 'wp_footer', 'FrmFormsController::footer_js', 1, 0 );
71 71
 
72 72
 		add_action( 'wp_scheduled_delete', 'FrmForm::scheduled_delete' );
73 73
 
74
-        // Form Shortcodes
75
-        add_shortcode( 'formidable', 'FrmFormsController::get_form_shortcode' );
74
+		// Form Shortcodes
75
+		add_shortcode( 'formidable', 'FrmFormsController::get_form_shortcode' );
76 76
 
77
-        // Styles Controller
78
-        add_action( 'init', 'FrmStylesController::register_post_types', 0 );
79
-        add_filter( 'frm_get_style_opts', 'FrmStylesController::get_style_opts' );
80
-        add_filter( 'frm_add_form_style_class', 'FrmStylesController::get_form_style_class', 10, 2 );
81
-        add_filter( 'frm_show_entry_styles', 'FrmStylesController::show_entry_styles' );
82
-    }
77
+		// Styles Controller
78
+		add_action( 'init', 'FrmStylesController::register_post_types', 0 );
79
+		add_filter( 'frm_get_style_opts', 'FrmStylesController::get_style_opts' );
80
+		add_filter( 'frm_add_form_style_class', 'FrmStylesController::get_form_style_class', 10, 2 );
81
+		add_filter( 'frm_show_entry_styles', 'FrmStylesController::show_entry_styles' );
82
+	}
83 83
 
84 84
 	public static function load_admin_hooks() {
85
-        add_action( 'admin_menu', 'FrmAppController::menu', 1 );
86
-        add_action( 'admin_enqueue_scripts', 'FrmAppController::load_wp_admin_style' );
87
-        add_action( 'admin_notices', 'FrmAppController::pro_get_started_headline' );
85
+		add_action( 'admin_menu', 'FrmAppController::menu', 1 );
86
+		add_action( 'admin_enqueue_scripts', 'FrmAppController::load_wp_admin_style' );
87
+		add_action( 'admin_notices', 'FrmAppController::pro_get_started_headline' );
88 88
 		add_action( 'admin_init', 'FrmAppController::admin_init', 11 );
89 89
 		add_filter( 'plugin_action_links_' . FrmAppHelper::plugin_folder() . '/formidable.php', 'FrmAppController::settings_link' );
90 90
 		register_activation_hook( FrmAppHelper::plugin_folder() . '/formidable.php', 'FrmAppController::activation_install' );
@@ -92,122 +92,122 @@  discard block
 block discarded – undo
92 92
 		// Addons Controller
93 93
 		add_action( 'admin_menu', 'FrmAddonsController::menu', 100 );
94 94
 
95
-        // Entries Controller
96
-        add_action( 'admin_menu', 'FrmEntriesController::menu', 12 );
97
-        add_filter( 'contextual_help', 'FrmEntriesController::contextual_help', 10, 3 );
98
-        add_filter( 'set-screen-option', 'FrmEntriesController::save_per_page', 10, 3 );
99
-        add_filter( 'update_user_metadata', 'FrmEntriesController::check_hidden_cols', 10, 5 );
100
-        add_action( 'updated_user_meta', 'FrmEntriesController::update_hidden_cols', 10, 4 );
95
+		// Entries Controller
96
+		add_action( 'admin_menu', 'FrmEntriesController::menu', 12 );
97
+		add_filter( 'contextual_help', 'FrmEntriesController::contextual_help', 10, 3 );
98
+		add_filter( 'set-screen-option', 'FrmEntriesController::save_per_page', 10, 3 );
99
+		add_filter( 'update_user_metadata', 'FrmEntriesController::check_hidden_cols', 10, 5 );
100
+		add_action( 'updated_user_meta', 'FrmEntriesController::update_hidden_cols', 10, 4 );
101 101
 
102
-        // Fields Controller
103
-        add_filter( 'frm_display_field_options', 'FrmFieldsController::display_field_options' );
102
+		// Fields Controller
103
+		add_filter( 'frm_display_field_options', 'FrmFieldsController::display_field_options' );
104 104
 
105
-        // Form Actions Controller
106
-        if ( FrmAppHelper::is_admin_page( 'formidable' ) ) {
107
-            add_action( 'frm_before_update_form_settings', 'FrmFormActionsController::update_settings' );
108
-        }
109
-        add_action( 'frm_after_duplicate_form', 'FrmFormActionsController::duplicate_form_actions', 20, 3 );
105
+		// Form Actions Controller
106
+		if ( FrmAppHelper::is_admin_page( 'formidable' ) ) {
107
+			add_action( 'frm_before_update_form_settings', 'FrmFormActionsController::update_settings' );
108
+		}
109
+		add_action( 'frm_after_duplicate_form', 'FrmFormActionsController::duplicate_form_actions', 20, 3 );
110 110
 
111
-        // Forms Controller
112
-        add_action( 'admin_menu', 'FrmFormsController::menu', 10 );
113
-        add_action( 'admin_head-toplevel_page_formidable', 'FrmFormsController::head' );
111
+		// Forms Controller
112
+		add_action( 'admin_menu', 'FrmFormsController::menu', 10 );
113
+		add_action( 'admin_head-toplevel_page_formidable', 'FrmFormsController::head' );
114 114
 
115
-        add_filter( 'set-screen-option', 'FrmFormsController::save_per_page', 10, 3 );
116
-        add_action( 'admin_footer', 'FrmFormsController::insert_form_popup' );
115
+		add_filter( 'set-screen-option', 'FrmFormsController::save_per_page', 10, 3 );
116
+		add_action( 'admin_footer', 'FrmFormsController::insert_form_popup' );
117 117
 		add_action( 'media_buttons', 'FrmFormsController::insert_form_button' );
118 118
 
119
-        // Forms Model
120
-        add_action( 'frm_after_duplicate_form', 'FrmForm::after_duplicate', 10, 2 );
119
+		// Forms Model
120
+		add_action( 'frm_after_duplicate_form', 'FrmForm::after_duplicate', 10, 2 );
121 121
 
122
-        // Settings Controller
123
-        add_action( 'admin_menu', 'FrmSettingsController::menu', 45 );
124
-        add_action( 'frm_before_settings', 'FrmSettingsController::license_box' );
122
+		// Settings Controller
123
+		add_action( 'admin_menu', 'FrmSettingsController::menu', 45 );
124
+		add_action( 'frm_before_settings', 'FrmSettingsController::license_box' );
125 125
 
126
-        // Styles Controller
127
-        add_action( 'admin_menu', 'FrmStylesController::menu', 14 );
128
-        add_action( 'admin_init', 'FrmStylesController::admin_init' );
126
+		// Styles Controller
127
+		add_action( 'admin_menu', 'FrmStylesController::menu', 14 );
128
+		add_action( 'admin_init', 'FrmStylesController::admin_init' );
129 129
 
130
-        // XML Controller
131
-        add_action( 'admin_menu', 'FrmXMLController::menu', 41 );
132
-    }
130
+		// XML Controller
131
+		add_action( 'admin_menu', 'FrmXMLController::menu', 41 );
132
+	}
133 133
 
134 134
 	public static function load_ajax_hooks() {
135 135
 		add_action( 'wp_ajax_frm_silent_upgrade', 'FrmAppController::ajax_install' );
136 136
 		add_action( 'wp_ajax_nopriv_frm_silent_upgrade', 'FrmAppController::ajax_install' );
137 137
 		add_action( 'wp_ajax_frm_install', 'FrmAppController::ajax_install' );
138
-        add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
139
-        add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
138
+		add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
139
+		add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
140 140
 
141 141
 		// Addons
142 142
 		add_action('wp_ajax_frm_addon_activate', 'FrmAddon::activate' );
143 143
 		add_action('wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' );
144 144
 		add_action( 'wp_ajax_frm_fill_licenses', 'FrmAddonsController::get_licenses' );
145 145
 
146
-        // Fields Controller
147
-        add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' );
148
-        add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' );
149
-        add_action( 'wp_ajax_frm_field_name_in_place_edit', 'FrmFieldsController::edit_name' );
150
-        add_action( 'wp_ajax_frm_update_ajax_option', 'FrmFieldsController::update_ajax_option' );
151
-        add_action( 'wp_ajax_frm_duplicate_field', 'FrmFieldsController::duplicate' );
152
-        add_action( 'wp_ajax_frm_delete_field', 'FrmFieldsController::destroy' );
153
-        add_action( 'wp_ajax_frm_add_field_option', 'FrmFieldsController::add_option' );
154
-        add_action( 'wp_ajax_frm_field_option_ipe', 'FrmFieldsController::edit_option' );
155
-        add_action( 'wp_ajax_frm_delete_field_option', 'FrmFieldsController::delete_option' );
156
-        add_action( 'wp_ajax_frm_import_choices', 'FrmFieldsController::import_choices' );
157
-        add_action( 'wp_ajax_frm_import_options', 'FrmFieldsController::import_options' );
158
-        add_action( 'wp_ajax_frm_update_field_order', 'FrmFieldsController::update_order' );
159
-
160
-        // Form Actions Controller
161
-        add_action( 'wp_ajax_frm_add_form_action', 'FrmFormActionsController::add_form_action' );
162
-        add_action( 'wp_ajax_frm_form_action_fill', 'FrmFormActionsController::fill_action' );
163
-
164
-        // Forms Controller
146
+		// Fields Controller
147
+		add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' );
148
+		add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' );
149
+		add_action( 'wp_ajax_frm_field_name_in_place_edit', 'FrmFieldsController::edit_name' );
150
+		add_action( 'wp_ajax_frm_update_ajax_option', 'FrmFieldsController::update_ajax_option' );
151
+		add_action( 'wp_ajax_frm_duplicate_field', 'FrmFieldsController::duplicate' );
152
+		add_action( 'wp_ajax_frm_delete_field', 'FrmFieldsController::destroy' );
153
+		add_action( 'wp_ajax_frm_add_field_option', 'FrmFieldsController::add_option' );
154
+		add_action( 'wp_ajax_frm_field_option_ipe', 'FrmFieldsController::edit_option' );
155
+		add_action( 'wp_ajax_frm_delete_field_option', 'FrmFieldsController::delete_option' );
156
+		add_action( 'wp_ajax_frm_import_choices', 'FrmFieldsController::import_choices' );
157
+		add_action( 'wp_ajax_frm_import_options', 'FrmFieldsController::import_options' );
158
+		add_action( 'wp_ajax_frm_update_field_order', 'FrmFieldsController::update_order' );
159
+
160
+		// Form Actions Controller
161
+		add_action( 'wp_ajax_frm_add_form_action', 'FrmFormActionsController::add_form_action' );
162
+		add_action( 'wp_ajax_frm_form_action_fill', 'FrmFormActionsController::fill_action' );
163
+
164
+		// Forms Controller
165 165
 		add_action( 'wp_ajax_frm_create_from_template', 'FrmFormsController::_create_from_template' );
166 166
 		add_action( 'wp_ajax_frm_save_form', 'FrmFormsController::route' );
167 167
 		add_action( 'wp_ajax_frm_form_key_in_place_edit', 'FrmFormsController::edit_key' );
168 168
 		add_action( 'wp_ajax_frm_form_desc_in_place_edit', 'FrmFormsController::edit_description' );
169
-        add_action( 'wp_ajax_frm_get_default_html', 'FrmFormsController::get_email_html' );
170
-        add_action( 'wp_ajax_frm_get_shortcode_opts', 'FrmFormsController::get_shortcode_opts' );
171
-        add_action( 'wp_ajax_frm_forms_preview', 'FrmFormsController::preview' );
172
-        add_action( 'wp_ajax_nopriv_frm_forms_preview', 'FrmFormsController::preview' );
173
-
174
-        // Styles Controller
175
-        add_action( 'wp_ajax_frm_settings_reset', 'FrmStylesController::reset_styling' );
176
-        add_action( 'wp_ajax_frm_change_styling', 'FrmStylesController::change_styling' );
177
-        add_action( 'wp_ajax_frmpro_load_css', 'FrmStylesController::load_css' );
178
-        add_action( 'wp_ajax_nopriv_frmpro_load_css', 'FrmStylesController::load_css' );
169
+		add_action( 'wp_ajax_frm_get_default_html', 'FrmFormsController::get_email_html' );
170
+		add_action( 'wp_ajax_frm_get_shortcode_opts', 'FrmFormsController::get_shortcode_opts' );
171
+		add_action( 'wp_ajax_frm_forms_preview', 'FrmFormsController::preview' );
172
+		add_action( 'wp_ajax_nopriv_frm_forms_preview', 'FrmFormsController::preview' );
173
+
174
+		// Styles Controller
175
+		add_action( 'wp_ajax_frm_settings_reset', 'FrmStylesController::reset_styling' );
176
+		add_action( 'wp_ajax_frm_change_styling', 'FrmStylesController::change_styling' );
177
+		add_action( 'wp_ajax_frmpro_load_css', 'FrmStylesController::load_css' );
178
+		add_action( 'wp_ajax_nopriv_frmpro_load_css', 'FrmStylesController::load_css' );
179 179
 		add_action( 'wp_ajax_frmpro_css', 'FrmStylesController::load_saved_css' );
180 180
 		add_action( 'wp_ajax_nopriv_frmpro_css', 'FrmStylesController::load_saved_css' );
181 181
 
182
-        // XML Controller
182
+		// XML Controller
183 183
 		add_action( 'wp_ajax_frm_entries_csv', 'FrmXMLController::csv' );
184 184
 		add_action( 'wp_ajax_nopriv_frm_entries_csv', 'FrmXMLController::csv' );
185
-        add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' );
186
-    }
185
+		add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' );
186
+	}
187 187
 
188 188
 	public static function load_form_hooks() {
189
-        // Fields Controller
190
-        add_filter( 'frm_field_type', 'FrmFieldsController::change_type' );
191
-        add_action( 'frm_field_input_html', 'FrmFieldsController::input_html' );
192
-        add_filter( 'frm_field_value_saved', 'FrmFieldsController::check_value', 50, 3 );
193
-        add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' );
189
+		// Fields Controller
190
+		add_filter( 'frm_field_type', 'FrmFieldsController::change_type' );
191
+		add_action( 'frm_field_input_html', 'FrmFieldsController::input_html' );
192
+		add_filter( 'frm_field_value_saved', 'FrmFieldsController::check_value', 50, 3 );
193
+		add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' );
194 194
 
195 195
 		// Forms Controller
196 196
 		add_filter( 'frm_form_classes', 'FrmFormsController::form_classes' );
197 197
 
198
-        // Styles Controller
199
-        add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 );
200
-    }
198
+		// Styles Controller
199
+		add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 );
200
+	}
201 201
 
202 202
 	public static function load_view_hooks() {
203
-        // Hooks go here when a view is loaded
204
-    }
203
+		// Hooks go here when a view is loaded
204
+	}
205 205
 
206 206
 	public static function load_multisite_hooks() {
207 207
 		add_action( 'init', 'FrmAppController::front_head' );
208 208
 		add_action( 'wpmu_upgrade_site', 'FrmAppController::network_upgrade_site' );
209 209
 
210
-        // drop tables when mu site is deleted
211
-        add_filter( 'wpmu_drop_tables', 'FrmAppController::drop_tables' );
212
-    }
210
+		// drop tables when mu site is deleted
211
+		add_filter( 'wpmu_drop_tables', 'FrmAppController::drop_tables' );
212
+	}
213 213
 }
Please login to merge, or discard this patch.
classes/models/FrmEntryFormat.php 2 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.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -37,20 +37,20 @@  discard block
 block discarded – undo
37 37
 			$atts['id'] = $atts['entry']->id;
38 38
 		}
39 39
 
40
-		if ( ! $atts['fields'] || ! is_array($atts['fields']) ) {
40
+		if ( ! $atts['fields'] || ! is_array( $atts['fields'] ) ) {
41 41
 			$atts['fields'] = FrmField::get_all_for_form( $atts['form_id'], '', 'include' );
42 42
 		}
43 43
 
44 44
 		$values = array();
45 45
 		foreach ( $atts['fields'] as $f ) {
46 46
 			self::fill_entry_values( $atts, $f, $values );
47
-			unset($f);
47
+			unset( $f );
48 48
 		}
49 49
 
50 50
 		self::fill_entry_user_info( $atts, $values );
51 51
 
52 52
 		if ( $atts['format'] == 'json' ) {
53
-			return json_encode($values);
53
+			return json_encode( $values );
54 54
 		} else if ( $atts['format'] == 'array' ) {
55 55
 			return $values;
56 56
 		}
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		self::convert_entry_to_content( $values, $atts, $content );
60 60
 
61 61
 		if ( 'text' == $atts['format'] ) {
62
-			$content = implode('', $content);
62
+			$content = implode( '', $content );
63 63
 		}
64 64
 
65 65
 		if ( $atts['clickable'] ) {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 			'val' => '[' . $f->id . ']'
83 83
 		);
84 84
 
85
-		$values[ $f->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $field_shortcodes, $f );
85
+		$values[$f->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $field_shortcodes, $f );
86 86
 	}
87 87
 
88 88
 	public static function fill_entry_values( $atts, $f, array &$values ) {
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 			return;
96 96
 		}
97 97
 
98
-		if ( $atts['entry'] && ! isset( $atts['entry']->metas[ $f->id ] ) ) {
98
+		if ( $atts['entry'] && ! isset( $atts['entry']->metas[$f->id] ) ) {
99 99
 			// In case include_blank is set
100
-			$atts['entry']->metas[ $f->id ] = '';
100
+			$atts['entry']->metas[$f->id] = '';
101 101
 
102 102
 			if ( FrmAppHelper::pro_is_installed() ) {
103 103
 				FrmProEntryMeta::add_post_value_to_entry( $f, $atts['entry'] );
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
 		$val = '';
109 109
 		if ( $atts['entry'] ) {
110
-			$prev_val = maybe_unserialize( $atts['entry']->metas[ $f->id ] );
110
+			$prev_val = maybe_unserialize( $atts['entry']->metas[$f->id] );
111 111
 			$meta = array( 'item_id' => $atts['id'], 'field_id' => $f->id, 'meta_value' => $prev_val, 'field_type' => $f->type );
112 112
 
113 113
 			//This filter applies to the default-message shortcode and frm-show-entry shortcode only
@@ -132,12 +132,12 @@  discard block
 block discarded – undo
132 132
 		self::maybe_strip_html( $atts['plain_text'], $val );
133 133
 
134 134
 		if ( $atts['format'] != 'text' ) {
135
-			$values[ $f->field_key ] = $val;
135
+			$values[$f->field_key] = $val;
136 136
 			if ( isset( $prev_val ) && $prev_val != $val && $f->type != 'textarea' ) {
137
-				$values[ $f->field_key . '-value' ] = $prev_val;
137
+				$values[$f->field_key . '-value'] = $prev_val;
138 138
 			}
139 139
 		} else {
140
-			$values[ $f->id ] = array( 'label' => $f->name, 'val' => $val );
140
+			$values[$f->id] = array( 'label' => $f->name, 'val' => $val );
141 141
 		}
142 142
 	}
143 143
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 			return;
184 184
 		}
185 185
 
186
-		$data  = self::get_entry_description_data( $atts );
186
+		$data = self::get_entry_description_data( $atts );
187 187
 
188 188
 		if ( $atts['default_email'] ) {
189 189
 			$atts['entry']->ip = '[ip]';
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 		preg_match_all( $pattern, $u_agent, $matches ); // get the matching numbers
271 271
 
272 272
 		// see how many we have
273
-		$i = count($matches['browser']);
273
+		$i = count( $matches['browser'] );
274 274
 		if ( $i != 1 ) {
275 275
 			//we will have two since we are not using 'other' argument yet
276 276
 			//see if version is before or after the name
@@ -307,15 +307,15 @@  discard block
 block discarded – undo
307 307
 
308 308
 			// merge defaults, global settings, and shortcode options
309 309
 			foreach ( $default_settings as $key => $setting ) {
310
-				if ( $atts[ $key ] != '' ) {
310
+				if ( $atts[$key] != '' ) {
311 311
 					continue;
312 312
 				}
313 313
 
314
-				$atts[ $key ] = $setting;
314
+				$atts[$key] = $setting;
315 315
 				unset( $key, $setting );
316 316
 			}
317 317
 
318
-			unset($default_settings);
318
+			unset( $default_settings );
319 319
 
320 320
 			$content[] = '<table cellspacing="0" style="font-size:' . $atts['font_size'] . ';line-height:135%; border-bottom:' . $atts['border_width'] . ' solid #' . $atts['border_color'] . ';"><tbody>' . "\r\n";
321 321
 			$atts['bg_color'] = ' style="background-color:#' . $atts['bg_color'] . ';"';
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 				continue;
339 339
 			}
340 340
 
341
-			if ( $atts['default_email'] && is_numeric($id) ) {
341
+			if ( $atts['default_email'] && is_numeric( $id ) ) {
342 342
 				$content[] = '[if ' . $id . ']<tr style="[frm-alt-color]">';
343 343
 			} else {
344 344
 				$content[] = '<tr' . ( $odd ? $atts['bg_color'] : $bg_color_alt ) . '>';
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/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   +17 added lines, -17 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,10 +18,10 @@  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
-<input type="hidden" name="frm_action" value="<?php echo esc_attr($form_action) ?>" />
22
-<input type="hidden" name="form_id" value="<?php echo esc_attr($form->id) ?>" />
23
-<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) ?>" />
24
-<input type="hidden" name="form_key" value="<?php echo esc_attr($form->form_key) ?>" />
21
+<input type="hidden" name="frm_action" value="<?php echo esc_attr( $form_action ) ?>" />
22
+<input type="hidden" name="form_id" value="<?php echo esc_attr( $form->id ) ?>" />
23
+<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 ) ?>" />
24
+<input type="hidden" name="form_key" value="<?php echo esc_attr( $form->form_key ) ?>" />
25 25
 <input type="hidden" name="item_meta[0]" value="" />
26 26
 <?php wp_nonce_field( 'frm_submit_entry_nonce', 'frm_submit_entry_' . $form->id ); ?>
27 27
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 		} else {
35 35
 			do_action( 'frm_show_other_field_type', $field, $form, array( 'action' => $form_action ) );
36 36
 		}
37
-    	do_action('frm_get_field_scripts', $field, $form, $form->id);
37
+    	do_action( 'frm_get_field_scripts', $field, $form, $form->id );
38 38
 	}
39 39
 }
40 40
 
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 if ( FrmAppHelper::is_admin() ) { ?>
43 43
 <div class="frm_form_field form-field">
44 44
 <label class="frm_primary_label"><?php _e( 'Entry Key', 'formidable' ) ?></label>
45
-<input type="text" name="item_key" value="<?php echo esc_attr($values['item_key']) ?>" />
45
+<input type="text" name="item_key" value="<?php echo esc_attr( $values['item_key'] ) ?>" />
46 46
 </div>
47 47
 <?php } else { ?>
48
-<input type="hidden" name="item_key" value="<?php echo esc_attr($values['item_key']) ?>" />
48
+<input type="hidden" name="item_key" value="<?php echo esc_attr( $values['item_key'] ) ?>" />
49 49
 <?php }
50 50
 
51
-do_action('frm_entry_form', $form, $form_action, $errors);
51
+do_action( 'frm_entry_form', $form, $form_action, $errors );
52 52
 
53 53
 global $frm_vars;
54 54
 // close open section div
@@ -58,23 +58,23 @@  discard block
 block discarded – undo
58 58
 }
59 59
 
60 60
 // close open collapsible toggle div
61
-if ( isset($frm_vars['collapse_div']) && $frm_vars['collapse_div'] ) {
61
+if ( isset( $frm_vars['collapse_div'] ) && $frm_vars['collapse_div'] ) {
62 62
     echo "</div>\n";
63
-    unset($frm_vars['collapse_div']);
63
+    unset( $frm_vars['collapse_div'] );
64 64
 }
65 65
 
66
-echo FrmFormsHelper::replace_shortcodes($values['after_html'], $form);
66
+echo FrmFormsHelper::replace_shortcodes( $values['after_html'], $form );
67 67
 
68 68
 
69
-if ( has_action('frm_entries_footer_scripts') ) { ?>
69
+if ( has_action( 'frm_entries_footer_scripts' ) ) { ?>
70 70
 <script type="text/javascript">
71
-<?php do_action('frm_entries_footer_scripts', $values['fields'], $form); ?>
71
+<?php do_action( 'frm_entries_footer_scripts', $values['fields'], $form ); ?>
72 72
 </script><?php
73 73
 }
74 74
 
75 75
 if ( FrmForm::show_submit( $form ) ) {
76
-    unset($values['fields']);
77
-    FrmFormsHelper::get_custom_submit($values['submit_html'], $form, $submit, $form_action, $values);
76
+    unset( $values['fields'] );
77
+    FrmFormsHelper::get_custom_submit( $values['submit_html'], $form, $submit, $form_action, $values );
78 78
 }
79 79
 ?>
80 80
 </fieldset>
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/default_actions.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 class FrmDefPostAction extends FrmFormAction {
4 4
 	public function __construct() {
5 5
 		$action_ops = FrmFormAction::default_action_opts();
6
-	    $action_ops['classes'] = 'ab-icon frm_dashicon_font dashicons-before';
6
+		$action_ops['classes'] = 'ab-icon frm_dashicon_font dashicons-before';
7 7
 
8 8
 		parent::__construct( 'wppost', __( 'Create Post', 'formidable' ), $action_ops );
9 9
 	}
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 // add register action
13 13
 class FrmDefRegAction extends FrmFormAction {
14 14
 	public function __construct() {
15
-		$action_ops = FrmFormAction::default_action_opts('frm_register_icon');
15
+		$action_ops = FrmFormAction::default_action_opts( 'frm_register_icon' );
16 16
 		parent::__construct( 'register', __( 'Register User', 'formidable' ), $action_ops );
17 17
 	}
18 18
 }
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 // add paypal action
21 21
 class FrmDefPayPalAction extends FrmFormAction {
22 22
 	public function __construct() {
23
-		$action_ops = FrmFormAction::default_action_opts('frm_paypal_icon');
23
+		$action_ops = FrmFormAction::default_action_opts( 'frm_paypal_icon' );
24 24
 		parent::__construct( 'paypal', __( 'Collect Payment', 'formidable' ), $action_ops );
25 25
 	}
26 26
 }
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 // add aweber action
29 29
 class FrmDefAweberAction extends FrmFormAction {
30 30
 	public function __construct() {
31
-		$action_ops = FrmFormAction::default_action_opts('frm_aweber_icon');
31
+		$action_ops = FrmFormAction::default_action_opts( 'frm_aweber_icon' );
32 32
 		parent::__construct( 'aweber', __( 'Aweber', 'formidable' ), $action_ops );
33 33
 	}
34 34
 }
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 // add mailchimp action
37 37
 class FrmDefMlcmpAction extends FrmFormAction {
38 38
 	public function __construct() {
39
-		$action_ops = FrmFormAction::default_action_opts('frm_mailchimp_icon');
39
+		$action_ops = FrmFormAction::default_action_opts( 'frm_mailchimp_icon' );
40 40
 		parent::__construct( 'mailchimp', __( 'MailChimp', 'formidable' ), $action_ops );
41 41
 	}
42 42
 }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 // add twilio action
45 45
 class FrmDefTwilioAction extends FrmFormAction {
46 46
 	public function __construct() {
47
-		$action_ops = FrmFormAction::default_action_opts('frm_sms_icon');
47
+		$action_ops = FrmFormAction::default_action_opts( 'frm_sms_icon' );
48 48
 		parent::__construct( 'twilio', __( 'Twilio', 'formidable' ), $action_ops );
49 49
 	}
50 50
 }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 // add highrise action
53 53
 class FrmDefHrsAction extends FrmFormAction {
54 54
 	public function __construct() {
55
-		$action_ops = FrmFormAction::default_action_opts('frm_highrise_icon');
55
+		$action_ops = FrmFormAction::default_action_opts( 'frm_highrise_icon' );
56 56
 		parent::__construct( 'highrise', __( 'Highrise', 'formidable' ), $action_ops );
57 57
 	}
58 58
 }
Please login to merge, or discard this patch.
classes/views/frm-forms/_publish_box.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
             <?php } ?>
13 13
             <div id="preview-action">
14 14
                 <?php
15
-                if ( ! isset($hide_preview) || ! $hide_preview ) {
15
+				if ( ! isset($hide_preview) || ! $hide_preview ) {
16 16
 
17
-                    if ( isset($values['form_key']) ) {
18
-                        $frm_settings = FrmAppHelper::get_settings();
19
-                        if ( empty($frm_settings->preview_page_id) ) { ?>
17
+					if ( isset($values['form_key']) ) {
18
+						$frm_settings = FrmAppHelper::get_settings();
19
+						if ( empty($frm_settings->preview_page_id) ) { ?>
20 20
                     <a href="<?php echo esc_url( FrmFormsHelper::get_direct_link($values['form_key']) ); ?>" class="preview button" target="wp-frm-preview-<?php echo esc_attr( $id ) ?>"><?php _e( 'Preview', 'formidable' ) ?></a>
21 21
                 <?php
22
-                        } else {
23
-                ?>
22
+						} else {
23
+				?>
24 24
                     <div class="preview dropdown">
25 25
                         <a href="#" id="frm-previewDrop" class="frm-dropdown-toggle button" data-toggle="dropdown"><?php _e( 'Preview', 'formidable' ) ?> <b class="caret"></b></a>
26 26
 
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
                     	</ul>
31 31
                     </div>
32 32
                 <?php   }
33
-                    }
34
-                } ?>
33
+					}
34
+				} ?>
35 35
             </div>
36 36
             <?php if ( 'draft' == $values['status'] ) { ?>
37 37
             <div class="clear"></div>
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -6,18 +6,18 @@  discard block
 block discarded – undo
6 6
         <div id="minor-publishing-actions">
7 7
             <?php if ( 'draft' == $values['status'] ) { ?>
8 8
             <div id="save-action">
9
-        	    <input type="button" value="<?php esc_html_e( 'Save Draft', 'formidable' ); ?>" class="frm_submit_form frm_submit_<?php echo ( isset($values['ajax_load']) && $values['ajax_load'] ) ? '': 'no_'; ?>ajax button-secondary button-large" id="save-post" />
9
+        	    <input type="button" value="<?php esc_html_e( 'Save Draft', 'formidable' ); ?>" class="frm_submit_form frm_submit_<?php echo ( isset( $values['ajax_load'] ) && $values['ajax_load'] ) ? '' : 'no_'; ?>ajax button-secondary button-large" id="save-post" />
10 10
         	    <span class="spinner"></span>
11 11
             </div>
12 12
             <?php } ?>
13 13
             <div id="preview-action">
14 14
                 <?php
15
-                if ( ! isset($hide_preview) || ! $hide_preview ) {
15
+                if ( ! isset( $hide_preview ) || ! $hide_preview ) {
16 16
 
17
-                    if ( isset($values['form_key']) ) {
17
+                    if ( isset( $values['form_key'] ) ) {
18 18
                         $frm_settings = FrmAppHelper::get_settings();
19
-                        if ( empty($frm_settings->preview_page_id) ) { ?>
20
-                    <a href="<?php echo esc_url( FrmFormsHelper::get_direct_link($values['form_key']) ); ?>" class="preview button" target="wp-frm-preview-<?php echo esc_attr( $id ) ?>"><?php _e( 'Preview', 'formidable' ) ?></a>
19
+                        if ( empty( $frm_settings->preview_page_id ) ) { ?>
20
+                    <a href="<?php echo esc_url( FrmFormsHelper::get_direct_link( $values['form_key'] ) ); ?>" class="preview button" target="wp-frm-preview-<?php echo esc_attr( $id ) ?>"><?php _e( 'Preview', 'formidable' ) ?></a>
21 21
                 <?php
22 22
                         } else {
23 23
                 ?>
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
                         <a href="#" id="frm-previewDrop" class="frm-dropdown-toggle button" data-toggle="dropdown"><?php _e( 'Preview', 'formidable' ) ?> <b class="caret"></b></a>
26 26
 
27 27
                         <ul class="frm-dropdown-menu pull-right" role="menu" aria-labelledby="frm-previewDrop">
28
-                            <li><a href="<?php echo esc_url( FrmFormsHelper::get_direct_link($values['form_key']) ); ?>" target="_blank"><?php _e( 'On Blank Page', 'formidable' ) ?></a></li>
29
-                            <li><a href="<?php echo esc_url( add_query_arg('form', $values['form_key'], get_permalink( $frm_settings->preview_page_id )) ) ?>" target="_blank"><?php _e( 'In Theme', 'formidable' ) ?></a></li>
28
+                            <li><a href="<?php echo esc_url( FrmFormsHelper::get_direct_link( $values['form_key'] ) ); ?>" target="_blank"><?php _e( 'On Blank Page', 'formidable' ) ?></a></li>
29
+                            <li><a href="<?php echo esc_url( add_query_arg( 'form', $values['form_key'], get_permalink( $frm_settings->preview_page_id ) ) ) ?>" target="_blank"><?php _e( 'In Theme', 'formidable' ) ?></a></li>
30 30
                     	</ul>
31 31
                     </div>
32 32
                 <?php   }
@@ -62,24 +62,24 @@  discard block
 block discarded – undo
62 62
 
63 63
 
64 64
             <div class="misc-pub-section misc-pub-post-status"><label for="post_status"><?php _e( 'Status', 'formidable' ) ?>:</label>
65
-                <span id="form-status-display"><?php echo FrmFormsHelper::status_nice_name($values['status']); ?></span>
65
+                <span id="form-status-display"><?php echo FrmFormsHelper::status_nice_name( $values['status'] ); ?></span>
66 66
 				<?php if ( 'draft' != $values['status'] && ( ! isset( $_GET['frm_action'] ) || 'settings' != FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' ) ) ) { ?>
67
-                <a href="#post_status" class="edit-form-status hide-if-no-js" data-slidedown="form-status-select"><span aria-hidden="true"><?php _e( 'Edit') ?></span> <span class="screen-reader-text"><?php _e( 'Edit status') ?></span></a>
67
+                <a href="#post_status" class="edit-form-status hide-if-no-js" data-slidedown="form-status-select"><span aria-hidden="true"><?php _e( 'Edit' ) ?></span> <span class="screen-reader-text"><?php _e( 'Edit status' ) ?></span></a>
68 68
 
69 69
                 <div id="form-status-select" class="frm_hidden">
70 70
                     <select name="frm_change_status" id="form_change_status">
71
-                        <option value="published" <?php selected($values['status'], 'published') ?>><?php _e( 'Published' ) ?></option>
72
-                        <option value="draft" <?php selected($values['status'], 'draft') ?>><?php _e( 'Draft' ) ?></option>
71
+                        <option value="published" <?php selected( $values['status'], 'published' ) ?>><?php _e( 'Published' ) ?></option>
72
+                        <option value="draft" <?php selected( $values['status'], 'draft' ) ?>><?php _e( 'Draft' ) ?></option>
73 73
                     </select>
74
-                    <a href="#post_status" class="save-form-status hide-if-no-js button"><?php _e( 'OK') ?></a>
75
-                    <a href="#post_status" class="cancel-form-status hide-if-no-js button-cancel" data-slideup="form-status-select"><?php _e( 'Cancel') ?></a>
74
+                    <a href="#post_status" class="save-form-status hide-if-no-js button"><?php _e( 'OK' ) ?></a>
75
+                    <a href="#post_status" class="cancel-form-status hide-if-no-js button-cancel" data-slideup="form-status-select"><?php _e( 'Cancel' ) ?></a>
76 76
                 </div>
77 77
                 <?php } ?>
78 78
             </div><!-- .misc-pub-section -->
79 79
 
80
-            <?php if ( has_action('frm_settings_buttons') ) { ?>
80
+            <?php if ( has_action( 'frm_settings_buttons' ) ) { ?>
81 81
             <div class="misc-pub-section">
82
-                <?php do_action('frm_settings_buttons', $values); ?>
82
+                <?php do_action( 'frm_settings_buttons', $values ); ?>
83 83
                 <div class="clear"></div>
84 84
             </div>
85 85
             <?php } ?>
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
     <div id="major-publishing-actions">
92 92
         <div id="delete-action">
93
-            <?php echo FrmFormsHelper::delete_trash_link($id, $values['status']); ?>
93
+            <?php echo FrmFormsHelper::delete_trash_link( $id, $values['status'] ); ?>
94 94
         </div>
95 95
 
96 96
 		<div id="publishing-action">
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 			<?php if ( 'settings' == FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' ) ) { ?>
99 99
 			<input type="button" value="<?php esc_attr_e( 'Update', 'formidable' ); ?>" class="frm_submit_form frm_submit_settings_btn button-primary button-large" id="frm_submit_side_top" />
100 100
             <?php } else { ?>
101
-    	    <input type="button" value="<?php echo isset($button) ? esc_attr($button) : __( 'Update', 'formidable' ); ?>" class="frm_submit_form frm_submit_<?php echo ( isset($values['ajax_load']) && $values['ajax_load'] ) ? '': 'no_'; ?>ajax button-primary button-large" id="frm_submit_side_top" />
101
+    	    <input type="button" value="<?php echo isset( $button ) ? esc_attr( $button ) : __( 'Update', 'formidable' ); ?>" class="frm_submit_form frm_submit_<?php echo ( isset( $values['ajax_load'] ) && $values['ajax_load'] ) ? '' : 'no_'; ?>ajax button-primary button-large" id="frm_submit_side_top" />
102 102
     	    <?php } ?>
103 103
 		</div>
104 104
 
Please login to merge, or discard this patch.
classes/views/frm-forms/add_field_links.php 2 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -62,16 +62,16 @@  discard block
 block discarded – undo
62 62
                 	</ul>
63 63
                 </li>
64 64
 <?php
65
-                } else {
66
-                    $field_label = $field_type;
67
-                    ?>
65
+				} else {
66
+					$field_label = $field_type;
67
+					?>
68 68
                     <li class="frmbutton button <?php echo esc_attr( $col_class .' '. $no_allow_class .' frm_t'. $field_key ) ?>" id="<?php echo esc_attr( $field_key ) ?>"><?php echo apply_filters( 'frmpro_field_links', $field_label, $id, $field_key ) ?></li>
69 69
                     <?php
70
-                }
70
+				}
71 71
 
72
-                $col_class = empty($col_class) ? 'frm_col_one' : '';
73
-                unset($field_key, $field_type, $field_label);
74
-            } ?>
72
+				$col_class = empty($col_class) ? 'frm_col_one' : '';
73
+				unset($field_key, $field_type, $field_label);
74
+			} ?>
75 75
             </ul>
76 76
             <div class="clear"></div>
77 77
         </div>
@@ -81,33 +81,33 @@  discard block
 block discarded – undo
81 81
 			<p class="howto"><?php _e( 'Add classes in the "CSS layout classes" field option', 'formidable' ) ?></p>
82 82
     	    <ul class="frm_code_list">
83 83
     	    <?php $classes = array(
84
-                    'frm_first'     => array(
85
-                        'label' => __( 'First', 'formidable' ),
86
-                        'title' => __( 'Add this to the first field in each row along with a width. ie frm_first frm_third', 'formidable' ),
87
-                    ),
88
-                    'frm_half'      => __( '1/2', 'formidable' ),
89
-                    'frm_third'     => __( '1/3', 'formidable' ),
90
-                    'frm_two_thirds' => __( '2/3', 'formidable' ),
91
-    	            'frm_fourth'    => __( '1/4', 'formidable' ),
84
+					'frm_first'     => array(
85
+						'label' => __( 'First', 'formidable' ),
86
+						'title' => __( 'Add this to the first field in each row along with a width. ie frm_first frm_third', 'formidable' ),
87
+					),
88
+					'frm_half'      => __( '1/2', 'formidable' ),
89
+					'frm_third'     => __( '1/3', 'formidable' ),
90
+					'frm_two_thirds' => __( '2/3', 'formidable' ),
91
+					'frm_fourth'    => __( '1/4', 'formidable' ),
92 92
 					'frm_three_fourths' => __( '3/4', 'formidable' ),
93
-                    'frm_fifth'     => __( '1/5', 'formidable' ),
93
+					'frm_fifth'     => __( '1/5', 'formidable' ),
94 94
 					'frm_two_fifths' => __( '2/5', 'formidable' ),
95
-                    'frm_sixth'     => __( '1/6', 'formidable' ),
96
-                    'frm_seventh'   => __( '1/7', 'formidable' ),
95
+					'frm_sixth'     => __( '1/6', 'formidable' ),
96
+					'frm_seventh'   => __( '1/7', 'formidable' ),
97 97
 					'frm_eighth'    => __( '1/8', 'formidable' ),
98 98
 					'frm_alignright' => __( 'Right', 'formidable' ),
99
-    	            'frm_inline'    => array(
100
-                        'label' => __( 'Inline', 'formidable' ),
99
+					'frm_inline'    => array(
100
+						'label' => __( 'Inline', 'formidable' ),
101 101
 						'title' => __( 'Align fields in a row without a specific width.', 'formidable' ),
102
-                    ),
102
+					),
103 103
 
104
-    	            'frm_full' => array(
105
-                        'label' => __( '100% width', 'formidable' ),
104
+					'frm_full' => array(
105
+						'label' => __( '100% width', 'formidable' ),
106 106
 						'title' => __( 'Force the field to fill the full space with 100% width.', 'formidable' ),
107
-                    ),
108
-    	            'frm_grid_first' => __( 'First Grid Row', 'formidable' ),
109
-    	            'frm_grid' => __( 'Even Grid Row', 'formidable' ),
110
-    	            'frm_grid_odd' => __( 'Odd Grid Row', 'formidable' ),
107
+					),
108
+					'frm_grid_first' => __( 'First Grid Row', 'formidable' ),
109
+					'frm_grid' => __( 'Even Grid Row', 'formidable' ),
110
+					'frm_grid_odd' => __( 'Odd Grid Row', 'formidable' ),
111 111
 					'frm_two_col' => array( 'label' => __( '2 Col Options', 'formidable' ), 'title' => __( 'Put your radio button or checkbox options into two columns.', 'formidable' ) ),
112 112
 					'frm_three_col' => array( 'label' => __( '3 Col Options', 'formidable' ), 'title' => __( 'Put your radio button or checkbox options into three columns.', 'formidable' ) ),
113 113
 					'frm_four_col' => array( 'label' => __( '4 Col Options', 'formidable' ), 'title' => __( 'Put your radio button or checkbox options into four columns.', 'formidable' ) ),
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 					'frm_scroll_box' => array( 'label' => __( 'Scroll Box', 'formidable' ), 'title' => __( 'If you have many checkbox or radio button options, you may add this class to allow your user to easily scroll through the options.', 'formidable' ) ),
116 116
 					'frm_text_block' => array( 'label' => __( 'Align Option Text', 'formidable' ), 'title' => __( 'If you have a large amount of text in a checkbox or radio button field, use this class to align all the text in a block.', 'formidable' ) ),
117 117
 					'frm_capitalize' => array( 'label' => __( 'Capitalize', 'formidable' ), 'title' => __( 'Automatically capitalize the first letter in each word.', 'formidable' ) ),
118
-    	        );
118
+				);
119 119
 
120 120
 $classes = apply_filters( 'frm_layout_classes', $classes );
121 121
 $col = 'one';
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
 	} ?>>
133 133
 <?php
134 134
 	if ( empty( $d ) ) {
135
-    	echo $c;
135
+		echo $c;
136 136
 	} else if ( ! is_array( $d ) ) {
137
-    	echo $d;
137
+		echo $d;
138 138
 	} else if ( isset( $d['label'] ) ) {
139
-    	echo $d['label'];
139
+		echo $d['label'];
140 140
 	}
141 141
 ?>
142 142
                     </a>
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
         <ul id="category-tabs" class="category-tabs frm-category-tabs">
18 18
     		<li class="tabs" ><a href="#frm-insert-fields" id="frm_insert_fields_tab"><?php _e( 'Fields', 'formidable' ); ?></a></li>
19 19
     		<li class="hide-if-no-js"><a href="#frm-layout-classes" id="frm_layout_classes_tab" class="frm_help" title="<?php esc_attr_e( 'Open the Field Options and click on the CSS Layout Classes option to enable this tab', 'formidable' ) ?>"><?php _e( 'Layout', 'formidable' ); ?></a></li>
20
-<?php do_action('frm_extra_form_instruction_tabs'); ?>
20
+<?php do_action( 'frm_extra_form_instruction_tabs' ); ?>
21 21
     	</ul>
22 22
 
23 23
     	<div id="frm-insert-fields" class="tabs-panel">
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
                     <?php
79 79
                 }
80 80
 
81
-                $col_class = empty($col_class) ? 'frm_col_one' : '';
82
-                unset($field_key, $field_type, $field_label);
81
+                $col_class = empty( $col_class ) ? 'frm_col_one' : '';
82
+                unset( $field_key, $field_type, $field_label );
83 83
             } ?>
84 84
             </ul>
85 85
             <div class="clear"></div>
86 86
         </div>
87
-    	<?php do_action('frm_extra_form_instructions'); ?>
87
+    	<?php do_action( 'frm_extra_form_instructions' ); ?>
88 88
 
89 89
     	<div id="frm-layout-classes" class="tabs-panel">
90 90
 			<p class="howto"><?php _e( 'Add classes in the "CSS layout classes" field option', 'formidable' ) ?></p>
@@ -135,9 +135,9 @@  discard block
 block discarded – undo
135 135
                     <a href="javascript:void(0);" class="frmbutton frm_insert_code button show_frm_classes<?php
136 136
 	if ( ! empty( $title ) ) {
137 137
 		echo ' frm_help';
138
-	} ?>" data-code="<?php echo esc_attr($c) ?>" <?php
138
+	} ?>" data-code="<?php echo esc_attr( $c ) ?>" <?php
139 139
 	if ( ! empty( $title ) ) {
140
-		?>title="<?php echo esc_attr($title); ?>"<?php
140
+		?>title="<?php echo esc_attr( $title ); ?>"<?php
141 141
 	} ?>>
142 142
 <?php
143 143
 	if ( empty( $d ) ) {
@@ -162,14 +162,14 @@  discard block
 block discarded – undo
162 162
 
163 163
     <div class="submitbox" id="major-publishing-actions">
164 164
         <div id="delete-action">
165
-            <?php echo FrmFormsHelper::delete_trash_link($id, $values['status']); ?>
165
+            <?php echo FrmFormsHelper::delete_trash_link( $id, $values['status'] ); ?>
166 166
         </div>
167 167
 
168 168
         <div id="publishing-action">
169 169
             <form method="post" id="frm_js_build_form">
170 170
             <span class="spinner"></span>
171 171
 		    <input type="hidden" id="frm_compact_fields" name="frm_compact_fields" value="" />
172
-    	    <input type="button" value="<?php echo esc_attr($button) ?>" class="frm_submit_form frm_submit_<?php echo ( isset($values['ajax_load']) && $values['ajax_load'] ) ? '': 'no_'; ?>ajax button-primary button-large" id="frm_submit_side" />
172
+    	    <input type="button" value="<?php echo esc_attr( $button ) ?>" class="frm_submit_form frm_submit_<?php echo ( isset( $values['ajax_load'] ) && $values['ajax_load'] ) ? '' : 'no_'; ?>ajax button-primary button-large" id="frm_submit_side" />
173 173
     	    </form>
174 174
 		</div>
175 175
         <div class="clear"></div>
Please login to merge, or discard this patch.