Completed
Pull Request — master (#101)
by Stephanie
02:46
created
classes/controllers/FrmStylesController.php 1 patch
Indentation   +179 added lines, -179 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 class FrmStylesController {
4
-    public static $post_type = 'frm_styles';
5
-    public static $screen = 'formidable_page_formidable-styles';
4
+	public static $post_type = 'frm_styles';
5
+	public static $screen = 'formidable_page_formidable-styles';
6 6
 
7
-    public static function load_pro_hooks() {
8
-        if ( FrmAppHelper::pro_is_installed() ) {
9
-            FrmProStylesController::load_pro_hooks();
10
-        }
11
-    }
7
+	public static function load_pro_hooks() {
8
+		if ( FrmAppHelper::pro_is_installed() ) {
9
+			FrmProStylesController::load_pro_hooks();
10
+		}
11
+	}
12 12
 
13
-    public static function register_post_types() {
13
+	public static function register_post_types() {
14 14
 		register_post_type(
15 15
 			self::$post_type,
16 16
 			array(
@@ -41,18 +41,18 @@  discard block
 block discarded – undo
41 41
 				),
42 42
 			)
43 43
 		);
44
-    }
44
+	}
45 45
 
46
-    public static function menu() {
46
+	public static function menu() {
47 47
 		add_submenu_page( 'formidable', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route' );
48
-    }
48
+	}
49 49
 
50 50
 	public static function admin_init() {
51 51
 		if ( ! FrmAppHelper::is_admin_page( 'formidable-styles' ) ) {
52 52
 			return;
53 53
 		}
54 54
 
55
-        self::load_pro_hooks();
55
+		self::load_pro_hooks();
56 56
 
57 57
 		$style_tab = FrmAppHelper::get_param( 'frm_action', '', 'get', 'sanitize_title' );
58 58
 		if ( $style_tab == 'manage' || $style_tab == 'custom_css' ) {
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
 		wp_enqueue_style( 'frm-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_css' ) );
66 66
 
67 67
 		$style = apply_filters( 'frm_style_head', false );
68
-        if ( $style ) {
68
+		if ( $style ) {
69 69
 			wp_enqueue_style( 'frm-single-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_load_css&flat=1' ) . '&' . http_build_query( $style->post_content ) );
70
-        }
71
-    }
70
+		}
71
+	}
72 72
 
73 73
 	public static function enqueue_css( $register = 'enqueue', $force = false ) {
74 74
 		global $frm_vars;
@@ -219,10 +219,10 @@  discard block
 block discarded – undo
219 219
 	}
220 220
 
221 221
 	public static function load_styler( $style, $message = '' ) {
222
-        global $frm_settings;
222
+		global $frm_settings;
223 223
 
224
-        $frm_style = new FrmStyle();
225
-        $styles = $frm_style->get_all();
224
+		$frm_style = new FrmStyle();
225
+		$styles = $frm_style->get_all();
226 226
 
227 227
 		if ( is_numeric( $style ) ) {
228 228
 			$style = $styles[ $style ];
@@ -230,10 +230,10 @@  discard block
 block discarded – undo
230 230
 			$style = $frm_style->get_default_style( $styles );
231 231
 		}
232 232
 
233
-        self::add_meta_boxes();
233
+		self::add_meta_boxes();
234 234
 
235 235
 		include( FrmAppHelper::plugin_path() . '/classes/views/styles/show.php' );
236
-    }
236
+	}
237 237
 
238 238
 	/**
239 239
 	 * @param string $message
@@ -251,31 +251,31 @@  discard block
 block discarded – undo
251 251
 		include( FrmAppHelper::plugin_path() . '/classes/views/styles/manage.php' );
252 252
 	}
253 253
 
254
-    private static function manage_styles() {
254
+	private static function manage_styles() {
255 255
 		$style_nonce = FrmAppHelper::get_post_param( 'frm_manage_style', '', 'sanitize_text_field' );
256 256
 		if ( ! $_POST || ! isset( $_POST['style'] ) || ! wp_verify_nonce( $style_nonce, 'frm_manage_style_nonce' ) ) {
257
-            return self::manage();
258
-        }
257
+			return self::manage();
258
+		}
259 259
 
260
-        global $wpdb;
260
+		global $wpdb;
261 261
 
262 262
 		$forms = FrmForm::get_published_forms();
263
-        foreach ( $forms as $form ) {
264
-            if ( $_POST['style'][ $form->id ] == $_POST['prev_style'][ $form->id ] ) {
265
-                continue;
266
-            }
263
+		foreach ( $forms as $form ) {
264
+			if ( $_POST['style'][ $form->id ] == $_POST['prev_style'][ $form->id ] ) {
265
+				continue;
266
+			}
267 267
 
268
-            $form->options['custom_style'] = $_POST['style'][ $form->id ];
268
+			$form->options['custom_style'] = $_POST['style'][ $form->id ];
269 269
 
270 270
 			$wpdb->update( $wpdb->prefix . 'frm_forms', array( 'options' => maybe_serialize( $form->options ) ), array( 'id' => $form->id ) );
271 271
 			unset( $form );
272
-        }
272
+		}
273 273
 
274
-        $message = __( 'Your form styles have been saved.', 'formidable' );
274
+		$message = __( 'Your form styles have been saved.', 'formidable' );
275 275
 		return self::manage( $message, $forms );
276
-    }
276
+	}
277 277
 
278
-    public static function custom_css( $message = '', $style = null ) {
278
+	public static function custom_css( $message = '', $style = null ) {
279 279
 		if ( function_exists( 'wp_enqueue_code_editor' ) ) {
280 280
 			$id = 'frm_codemirror_box';
281 281
 			$settings = wp_enqueue_code_editor(
@@ -317,41 +317,41 @@  discard block
 block discarded – undo
317 317
 		return self::custom_css( $message );
318 318
 	}
319 319
 
320
-    public static function route() {
320
+	public static function route() {
321 321
 		$action = FrmAppHelper::get_param( 'frm_action', '', 'get', 'sanitize_title' );
322 322
 
323
-        switch ( $action ) {
324
-            case 'edit':
325
-            case 'save':
326
-            case 'manage':
327
-            case 'manage_styles':
328
-            case 'custom_css':
329
-            case 'save_css':
323
+		switch ( $action ) {
324
+			case 'edit':
325
+			case 'save':
326
+			case 'manage':
327
+			case 'manage_styles':
328
+			case 'custom_css':
329
+			case 'save_css':
330 330
 				return self::$action();
331
-            default:
332
-            	do_action( 'frm_style_action_route', $action );
333
-            	if ( apply_filters( 'frm_style_stop_action_route', false, $action ) ) {
334
-                	return;
335
-            	}
331
+			default:
332
+				do_action( 'frm_style_action_route', $action );
333
+				if ( apply_filters( 'frm_style_stop_action_route', false, $action ) ) {
334
+					return;
335
+				}
336 336
 
337
-                if ( 'new_style' == $action || 'duplicate' == $action ) {
338
-                    return self::$action();
339
-                }
337
+				if ( 'new_style' == $action || 'duplicate' == $action ) {
338
+					return self::$action();
339
+				}
340 340
 
341
-                return self::edit();
342
-        }
343
-    }
341
+				return self::edit();
342
+		}
343
+	}
344 344
 
345
-    public static function reset_styling() {
345
+	public static function reset_styling() {
346 346
 		FrmAppHelper::permission_check( 'frm_change_settings' );
347
-        check_ajax_referer( 'frm_ajax', 'nonce' );
347
+		check_ajax_referer( 'frm_ajax', 'nonce' );
348 348
 
349
-        $frm_style = new FrmStyle();
350
-        $defaults = $frm_style->get_defaults();
349
+		$frm_style = new FrmStyle();
350
+		$defaults = $frm_style->get_defaults();
351 351
 
352
-        echo json_encode( $defaults );
353
-        wp_die();
354
-    }
352
+		echo json_encode( $defaults );
353
+		wp_die();
354
+	}
355 355
 
356 356
 	public static function change_styling() {
357 357
 		check_ajax_referer( 'frm_ajax', 'nonce' );
@@ -366,21 +366,21 @@  discard block
 block discarded – undo
366 366
 		wp_die();
367 367
 	}
368 368
 
369
-    private static function add_meta_boxes() {
370
-
371
-        // setup meta boxes
372
-        $meta_boxes = array(
373
-            'general'           => __( 'General', 'formidable' ),
374
-            'form-title'        => __( 'Form Title', 'formidable' ),
375
-            'form-description'  => __( 'Form Description', 'formidable' ),
376
-            'field-labels'      => __( 'Field Labels', 'formidable' ),
377
-            'field-description' => __( 'Field Description', 'formidable' ),
378
-            'field-colors'      => __( 'Field Colors', 'formidable' ),
379
-            'field-sizes'       => __( 'Field Settings', 'formidable' ),
380
-            'check-box-radio-fields' => __( 'Check Box & Radio Fields', 'formidable' ),
381
-            'buttons'           => __( 'Buttons', 'formidable' ),
382
-            'form-messages'     => __( 'Form Messages', 'formidable' ),
383
-        );
369
+	private static function add_meta_boxes() {
370
+
371
+		// setup meta boxes
372
+		$meta_boxes = array(
373
+			'general'           => __( 'General', 'formidable' ),
374
+			'form-title'        => __( 'Form Title', 'formidable' ),
375
+			'form-description'  => __( 'Form Description', 'formidable' ),
376
+			'field-labels'      => __( 'Field Labels', 'formidable' ),
377
+			'field-description' => __( 'Field Description', 'formidable' ),
378
+			'field-colors'      => __( 'Field Colors', 'formidable' ),
379
+			'field-sizes'       => __( 'Field Settings', 'formidable' ),
380
+			'check-box-radio-fields' => __( 'Check Box & Radio Fields', 'formidable' ),
381
+			'buttons'           => __( 'Buttons', 'formidable' ),
382
+			'form-messages'     => __( 'Form Messages', 'formidable' ),
383
+		);
384 384
 
385 385
 		/**
386 386
 		 * Add custom boxes to the styling settings
@@ -412,18 +412,18 @@  discard block
 block discarded – undo
412 412
 		$file_name = apply_filters( 'frm_style_settings_' . $sec['args'], $file_name );
413 413
 
414 414
 		include( $file_name );
415
-    }
415
+	}
416 416
 
417
-    public static function load_css() {
417
+	public static function load_css() {
418 418
 		header( 'Content-type: text/css' );
419 419
 
420
-        $frm_style = new FrmStyle();
421
-        $defaults = $frm_style->get_defaults();
420
+		$frm_style = new FrmStyle();
421
+		$defaults = $frm_style->get_defaults();
422 422
 		$style = '';
423 423
 
424 424
 		include( FrmAppHelper::plugin_path() . '/css/_single_theme.css.php' );
425
-        wp_die();
426
-    }
425
+		wp_die();
426
+	}
427 427
 
428 428
 	public static function load_saved_css() {
429 429
 		$css = get_transient( 'frmpro_css' );
@@ -432,49 +432,49 @@  discard block
 block discarded – undo
432 432
 		wp_die();
433 433
 	}
434 434
 
435
-    /**
436
-     * Check if the Formidable styling should be loaded,
437
-     * then enqueue it for the footer
438
-     * @since 2.0
439
-     */
440
-    public static function enqueue_style() {
441
-        global $frm_vars;
442
-
443
-        if ( isset( $frm_vars['css_loaded'] ) && $frm_vars['css_loaded'] ) {
444
-            // the CSS has already been loaded
445
-            return;
446
-        }
447
-
448
-        $frm_settings = FrmAppHelper::get_settings();
449
-        if ( $frm_settings->load_style != 'none' ) {
450
-            wp_enqueue_style( 'formidable' );
451
-            $frm_vars['css_loaded'] = true;
452
-        }
453
-    }
454
-
455
-    // Get the stylesheets for the form settings page
456
-    public static function get_style_opts() {
457
-        $frm_style = new FrmStyle();
458
-        $styles = $frm_style->get_all();
459
-
460
-        return $styles;
461
-    }
462
-
463
-    public static function get_form_style( $form = 'default' ) {
464
-        $style = FrmFormsHelper::get_form_style( $form );
465
-
466
-        if ( empty( $style ) || 1 == $style ) {
467
-            $style = 'default';
468
-        }
469
-
470
-        $frm_style = new FrmStyle( $style );
471
-        return $frm_style->get_one();
472
-    }
473
-
474
-    /**
475
-     * @param string $class
476
-     * @param string $style
477
-     */
435
+	/**
436
+	 * Check if the Formidable styling should be loaded,
437
+	 * then enqueue it for the footer
438
+	 * @since 2.0
439
+	 */
440
+	public static function enqueue_style() {
441
+		global $frm_vars;
442
+
443
+		if ( isset( $frm_vars['css_loaded'] ) && $frm_vars['css_loaded'] ) {
444
+			// the CSS has already been loaded
445
+			return;
446
+		}
447
+
448
+		$frm_settings = FrmAppHelper::get_settings();
449
+		if ( $frm_settings->load_style != 'none' ) {
450
+			wp_enqueue_style( 'formidable' );
451
+			$frm_vars['css_loaded'] = true;
452
+		}
453
+	}
454
+
455
+	// Get the stylesheets for the form settings page
456
+	public static function get_style_opts() {
457
+		$frm_style = new FrmStyle();
458
+		$styles = $frm_style->get_all();
459
+
460
+		return $styles;
461
+	}
462
+
463
+	public static function get_form_style( $form = 'default' ) {
464
+		$style = FrmFormsHelper::get_form_style( $form );
465
+
466
+		if ( empty( $style ) || 1 == $style ) {
467
+			$style = 'default';
468
+		}
469
+
470
+		$frm_style = new FrmStyle( $style );
471
+		return $frm_style->get_one();
472
+	}
473
+
474
+	/**
475
+	 * @param string $class
476
+	 * @param string $style
477
+	 */
478 478
 	public static function get_form_style_class( $class, $style ) {
479 479
 		if ( 1 == $style ) {
480 480
 			$style = 'default';
@@ -504,9 +504,9 @@  discard block
 block discarded – undo
504 504
 		}
505 505
 	}
506 506
 
507
-    /**
508
-     * @param string $val
509
-     */
507
+	/**
508
+	 * @param string $val
509
+	 */
510 510
 	public static function get_style_val( $val, $form = 'default' ) {
511 511
 		$style = self::get_form_style( $form );
512 512
 		if ( $style && isset( $style->post_content[ $val ] ) ) {
@@ -516,72 +516,72 @@  discard block
 block discarded – undo
516 516
 
517 517
 	public static function show_entry_styles( $default_styles ) {
518 518
 		$frm_style = new FrmStyle( 'default' );
519
-        $style = $frm_style->get_one();
520
-
521
-        if ( ! $style ) {
522
-            return $default_styles;
523
-        }
524
-
525
-        foreach ( $default_styles as $name => $val ) {
526
-            $setting = $name;
527
-            if ( 'border_width' == $name ) {
528
-                $setting = 'field_border_width';
529
-            } else if ( 'alt_bg_color' == $name ) {
530
-                $setting = 'bg_color_active';
531
-            }
532
-            $default_styles[ $name ] = $style->post_content[ $setting ];
519
+		$style = $frm_style->get_one();
520
+
521
+		if ( ! $style ) {
522
+			return $default_styles;
523
+		}
524
+
525
+		foreach ( $default_styles as $name => $val ) {
526
+			$setting = $name;
527
+			if ( 'border_width' == $name ) {
528
+				$setting = 'field_border_width';
529
+			} else if ( 'alt_bg_color' == $name ) {
530
+				$setting = 'bg_color_active';
531
+			}
532
+			$default_styles[ $name ] = $style->post_content[ $setting ];
533 533
 			unset( $name, $val );
534
-        }
534
+		}
535 535
 
536
-        return $default_styles;
537
-    }
536
+		return $default_styles;
537
+	}
538 538
 
539 539
 	public static function &important_style( $important, $field ) {
540 540
 		$important = self::get_style_val( 'important_style', $field['form_id'] );
541
-        return $important;
542
-    }
541
+		return $important;
542
+	}
543 543
 
544
-    /**
545
-     * Fallback for WP < 3.6
546
-     */
547
-    public static function do_accordion_sections( $screen, $context, $object ) {
548
-        if ( function_exists( 'do_accordion_sections' ) ) {
549
-            return do_accordion_sections( $screen, $context, $object );
550
-        }
544
+	/**
545
+	 * Fallback for WP < 3.6
546
+	 */
547
+	public static function do_accordion_sections( $screen, $context, $object ) {
548
+		if ( function_exists( 'do_accordion_sections' ) ) {
549
+			return do_accordion_sections( $screen, $context, $object );
550
+		}
551 551
 
552
-    	global $wp_meta_boxes;
552
+		global $wp_meta_boxes;
553 553
 
554
-        $screen = 'formidable_page_formidable-styles';
555
-        $screen = convert_to_screen( $screen );
554
+		$screen = 'formidable_page_formidable-styles';
555
+		$screen = convert_to_screen( $screen );
556 556
 
557
-    	$page = $screen->id;
557
+		$page = $screen->id;
558 558
 
559
-    	$hidden = get_hidden_meta_boxes( $screen );
560
-    	?>
559
+		$hidden = get_hidden_meta_boxes( $screen );
560
+		?>
561 561
     	<div id="side-sortables" class="accordion-container">
562 562
     	<?php
563
-    	$i = 0;
564
-    	$first_open = false;
565
-    	do {
563
+		$i = 0;
564
+		$first_open = false;
565
+		do {
566 566
 			if ( ! isset( $wp_meta_boxes ) || ! isset( $wp_meta_boxes[ $page ] ) || ! isset( $wp_meta_boxes[ $page ][ $context ] ) ) {
567 567
 				break;
568 568
 			}
569 569
 
570
-    		foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
571
-    			if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
572
-    				foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
573
-    					if ( false == $box || ! $box['title'] ) {
574
-    						continue;
570
+			foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
571
+				if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
572
+					foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
573
+						if ( false == $box || ! $box['title'] ) {
574
+							continue;
575 575
 						}
576 576
 
577
-    					$i++;
578
-    					$hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : '';
577
+						$i++;
578
+						$hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : '';
579 579
 
580
-    					if ( ! $first_open && empty( $hidden_class ) ) {
581
-    						$first_open = true;
582
-    					}
580
+						if ( ! $first_open && empty( $hidden_class ) ) {
581
+							$first_open = true;
582
+						}
583 583
 
584
-    					?>
584
+						?>
585 585
 						<div class="postbox <?php echo esc_attr( $box['id'] ); ?>">
586 586
 						<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'formidable' ); ?>"><br/></div>
587 587
                         <h3 class='hndle'><span><?php echo esc_html( $box['title'] ); ?></span></h3>
@@ -592,13 +592,13 @@  discard block
 block discarded – undo
592 592
     						</div><!-- .accordion-section-content -->
593 593
     					</div><!-- .postbox -->
594 594
     					<?php
595
-    				}
596
-    			}
597
-    		}
598
-    	} while ( 0 );
599
-    	?>
595
+					}
596
+				}
597
+			}
598
+		} while ( 0 );
599
+		?>
600 600
     	</div><!-- .accordion-container -->
601 601
     	<?php
602
-    	return $i;
603
-    }
602
+		return $i;
603
+	}
604 604
 }
Please login to merge, or discard this patch.
classes/controllers/FrmHooksController.php 1 patch
Indentation   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -2,89 +2,89 @@  discard block
 block discarded – undo
2 2
 
3 3
 class FrmHooksController {
4 4
 
5
-    /**
6
-     * Trigger plugin-wide hook loading
7
-     */
8
-    public static function trigger_load_hook( $hooks = 'load_hooks' ) {
9
-        $controllers = apply_filters( 'frm_load_controllers', array( 'FrmHooksController' ) );
10
-
11
-        $trigger_hooks = $hooks;
12
-        $hooks = (array) $hooks;
13
-
14
-        if ( 'load_hooks' == $trigger_hooks ) {
15
-            if ( is_admin() ) {
16
-                $hooks[] = 'load_admin_hooks';
17
-                if ( defined( 'DOING_AJAX' ) ) {
18
-                    $hooks[] = 'load_ajax_hooks';
19
-                    $hooks[] = 'load_form_hooks';
20
-                }
21
-            }
22
-
23
-            if ( is_multisite() ) {
24
-                $hooks[] = 'load_multisite_hooks';
25
-            }
26
-        } else {
27
-            // Make sure the hooks are only triggered once
28
-            add_filter( 'frm' . str_replace( 'load', '', $trigger_hooks ) . '_loaded', '__return_true' );
29
-        }
30
-        unset( $trigger_hooks );
31
-
32
-        // Instansiate Controllers
33
-        foreach ( $controllers as $c ) {
34
-            foreach ( $hooks as $hook ) {
5
+	/**
6
+	 * Trigger plugin-wide hook loading
7
+	 */
8
+	public static function trigger_load_hook( $hooks = 'load_hooks' ) {
9
+		$controllers = apply_filters( 'frm_load_controllers', array( 'FrmHooksController' ) );
10
+
11
+		$trigger_hooks = $hooks;
12
+		$hooks = (array) $hooks;
13
+
14
+		if ( 'load_hooks' == $trigger_hooks ) {
15
+			if ( is_admin() ) {
16
+				$hooks[] = 'load_admin_hooks';
17
+				if ( defined( 'DOING_AJAX' ) ) {
18
+					$hooks[] = 'load_ajax_hooks';
19
+					$hooks[] = 'load_form_hooks';
20
+				}
21
+			}
22
+
23
+			if ( is_multisite() ) {
24
+				$hooks[] = 'load_multisite_hooks';
25
+			}
26
+		} else {
27
+			// Make sure the hooks are only triggered once
28
+			add_filter( 'frm' . str_replace( 'load', '', $trigger_hooks ) . '_loaded', '__return_true' );
29
+		}
30
+		unset( $trigger_hooks );
31
+
32
+		// Instansiate Controllers
33
+		foreach ( $controllers as $c ) {
34
+			foreach ( $hooks as $hook ) {
35 35
 				call_user_func( array( $c, $hook ) );
36 36
 				unset( $hook );
37
-            }
37
+			}
38 38
 			unset( $c );
39
-        }
39
+		}
40 40
 
41
-    }
41
+	}
42 42
 
43
-    public static function trigger_load_form_hooks() {
44
-        self::trigger_load_hook( 'load_form_hooks' );
45
-    }
43
+	public static function trigger_load_form_hooks() {
44
+		self::trigger_load_hook( 'load_form_hooks' );
45
+	}
46 46
 
47 47
 	public static function load_hooks() {
48 48
 		add_action( 'rest_api_init', 'FrmAppController::create_rest_routes', 0 );
49
-        add_action( 'plugins_loaded', 'FrmAppController::load_lang' );
49
+		add_action( 'plugins_loaded', 'FrmAppController::load_lang' );
50 50
 		add_filter( 'widget_text', 'do_shortcode' );
51 51
 
52
-        // Entries controller
53
-        add_action( 'wp_loaded', 'FrmEntriesController::process_entry', 10, 0 );
54
-        add_action( 'frm_after_entry_processed', 'FrmEntriesController::delete_entry_after_save', 100 );
52
+		// Entries controller
53
+		add_action( 'wp_loaded', 'FrmEntriesController::process_entry', 10, 0 );
54
+		add_action( 'frm_after_entry_processed', 'FrmEntriesController::delete_entry_after_save', 100 );
55 55
 
56
-        // Form Actions Controller
57
-        add_action( 'init', 'FrmFormActionsController::register_post_types', 1 );
56
+		// Form Actions Controller
57
+		add_action( 'init', 'FrmFormActionsController::register_post_types', 1 );
58 58
 		add_action( 'frm_after_create_entry', 'FrmFormActionsController::trigger_create_actions', 20, 3 );
59 59
 
60
-        // Forms Controller
61
-        add_action( 'widgets_init', 'FrmFormsController::register_widgets' );
60
+		// Forms Controller
61
+		add_action( 'widgets_init', 'FrmFormsController::register_widgets' );
62 62
 		add_action( 'init', 'FrmFormsController::front_head' );
63
-        add_filter( 'frm_content', 'FrmFormsController::filter_content', 10, 3 );
64
-        add_filter( 'frm_replace_content_shortcodes', 'FrmFormsController::replace_content_shortcodes', 20, 3 );
65
-        add_action( 'admin_bar_init', 'FrmFormsController::admin_bar_css' );
63
+		add_filter( 'frm_content', 'FrmFormsController::filter_content', 10, 3 );
64
+		add_filter( 'frm_replace_content_shortcodes', 'FrmFormsController::replace_content_shortcodes', 20, 3 );
65
+		add_action( 'admin_bar_init', 'FrmFormsController::admin_bar_css' );
66 66
 		add_action( 'wp_footer', 'FrmFormsController::footer_js', 1, 0 );
67 67
 
68 68
 		add_action( 'wp_scheduled_delete', 'FrmForm::scheduled_delete' );
69 69
 
70
-        // Form Shortcodes
71
-        add_shortcode( 'formidable', 'FrmFormsController::get_form_shortcode' );
70
+		// Form Shortcodes
71
+		add_shortcode( 'formidable', 'FrmFormsController::get_form_shortcode' );
72 72
 
73
-        // Styles Controller
74
-        add_action( 'init', 'FrmStylesController::register_post_types', 0 );
75
-        add_filter( 'frm_get_style_opts', 'FrmStylesController::get_style_opts' );
76
-        add_filter( 'frm_add_form_style_class', 'FrmStylesController::get_form_style_class', 10, 2 );
77
-        add_filter( 'frm_show_entry_styles', 'FrmStylesController::show_entry_styles' );
73
+		// Styles Controller
74
+		add_action( 'init', 'FrmStylesController::register_post_types', 0 );
75
+		add_filter( 'frm_get_style_opts', 'FrmStylesController::get_style_opts' );
76
+		add_filter( 'frm_add_form_style_class', 'FrmStylesController::get_form_style_class', 10, 2 );
77
+		add_filter( 'frm_show_entry_styles', 'FrmStylesController::show_entry_styles' );
78 78
 
79 79
 		//Simple Blocks Controller
80 80
 		add_action( 'init', 'FrmSimpleBlocksController::register_simple_form_block' );
81
-    }
81
+	}
82 82
 
83 83
 	public static function load_admin_hooks() {
84
-        add_action( 'admin_menu', 'FrmAppController::menu', 1 );
84
+		add_action( 'admin_menu', 'FrmAppController::menu', 1 );
85 85
 		add_filter( 'admin_body_class', 'FrmAppController::add_admin_class', 999 );
86
-        add_action( 'admin_enqueue_scripts', 'FrmAppController::load_wp_admin_style' );
87
-        add_action( 'admin_notices', 'FrmAppController::pro_get_started_headline' );
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
 		add_filter( 'admin_footer_text', 'FrmAppController::set_footer_text' );
@@ -95,120 +95,120 @@  discard block
 block discarded – undo
95 95
 		add_action( 'admin_menu', 'FrmAddonsController::menu', 100 );
96 96
 		add_filter( 'pre_set_site_transient_update_plugins', 'FrmAddonsController::check_update' );
97 97
 
98
-        // Entries Controller
99
-        add_action( 'admin_menu', 'FrmEntriesController::menu', 12 );
100
-        add_filter( 'contextual_help', 'FrmEntriesController::contextual_help', 10, 3 );
101
-        add_filter( 'set-screen-option', 'FrmEntriesController::save_per_page', 10, 3 );
102
-        add_filter( 'update_user_metadata', 'FrmEntriesController::check_hidden_cols', 10, 5 );
103
-        add_action( 'updated_user_meta', 'FrmEntriesController::update_hidden_cols', 10, 4 );
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 );
110
-
111
-        // Forms Controller
112
-        add_action( 'admin_menu', 'FrmFormsController::menu', 10 );
113
-        add_action( 'admin_head-toplevel_page_formidable', 'FrmFormsController::head' );
114
-
115
-        add_filter( 'set-screen-option', 'FrmFormsController::save_per_page', 10, 3 );
116
-        add_action( 'admin_footer', 'FrmFormsController::insert_form_popup' );
98
+		// Entries Controller
99
+		add_action( 'admin_menu', 'FrmEntriesController::menu', 12 );
100
+		add_filter( 'contextual_help', 'FrmEntriesController::contextual_help', 10, 3 );
101
+		add_filter( 'set-screen-option', 'FrmEntriesController::save_per_page', 10, 3 );
102
+		add_filter( 'update_user_metadata', 'FrmEntriesController::check_hidden_cols', 10, 5 );
103
+		add_action( 'updated_user_meta', 'FrmEntriesController::update_hidden_cols', 10, 4 );
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 );
110
+
111
+		// Forms Controller
112
+		add_action( 'admin_menu', 'FrmFormsController::menu', 10 );
113
+		add_action( 'admin_head-toplevel_page_formidable', 'FrmFormsController::head' );
114
+
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
 		add_action( 'et_pb_admin_excluded_shortcodes', 'FrmFormsController::prevent_divi_conflict' );
119 119
 
120
-        // Forms Model
121
-        add_action( 'frm_after_duplicate_form', 'FrmForm::after_duplicate', 10, 2 );
120
+		// Forms Model
121
+		add_action( 'frm_after_duplicate_form', 'FrmForm::after_duplicate', 10, 2 );
122 122
 
123
-        // Settings Controller
124
-        add_action( 'admin_menu', 'FrmSettingsController::menu', 45 );
125
-        add_action( 'frm_before_settings', 'FrmSettingsController::license_box' );
123
+		// Settings Controller
124
+		add_action( 'admin_menu', 'FrmSettingsController::menu', 45 );
125
+		add_action( 'frm_before_settings', 'FrmSettingsController::license_box' );
126 126
 		add_action( 'frm_after_settings', 'FrmSettingsController::settings_cta' );
127 127
 		add_action( 'wp_ajax_frm_settings_tab', 'FrmSettingsController::load_settings_tab' );
128 128
 
129
-        // Styles Controller
130
-        add_action( 'admin_menu', 'FrmStylesController::menu', 14 );
131
-        add_action( 'admin_init', 'FrmStylesController::admin_init' );
129
+		// Styles Controller
130
+		add_action( 'admin_menu', 'FrmStylesController::menu', 14 );
131
+		add_action( 'admin_init', 'FrmStylesController::admin_init' );
132 132
 
133
-        // XML Controller
134
-        add_action( 'admin_menu', 'FrmXMLController::menu', 41 );
133
+		// XML Controller
134
+		add_action( 'admin_menu', 'FrmXMLController::menu', 41 );
135 135
 
136 136
 		// Simple Blocks Controller
137 137
 		add_action( 'enqueue_block_editor_assets', 'FrmSimpleBlocksController::block_editor_assets' );
138
-    }
138
+	}
139 139
 
140 140
 	public static function load_ajax_hooks() {
141 141
 		add_action( 'wp_ajax_frm_install', 'FrmAppController::ajax_install' );
142
-        add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
143
-        add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
142
+		add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
143
+		add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
144 144
 
145 145
 		// Addons
146 146
 		add_action( 'wp_ajax_frm_addon_activate', 'FrmAddon::activate' );
147 147
 		add_action( 'wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' );
148 148
 		add_action( 'wp_ajax_frm_install_addon', 'FrmAddonsController::ajax_install_addon' );
149 149
 
150
-        // Fields Controller
151
-        add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' );
152
-        add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' );
153
-        add_action( 'wp_ajax_frm_update_ajax_option', 'FrmFieldsController::update_ajax_option' );
154
-        add_action( 'wp_ajax_frm_duplicate_field', 'FrmFieldsController::duplicate' );
155
-        add_action( 'wp_ajax_frm_delete_field', 'FrmFieldsController::destroy' );
156
-        add_action( 'wp_ajax_frm_add_field_option', 'FrmFieldsController::add_option' );
157
-        add_action( 'wp_ajax_frm_import_choices', 'FrmFieldsController::import_choices' );
158
-        add_action( 'wp_ajax_frm_import_options', 'FrmFieldsController::import_options' );
159
-        add_action( 'wp_ajax_frm_update_field_order', 'FrmFieldsController::update_order' );
160
-
161
-        // Form Actions Controller
162
-        add_action( 'wp_ajax_frm_add_form_action', 'FrmFormActionsController::add_form_action' );
163
-        add_action( 'wp_ajax_frm_form_action_fill', 'FrmFormActionsController::fill_action' );
164
-
165
-        // Forms Controller
150
+		// Fields Controller
151
+		add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' );
152
+		add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' );
153
+		add_action( 'wp_ajax_frm_update_ajax_option', 'FrmFieldsController::update_ajax_option' );
154
+		add_action( 'wp_ajax_frm_duplicate_field', 'FrmFieldsController::duplicate' );
155
+		add_action( 'wp_ajax_frm_delete_field', 'FrmFieldsController::destroy' );
156
+		add_action( 'wp_ajax_frm_add_field_option', 'FrmFieldsController::add_option' );
157
+		add_action( 'wp_ajax_frm_import_choices', 'FrmFieldsController::import_choices' );
158
+		add_action( 'wp_ajax_frm_import_options', 'FrmFieldsController::import_options' );
159
+		add_action( 'wp_ajax_frm_update_field_order', 'FrmFieldsController::update_order' );
160
+
161
+		// Form Actions Controller
162
+		add_action( 'wp_ajax_frm_add_form_action', 'FrmFormActionsController::add_form_action' );
163
+		add_action( 'wp_ajax_frm_form_action_fill', 'FrmFormActionsController::fill_action' );
164
+
165
+		// Forms Controller
166 166
 		add_action( 'wp_ajax_frm_create_from_template', 'FrmFormsController::_create_from_template' );
167 167
 		add_action( 'wp_ajax_frm_save_form', 'FrmFormsController::route' );
168
-        add_action( 'wp_ajax_frm_get_default_html', 'FrmFormsController::get_email_html' );
169
-        add_action( 'wp_ajax_frm_get_shortcode_opts', 'FrmFormsController::get_shortcode_opts' );
170
-        add_action( 'wp_ajax_frm_forms_preview', 'FrmFormsController::preview' );
171
-        add_action( 'wp_ajax_nopriv_frm_forms_preview', 'FrmFormsController::preview' );
168
+		add_action( 'wp_ajax_frm_get_default_html', 'FrmFormsController::get_email_html' );
169
+		add_action( 'wp_ajax_frm_get_shortcode_opts', 'FrmFormsController::get_shortcode_opts' );
170
+		add_action( 'wp_ajax_frm_forms_preview', 'FrmFormsController::preview' );
171
+		add_action( 'wp_ajax_nopriv_frm_forms_preview', 'FrmFormsController::preview' );
172 172
 
173 173
 		// Settings
174 174
 		add_action( 'wp_ajax_frm_lite_settings_upgrade', 'FrmSettingsController::settings_cta_dismiss' );
175 175
 
176
-        // Styles Controller
177
-        add_action( 'wp_ajax_frm_settings_reset', 'FrmStylesController::reset_styling' );
178
-        add_action( 'wp_ajax_frm_change_styling', 'FrmStylesController::change_styling' );
179
-        add_action( 'wp_ajax_frmpro_load_css', 'FrmStylesController::load_css' );
180
-        add_action( 'wp_ajax_nopriv_frmpro_load_css', 'FrmStylesController::load_css' );
176
+		// Styles Controller
177
+		add_action( 'wp_ajax_frm_settings_reset', 'FrmStylesController::reset_styling' );
178
+		add_action( 'wp_ajax_frm_change_styling', 'FrmStylesController::change_styling' );
179
+		add_action( 'wp_ajax_frmpro_load_css', 'FrmStylesController::load_css' );
180
+		add_action( 'wp_ajax_nopriv_frmpro_load_css', 'FrmStylesController::load_css' );
181 181
 		add_action( 'wp_ajax_frmpro_css', 'FrmStylesController::load_saved_css' );
182 182
 		add_action( 'wp_ajax_nopriv_frmpro_css', 'FrmStylesController::load_saved_css' );
183 183
 
184
-        // XML Controller
184
+		// XML Controller
185 185
 		add_action( 'wp_ajax_frm_entries_csv', 'FrmXMLController::csv' );
186 186
 		add_action( 'wp_ajax_nopriv_frm_entries_csv', 'FrmXMLController::csv' );
187
-        add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' );
188
-    }
187
+		add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' );
188
+	}
189 189
 
190 190
 	public static function load_form_hooks() {
191
-        // Fields Controller
192
-        add_filter( 'frm_field_type', 'FrmFieldsController::change_type' );
193
-        add_action( 'frm_field_input_html', 'FrmFieldsController::input_html' );
194
-        add_filter( 'frm_field_value_saved', 'FrmFieldsController::check_value', 50, 3 );
195
-        add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' );
191
+		// Fields Controller
192
+		add_filter( 'frm_field_type', 'FrmFieldsController::change_type' );
193
+		add_action( 'frm_field_input_html', 'FrmFieldsController::input_html' );
194
+		add_filter( 'frm_field_value_saved', 'FrmFieldsController::check_value', 50, 3 );
195
+		add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' );
196 196
 
197 197
 		// Forms Controller
198 198
 		add_filter( 'frm_form_classes', 'FrmFormsController::form_classes' );
199 199
 
200
-        // Styles Controller
201
-        add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 );
202
-    }
200
+		// Styles Controller
201
+		add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 );
202
+	}
203 203
 
204 204
 	public static function load_view_hooks() {
205
-        // Hooks go here when a view is loaded
206
-    }
205
+		// Hooks go here when a view is loaded
206
+	}
207 207
 
208 208
 	public static function load_multisite_hooks() {
209 209
 		add_action( 'wpmu_upgrade_site', 'FrmAppController::network_upgrade_site' );
210 210
 
211
-        // drop tables when mu site is deleted
212
-        add_filter( 'wpmu_drop_tables', 'FrmAppController::drop_tables' );
213
-    }
211
+		// drop tables when mu site is deleted
212
+		add_filter( 'wpmu_drop_tables', 'FrmAppController::drop_tables' );
213
+	}
214 214
 }
Please login to merge, or discard this patch.