Completed
Push — master ( ea430e...236b06 )
by Jamie
03:00
created
classes/controllers/FrmSettingsController.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -2,26 +2,26 @@  discard block
 block discarded – undo
2 2
 
3 3
 class FrmSettingsController {
4 4
 
5
-    public static function menu() {
5
+	public static function menu() {
6 6
 		// Make sure admins can see the menu items
7 7
 		FrmAppHelper::force_capability( 'frm_change_settings' );
8 8
 
9
-        add_submenu_page( 'formidable', 'Formidable | ' . __( 'Global Settings', 'formidable' ), __( 'Global Settings', 'formidable' ), 'frm_change_settings', 'formidable-settings', 'FrmSettingsController::route' );
10
-    }
9
+		add_submenu_page( 'formidable', 'Formidable | ' . __( 'Global Settings', 'formidable' ), __( 'Global Settings', 'formidable' ), 'frm_change_settings', 'formidable-settings', 'FrmSettingsController::route' );
10
+	}
11 11
 
12
-    public static function license_box() {
12
+	public static function license_box() {
13 13
 		$a = FrmAppHelper::simple_get( 't', 'sanitize_title', 'general_settings' );
14
-        include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/license_box.php' );
15
-    }
14
+		include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/license_box.php' );
15
+	}
16 16
 
17
-    public static function display_form( $errors = array(), $message = '' ) {
18
-        global $frm_vars;
17
+	public static function display_form( $errors = array(), $message = '' ) {
18
+		global $frm_vars;
19 19
 
20
-        $frm_settings = FrmAppHelper::get_settings();
21
-        $frm_roles = FrmAppHelper::frm_capabilities();
20
+		$frm_settings = FrmAppHelper::get_settings();
21
+		$frm_roles = FrmAppHelper::frm_capabilities();
22 22
 
23
-        $uploads = wp_upload_dir();
24
-        $target_path = $uploads['basedir'] . '/formidable/css';
23
+		$uploads = wp_upload_dir();
24
+		$target_path = $uploads['basedir'] . '/formidable/css';
25 25
 
26 26
 		$sections = array();
27 27
 		if ( apply_filters( 'frm_include_addon_page', false ) ) {
@@ -30,54 +30,54 @@  discard block
 block discarded – undo
30 30
 				'name' => __( 'Plugin Licenses', 'formidable' ),
31 31
 			);
32 32
 		}
33
-        $sections = apply_filters( 'frm_add_settings_section', $sections );
33
+		$sections = apply_filters( 'frm_add_settings_section', $sections );
34 34
 
35
-        $captcha_lang = FrmAppHelper::locales( 'captcha' );
35
+		$captcha_lang = FrmAppHelper::locales( 'captcha' );
36 36
 
37
-        require( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/form.php' );
38
-    }
37
+		require( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/form.php' );
38
+	}
39 39
 
40
-    public static function process_form( $stop_load = false ) {
41
-        global $frm_vars;
40
+	public static function process_form( $stop_load = false ) {
41
+		global $frm_vars;
42 42
 
43
-        $frm_settings = FrmAppHelper::get_settings();
43
+		$frm_settings = FrmAppHelper::get_settings();
44 44
 
45 45
 		$process_form = FrmAppHelper::get_post_param( 'process_form', '', 'sanitize_text_field' );
46 46
 		if ( ! wp_verify_nonce( $process_form, 'process_form_nonce' ) ) {
47
-            wp_die( $frm_settings->admin_permission );
48
-        }
47
+			wp_die( $frm_settings->admin_permission );
48
+		}
49 49
 
50
-        $errors = array();
51
-        $message = '';
50
+		$errors = array();
51
+		$message = '';
52 52
 
53
-        if ( ! isset( $frm_vars['settings_routed'] ) || ! $frm_vars['settings_routed'] ) {
54
-            $errors = $frm_settings->validate( $_POST, array() );
53
+		if ( ! isset( $frm_vars['settings_routed'] ) || ! $frm_vars['settings_routed'] ) {
54
+			$errors = $frm_settings->validate( $_POST, array() );
55 55
 
56
-            $frm_settings->update( stripslashes_deep( $_POST ) );
56
+			$frm_settings->update( stripslashes_deep( $_POST ) );
57 57
 
58
-            if ( empty( $errors ) ) {
59
-                $frm_settings->store();
60
-                $message = __( 'Settings Saved', 'formidable' );
61
-            }
62
-        } else {
63
-            $message = __( 'Settings Saved', 'formidable' );
64
-        }
58
+			if ( empty( $errors ) ) {
59
+				$frm_settings->store();
60
+				$message = __( 'Settings Saved', 'formidable' );
61
+			}
62
+		} else {
63
+			$message = __( 'Settings Saved', 'formidable' );
64
+		}
65 65
 
66 66
 		if ( $stop_load == 'stop_load' ) {
67
-            $frm_vars['settings_routed'] = true;
68
-            return;
69
-        }
67
+			$frm_vars['settings_routed'] = true;
68
+			return;
69
+		}
70 70
 
71
-        self::display_form( $errors, $message );
72
-    }
71
+		self::display_form( $errors, $message );
72
+	}
73 73
 
74
-    public static function route( $stop_load = false ) {
75
-        $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action';
74
+	public static function route( $stop_load = false ) {
75
+		$action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action';
76 76
 		$action = FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' );
77
-        if ( $action == 'process-form' ) {
77
+		if ( $action == 'process-form' ) {
78 78
 			self::process_form( $stop_load );
79
-        } else if ( $stop_load != 'stop_load' ) {
79
+		} else if ( $stop_load != 'stop_load' ) {
80 80
 			self::display_form();
81
-        }
82
-    }
81
+		}
82
+	}
83 83
 }
Please login to merge, or discard this patch.