Completed
Push — master ( 2cf045...5e9e9f )
by Jamie
03:28
created
classes/views/styles/_field-colors.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 				<a href="?page=formidable-styles&page-tab=default#tabs-panel-default-color" class="nav-tab-link" data-type="tabs-panel-default-color"><?php _e( 'Default', 'formidable' ) ?></a>
5 5
 			</li>
6 6
 			<li <?php echo ( 'active-color' == $current_tab ? ' class="tabs"' : '' ); ?>>
7
-				<a href="<?php echo esc_url('?page=formidable-styles&page-tab=active-color#page-active-color') ?>" class="nav-tab-link" data-type="tabs-panel-active-color"><?php _e( 'Active', 'formidable' ) ?></a>
7
+				<a href="<?php echo esc_url( '?page=formidable-styles&page-tab=active-color#page-active-color' ) ?>" class="nav-tab-link" data-type="tabs-panel-active-color"><?php _e( 'Active', 'formidable' ) ?></a>
8 8
 			</li>
9 9
 			<li <?php echo ( 'active-error' == $current_tab ? ' class="tabs"' : '' ); ?>>
10 10
 				<a href="?page=formidable-styles&page-tab=active-error#tabs-panel-active-error" class="nav-tab-link" data-type="tabs-panel-active-error"><?php _e( 'Error', 'formidable' ) ?></a>
@@ -19,34 +19,34 @@  discard block
 block discarded – undo
19 19
 		?>">
20 20
 			<div class="field-group field-group-border clearfix">
21 21
             	<label class="background"><?php _e( 'BG color', 'formidable' ) ?></label>
22
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color') ) ?>" id="frm_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color'] ) ?>" />
22
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color' ) ) ?>" id="frm_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color'] ) ?>" />
23 23
             </div>
24 24
             <div class="field-group clearfix">
25 25
             	<label><?php _e( 'Text', 'formidable' ) ?></label>
26
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('text_color') ) ?>" id="frm_text_color" class="hex" value="<?php echo esc_attr( $style->post_content['text_color'] ) ?>" />
26
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'text_color' ) ) ?>" id="frm_text_color" class="hex" value="<?php echo esc_attr( $style->post_content['text_color'] ) ?>" />
27 27
             </div>
28 28
 
29 29
             <div class="field-group field-group-border clearfix">
30 30
             	<label><?php _e( 'Border', 'formidable' ) ?></label>
31
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color') ) ?>" id="frm_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['border_color'] ) ?>" />
31
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color' ) ) ?>" id="frm_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['border_color'] ) ?>" />
32 32
             </div>
33 33
             <div class="field-group clearfix">
34 34
             	<label><?php _e( 'Thickness', 'formidable' ) ?></label>
35
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_border_width') ) ?>" id="frm_field_border_width" value="<?php echo esc_attr( $style->post_content['field_border_width'] ) ?>" size="4" />
35
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_border_width' ) ) ?>" id="frm_field_border_width" value="<?php echo esc_attr( $style->post_content['field_border_width'] ) ?>" size="4" />
36 36
             </div>
37 37
             <div class="field-group clearfix">
38 38
 				<label><?php _e( 'Style', 'formidable' ) ?></label>
39
-            	<select name="<?php echo esc_attr( $frm_style->get_field_name('field_border_style') ) ?>" id="frm_field_border_style">
40
-            	    <option value="solid" <?php selected($style->post_content['field_border_style'], 'solid') ?>><?php _e( 'solid', 'formidable' ) ?></option>
41
-            		<option value="dotted" <?php selected($style->post_content['field_border_style'], 'dotted') ?>><?php _e( 'dotted', 'formidable' ) ?></option>
42
-            		<option value="dashed" <?php selected($style->post_content['field_border_style'], 'dashed') ?>><?php _e( 'dashed', 'formidable' ) ?></option>
43
-            		<option value="double" <?php selected($style->post_content['field_border_style'], 'double') ?>><?php _e( 'double', 'formidable' ) ?></option>
39
+            	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'field_border_style' ) ) ?>" id="frm_field_border_style">
40
+            	    <option value="solid" <?php selected( $style->post_content['field_border_style'], 'solid' ) ?>><?php _e( 'solid', 'formidable' ) ?></option>
41
+            		<option value="dotted" <?php selected( $style->post_content['field_border_style'], 'dotted' ) ?>><?php _e( 'dotted', 'formidable' ) ?></option>
42
+            		<option value="dashed" <?php selected( $style->post_content['field_border_style'], 'dashed' ) ?>><?php _e( 'dashed', 'formidable' ) ?></option>
43
+            		<option value="double" <?php selected( $style->post_content['field_border_style'], 'double' ) ?>><?php _e( 'double', 'formidable' ) ?></option>
44 44
             	</select>
45 45
             </div>
46 46
             <div class="clear"></div>
47 47
 			<p class="frm_no_bottom_margin">
48 48
 				<label>
49
-					<input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('remove_box_shadow') ) ?>" id="frm_remove_box_shadow" value="1" <?php checked($style->post_content['remove_box_shadow'], 1) ?> />
49
+					<input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'remove_box_shadow' ) ) ?>" id="frm_remove_box_shadow" value="1" <?php checked( $style->post_content['remove_box_shadow'], 1 ) ?> />
50 50
 					<?php _e( 'Remove box shadow', 'formidable' ) ?>
51 51
 				</label>
52 52
 			</p>
@@ -57,16 +57,16 @@  discard block
 block discarded – undo
57 57
 		?>">
58 58
             <div class="field-group field-group-border clearfix">
59 59
             	<label class="background"><?php _e( 'BG color', 'formidable' ) ?></label>
60
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color_active') ) ?>" id="frm_bg_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_active'] ) ?>" />
60
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color_active' ) ) ?>" id="frm_bg_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_active'] ) ?>" />
61 61
             </div>
62 62
             <div class="field-group clearfix">
63 63
             	<label><?php _e( 'Border', 'formidable' ) ?></label>
64
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color_active') ) ?>" id="frm_border_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_active'] ) ?>" />
64
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color_active' ) ) ?>" id="frm_border_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_active'] ) ?>" />
65 65
             </div>
66 66
 			<div class="clear"></div>
67 67
 			<p class="frm_no_bottom_margin">
68 68
 				<label>
69
-					<input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('remove_box_shadow_active') ) ?>" id="frm_remove_box_shadow_active" value="1" <?php checked($style->post_content['remove_box_shadow_active'], 1) ?> />
69
+					<input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'remove_box_shadow_active' ) ) ?>" id="frm_remove_box_shadow_active" value="1" <?php checked( $style->post_content['remove_box_shadow_active'], 1 ) ?> />
70 70
 					<?php _e( 'Remove box shadow', 'formidable' ) ?>
71 71
 				</label>
72 72
 			</p>
@@ -77,28 +77,28 @@  discard block
 block discarded – undo
77 77
 		?>">
78 78
 		    <div class="field-group field-group-border clearfix">
79 79
         	    <label class="background"><?php _e( 'BG color', 'formidable' ) ?></label>
80
-        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color_error') ) ?>" id="frm_bg_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_error'] ) ?>" />
80
+        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color_error' ) ) ?>" id="frm_bg_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_error'] ) ?>" />
81 81
             </div>
82 82
             <div class="field-group clearfix">
83 83
         	    <label><?php _e( 'Text', 'formidable' ) ?></label>
84
-        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('text_color_error') ) ?>" id="frm_text_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_error'] ) ?>" />
84
+        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'text_color_error' ) ) ?>" id="frm_text_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_error'] ) ?>" />
85 85
             </div>
86 86
 
87 87
             <div class="field-group field-group-border clearfix">
88 88
                 <label><?php _e( 'Border', 'formidable' ) ?></label>
89
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color_error') ) ?>" id="frm_border_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_error'] ) ?>" />
89
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color_error' ) ) ?>" id="frm_border_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_error'] ) ?>" />
90 90
             </div>
91 91
             <div class="field-group clearfix">
92 92
             	<label><?php _e( 'Thickness', 'formidable' ) ?></label>
93
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_width_error') ) ?>" id="frm_border_width_error" value="<?php echo esc_attr( $style->post_content['border_width_error'] ) ?>" size="4" />
93
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_width_error' ) ) ?>" id="frm_border_width_error" value="<?php echo esc_attr( $style->post_content['border_width_error'] ) ?>" size="4" />
94 94
             </div>
95 95
             <div class="field-group clearfix">
96 96
             	<label><?php _e( 'Style', 'formidable' ) ?></label>
97
-            	<select name="<?php echo esc_attr( $frm_style->get_field_name('border_style_error') ) ?>" id="frm_border_style_error">
98
-            	    <option value="solid" <?php selected($style->post_content['border_style_error'], 'solid') ?>><?php _e( 'solid', 'formidable' ) ?></option>
99
-            		<option value="dotted" <?php selected($style->post_content['border_style_error'], 'dotted') ?>><?php _e( 'dotted', 'formidable' ) ?></option>
100
-            		<option value="dashed" <?php selected($style->post_content['border_style_error'], 'dashed') ?>><?php _e( 'dashed', 'formidable' ) ?></option>
101
-            		<option value="double" <?php selected($style->post_content['border_style_error'], 'double') ?>><?php _e( 'double', 'formidable' ) ?></option>
97
+            	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'border_style_error' ) ) ?>" id="frm_border_style_error">
98
+            	    <option value="solid" <?php selected( $style->post_content['border_style_error'], 'solid' ) ?>><?php _e( 'solid', 'formidable' ) ?></option>
99
+            		<option value="dotted" <?php selected( $style->post_content['border_style_error'], 'dotted' ) ?>><?php _e( 'dotted', 'formidable' ) ?></option>
100
+            		<option value="dashed" <?php selected( $style->post_content['border_style_error'], 'dashed' ) ?>><?php _e( 'dashed', 'formidable' ) ?></option>
101
+            		<option value="double" <?php selected( $style->post_content['border_style_error'], 'double' ) ?>><?php _e( 'double', 'formidable' ) ?></option>
102 102
             	</select>
103 103
             </div>
104 104
 
@@ -110,16 +110,16 @@  discard block
 block discarded – undo
110 110
 		?>">
111 111
 		    <div class="field-group field-group-border clearfix">
112 112
         	    <label class="background"><?php _e( 'BG color', 'formidable' ) ?></label>
113
-        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color_disabled') ) ?>" id="frm_bg_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_disabled'] ) ?>" />
113
+        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color_disabled' ) ) ?>" id="frm_bg_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_disabled'] ) ?>" />
114 114
             </div>
115 115
             <div class="field-group clearfix">
116 116
         	    <label><?php _e( 'Text', 'formidable' ) ?></label>
117
-        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('text_color_disabled') ) ?>" id="frm_text_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_disabled'] ) ?>" />
117
+        	    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'text_color_disabled' ) ) ?>" id="frm_text_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_disabled'] ) ?>" />
118 118
             </div>
119 119
 
120 120
             <div class="field-group clearfix">
121 121
                 <label><?php _e( 'Border', 'formidable' ) ?></label>
122
-            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color_disabled') ) ?>" id="frm_border_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_disabled'] ) ?>" />
122
+            	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color_disabled' ) ) ?>" id="frm_border_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_disabled'] ) ?>" />
123 123
             </div>
124 124
             <div class="clear"></div>
125 125
 		</div><!-- /.tabs-panel -->
Please login to merge, or discard this patch.
classes/views/styles/_field-sizes.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,42 +1,42 @@
 block discarded – undo
1 1
 <div class="field-group clearfix frm-first-row">
2 2
 	<label><?php _e( 'Size', 'formidable' ) ?></label>
3
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_font_size') ) ?>" id="frm_field_font_size" value="<?php echo esc_attr( $style->post_content['field_font_size'] ) ?>" />
3
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_font_size' ) ) ?>" id="frm_field_font_size" value="<?php echo esc_attr( $style->post_content['field_font_size'] ) ?>" />
4 4
 </div>
5 5
 
6 6
 <div class="field-group clearfix frm-first-row">
7 7
 	<label><?php _e( 'Height', 'formidable' ) ?></label>
8
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_height') ) ?>" id="frm_field_height" value="<?php echo esc_attr( $style->post_content['field_height'] ) ?>" />
8
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_height' ) ) ?>" id="frm_field_height" value="<?php echo esc_attr( $style->post_content['field_height'] ) ?>" />
9 9
 </div>
10 10
 
11 11
 <div class="field-group clearfix frm-first-row">
12 12
 	<label><?php _e( 'Width', 'formidable' ) ?></label>
13
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_width') ) ?>" id="frm_field_width" value="<?php echo esc_attr( $style->post_content['field_width'] ) ?>" />
13
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_width' ) ) ?>" id="frm_field_width" value="<?php echo esc_attr( $style->post_content['field_width'] ) ?>" />
14 14
 </div>
15 15
 
16 16
 <div class="clear"></div>
17 17
 <p class="frm_no_bottom_margin">
18
-    <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('auto_width') ) ?>" id="frm_auto_width" value="1" <?php checked( $style->post_content['auto_width'], 1 ) ?> />
18
+    <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'auto_width' ) ) ?>" id="frm_auto_width" value="1" <?php checked( $style->post_content['auto_width'], 1 ) ?> />
19 19
 	<?php _e( 'Automatic Width for drop-down fields', 'formidable' ) ?></label>
20 20
 </p>
21 21
 
22 22
 <div class="field-group clearfix">
23 23
 	<label><?php _e( 'Padding', 'formidable' ) ?></label>
24
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_pad') ) ?>" id="frm_field_pad" value="<?php echo esc_attr( $style->post_content['field_pad'] ) ?>" />
24
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_pad' ) ) ?>" id="frm_field_pad" value="<?php echo esc_attr( $style->post_content['field_pad'] ) ?>" />
25 25
 </div>
26 26
 
27 27
 <div class="field-group clearfix">
28 28
 	<label><?php _e( 'Margin', 'formidable' ) ?></label>
29
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_margin') ) ?>" id="frm_field_margin" value="<?php echo esc_attr( $style->post_content['field_margin'] ) ?>" />
29
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_margin' ) ) ?>" id="frm_field_margin" value="<?php echo esc_attr( $style->post_content['field_margin'] ) ?>" />
30 30
 </div>
31 31
 
32 32
 <div class="field-group clearfix">
33 33
 	<label><?php _e( 'Corners', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Formidable uses CSS3 border-radius for corner rounding, which is not currently supported by Internet Explorer.', 'formidable' ) ?>" ></span></label>
34
-	<input type="text" value="<?php echo esc_attr( $style->post_content['border_radius'] ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name('border_radius') ) ?>" id="frm_border_radius" />
34
+	<input type="text" value="<?php echo esc_attr( $style->post_content['border_radius'] ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_radius' ) ) ?>" id="frm_border_radius" />
35 35
 </div>
36 36
 
37 37
 <div class="field-group clearfix frm-first-row">
38 38
 	<label><?php _e( 'Weight', 'formidable' ) ?></label>
39
-	<select name="<?php echo esc_attr( $frm_style->get_field_name('field_weight') ) ?>" id="frm_field_weight">
39
+	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'field_weight' ) ) ?>" id="frm_field_weight">
40 40
 		<?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?>
41 41
 			<option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['field_weight'], $value ) ?>><?php echo $name ?></option>
42 42
 		<?php } ?>
Please login to merge, or discard this patch.
classes/views/styles/_general.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,59 +1,59 @@
 block discarded – undo
1 1
 <p>
2
-    <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('center_form') ) ?>" id="frm_center_form" value="1" <?php checked($style->post_content['center_form'], 1) ?> />
2
+    <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'center_form' ) ) ?>" id="frm_center_form" value="1" <?php checked( $style->post_content['center_form'], 1 ) ?> />
3 3
 	    <?php _e( 'Center form on page', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'This will center your form on the page where it is published if the form width is less than the available width on the page.', 'formidable' ) ?>" ></span>
4 4
 	</label>
5 5
 </p>
6 6
 
7 7
 <div class="field-group clearfix frm-first-row">
8 8
 	<label><?php _e( 'Alignment', 'formidable' ) ?></label>
9
-	<select name="<?php echo esc_attr( $frm_style->get_field_name('form_align') ) ?>" id="frm_form_align">
10
-		<option value="left" <?php selected($style->post_content['form_align'], 'left') ?>><?php _e( 'left', 'formidable' ) ?></option>
11
-		<option value="right" <?php selected($style->post_content['form_align'], 'right') ?>><?php _e( 'right', 'formidable' ) ?></option>
12
-		<option value="center" <?php selected($style->post_content['form_align'], 'center') ?>><?php _e( 'center', 'formidable' ) ?></option>
9
+	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'form_align' ) ) ?>" id="frm_form_align">
10
+		<option value="left" <?php selected( $style->post_content['form_align'], 'left' ) ?>><?php _e( 'left', 'formidable' ) ?></option>
11
+		<option value="right" <?php selected( $style->post_content['form_align'], 'right' ) ?>><?php _e( 'right', 'formidable' ) ?></option>
12
+		<option value="center" <?php selected( $style->post_content['form_align'], 'center' ) ?>><?php _e( 'center', 'formidable' ) ?></option>
13 13
 	</select>
14 14
 </div>
15 15
 
16 16
 <div class="field-group clearfix frm-first-row">
17 17
 	<label><?php _e( 'Max Width', 'formidable' ) ?></label>
18
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_width') ) ?>" value="<?php echo esc_attr( $style->post_content['form_width'] ) ?>"/>
18
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'form_width' ) ) ?>" value="<?php echo esc_attr( $style->post_content['form_width'] ) ?>"/>
19 19
 </div>
20 20
 
21 21
 <div class="field-group clearfix frm-first-row">
22 22
 	<label><?php _e( 'Background', 'formidable' ) ?></label>
23
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset_bg_color') ) ?>" id="frm_fieldset_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_bg_color'] ) ?>" size="4" />
23
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset_bg_color' ) ) ?>" id="frm_fieldset_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_bg_color'] ) ?>" size="4" />
24 24
 </div>
25 25
 
26 26
 <div class="field-group field-group-border clearfix">
27 27
 	<label><?php _e( 'Border', 'formidable' ) ?></label>
28
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset') ) ?>" id="frm_fieldset" value="<?php echo esc_attr( $style->post_content['fieldset'] ) ?>" size="4" />
28
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset' ) ) ?>" id="frm_fieldset" value="<?php echo esc_attr( $style->post_content['fieldset'] ) ?>" size="4" />
29 29
 </div>
30 30
 
31 31
 <div class="field-group clearfix">
32 32
 	<label><?php _e( 'Color', 'formidable' ) ?></label>
33
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset_color') ) ?>" id="frm_fieldset_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_color'] ) ?>" />
33
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset_color' ) ) ?>" id="frm_fieldset_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_color'] ) ?>" />
34 34
 </div>
35 35
 
36 36
 <div class="field-group clearfix">
37 37
 	<label><?php _e( 'Padding', 'formidable' ) ?></label>
38
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset_padding') ) ?>" id="frm_fieldset_padding" value="<?php echo esc_attr( $style->post_content['fieldset_padding'] ) ?>" size="4" />
38
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset_padding' ) ) ?>" id="frm_fieldset_padding" value="<?php echo esc_attr( $style->post_content['fieldset_padding'] ) ?>" size="4" />
39 39
 </div>
40 40
 
41 41
 <div id="frm_gen_font_box" class="field-group clearfix">
42 42
 	<label><?php _e( 'Font Family', 'formidable' ) ?></label>
43
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('font') ) ?>" id="frm_font" value="<?php echo esc_attr( $style->post_content['font'] ) ?>"  class="frm_full_width" />
43
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'font' ) ) ?>" id="frm_font" value="<?php echo esc_attr( $style->post_content['font'] ) ?>"  class="frm_full_width" />
44 44
 </div>
45 45
 
46 46
 <div class="field-group clearfix frm-half">
47 47
 	<label><?php _e( 'Direction', 'formidable' ) ?></label>
48
-	<select name="<?php echo esc_attr( $frm_style->get_field_name('direction') ) ?>" id="frm_direction">
49
-		<option value="ltr" <?php selected($style->post_content['direction'], 'ltr') ?>><?php _e( 'Left to Right', 'formidable' ) ?></option>
50
-		<option value="rtl" <?php selected($style->post_content['direction'], 'rtl') ?>><?php _e( 'Right to Left', 'formidable' ) ?></option>
48
+	<select name="<?php echo esc_attr( $frm_style->get_field_name( 'direction' ) ) ?>" id="frm_direction">
49
+		<option value="ltr" <?php selected( $style->post_content['direction'], 'ltr' ) ?>><?php _e( 'Left to Right', 'formidable' ) ?></option>
50
+		<option value="rtl" <?php selected( $style->post_content['direction'], 'rtl' ) ?>><?php _e( 'Right to Left', 'formidable' ) ?></option>
51 51
 	</select>
52 52
 </div>
53 53
 
54 54
 <div class="clear"></div>
55 55
 <p class="frm_no_bottom_margin">
56
-    <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('important_style') ) ?>" id="frm_important_style" value="1" <?php checked($style->post_content['important_style'], 1) ?> />
56
+    <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'important_style' ) ) ?>" id="frm_important_style" value="1" <?php checked( $style->post_content['important_style'], 1 ) ?> />
57 57
 	    <?php _e( 'Override theme styling', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'This will add !important to many of the lines in the Formidable styling to make sure it will be used.', 'formidable' ) ?>" ></span>
58 58
 	</label>
59 59
 </p>
Please login to merge, or discard this patch.
classes/controllers/FrmStylesController.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -121,6 +121,9 @@
 block discarded – undo
121 121
 		$stylesheet_urls['formidable'] = $url;
122 122
 	}
123 123
 
124
+	/**
125
+	 * @param string $version
126
+	 */
124 127
 	private static function get_css_version( $css_key, $version ) {
125 128
 		if ( 'formidable' == $css_key ) {
126 129
 			$this_version = get_option( 'frm_last_style_update' );
Please login to merge, or discard this patch.
Indentation   +317 added lines, -317 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@  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';
6
-
7
-    public static function load_pro_hooks() {
8
-        if ( FrmAppHelper::pro_is_installed() ) {
9
-            FrmProStylesController::load_pro_hooks();
10
-        }
11
-    }
12
-
13
-    public static function register_post_types() {
14
-        register_post_type( self::$post_type, array(
15
-            'label' => __( 'Styles', 'formidable' ),
16
-            'public' => false,
17
-            'show_ui' => false,
18
-            'capability_type' => 'page',
4
+	public static $post_type = 'frm_styles';
5
+	public static $screen = 'formidable_page_formidable-styles';
6
+
7
+	public static function load_pro_hooks() {
8
+		if ( FrmAppHelper::pro_is_installed() ) {
9
+			FrmProStylesController::load_pro_hooks();
10
+		}
11
+	}
12
+
13
+	public static function register_post_types() {
14
+		register_post_type( self::$post_type, array(
15
+			'label' => __( 'Styles', 'formidable' ),
16
+			'public' => false,
17
+			'show_ui' => false,
18
+			'capability_type' => 'page',
19 19
 			'capabilities' => array(
20 20
 				'edit_post'		=> 'frm_change_settings',
21 21
 				'edit_posts'	=> 'frm_change_settings',
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
 				'delete_posts'	=> 'frm_change_settings',
26 26
 				'read_private_posts' => 'read_private_posts',
27 27
 			),
28
-            'supports' => array(
28
+			'supports' => array(
29 29
 				'title',
30
-            ),
31
-            'has_archive' => false,
32
-            'labels' => array(
30
+			),
31
+			'has_archive' => false,
32
+			'labels' => array(
33 33
 				'name' => __( 'Styles', 'formidable' ),
34 34
 				'singular_name' => __( 'Style', 'formidable' ),
35 35
 				'menu_name' => __( 'Style', 'formidable' ),
@@ -37,31 +37,31 @@  discard block
 block discarded – undo
37 37
 				'add_new_item' => __( 'Create a New Style', 'formidable' ),
38 38
 				'edit_item'    => __( 'Edit Style', 'formidable' ),
39 39
 			),
40
-        ) );
41
-    }
40
+		) );
41
+	}
42 42
 
43
-    public static function menu() {
44
-        add_submenu_page('formidable', 'Formidable | '. __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route');
45
-    }
43
+	public static function menu() {
44
+		add_submenu_page('formidable', 'Formidable | '. __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route');
45
+	}
46 46
 
47
-    public static function admin_init() {
48
-        if ( ! FrmAppHelper::is_admin_page('formidable-styles') ) {
49
-            return;
50
-        }
47
+	public static function admin_init() {
48
+		if ( ! FrmAppHelper::is_admin_page('formidable-styles') ) {
49
+			return;
50
+		}
51 51
 
52
-        self::load_pro_hooks();
53
-        wp_enqueue_script('jquery-ui-datepicker');
52
+		self::load_pro_hooks();
53
+		wp_enqueue_script('jquery-ui-datepicker');
54 54
 
55
-        $version = FrmAppHelper::plugin_version();
55
+		$version = FrmAppHelper::plugin_version();
56 56
 		wp_enqueue_script( 'jquery-frm-themepicker', FrmAppHelper::plugin_url() . '/js/jquery/jquery-ui-themepicker.js', array( 'jquery' ), $version );
57 57
 
58 58
 		wp_enqueue_style( 'frm-custom-theme', admin_url('admin-ajax.php?action=frmpro_css' ) );
59 59
 
60
-        $style = apply_filters('frm_style_head', false);
61
-        if ( $style ) {
60
+		$style = apply_filters('frm_style_head', false);
61
+		if ( $style ) {
62 62
 			wp_enqueue_style( 'frm-single-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_load_css&flat=1' ) .'&'. http_build_query( $style->post_content ) );
63
-        }
64
-    }
63
+		}
64
+	}
65 65
 
66 66
 	public static function enqueue_css( $register = 'enqueue' ) {
67 67
 		global $frm_vars;
@@ -141,230 +141,230 @@  discard block
 block discarded – undo
141 141
 	}
142 142
 
143 143
 	public static function new_style( $return = '' ) {
144
-        self::load_styler('default');
145
-    }
144
+		self::load_styler('default');
145
+	}
146 146
 
147 147
 	public static function duplicate() {
148 148
 		self::load_styler('default');
149 149
 	}
150 150
 
151 151
 	public static function edit( $style_id = false, $message = '' ) {
152
-        if ( ! $style_id ) {
152
+		if ( ! $style_id ) {
153 153
 			$style_id = FrmAppHelper::get_param( 'id', '', 'get', 'absint' );
154
-            if ( empty($style_id) ) {
155
-                $style_id = 'default';
156
-            }
157
-        }
158
-
159
-        if ( 'default' == $style_id ) {
160
-            $style = 'default';
161
-        } else {
162
-            $frm_style = new FrmStyle($style_id);
163
-            $style = $frm_style->get_one();
164
-            $style = $style->ID;
165
-        }
166
-
167
-        self::load_styler($style, $message);
168
-    }
169
-
170
-    public static function save() {
171
-        $frm_style = new FrmStyle();
172
-        $message = '';
154
+			if ( empty($style_id) ) {
155
+				$style_id = 'default';
156
+			}
157
+		}
158
+
159
+		if ( 'default' == $style_id ) {
160
+			$style = 'default';
161
+		} else {
162
+			$frm_style = new FrmStyle($style_id);
163
+			$style = $frm_style->get_one();
164
+			$style = $style->ID;
165
+		}
166
+
167
+		self::load_styler($style, $message);
168
+	}
169
+
170
+	public static function save() {
171
+		$frm_style = new FrmStyle();
172
+		$message = '';
173 173
 		$post_id = FrmAppHelper::get_post_param( 'ID', false, 'sanitize_title' );
174 174
 		$style_nonce = FrmAppHelper::get_post_param( 'frm_style', '', 'sanitize_text_field' );
175 175
 
176 176
 		if ( $post_id !== false && wp_verify_nonce( $style_nonce, 'frm_style_nonce' ) ) {
177
-            $id = $frm_style->update($post_id);
178
-            if ( empty($post_id) && ! empty($id) ) {
179
-                // set the post id to the new style so it will be loaded for editing
180
-                $post_id = reset($id);
181
-            }
182
-            // include the CSS that includes this style
177
+			$id = $frm_style->update($post_id);
178
+			if ( empty($post_id) && ! empty($id) ) {
179
+				// set the post id to the new style so it will be loaded for editing
180
+				$post_id = reset($id);
181
+			}
182
+			// include the CSS that includes this style
183 183
 			echo '<link href="' . esc_url( admin_url( 'admin-ajax.php?action=frmpro_css' ) ) . '" type="text/css" rel="Stylesheet" class="frm-custom-theme" />';
184
-            $message = __( 'Your styling settings have been saved.', 'formidable' );
185
-        }
184
+			$message = __( 'Your styling settings have been saved.', 'formidable' );
185
+		}
186 186
 
187
-        return self::edit($post_id, $message);
188
-    }
187
+		return self::edit($post_id, $message);
188
+	}
189 189
 
190 190
 	public static function load_styler( $style, $message = '' ) {
191
-        global $frm_settings;
191
+		global $frm_settings;
192 192
 
193
-        $frm_style = new FrmStyle();
194
-        $styles = $frm_style->get_all();
193
+		$frm_style = new FrmStyle();
194
+		$styles = $frm_style->get_all();
195 195
 
196
-        if ( is_numeric($style) ) {
197
-            $style = $styles[ $style ];
198
-        } else if ( 'default' == $style ) {
199
-            $style = $frm_style->get_default_style($styles);
200
-        }
196
+		if ( is_numeric($style) ) {
197
+			$style = $styles[ $style ];
198
+		} else if ( 'default' == $style ) {
199
+			$style = $frm_style->get_default_style($styles);
200
+		}
201 201
 
202
-        self::add_meta_boxes();
202
+		self::add_meta_boxes();
203 203
 
204
-        include(FrmAppHelper::plugin_path() .'/classes/views/styles/show.php');
205
-    }
204
+		include(FrmAppHelper::plugin_path() .'/classes/views/styles/show.php');
205
+	}
206 206
 
207 207
 	/**
208 208
 	 * @param string $message
209 209
 	 * @param array|object $forms
210 210
 	 */
211 211
 	private static function manage( $message = '', $forms = array() ) {
212
-        $frm_style = new FrmStyle();
213
-        $styles = $frm_style->get_all();
214
-        $default_style = $frm_style->get_default_style($styles);
212
+		$frm_style = new FrmStyle();
213
+		$styles = $frm_style->get_all();
214
+		$default_style = $frm_style->get_default_style($styles);
215 215
 
216
-        if ( empty($forms) ) {
217
-            $forms = FrmForm::get_published_forms();
218
-        }
216
+		if ( empty($forms) ) {
217
+			$forms = FrmForm::get_published_forms();
218
+		}
219 219
 
220
-        include(FrmAppHelper::plugin_path() .'/classes/views/styles/manage.php');
221
-    }
220
+		include(FrmAppHelper::plugin_path() .'/classes/views/styles/manage.php');
221
+	}
222 222
 
223
-    private static function manage_styles() {
223
+	private static function manage_styles() {
224 224
 		$style_nonce = FrmAppHelper::get_post_param( 'frm_manage_style', '', 'sanitize_text_field' );
225 225
 		if ( ! $_POST || ! isset( $_POST['style'] ) || ! wp_verify_nonce( $style_nonce, 'frm_manage_style_nonce' ) ) {
226
-            return self::manage();
227
-        }
226
+			return self::manage();
227
+		}
228 228
 
229
-        global $wpdb;
229
+		global $wpdb;
230 230
 
231 231
 		$forms = FrmForm::get_published_forms();
232
-        foreach ( $forms as $form ) {
233
-            if ( $_POST['style'][ $form->id ] == $_POST['prev_style'][ $form->id ] ) {
234
-                continue;
235
-            }
232
+		foreach ( $forms as $form ) {
233
+			if ( $_POST['style'][ $form->id ] == $_POST['prev_style'][ $form->id ] ) {
234
+				continue;
235
+			}
236 236
 
237
-            $form->options['custom_style'] = $_POST['style'][ $form->id ];
237
+			$form->options['custom_style'] = $_POST['style'][ $form->id ];
238 238
 
239 239
 			$wpdb->update( $wpdb->prefix . 'frm_forms', array( 'options' => maybe_serialize( $form->options ) ), array( 'id' => $form->id ) );
240
-            unset($form);
241
-        }
240
+			unset($form);
241
+		}
242 242
 
243
-        $message = __( 'Your form styles have been saved.', 'formidable' );
244
-        return self::manage($message, $forms);
245
-    }
243
+		$message = __( 'Your form styles have been saved.', 'formidable' );
244
+		return self::manage($message, $forms);
245
+	}
246 246
 
247
-    public static function custom_css( $message = '', $style = null ) {
248
-        wp_enqueue_style('codemirror', FrmAppHelper::plugin_url() . '/css/codemirror.css');
249
-        wp_enqueue_script('codemirror', FrmAppHelper::plugin_url() . '/js/codemirror/codemirror.js', array(), '4.7');
250
-        wp_enqueue_script( 'codemirror-css', FrmAppHelper::plugin_url() . '/js/codemirror/css.js', array( 'codemirror' ), '4.7' );
247
+	public static function custom_css( $message = '', $style = null ) {
248
+		wp_enqueue_style('codemirror', FrmAppHelper::plugin_url() . '/css/codemirror.css');
249
+		wp_enqueue_script('codemirror', FrmAppHelper::plugin_url() . '/js/codemirror/codemirror.js', array(), '4.7');
250
+		wp_enqueue_script( 'codemirror-css', FrmAppHelper::plugin_url() . '/js/codemirror/css.js', array( 'codemirror' ), '4.7' );
251 251
 
252
-        if ( ! isset($style) ) {
253
-            $frm_style = new FrmStyle();
254
-            $style = $frm_style->get_default_style();
255
-        }
252
+		if ( ! isset($style) ) {
253
+			$frm_style = new FrmStyle();
254
+			$style = $frm_style->get_default_style();
255
+		}
256 256
 
257
-        include(FrmAppHelper::plugin_path() .'/classes/views/styles/custom_css.php');
258
-    }
257
+		include(FrmAppHelper::plugin_path() .'/classes/views/styles/custom_css.php');
258
+	}
259 259
 
260
-    public static function save_css() {
261
-        $frm_style = new FrmStyle();
260
+	public static function save_css() {
261
+		$frm_style = new FrmStyle();
262 262
 
263
-        $message = '';
263
+		$message = '';
264 264
 		$post_id = FrmAppHelper::get_post_param( 'ID', false, 'sanitize_text_field' );
265 265
 		$nonce = FrmAppHelper::get_post_param( 'frm_custom_css', '', 'sanitize_text_field' );
266 266
 		if ( wp_verify_nonce( $nonce, 'frm_custom_css_nonce' ) ) {
267
-            $frm_style->update($post_id);
268
-            $message = __( 'Your styling settings have been saved.', 'formidable' );
269
-        }
267
+			$frm_style->update($post_id);
268
+			$message = __( 'Your styling settings have been saved.', 'formidable' );
269
+		}
270 270
 
271
-        return self::custom_css($message);
272
-    }
271
+		return self::custom_css($message);
272
+	}
273 273
 
274
-    public static function route() {
274
+	public static function route() {
275 275
 		$action = FrmAppHelper::get_param( 'frm_action', '', 'get', 'sanitize_title' );
276 276
 
277
-        switch ( $action ) {
278
-            case 'edit':
279
-            case 'save':
280
-            case 'manage':
281
-            case 'manage_styles':
282
-            case 'custom_css':
283
-            case 'save_css':
277
+		switch ( $action ) {
278
+			case 'edit':
279
+			case 'save':
280
+			case 'manage':
281
+			case 'manage_styles':
282
+			case 'custom_css':
283
+			case 'save_css':
284 284
 				return self::$action();
285
-            default:
286
-            	do_action( 'frm_style_action_route', $action );
287
-            	if ( apply_filters( 'frm_style_stop_action_route', false, $action ) ) {
288
-                	return;
289
-            	}
285
+			default:
286
+				do_action( 'frm_style_action_route', $action );
287
+				if ( apply_filters( 'frm_style_stop_action_route', false, $action ) ) {
288
+					return;
289
+				}
290 290
 
291
-                if ( 'new_style' == $action || 'duplicate' == $action ) {
292
-                    return self::$action();
293
-                }
291
+				if ( 'new_style' == $action || 'duplicate' == $action ) {
292
+					return self::$action();
293
+				}
294 294
 
295
-                return self::edit();
296
-        }
297
-    }
295
+				return self::edit();
296
+		}
297
+	}
298 298
 
299
-    public static function reset_styling() {
299
+	public static function reset_styling() {
300 300
 		FrmAppHelper::permission_check('frm_change_settings');
301
-        check_ajax_referer( 'frm_ajax', 'nonce' );
302
-
303
-        $frm_style = new FrmStyle();
304
-        $defaults = $frm_style->get_defaults();
305
-
306
-        echo json_encode( $defaults );
307
-        wp_die();
308
-    }
309
-
310
-    public static function change_styling() {
311
-        check_ajax_referer( 'frm_ajax', 'nonce' );
312
-
313
-        $frm_style = new FrmStyle();
314
-        $defaults = $frm_style->get_defaults();
315
-
316
-        // remove the # from the colors
317
-        foreach ( $_GET['frm_style_setting']['post_content'] as $k => $v ) {
318
-            if ( ! is_array($v) && strpos($v, '#') === 0 ) {
319
-                $_GET['frm_style_setting']['post_content'][ $k ] = str_replace( '#', '', $v );
320
-            }
321
-        }
322
-
323
-        echo '<style type="text/css">';
324
-        include(FrmAppHelper::plugin_path() .'/css/_single_theme.css.php');
325
-        echo '</style>';
326
-        wp_die();
327
-    }
328
-
329
-    private static function add_meta_boxes() {
330
-
331
-        // setup meta boxes
332
-        $meta_boxes = array(
333
-            'general'           => __( 'General', 'formidable' ),
334
-            'form-title'        => __( 'Form Title', 'formidable' ),
335
-            'form-description'  => __( 'Form Description', 'formidable' ),
336
-            'field-labels'      => __( 'Field Labels', 'formidable' ),
337
-            'field-description' => __( 'Field Description', 'formidable' ),
338
-            'field-colors'      => __( 'Field Colors', 'formidable' ),
339
-            'field-sizes'       => __( 'Field Settings', 'formidable' ),
340
-            'check-box-radio-fields' => __( 'Check Box & Radio Fields', 'formidable' ),
341
-            'section-fields'    => __( 'Section Fields', 'formidable' ),
342
-            'date-fields'       => __( 'Date Fields', 'formidable' ),
343
-            'buttons'           => __( 'Buttons', 'formidable' ),
344
-            'form-messages'     => __( 'Form Messages', 'formidable' ),
345
-        );
346
-
347
-        foreach ( $meta_boxes as $nicename => $name ) {
348
-            add_meta_box( $nicename .'-style', $name, 'FrmStylesController::include_style_section', self::$screen, 'side', 'default', $nicename );
349
-            unset($nicename, $name);
350
-        }
351
-    }
301
+		check_ajax_referer( 'frm_ajax', 'nonce' );
302
+
303
+		$frm_style = new FrmStyle();
304
+		$defaults = $frm_style->get_defaults();
305
+
306
+		echo json_encode( $defaults );
307
+		wp_die();
308
+	}
309
+
310
+	public static function change_styling() {
311
+		check_ajax_referer( 'frm_ajax', 'nonce' );
312
+
313
+		$frm_style = new FrmStyle();
314
+		$defaults = $frm_style->get_defaults();
315
+
316
+		// remove the # from the colors
317
+		foreach ( $_GET['frm_style_setting']['post_content'] as $k => $v ) {
318
+			if ( ! is_array($v) && strpos($v, '#') === 0 ) {
319
+				$_GET['frm_style_setting']['post_content'][ $k ] = str_replace( '#', '', $v );
320
+			}
321
+		}
322
+
323
+		echo '<style type="text/css">';
324
+		include(FrmAppHelper::plugin_path() .'/css/_single_theme.css.php');
325
+		echo '</style>';
326
+		wp_die();
327
+	}
328
+
329
+	private static function add_meta_boxes() {
330
+
331
+		// setup meta boxes
332
+		$meta_boxes = array(
333
+			'general'           => __( 'General', 'formidable' ),
334
+			'form-title'        => __( 'Form Title', 'formidable' ),
335
+			'form-description'  => __( 'Form Description', 'formidable' ),
336
+			'field-labels'      => __( 'Field Labels', 'formidable' ),
337
+			'field-description' => __( 'Field Description', 'formidable' ),
338
+			'field-colors'      => __( 'Field Colors', 'formidable' ),
339
+			'field-sizes'       => __( 'Field Settings', 'formidable' ),
340
+			'check-box-radio-fields' => __( 'Check Box & Radio Fields', 'formidable' ),
341
+			'section-fields'    => __( 'Section Fields', 'formidable' ),
342
+			'date-fields'       => __( 'Date Fields', 'formidable' ),
343
+			'buttons'           => __( 'Buttons', 'formidable' ),
344
+			'form-messages'     => __( 'Form Messages', 'formidable' ),
345
+		);
346
+
347
+		foreach ( $meta_boxes as $nicename => $name ) {
348
+			add_meta_box( $nicename .'-style', $name, 'FrmStylesController::include_style_section', self::$screen, 'side', 'default', $nicename );
349
+			unset($nicename, $name);
350
+		}
351
+	}
352 352
 
353 353
 	public static function include_style_section( $atts, $sec ) {
354
-        extract($atts);
354
+		extract($atts);
355 355
 		$current_tab = FrmAppHelper::simple_get( 'page-tab', 'sanitize_title', 'default' );
356
-        include(FrmAppHelper::plugin_path() .'/classes/views/styles/_'. $sec['args'] .'.php');
357
-    }
356
+		include(FrmAppHelper::plugin_path() .'/classes/views/styles/_'. $sec['args'] .'.php');
357
+	}
358 358
 
359
-    public static function load_css() {
360
-        header('Content-type: text/css');
359
+	public static function load_css() {
360
+		header('Content-type: text/css');
361 361
 
362
-        $frm_style = new FrmStyle();
363
-        $defaults = $frm_style->get_defaults();
362
+		$frm_style = new FrmStyle();
363
+		$defaults = $frm_style->get_defaults();
364 364
 
365
-        include(FrmAppHelper::plugin_path() .'/css/_single_theme.css.php');
366
-        wp_die();
367
-    }
365
+		include(FrmAppHelper::plugin_path() .'/css/_single_theme.css.php');
366
+		wp_die();
367
+	}
368 368
 
369 369
 	public static function load_saved_css() {
370 370
 		$css = get_transient( 'frmpro_css' );
@@ -373,142 +373,142 @@  discard block
 block discarded – undo
373 373
 		wp_die();
374 374
 	}
375 375
 
376
-    /**
377
-     * Check if the Formidable styling should be loaded,
378
-     * then enqueue it for the footer
379
-     * @since 2.0
380
-     */
381
-    public static function enqueue_style() {
382
-        global $frm_vars;
383
-
384
-        if ( isset( $frm_vars['css_loaded'] ) && $frm_vars['css_loaded'] ) {
385
-            // the CSS has already been loaded
386
-            return;
387
-        }
388
-
389
-        $frm_settings = FrmAppHelper::get_settings();
390
-        if ( $frm_settings->load_style != 'none' ) {
391
-            wp_enqueue_style( 'formidable' );
392
-            $frm_vars['css_loaded'] = true;
393
-        }
394
-    }
395
-
396
-    // Get the stylesheets for the form settings page
397
-    public static function get_style_opts() {
398
-        $frm_style = new FrmStyle();
399
-        $styles = $frm_style->get_all();
400
-
401
-        return $styles;
402
-    }
403
-
404
-    public static function get_form_style( $form = 'default' ) {
405
-        $style = FrmFormsHelper::get_form_style( $form );
406
-
407
-        if ( empty( $style ) || 1 == $style ) {
408
-            $style = 'default';
409
-        }
410
-
411
-        $frm_style = new FrmStyle( $style );
412
-        return $frm_style->get_one();
413
-    }
414
-
415
-    /**
416
-     * @param string $class
417
-     * @param string $style
418
-     */
376
+	/**
377
+	 * Check if the Formidable styling should be loaded,
378
+	 * then enqueue it for the footer
379
+	 * @since 2.0
380
+	 */
381
+	public static function enqueue_style() {
382
+		global $frm_vars;
383
+
384
+		if ( isset( $frm_vars['css_loaded'] ) && $frm_vars['css_loaded'] ) {
385
+			// the CSS has already been loaded
386
+			return;
387
+		}
388
+
389
+		$frm_settings = FrmAppHelper::get_settings();
390
+		if ( $frm_settings->load_style != 'none' ) {
391
+			wp_enqueue_style( 'formidable' );
392
+			$frm_vars['css_loaded'] = true;
393
+		}
394
+	}
395
+
396
+	// Get the stylesheets for the form settings page
397
+	public static function get_style_opts() {
398
+		$frm_style = new FrmStyle();
399
+		$styles = $frm_style->get_all();
400
+
401
+		return $styles;
402
+	}
403
+
404
+	public static function get_form_style( $form = 'default' ) {
405
+		$style = FrmFormsHelper::get_form_style( $form );
406
+
407
+		if ( empty( $style ) || 1 == $style ) {
408
+			$style = 'default';
409
+		}
410
+
411
+		$frm_style = new FrmStyle( $style );
412
+		return $frm_style->get_one();
413
+	}
414
+
415
+	/**
416
+	 * @param string $class
417
+	 * @param string $style
418
+	 */
419 419
 	public static function get_form_style_class( $class, $style ) {
420
-        if ( 1 == $style ) {
421
-            $style = 'default';
422
-        }
420
+		if ( 1 == $style ) {
421
+			$style = 'default';
422
+		}
423 423
 
424
-        $frm_style = new FrmStyle($style);
425
-        $style = $frm_style->get_one();
424
+		$frm_style = new FrmStyle($style);
425
+		$style = $frm_style->get_one();
426 426
 
427
-        if ( $style ) {
428
-            $class .= ' frm_style_'. $style->post_name;
429
-        }
427
+		if ( $style ) {
428
+			$class .= ' frm_style_'. $style->post_name;
429
+		}
430 430
 
431
-        return $class;
432
-    }
431
+		return $class;
432
+	}
433 433
 
434
-    /**
435
-     * @param string $val
436
-     */
434
+	/**
435
+	 * @param string $val
436
+	 */
437 437
 	public static function get_style_val( $val, $form = 'default' ) {
438
-        $style = self::get_form_style($form);
439
-        if ( $style && isset( $style->post_content[ $val ] ) ) {
440
-            return $style->post_content[ $val ];
441
-        }
442
-    }
438
+		$style = self::get_form_style($form);
439
+		if ( $style && isset( $style->post_content[ $val ] ) ) {
440
+			return $style->post_content[ $val ];
441
+		}
442
+	}
443 443
 
444 444
 	public static function show_entry_styles( $default_styles ) {
445
-        $frm_style = new FrmStyle('default');
446
-        $style = $frm_style->get_one();
447
-
448
-        if ( ! $style ) {
449
-            return $default_styles;
450
-        }
451
-
452
-        foreach ( $default_styles as $name => $val ) {
453
-            $setting = $name;
454
-            if ( 'border_width' == $name ) {
455
-                $setting = 'field_border_width';
456
-            } else if ( 'alt_bg_color' == $name ) {
457
-                $setting = 'bg_color_active';
458
-            }
459
-            $default_styles[ $name ] = $style->post_content[ $setting ];
460
-            unset($name, $val);
461
-        }
462
-
463
-        return $default_styles;
464
-    }
445
+		$frm_style = new FrmStyle('default');
446
+		$style = $frm_style->get_one();
447
+
448
+		if ( ! $style ) {
449
+			return $default_styles;
450
+		}
451
+
452
+		foreach ( $default_styles as $name => $val ) {
453
+			$setting = $name;
454
+			if ( 'border_width' == $name ) {
455
+				$setting = 'field_border_width';
456
+			} else if ( 'alt_bg_color' == $name ) {
457
+				$setting = 'bg_color_active';
458
+			}
459
+			$default_styles[ $name ] = $style->post_content[ $setting ];
460
+			unset($name, $val);
461
+		}
462
+
463
+		return $default_styles;
464
+	}
465 465
 
466 466
 	public static function &important_style( $important, $field ) {
467
-        $important = self::get_style_val('important_style', $field['form_id']);
468
-        return $important;
469
-    }
467
+		$important = self::get_style_val('important_style', $field['form_id']);
468
+		return $important;
469
+	}
470 470
 
471
-    /**
472
-     * Fallback for WP < 3.6
473
-     */
474
-    public static function do_accordion_sections( $screen, $context, $object ) {
475
-        if ( function_exists( 'do_accordion_sections' ) ) {
476
-            return do_accordion_sections( $screen, $context, $object );
477
-        }
471
+	/**
472
+	 * Fallback for WP < 3.6
473
+	 */
474
+	public static function do_accordion_sections( $screen, $context, $object ) {
475
+		if ( function_exists( 'do_accordion_sections' ) ) {
476
+			return do_accordion_sections( $screen, $context, $object );
477
+		}
478 478
 
479
-    	global $wp_meta_boxes;
479
+		global $wp_meta_boxes;
480 480
 
481
-        $screen = 'formidable_page_formidable-styles';
482
-        $screen = convert_to_screen( $screen );
481
+		$screen = 'formidable_page_formidable-styles';
482
+		$screen = convert_to_screen( $screen );
483 483
 
484
-    	$page = $screen->id;
484
+		$page = $screen->id;
485 485
 
486
-    	$hidden = get_hidden_meta_boxes( $screen );
487
-    	?>
486
+		$hidden = get_hidden_meta_boxes( $screen );
487
+		?>
488 488
     	<div id="side-sortables" class="accordion-container">
489 489
     	<?php
490
-    	$i = 0;
491
-    	$first_open = false;
492
-    	do {
490
+		$i = 0;
491
+		$first_open = false;
492
+		do {
493 493
 			if ( ! isset( $wp_meta_boxes ) || ! isset( $wp_meta_boxes[ $page ] ) || ! isset( $wp_meta_boxes[ $page ][ $context ] ) ) {
494 494
 				break;
495 495
 			}
496 496
 
497
-    		foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
498
-    			if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
499
-    				foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
500
-    					if ( false == $box || ! $box['title'] ) {
501
-    						continue;
497
+			foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
498
+				if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
499
+					foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
500
+						if ( false == $box || ! $box['title'] ) {
501
+							continue;
502 502
 						}
503 503
 
504
-    					$i++;
505
-    					$hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : '';
504
+						$i++;
505
+						$hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : '';
506 506
 
507
-    					if ( ! $first_open && empty( $hidden_class ) ) {
508
-    						$first_open = true;
509
-    					}
507
+						if ( ! $first_open && empty( $hidden_class ) ) {
508
+							$first_open = true;
509
+						}
510 510
 
511
-    					?>
511
+						?>
512 512
 						<div class="postbox <?php echo esc_attr( $box['id'] ); ?>">
513 513
 						<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'formidable' ) ?>"><br/></div>
514 514
                         <h3 class='hndle'><span><?php echo esc_html( $box['title'] ); ?></span></h3>
@@ -519,13 +519,13 @@  discard block
 block discarded – undo
519 519
     						</div><!-- .accordion-section-content -->
520 520
     					</div><!-- .postbox -->
521 521
     					<?php
522
-    				}
523
-    			}
524
-    		}
525
-    	} while ( 0 );
526
-    	?>
522
+					}
523
+				}
524
+			}
525
+		} while ( 0 );
526
+		?>
527 527
     	</div><!-- .accordion-container -->
528 528
     	<?php
529
-    	return $i;
530
-    }
529
+		return $i;
530
+	}
531 531
 }
Please login to merge, or discard this patch.
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -41,25 +41,25 @@  discard block
 block discarded – undo
41 41
     }
42 42
 
43 43
     public static function menu() {
44
-        add_submenu_page('formidable', 'Formidable | '. __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route');
44
+        add_submenu_page( 'formidable', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route' );
45 45
     }
46 46
 
47 47
     public static function admin_init() {
48
-        if ( ! FrmAppHelper::is_admin_page('formidable-styles') ) {
48
+        if ( ! FrmAppHelper::is_admin_page( 'formidable-styles' ) ) {
49 49
             return;
50 50
         }
51 51
 
52 52
         self::load_pro_hooks();
53
-        wp_enqueue_script('jquery-ui-datepicker');
53
+        wp_enqueue_script( 'jquery-ui-datepicker' );
54 54
 
55 55
         $version = FrmAppHelper::plugin_version();
56 56
 		wp_enqueue_script( 'jquery-frm-themepicker', FrmAppHelper::plugin_url() . '/js/jquery/jquery-ui-themepicker.js', array( 'jquery' ), $version );
57 57
 
58
-		wp_enqueue_style( 'frm-custom-theme', admin_url('admin-ajax.php?action=frmpro_css' ) );
58
+		wp_enqueue_style( 'frm-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_css' ) );
59 59
 
60
-        $style = apply_filters('frm_style_head', false);
60
+        $style = apply_filters( 'frm_style_head', false );
61 61
         if ( $style ) {
62
-			wp_enqueue_style( 'frm-single-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_load_css&flat=1' ) .'&'. http_build_query( $style->post_content ) );
62
+			wp_enqueue_style( 'frm-single-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_load_css&flat=1' ) . '&' . http_build_query( $style->post_content ) );
63 63
         }
64 64
     }
65 65
 
@@ -141,17 +141,17 @@  discard block
 block discarded – undo
141 141
 	}
142 142
 
143 143
 	public static function new_style( $return = '' ) {
144
-        self::load_styler('default');
144
+        self::load_styler( 'default' );
145 145
     }
146 146
 
147 147
 	public static function duplicate() {
148
-		self::load_styler('default');
148
+		self::load_styler( 'default' );
149 149
 	}
150 150
 
151 151
 	public static function edit( $style_id = false, $message = '' ) {
152 152
         if ( ! $style_id ) {
153 153
 			$style_id = FrmAppHelper::get_param( 'id', '', 'get', 'absint' );
154
-            if ( empty($style_id) ) {
154
+            if ( empty( $style_id ) ) {
155 155
                 $style_id = 'default';
156 156
             }
157 157
         }
@@ -159,12 +159,12 @@  discard block
 block discarded – undo
159 159
         if ( 'default' == $style_id ) {
160 160
             $style = 'default';
161 161
         } else {
162
-            $frm_style = new FrmStyle($style_id);
162
+            $frm_style = new FrmStyle( $style_id );
163 163
             $style = $frm_style->get_one();
164 164
             $style = $style->ID;
165 165
         }
166 166
 
167
-        self::load_styler($style, $message);
167
+        self::load_styler( $style, $message );
168 168
     }
169 169
 
170 170
     public static function save() {
@@ -174,17 +174,17 @@  discard block
 block discarded – undo
174 174
 		$style_nonce = FrmAppHelper::get_post_param( 'frm_style', '', 'sanitize_text_field' );
175 175
 
176 176
 		if ( $post_id !== false && wp_verify_nonce( $style_nonce, 'frm_style_nonce' ) ) {
177
-            $id = $frm_style->update($post_id);
178
-            if ( empty($post_id) && ! empty($id) ) {
177
+            $id = $frm_style->update( $post_id );
178
+            if ( empty( $post_id ) && ! empty( $id ) ) {
179 179
                 // set the post id to the new style so it will be loaded for editing
180
-                $post_id = reset($id);
180
+                $post_id = reset( $id );
181 181
             }
182 182
             // include the CSS that includes this style
183 183
 			echo '<link href="' . esc_url( admin_url( 'admin-ajax.php?action=frmpro_css' ) ) . '" type="text/css" rel="Stylesheet" class="frm-custom-theme" />';
184 184
             $message = __( 'Your styling settings have been saved.', 'formidable' );
185 185
         }
186 186
 
187
-        return self::edit($post_id, $message);
187
+        return self::edit( $post_id, $message );
188 188
     }
189 189
 
190 190
 	public static function load_styler( $style, $message = '' ) {
@@ -193,15 +193,15 @@  discard block
 block discarded – undo
193 193
         $frm_style = new FrmStyle();
194 194
         $styles = $frm_style->get_all();
195 195
 
196
-        if ( is_numeric($style) ) {
197
-            $style = $styles[ $style ];
196
+        if ( is_numeric( $style ) ) {
197
+            $style = $styles[$style];
198 198
         } else if ( 'default' == $style ) {
199
-            $style = $frm_style->get_default_style($styles);
199
+            $style = $frm_style->get_default_style( $styles );
200 200
         }
201 201
 
202 202
         self::add_meta_boxes();
203 203
 
204
-        include(FrmAppHelper::plugin_path() .'/classes/views/styles/show.php');
204
+        include( FrmAppHelper::plugin_path() . '/classes/views/styles/show.php' );
205 205
     }
206 206
 
207 207
 	/**
@@ -211,13 +211,13 @@  discard block
 block discarded – undo
211 211
 	private static function manage( $message = '', $forms = array() ) {
212 212
         $frm_style = new FrmStyle();
213 213
         $styles = $frm_style->get_all();
214
-        $default_style = $frm_style->get_default_style($styles);
214
+        $default_style = $frm_style->get_default_style( $styles );
215 215
 
216
-        if ( empty($forms) ) {
216
+        if ( empty( $forms ) ) {
217 217
             $forms = FrmForm::get_published_forms();
218 218
         }
219 219
 
220
-        include(FrmAppHelper::plugin_path() .'/classes/views/styles/manage.php');
220
+        include( FrmAppHelper::plugin_path() . '/classes/views/styles/manage.php' );
221 221
     }
222 222
 
223 223
     private static function manage_styles() {
@@ -230,31 +230,31 @@  discard block
 block discarded – undo
230 230
 
231 231
 		$forms = FrmForm::get_published_forms();
232 232
         foreach ( $forms as $form ) {
233
-            if ( $_POST['style'][ $form->id ] == $_POST['prev_style'][ $form->id ] ) {
233
+            if ( $_POST['style'][$form->id] == $_POST['prev_style'][$form->id] ) {
234 234
                 continue;
235 235
             }
236 236
 
237
-            $form->options['custom_style'] = $_POST['style'][ $form->id ];
237
+            $form->options['custom_style'] = $_POST['style'][$form->id];
238 238
 
239 239
 			$wpdb->update( $wpdb->prefix . 'frm_forms', array( 'options' => maybe_serialize( $form->options ) ), array( 'id' => $form->id ) );
240
-            unset($form);
240
+            unset( $form );
241 241
         }
242 242
 
243 243
         $message = __( 'Your form styles have been saved.', 'formidable' );
244
-        return self::manage($message, $forms);
244
+        return self::manage( $message, $forms );
245 245
     }
246 246
 
247 247
     public static function custom_css( $message = '', $style = null ) {
248
-        wp_enqueue_style('codemirror', FrmAppHelper::plugin_url() . '/css/codemirror.css');
249
-        wp_enqueue_script('codemirror', FrmAppHelper::plugin_url() . '/js/codemirror/codemirror.js', array(), '4.7');
248
+        wp_enqueue_style( 'codemirror', FrmAppHelper::plugin_url() . '/css/codemirror.css' );
249
+        wp_enqueue_script( 'codemirror', FrmAppHelper::plugin_url() . '/js/codemirror/codemirror.js', array(), '4.7' );
250 250
         wp_enqueue_script( 'codemirror-css', FrmAppHelper::plugin_url() . '/js/codemirror/css.js', array( 'codemirror' ), '4.7' );
251 251
 
252
-        if ( ! isset($style) ) {
252
+        if ( ! isset( $style ) ) {
253 253
             $frm_style = new FrmStyle();
254 254
             $style = $frm_style->get_default_style();
255 255
         }
256 256
 
257
-        include(FrmAppHelper::plugin_path() .'/classes/views/styles/custom_css.php');
257
+        include( FrmAppHelper::plugin_path() . '/classes/views/styles/custom_css.php' );
258 258
     }
259 259
 
260 260
     public static function save_css() {
@@ -264,11 +264,11 @@  discard block
 block discarded – undo
264 264
 		$post_id = FrmAppHelper::get_post_param( 'ID', false, 'sanitize_text_field' );
265 265
 		$nonce = FrmAppHelper::get_post_param( 'frm_custom_css', '', 'sanitize_text_field' );
266 266
 		if ( wp_verify_nonce( $nonce, 'frm_custom_css_nonce' ) ) {
267
-            $frm_style->update($post_id);
267
+            $frm_style->update( $post_id );
268 268
             $message = __( 'Your styling settings have been saved.', 'formidable' );
269 269
         }
270 270
 
271
-        return self::custom_css($message);
271
+        return self::custom_css( $message );
272 272
     }
273 273
 
274 274
     public static function route() {
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
     }
298 298
 
299 299
     public static function reset_styling() {
300
-		FrmAppHelper::permission_check('frm_change_settings');
300
+		FrmAppHelper::permission_check( 'frm_change_settings' );
301 301
         check_ajax_referer( 'frm_ajax', 'nonce' );
302 302
 
303 303
         $frm_style = new FrmStyle();
@@ -315,13 +315,13 @@  discard block
 block discarded – undo
315 315
 
316 316
         // remove the # from the colors
317 317
         foreach ( $_GET['frm_style_setting']['post_content'] as $k => $v ) {
318
-            if ( ! is_array($v) && strpos($v, '#') === 0 ) {
319
-                $_GET['frm_style_setting']['post_content'][ $k ] = str_replace( '#', '', $v );
318
+            if ( ! is_array( $v ) && strpos( $v, '#' ) === 0 ) {
319
+                $_GET['frm_style_setting']['post_content'][$k] = str_replace( '#', '', $v );
320 320
             }
321 321
         }
322 322
 
323 323
         echo '<style type="text/css">';
324
-        include(FrmAppHelper::plugin_path() .'/css/_single_theme.css.php');
324
+        include( FrmAppHelper::plugin_path() . '/css/_single_theme.css.php' );
325 325
         echo '</style>';
326 326
         wp_die();
327 327
     }
@@ -345,24 +345,24 @@  discard block
 block discarded – undo
345 345
         );
346 346
 
347 347
         foreach ( $meta_boxes as $nicename => $name ) {
348
-            add_meta_box( $nicename .'-style', $name, 'FrmStylesController::include_style_section', self::$screen, 'side', 'default', $nicename );
349
-            unset($nicename, $name);
348
+            add_meta_box( $nicename . '-style', $name, 'FrmStylesController::include_style_section', self::$screen, 'side', 'default', $nicename );
349
+            unset( $nicename, $name );
350 350
         }
351 351
     }
352 352
 
353 353
 	public static function include_style_section( $atts, $sec ) {
354
-        extract($atts);
354
+        extract( $atts );
355 355
 		$current_tab = FrmAppHelper::simple_get( 'page-tab', 'sanitize_title', 'default' );
356
-        include(FrmAppHelper::plugin_path() .'/classes/views/styles/_'. $sec['args'] .'.php');
356
+        include( FrmAppHelper::plugin_path() . '/classes/views/styles/_' . $sec['args'] . '.php' );
357 357
     }
358 358
 
359 359
     public static function load_css() {
360
-        header('Content-type: text/css');
360
+        header( 'Content-type: text/css' );
361 361
 
362 362
         $frm_style = new FrmStyle();
363 363
         $defaults = $frm_style->get_defaults();
364 364
 
365
-        include(FrmAppHelper::plugin_path() .'/css/_single_theme.css.php');
365
+        include( FrmAppHelper::plugin_path() . '/css/_single_theme.css.php' );
366 366
         wp_die();
367 367
     }
368 368
 
@@ -421,11 +421,11 @@  discard block
 block discarded – undo
421 421
             $style = 'default';
422 422
         }
423 423
 
424
-        $frm_style = new FrmStyle($style);
424
+        $frm_style = new FrmStyle( $style );
425 425
         $style = $frm_style->get_one();
426 426
 
427 427
         if ( $style ) {
428
-            $class .= ' frm_style_'. $style->post_name;
428
+            $class .= ' frm_style_' . $style->post_name;
429 429
         }
430 430
 
431 431
         return $class;
@@ -435,14 +435,14 @@  discard block
 block discarded – undo
435 435
      * @param string $val
436 436
      */
437 437
 	public static function get_style_val( $val, $form = 'default' ) {
438
-        $style = self::get_form_style($form);
439
-        if ( $style && isset( $style->post_content[ $val ] ) ) {
440
-            return $style->post_content[ $val ];
438
+        $style = self::get_form_style( $form );
439
+        if ( $style && isset( $style->post_content[$val] ) ) {
440
+            return $style->post_content[$val];
441 441
         }
442 442
     }
443 443
 
444 444
 	public static function show_entry_styles( $default_styles ) {
445
-        $frm_style = new FrmStyle('default');
445
+        $frm_style = new FrmStyle( 'default' );
446 446
         $style = $frm_style->get_one();
447 447
 
448 448
         if ( ! $style ) {
@@ -456,15 +456,15 @@  discard block
 block discarded – undo
456 456
             } else if ( 'alt_bg_color' == $name ) {
457 457
                 $setting = 'bg_color_active';
458 458
             }
459
-            $default_styles[ $name ] = $style->post_content[ $setting ];
460
-            unset($name, $val);
459
+            $default_styles[$name] = $style->post_content[$setting];
460
+            unset( $name, $val );
461 461
         }
462 462
 
463 463
         return $default_styles;
464 464
     }
465 465
 
466 466
 	public static function &important_style( $important, $field ) {
467
-        $important = self::get_style_val('important_style', $field['form_id']);
467
+        $important = self::get_style_val( 'important_style', $field['form_id'] );
468 468
         return $important;
469 469
     }
470 470
 
@@ -490,18 +490,18 @@  discard block
 block discarded – undo
490 490
     	$i = 0;
491 491
     	$first_open = false;
492 492
     	do {
493
-			if ( ! isset( $wp_meta_boxes ) || ! isset( $wp_meta_boxes[ $page ] ) || ! isset( $wp_meta_boxes[ $page ][ $context ] ) ) {
493
+			if ( ! isset( $wp_meta_boxes ) || ! isset( $wp_meta_boxes[$page] ) || ! isset( $wp_meta_boxes[$page][$context] ) ) {
494 494
 				break;
495 495
 			}
496 496
 
497 497
     		foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
498
-    			if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
499
-    				foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
498
+    			if ( isset( $wp_meta_boxes[$page][$context][$priority] ) ) {
499
+    				foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) {
500 500
     					if ( false == $box || ! $box['title'] ) {
501 501
     						continue;
502 502
 						}
503 503
 
504
-    					$i++;
504
+    					$i ++;
505 505
     					$hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : '';
506 506
 
507 507
     					if ( ! $first_open && empty( $hidden_class ) ) {
Please login to merge, or discard this patch.
classes/views/addons/list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@
 block discarded – undo
7 7
 				continue;
8 8
 			}
9 9
 
10
-			if ( isset( $plugin_names[ $addon['info']['slug'] ] ) ) {
11
-				$installed = is_dir( WP_PLUGIN_DIR . '/' . $plugin_names[ $addon['info']['slug'] ] );
10
+			if ( isset( $plugin_names[$addon['info']['slug']] ) ) {
11
+				$installed = is_dir( WP_PLUGIN_DIR . '/' . $plugin_names[$addon['info']['slug']] );
12 12
 			} else {
13
-				$installed = isset( $installed_addons[ $addon['info']['slug'] ] ) || is_dir( WP_PLUGIN_DIR . '/formidable-' . $addon['info']['slug'] );
13
+				$installed = isset( $installed_addons[$addon['info']['slug']] ) || is_dir( WP_PLUGIN_DIR . '/formidable-' . $addon['info']['slug'] );
14 14
 			}
15 15
 			$has_thumbnail = ! empty( $addon['info']['thumbnail'] );
16 16
 			if ( $addon['info']['slug'] == 'formidable-pro' ) {
Please login to merge, or discard this patch.
classes/views/addons/upgrade_to_pro.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 			<tr>
7 7
 				<th></th>
8 8
 			<?php foreach ( $pro['pricing'] as $name => $price ) {
9
-				$price_id++;
9
+				$price_id ++;
10 10
 				if ( $name == 'smallbusiness' ) {
11 11
 					$name = 'Small Business';
12 12
 				} ?>
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 			<tr>
51 51
 				<th>Included AddOns</th>
52 52
 				<td>None</td>
53
-				<td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">Basic Addons</a></td>
54
-				<td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">Advanced Addons</a></td>
55
-				<td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">Enterprise Addons</a></td>
53
+				<td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/pricing/#addon-lists' ) ) ?>" target="_blank">Basic Addons</a></td>
54
+				<td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/pricing/#addon-lists' ) ) ?>" target="_blank">Advanced Addons</a></td>
55
+				<td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/pricing/#addon-lists' ) ) ?>" target="_blank">Enterprise Addons</a></td>
56 56
 			</tr>
57 57
 		</tbody>
58 58
 	</table>
Please login to merge, or discard this patch.
classes/models/FrmAddon.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@
 block discarded – undo
275 275
 		return $message;
276 276
 	}
277 277
 
278
-    public function manually_queue_update() {
279
-        set_site_transient( 'update_plugins', null );
280
-    }
278
+	public function manually_queue_update() {
279
+		set_site_transient( 'update_plugins', null );
280
+	}
281 281
 }
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -38,15 +38,15 @@  discard block
 block discarded – undo
38 38
 	}
39 39
 
40 40
 	public function insert_installed_addon( $plugins ) {
41
-		$plugins[ $this->plugin_slug ] = $this;
41
+		$plugins[$this->plugin_slug] = $this;
42 42
 		return $plugins;
43 43
 	}
44 44
 
45 45
 	public static function get_addon( $plugin_slug ) {
46 46
 		$plugins = apply_filters( 'frm_installed_addons', array() );
47 47
 		$plugin = false;
48
-		if ( isset( $plugins[ $plugin_slug ] ) ) {
49
-			$plugin = $plugins[ $plugin_slug ];
48
+		if ( isset( $plugins[$plugin_slug] ) ) {
49
+			$plugin = $plugins[$plugin_slug];
50 50
 		}
51 51
 		return $plugin;
52 52
 	}
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	public function show_license_message( $file, $plugin ) {
99 99
 		$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
100 100
 		echo '<tr class="plugin-update-tr active"><td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange"><div class="update-message">';
101
-		echo sprintf( __( 'Your %1$s license key is missing. Please add it on the %2$slicenses page%3$s.', 'formidable' ), $this->plugin_name, '<a href="' . esc_url( admin_url('admin.php?page=formidable-settings&t=licenses_settings' ) ) . '">', '</a>' );
101
+		echo sprintf( __( 'Your %1$s license key is missing. Please add it on the %2$slicenses page%3$s.', 'formidable' ), $this->plugin_name, '<a href="' . esc_url( admin_url( 'admin.php?page=formidable-settings&t=licenses_settings' ) ) . '">', '</a>' );
102 102
 		$id = sanitize_title( $plugin['Name'] );
103 103
 		echo '<script type="text/javascript">var d = document.getElementById("' . esc_attr( $id ) . '");if ( d !== null ){ d.className = d.className + " update"; }</script>';
104 104
 		echo '</div></td></tr>';
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
 
112 112
 		if ( $this->is_current_version( $transient ) ) {
113 113
 			//make sure it doesn't show there is an update if plugin is up-to-date
114
-			if ( isset( $transient->response[ $this->plugin_folder ] ) ) {
115
-				unset( $transient->response[ $this->plugin_folder ] );
114
+			if ( isset( $transient->response[$this->plugin_folder] ) ) {
115
+				unset( $transient->response[$this->plugin_folder] );
116 116
 			}
117
-		} else if ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) {
117
+		} else if ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) {
118 118
 			$cache_key = 'edd_plugin_' . md5( sanitize_key( $this->license . $this->version ) . '_get_version' );
119 119
 			$version_info = get_transient( $cache_key );
120 120
 			if ( $version_info !== false && version_compare( $version_info->new_version, $this->version, '>' ) ) {
121
-				$transient->response[ $this->plugin_folder ] = $version_info;
121
+				$transient->response[$this->plugin_folder] = $version_info;
122 122
 			} else {
123 123
 				delete_transient( $cache_key );
124 124
 				if ( ! $this->has_been_cleared() ) {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 					$this->manually_queue_update();
128 128
 				}
129 129
 
130
-				unset( $transient->response[ $this->plugin_folder ] );
130
+				unset( $transient->response[$this->plugin_folder] );
131 131
 			}
132 132
 		}
133 133
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	}
136 136
 
137 137
 	private function is_current_version( $transient ) {
138
-		if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) {
138
+		if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) {
139 139
 			return false;
140 140
 		}
141 141
 
@@ -144,20 +144,20 @@  discard block
 block discarded – undo
144 144
 			return true;
145 145
 		}
146 146
 
147
-		return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] == $transient->response[ $this->plugin_folder ]->new_version;
147
+		return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] == $transient->response[$this->plugin_folder]->new_version;
148 148
 	}
149 149
 
150 150
 	private function has_been_cleared() {
151 151
 		$last_cleared = get_option( 'frm_last_cleared' );
152
-		return ( $last_cleared && $last_cleared > date( 'Y-m-d H:i:s', strtotime('-5 minutes') ) );
152
+		return ( $last_cleared && $last_cleared > date( 'Y-m-d H:i:s', strtotime( '-5 minutes' ) ) );
153 153
 	}
154 154
 
155 155
 	private function cleared_plugins() {
156
-		update_option( 'frm_last_cleared', date('Y-m-d H:i:s') );
156
+		update_option( 'frm_last_cleared', date( 'Y-m-d H:i:s' ) );
157 157
 	}
158 158
 
159 159
 	public static function activate() {
160
-		FrmAppHelper::permission_check('frm_change_settings');
160
+		FrmAppHelper::permission_check( 'frm_change_settings' );
161 161
 	 	check_ajax_referer( 'frm_ajax', 'nonce' );
162 162
 
163 163
 		if ( ! isset( $_POST['license'] ) || empty( $_POST['license'] ) ) {
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	}
206 206
 
207 207
 	public static function deactivate() {
208
-		FrmAppHelper::permission_check('frm_change_settings');
208
+		FrmAppHelper::permission_check( 'frm_change_settings' );
209 209
 		check_ajax_referer( 'frm_ajax', 'nonce' );
210 210
 
211 211
 		$plugin_slug = sanitize_text_field( $_POST['plugin'] );
@@ -255,9 +255,9 @@  discard block
 block discarded – undo
255 255
 
256 256
 		$message = __( 'Your License Key was invalid', 'formidable' );
257 257
 		if ( is_wp_error( $resp ) ) {
258
-			$message = sprintf( __( 'You had an error communicating with Formidable Pro\'s API. %1$sClick here%2$s for more information.', 'formidable' ), '<a href="http://formidablepro.com/knowledgebase/why-cant-i-activate-formidable-pro/" target="_blank">', '</a>');
258
+			$message = sprintf( __( 'You had an error communicating with Formidable Pro\'s API. %1$sClick here%2$s for more information.', 'formidable' ), '<a href="http://formidablepro.com/knowledgebase/why-cant-i-activate-formidable-pro/" target="_blank">', '</a>' );
259 259
 			if ( is_wp_error( $resp ) ) {
260
-				$message .= ' '. $resp->get_error_message();
260
+				$message .= ' ' . $resp->get_error_message();
261 261
 			}
262 262
 		} else if ( $body == 'error' || is_wp_error( $body ) ) {
263 263
 			$message = __( 'You had an HTTP error connecting to Formidable Pro\'s API', 'formidable' );
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 					$message = $json_res;
271 271
 				}
272 272
 			} else if ( isset( $resp['response'] ) && isset( $resp['response']['code'] ) ) {
273
-				$message = sprintf( __( 'There was a %1$s error: %2$s', 'formidable' ), $resp['response']['code'], $resp['response']['message'] .' '. $resp['body'] );
273
+				$message = sprintf( __( 'There was a %1$s error: %2$s', 'formidable' ), $resp['response']['code'], $resp['response']['message'] . ' ' . $resp['body'] );
274 274
 			}
275 275
 		}
276 276
 
Please login to merge, or discard this patch.
classes/views/styles/_form-description.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <div class="field-group clearfix frm-half frm-first-row">
2 2
     <label><?php _e( 'Size', 'formidable' ) ?></label>
3
-    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_size') ) ?>" id="frm_form_desc_size" value="<?php echo esc_attr( $style->post_content['form_desc_size'] ) ?>" />
3
+    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'form_desc_size' ) ) ?>" id="frm_form_desc_size" value="<?php echo esc_attr( $style->post_content['form_desc_size'] ) ?>" />
4 4
 </div>
5 5
 
6 6
 <div class="field-group clearfix frm-half frm-first-row">
7 7
     <label><?php _e( 'Color', 'formidable' ) ?></label>
8
-    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_color') ) ?>" id="frm_form_desc_color" class="hex" value="<?php echo esc_attr( $style->post_content['form_desc_color'] ) ?>" />
8
+    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'form_desc_color' ) ) ?>" id="frm_form_desc_color" class="hex" value="<?php echo esc_attr( $style->post_content['form_desc_color'] ) ?>" />
9 9
 </div>
10 10
 <div class="field-group clearfix frm-half">
11 11
     <label><?php _e( 'Margin Top', 'formidable' ) ?></label>
12
-    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_margin_top') ) ?>" id="frm_form_desc_margin_top" value="<?php echo esc_attr( $style->post_content['form_desc_margin_top'] ) ?>" size="4" />
12
+    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'form_desc_margin_top' ) ) ?>" id="frm_form_desc_margin_top" value="<?php echo esc_attr( $style->post_content['form_desc_margin_top'] ) ?>" size="4" />
13 13
 </div>
14 14
 <div class="field-group clearfix frm-half">
15 15
     <label><?php _e( 'Margin Bottom', 'formidable' ) ?></label>
16
-    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_margin_bottom') ) ?>" id="frm_form_desc_margin_bottom" value="<?php echo esc_attr( $style->post_content['form_desc_margin_bottom'] ) ?>" size="4" />
16
+    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'form_desc_margin_bottom' ) ) ?>" id="frm_form_desc_margin_bottom" value="<?php echo esc_attr( $style->post_content['form_desc_margin_bottom'] ) ?>" size="4" />
17 17
 </div>
Please login to merge, or discard this patch.
classes/views/styles/_form-title.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <div class="field-group clearfix frm-half frm-first-row">
2 2
 	<label><?php _e( 'Size', 'formidable' ) ?></label>
3
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_size') ) ?>" id="frm_title_size" value="<?php echo esc_attr( $style->post_content['title_size'] ) ?>" />
3
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'title_size' ) ) ?>" id="frm_title_size" value="<?php echo esc_attr( $style->post_content['title_size'] ) ?>" />
4 4
 </div>
5 5
 
6 6
 <div class="field-group clearfix frm-half frm-first-row">
7 7
 	<label><?php _e( 'Color', 'formidable' ) ?></label>
8
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_color') ) ?>" id="frm_title_color" class="hex" value="<?php echo esc_attr( $style->post_content['title_color'] ) ?>" />
8
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'title_color' ) ) ?>" id="frm_title_color" class="hex" value="<?php echo esc_attr( $style->post_content['title_color'] ) ?>" />
9 9
 </div>
10 10
 <div class="field-group clearfix frm-half">
11 11
 	<label><?php _e( 'Margin Top', 'formidable' ) ?></label>
12
-	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_margin_top') ) ?>" id="frm_title_margin_top" value="<?php echo esc_attr( $style->post_content['title_margin_top'] ) ?>" size="4" />
12
+	<input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'title_margin_top' ) ) ?>" id="frm_title_margin_top" value="<?php echo esc_attr( $style->post_content['title_margin_top'] ) ?>" size="4" />
13 13
 </div>
14 14
 <div class="field-group clearfix frm-half">
15 15
     <label><?php _e( 'Margin Bottom', 'formidable' ) ?></label>
16
-    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_margin_bottom') ) ?>" id="frm_title_margin_bottom" value="<?php echo esc_attr( $style->post_content['title_margin_bottom'] ) ?>" size="4" />
16
+    <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'title_margin_bottom' ) ) ?>" id="frm_title_margin_bottom" value="<?php echo esc_attr( $style->post_content['title_margin_bottom'] ) ?>" size="4" />
17 17
 </div>
Please login to merge, or discard this patch.