Completed
Push — master ( 838aba...126c97 )
by Stephanie
03:34
created
classes/helpers/FrmFormActionsHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if ( ! defined('ABSPATH') ) {
2
+if ( ! defined( 'ABSPATH' ) ) {
3 3
 	die( 'You are not allowed to call this page directly.' );
4 4
 }
5 5
 
Please login to merge, or discard this patch.
classes/views/frm-entries/_sidebar-shared-pub.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! isset( $entry) ) {
2
+if ( ! isset( $entry ) ) {
3 3
     $entry = $record;
4 4
 } ?>
5 5
 
@@ -18,4 +18,4 @@  discard block
 block discarded – undo
18 18
 </div>
19 19
 <?php } ?>
20 20
 
21
-<?php do_action('frm_entry_shared_sidebar', $entry); ?>
21
+<?php do_action( 'frm_entry_shared_sidebar', $entry ); ?>
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 if ( ! isset( $entry) ) {
3
-    $entry = $record;
3
+	$entry = $record;
4 4
 } ?>
5 5
 
6 6
 <div class="misc-pub-section curtime misc-pub-curtime">
7 7
     <span id="timestamp">
8 8
     <?php
9
-    $date_format = __( 'M j, Y @ G:i' );
9
+	$date_format = __( 'M j, Y @ G:i' );
10 10
 	printf( esc_html__( 'Published on: %1$s' ), '<b>' . FrmAppHelper::get_localized_date( $date_format, $entry->created_at ) . '</b>' );
11 11
 	?>
12 12
     </span>
Please login to merge, or discard this patch.
classes/views/frm-entries/sidebar-shared.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -66,18 +66,18 @@
 block discarded – undo
66 66
         <?php } ?>
67 67
 
68 68
         <?php
69
-        foreach ( (array) $data as $k => $d ) {
69
+		foreach ( (array) $data as $k => $d ) {
70 70
 			if ( in_array( $k, array( 'browser', 'referrer' ) ) ) {
71
-                continue;
72
-            }
73
-        ?>
71
+				continue;
72
+			}
73
+		?>
74 74
         <div class="misc-pub-section">
75 75
 			<b><?php echo sanitize_text_field( ucfirst( str_replace( '-', ' ', $k ) ) ); ?></b>:
76 76
 			<?php echo wp_kses_post( implode( ', ', (array) $d ) ); ?>
77 77
         </div>
78 78
         <?php
79
-            unset($k, $d);
80
-        }
81
-        ?>
79
+			unset($k, $d);
80
+		}
81
+		?>
82 82
     </div>
83 83
 </div>
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 <div class="postbox frm_with_icons" >
3 3
     <h3 class="hndle">
4 4
 		<span><?php esc_html_e( 'Entry Details', 'formidable' ) ?></span>
5
-		<?php if ( FrmAppHelper::get_param('frm_action') != 'show' ) { ?>
5
+		<?php if ( FrmAppHelper::get_param( 'frm_action' ) != 'show' ) { ?>
6 6
 		<a href="?page=formidable-entries&amp;frm_action=show&amp;id=<?php echo absint( $entry->id ); ?>" class="alignright">
7 7
 			<?php esc_html_e( 'View Entry', 'formidable' ) ?>
8 8
 		</a>
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
         <div class="misc-pub-section frm_no_print">
16 16
             <span class="dashicons dashicons-admin-post wp-media-buttons-icon"></span>
17 17
             <?php esc_html_e( 'Post', 'formidable' ) ?>:
18
-            <b><?php echo get_the_title($entry->post_id) ?></b>
18
+            <b><?php echo get_the_title( $entry->post_id ) ?></b>
19 19
 			<span>
20 20
 				<a href="<?php echo esc_url( admin_url( 'post.php?post=' . $entry->post_id . '&action=edit' ) ) ?>">
21 21
 					<?php esc_html_e( 'Edit', 'formidable' ) ?>
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         </div>
76 76
         <?php } ?>
77 77
 
78
-        <?php if ( isset($data['referrer']) ) { ?>
78
+        <?php if ( isset( $data['referrer'] ) ) { ?>
79 79
 		<div class="misc-pub-section frm_force_wrap">
80 80
 			<b><?php esc_html_e( 'Referrer', 'formidable' ) ?></b>:<br/>
81 81
 			<?php echo wp_kses_post( str_replace( "\r\n", '<br/>', $data['referrer'] ) ); ?>
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 			<?php echo wp_kses_post( implode( ', ', (array) $d ) ); ?>
94 94
         </div>
95 95
         <?php
96
-            unset($k, $d);
96
+            unset( $k, $d );
97 97
         }
98 98
         ?>
99 99
     </div>
Please login to merge, or discard this patch.
classes/views/frm-form-actions/default_actions.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 class FrmDefPostAction extends FrmFormAction {
4 4
 	public function __construct() {
5 5
 		$action_ops = FrmFormAction::default_action_opts();
6
-	    $action_ops['classes'] = 'ab-icon frm_dashicon_font dashicons-before';
6
+		$action_ops['classes'] = 'ab-icon frm_dashicon_font dashicons-before';
7 7
 
8 8
 		parent::__construct( 'wppost', __( 'Create Post', 'formidable' ), $action_ops );
9 9
 	}
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 // add register action
13 13
 class FrmDefRegAction extends FrmFormAction {
14 14
 	public function __construct() {
15
-		$action_ops = FrmFormAction::default_action_opts('frm_register_icon');
15
+		$action_ops = FrmFormAction::default_action_opts( 'frm_register_icon' );
16 16
 		parent::__construct( 'register', __( 'Register User', 'formidable' ), $action_ops );
17 17
 	}
18 18
 }
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 // add paypal action
21 21
 class FrmDefPayPalAction extends FrmFormAction {
22 22
 	public function __construct() {
23
-		$action_ops = FrmFormAction::default_action_opts('frm_paypal_icon');
23
+		$action_ops = FrmFormAction::default_action_opts( 'frm_paypal_icon' );
24 24
 		parent::__construct( 'paypal', __( 'Collect Payment', 'formidable' ), $action_ops );
25 25
 	}
26 26
 }
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 // add aweber action
29 29
 class FrmDefAweberAction extends FrmFormAction {
30 30
 	public function __construct() {
31
-		$action_ops = FrmFormAction::default_action_opts('frm_aweber_icon');
31
+		$action_ops = FrmFormAction::default_action_opts( 'frm_aweber_icon' );
32 32
 		parent::__construct( 'aweber', __( 'Aweber', 'formidable' ), $action_ops );
33 33
 	}
34 34
 }
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 // add mailchimp action
37 37
 class FrmDefMlcmpAction extends FrmFormAction {
38 38
 	public function __construct() {
39
-		$action_ops = FrmFormAction::default_action_opts('frm_mailchimp_icon');
39
+		$action_ops = FrmFormAction::default_action_opts( 'frm_mailchimp_icon' );
40 40
 		parent::__construct( 'mailchimp', __( 'MailChimp', 'formidable' ), $action_ops );
41 41
 	}
42 42
 }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 // add twilio action
45 45
 class FrmDefTwilioAction extends FrmFormAction {
46 46
 	public function __construct() {
47
-		$action_ops = FrmFormAction::default_action_opts('frm_sms_icon');
47
+		$action_ops = FrmFormAction::default_action_opts( 'frm_sms_icon' );
48 48
 		parent::__construct( 'twilio', __( 'Twilio', 'formidable' ), $action_ops );
49 49
 	}
50 50
 }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 // add highrise action
53 53
 class FrmDefHrsAction extends FrmFormAction {
54 54
 	public function __construct() {
55
-		$action_ops = FrmFormAction::default_action_opts('frm_highrise_icon');
55
+		$action_ops = FrmFormAction::default_action_opts( 'frm_highrise_icon' );
56 56
 		parent::__construct( 'highrise', __( 'Highrise', 'formidable' ), $action_ops );
57 57
 	}
58 58
 }
Please login to merge, or discard this patch.
classes/views/xml/forms_xml.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if ( ! $item_ids ) {
4
-    return;
4
+	return;
5 5
 }
6 6
 
7 7
 // fetch 20 posts at a time rather than loading the entire table into memory
@@ -45,6 +45,6 @@  discard block
 block discarded – undo
45 45
 <?php	} ?>
46 46
 	</form>
47 47
 <?php
48
-    	unset( $fields );
48
+		unset( $fields );
49 49
 	}
50 50
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,16 +13,16 @@  discard block
 block discarded – undo
13 13
 ?>
14 14
 	<form>
15 15
 		<id><?php echo absint( $form->id ) ?></id>
16
-		<form_key><?php echo FrmXMLHelper::cdata($form->form_key) ?></form_key>
17
-		<name><?php echo FrmXMLHelper::cdata($form->name) ?></name>
18
-		<description><?php echo FrmXMLHelper::cdata($form->description) ?></description>
16
+		<form_key><?php echo FrmXMLHelper::cdata( $form->form_key ) ?></form_key>
17
+		<name><?php echo FrmXMLHelper::cdata( $form->name ) ?></name>
18
+		<description><?php echo FrmXMLHelper::cdata( $form->description ) ?></description>
19 19
 		<created_at><?php echo esc_html( $form->created_at ) ?></created_at>
20 20
 		<logged_in><?php echo esc_html( $form->logged_in ) ?></logged_in>
21 21
 		<is_template><?php echo esc_html( $form->is_template ) ?></is_template>
22 22
 		<default_template><?php echo esc_html( $form->default_template ) ?></default_template>
23 23
 		<editable><?php echo esc_html( $form->editable ) ?></editable>
24
-		<options><?php echo FrmXMLHelper::prepare_form_options_for_export($form->options) ?></options>
25
-		<status><?php echo FrmXMLHelper::cdata($form->status) ?></status>
24
+		<options><?php echo FrmXMLHelper::prepare_form_options_for_export( $form->options ) ?></options>
25
+		<status><?php echo FrmXMLHelper::cdata( $form->status ) ?></status>
26 26
         <parent_form_id><?php echo esc_html( $form->parent_form_id ) ?></parent_form_id>
27 27
 <?php
28 28
 
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
 		?>
33 33
 		<field>
34 34
 		    <id><?php echo absint( $field->id ) ?></id>
35
-            <field_key><?php echo FrmXMLHelper::cdata($field->field_key) ?></field_key>
36
-            <name><?php echo FrmXMLHelper::cdata($field->name) ?></name>
37
-            <description><?php echo FrmXMLHelper::cdata($field->description) ?></description>
38
-            <type><?php echo FrmXMLHelper::cdata($field->type) ?></type>
39
-            <default_value><?php echo FrmXMLHelper::cdata($field->default_value) ?></default_value>
35
+            <field_key><?php echo FrmXMLHelper::cdata( $field->field_key ) ?></field_key>
36
+            <name><?php echo FrmXMLHelper::cdata( $field->name ) ?></name>
37
+            <description><?php echo FrmXMLHelper::cdata( $field->description ) ?></description>
38
+            <type><?php echo FrmXMLHelper::cdata( $field->type ) ?></type>
39
+            <default_value><?php echo FrmXMLHelper::cdata( $field->default_value ) ?></default_value>
40 40
             <field_order><?php echo absint( $field->field_order ) ?></field_order>
41 41
             <form_id><?php echo absint( $field->form_id ) ?></form_id>
42 42
             <required><?php echo absint( $field->required ) ?></required>
43
-            <options><?php echo FrmXMLHelper::cdata($field->options) ?></options>
44
-            <field_options><?php echo FrmXMLHelper::cdata($field->field_options) ?></field_options>
43
+            <options><?php echo FrmXMLHelper::cdata( $field->options ) ?></options>
44
+            <field_options><?php echo FrmXMLHelper::cdata( $field->field_options ) ?></field_options>
45 45
 		</field>
46 46
 <?php	} ?>
47 47
 	</form>
Please login to merge, or discard this patch.
classes/models/FrmPointers.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 	/**
46 46
 	 * Get the singleton instance of this class
47 47
 	 *
48
-	 * @return object
48
+	 * @return FrmPointers
49 49
 	 */
50 50
 	public static function get_instance() {
51 51
 		if ( ! ( self::$instance instanceof self ) ) {
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -239,16 +239,16 @@  discard block
 block discarded – undo
239 239
 
240 240
 		return array(
241 241
 			'content'   => '<h3>' . __( 'Forms', 'formidable' ) . '</h3>'
242
-			               . '<p>' . __( 'All your forms will be listed on this page. Create your first form by clicking on the "Add New" button.', 'formidable' ) . '</p>'
243
-			               . '<p><strong>' . __( 'Subscribe to our Newsletter', 'formidable' ) . '</strong><br/>'
244
-			               . sprintf( __( 'If you would like to hear about new features and updates for %1$s, subscribe to our newsletter:', 'formidable' ), 'Formidable' ) . '</p>'
245
-			               . '<form target="_blank" action="//formidablepro.us1.list-manage.com/subscribe/post?u=a4a913790ffb892daacc6f271&amp;id=7e7df15967" method="post" selector="newsletter-form" accept-charset="' . esc_attr( get_bloginfo( 'charset' ) ) . '">'
246
-			               . '<p>'
247
-			               . '<input style="margin: 5px; color:#666" name="EMAIL" value="' . esc_attr( $current_user->user_email ) . '" selector="newsletter-email" placeholder="' . esc_attr__( 'Email', 'formidable' ) . '"/>'
242
+						   . '<p>' . __( 'All your forms will be listed on this page. Create your first form by clicking on the "Add New" button.', 'formidable' ) . '</p>'
243
+						   . '<p><strong>' . __( 'Subscribe to our Newsletter', 'formidable' ) . '</strong><br/>'
244
+						   . sprintf( __( 'If you would like to hear about new features and updates for %1$s, subscribe to our newsletter:', 'formidable' ), 'Formidable' ) . '</p>'
245
+						   . '<form target="_blank" action="//formidablepro.us1.list-manage.com/subscribe/post?u=a4a913790ffb892daacc6f271&amp;id=7e7df15967" method="post" selector="newsletter-form" accept-charset="' . esc_attr( get_bloginfo( 'charset' ) ) . '">'
246
+						   . '<p>'
247
+						   . '<input style="margin: 5px; color:#666" name="EMAIL" value="' . esc_attr( $current_user->user_email ) . '" selector="newsletter-email" placeholder="' . esc_attr__( 'Email', 'formidable' ) . '"/>'
248 248
 						   . '<input type="hidden" name="group[4505]" value="4" />'
249
-			               . '<button type="submit" class="button-primary">' . esc_html__( 'Subscribe', 'formidable' ) . '</button>'
250
-			               . '</p>'
251
-			               . '</form>',
249
+						   . '<button type="submit" class="button-primary">' . esc_html__( 'Subscribe', 'formidable' ) . '</button>'
250
+						   . '</p>'
251
+						   . '</form>',
252 252
 			'next_page' => 'entries',
253 253
 		);
254 254
 	}
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	private function entries_pointer() {
262 262
 		return array(
263 263
 			'content'   => '<h3>' . __( 'Entries', 'formidable' ) . '</h3>'
264
-			               . '<p>' . __( 'Each time one of your forms is submitted, an entry is created. You will find every form submission listed here so you will always have a backup if an email fails.', 'formidable' ) . '</p>',
264
+						   . '<p>' . __( 'Each time one of your forms is submitted, an entry is created. You will find every form submission listed here so you will always have a backup if an email fails.', 'formidable' ) . '</p>',
265 265
 			'prev_page' => '',
266 266
 			'next_page' => 'styles',
267 267
 			'selector'  => '.wp-list-table',
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 	private function styles_pointer() {
278 278
 		return array(
279 279
 			'content'   => '<h3>' . __( 'Styles', 'formidable' ) . '</h3>'
280
-			               . '<p>' . __( 'Want to make changes to the way your forms look? Make all the changes you would like right here, and watch the sample form change before your eyes.', 'formidable' ) . '</p>',
280
+						   . '<p>' . __( 'Want to make changes to the way your forms look? Make all the changes you would like right here, and watch the sample form change before your eyes.', 'formidable' ) . '</p>',
281 281
 			'prev_page' => 'entries',
282 282
 			'next_page' => 'import',
283 283
 			'selector'  => '.general-style',
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 	private function import_pointer() {
294 294
 		return array(
295 295
 			'content'   => '<h3>' . __( 'Import/Export', 'formidable' ) . '</h3>'
296
-			               . '<p>' . __( 'Import and export forms and styles when copying from one site to another or sharing with someone else. Your entries can be exported to a CSV as well. The Premium version also includes the option to import entries to your site from a CSV.', 'formidable' ) . '</p>',
296
+						   . '<p>' . __( 'Import and export forms and styles when copying from one site to another or sharing with someone else. Your entries can be exported to a CSV as well. The Premium version also includes the option to import entries to your site from a CSV.', 'formidable' ) . '</p>',
297 297
 			'prev_page' => 'styles',
298 298
 			'next_page' => 'settings',
299 299
 			'selector'  => '.inside.with_frm_style',
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 				. __( 'Turn stylesheets and scripts off, set which user roles have access to change and create forms, setup your reCaptcha, and set default messages for new forms and fields.', 'formidable' )
314 314
 				. '<p><strong>' . __( 'Plugin Licenses', 'formidable' ) . '</strong><br/>'
315 315
 				. sprintf( __( 'Once you&#8217;ve purchased %1$s or any addons, you&#8217;ll have to enter a license key to get access to all of their powerful features. A Plugin Licenses tab will appear here for you to enter your license key.', 'formidable' ), 'Formidable Pro' )
316
-           	    . '</p>',
316
+		   		. '</p>',
317 317
 			'prev_page' => 'import',
318 318
 			'next_page' => 'addons',
319 319
 		);
@@ -327,10 +327,10 @@  discard block
 block discarded – undo
327 327
 	private function addons_pointer() {
328 328
 		return array(
329 329
 			'content'   => '<h3>' . __( 'Addons', 'formidable' ) . '</h3>'
330
-			               . '<p>' . sprintf( __( 'The powerful functions of %1$s can be extended with %2$spremium plugins%3$s. You can read all about the Formidable Premium Plugins %2$shere%3$s.', 'formidable' ), 'Formidable', '<a target="_blank" href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/' ) ) . '">', '</a>' )
330
+						   . '<p>' . sprintf( __( 'The powerful functions of %1$s can be extended with %2$spremium plugins%3$s. You can read all about the Formidable Premium Plugins %2$shere%3$s.', 'formidable' ), 'Formidable', '<a target="_blank" href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/' ) ) . '">', '</a>' )
331 331
 						   . '</p>'
332
-			               . '<p><strong>' . __( 'Like this plugin?', 'formidable' ) . '</strong><br/>' . sprintf( __( 'So, we&#8217;ve come to the end of the tour. If you like the plugin, please %1$srate it 5 stars on WordPress.org%2$s!', 'formidable' ), '<a target="_blank" href="https://wordpress.org/plugins/formidable/">', '</a>' ) . '</p>'
333
-			               . '<p>' . sprintf( __( 'Thank you for using our plugin and good luck with your forms!<br/><br/>Best,<br/>Team Formidable - %1$sformidableforms.com%2$s', 'formidable' ), '<a target="_blank" href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/' ) ) . '">', '</a>' ) . '</p>',
332
+						   . '<p><strong>' . __( 'Like this plugin?', 'formidable' ) . '</strong><br/>' . sprintf( __( 'So, we&#8217;ve come to the end of the tour. If you like the plugin, please %1$srate it 5 stars on WordPress.org%2$s!', 'formidable' ), '<a target="_blank" href="https://wordpress.org/plugins/formidable/">', '</a>' ) . '</p>'
333
+						   . '<p>' . sprintf( __( 'Thank you for using our plugin and good luck with your forms!<br/><br/>Best,<br/>Team Formidable - %1$sformidableforms.com%2$s', 'formidable' ), '<a target="_blank" href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/' ) ) . '">', '</a>' ) . '</p>',
334 334
 			'prev_page' => 'settings',
335 335
 		);
336 336
 	}
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -188,7 +188,7 @@
 block discarded – undo
188 188
 	 * @param string $page Admin page key.
189 189
 	 */
190 190
 	private function do_page_pointer( $page ) {
191
-		$pointer = call_user_func( array( $this, $this->admin_pages[ $page ] ) );
191
+		$pointer = call_user_func( array( $this, $this->admin_pages[$page] ) );
192 192
 
193 193
 		$opt_arr = array(
194 194
 			'content'      => $pointer['content'],
Please login to merge, or discard this patch.
classes/helpers/FrmTipsHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -181,13 +181,13 @@
 block discarded – undo
181 181
 			),
182 182
 		);
183 183
 		$random = rand( 0, count( $tips ) - 1 );
184
-		$tip = $tips[ $random ];
184
+		$tip = $tips[$random];
185 185
 		$tip['num'] = $random;
186 186
 		return $tip;
187 187
 	}
188 188
 
189 189
 	public static function get_random_tip( $tips ) {
190 190
 		$random = rand( 0, count( $tips ) - 1 );
191
-		return $tips[ $random ];
191
+		return $tips[$random];
192 192
 	}
193 193
 }
Please login to merge, or discard this patch.
classes/views/frm-form-actions/email_action.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@  discard block
 block discarded – undo
4 4
 
5 5
 	public function __construct() {
6 6
 		$action_ops = array(
7
-		    'classes'   => 'frm_email_icon frm_icon_font',
8
-            'active'    => true,
7
+			'classes'   => 'frm_email_icon frm_icon_font',
8
+			'active'    => true,
9 9
 			'event'     => array( 'create' ),
10
-            'limit'     => 99,
11
-            'priority'  => 10,
12
-            'ajax_load' => false,
10
+			'limit'     => 99,
11
+			'priority'  => 10,
12
+			'ajax_load' => false,
13 13
 		);
14 14
 		$action_ops = apply_filters('frm_email_control_settings', $action_ops);
15 15
 
@@ -17,23 +17,23 @@  discard block
 block discarded – undo
17 17
 	}
18 18
 
19 19
 	public function form( $form_action, $args = array() ) {
20
-	    extract($args);
20
+		extract($args);
21 21
 
22 22
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/_email_settings.php' );
23 23
 	}
24 24
 
25 25
 	public function get_defaults() {
26
-	    return array(
27
-            'email_to'      => '[admin_email]',
28
-            'cc'            => '',
29
-            'bcc'           => '',
30
-            'from'          => '[sitename] <[admin_email]>',
31
-            'reply_to'      => '',
32
-            'email_subject' => '',
33
-            'email_message' => '[default-message]',
34
-            'inc_user_info' => 0,
35
-            'plain_text'    => 0,
26
+		return array(
27
+			'email_to'      => '[admin_email]',
28
+			'cc'            => '',
29
+			'bcc'           => '',
30
+			'from'          => '[sitename] <[admin_email]>',
31
+			'reply_to'      => '',
32
+			'email_subject' => '',
33
+			'email_message' => '[default-message]',
34
+			'inc_user_info' => 0,
35
+			'plain_text'    => 0,
36 36
 			'event'         => array( 'create' ),
37
-	    );
37
+		);
38 38
 	}
39 39
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@
 block discarded – undo
11 11
             'priority'  => 10,
12 12
             'ajax_load' => false,
13 13
 		);
14
-		$action_ops = apply_filters('frm_email_control_settings', $action_ops);
14
+		$action_ops = apply_filters( 'frm_email_control_settings', $action_ops );
15 15
 
16
-		parent::__construct('email', __( 'Email Notification', 'formidable' ), $action_ops);
16
+		parent::__construct( 'email', __( 'Email Notification', 'formidable' ), $action_ops );
17 17
 	}
18 18
 
19 19
 	public function form( $form_action, $args = array() ) {
20
-	    extract($args);
20
+	    extract( $args );
21 21
 
22 22
 		include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/_email_settings.php' );
23 23
 	}
Please login to merge, or discard this patch.
classes/models/FrmStyle.php 3 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 	public $id = 0; // the id of the post
5 5
 
6 6
 	/**
7
-	 * @param int|string $id The id of the stylsheet or 'default'
7
+	 * @param integer $id The id of the stylsheet or 'default'
8 8
 	 */
9 9
 	public function __construct( $id = 0 ) {
10 10
         $this->id = $id;
@@ -120,6 +120,9 @@  discard block
 block discarded – undo
120 120
         set_transient('frmpro_css', $css);
121 121
 	}
122 122
 
123
+	/**
124
+	 * @param string $filename
125
+	 */
123 126
 	private function get_css_content( $filename ) {
124 127
 		$css = '/* ' . __( 'WARNING: Any changes made to this file will be lost when your Formidable settings are updated', 'formidable' ) . ' */' . "\n";
125 128
 
Please login to merge, or discard this patch.
Indentation   +263 added lines, -263 removed lines patch added patch discarded remove patch
@@ -7,46 +7,46 @@  discard block
 block discarded – undo
7 7
 	 * @param int|string $id The id of the stylsheet or 'default'
8 8
 	 */
9 9
 	public function __construct( $id = 0 ) {
10
-        $this->id = $id;
11
-    }
10
+		$this->id = $id;
11
+	}
12 12
 
13
-    public function get_new() {
13
+	public function get_new() {
14 14
 		$this->id = 0;
15 15
 
16
-        $max_slug_value = 2147483647;
17
-        $min_slug_value = 37; // we want to have at least 2 characters in the slug
18
-        $key = base_convert( rand($min_slug_value, $max_slug_value), 10, 36 );
19
-
20
-        $style = array(
21
-            'post_type'     => FrmStylesController::$post_type,
22
-            'ID'            => '',
23
-            'post_title'    => __( 'New Style', 'formidable' ),
24
-            'post_name'     => $key,
25
-            'post_content'  => $this->get_defaults(),
26
-            'menu_order'    => '',
27
-            'post_status'   => 'publish',
28
-        );
16
+		$max_slug_value = 2147483647;
17
+		$min_slug_value = 37; // we want to have at least 2 characters in the slug
18
+		$key = base_convert( rand($min_slug_value, $max_slug_value), 10, 36 );
19
+
20
+		$style = array(
21
+			'post_type'     => FrmStylesController::$post_type,
22
+			'ID'            => '',
23
+			'post_title'    => __( 'New Style', 'formidable' ),
24
+			'post_name'     => $key,
25
+			'post_content'  => $this->get_defaults(),
26
+			'menu_order'    => '',
27
+			'post_status'   => 'publish',
28
+		);
29 29
 
30
-        return (object) $style;
31
-    }
30
+		return (object) $style;
31
+	}
32 32
 
33 33
 	public function save( $settings ) {
34 34
 		return FrmDb::save_settings( $settings, 'frm_styles' );
35
-    }
35
+	}
36 36
 
37 37
 	public function duplicate( $id ) {
38
-        // duplicating is a pro feature
39
-    }
38
+		// duplicating is a pro feature
39
+	}
40 40
 
41
-    public function update( $id = 'default' ) {
41
+	public function update( $id = 'default' ) {
42 42
  		$all_instances = $this->get_all();
43 43
 
44 44
  		if ( empty($id) ) {
45
- 		     $new_style = (array) $this->get_new();
46
- 		     $all_instances[] = $new_style;
45
+ 			 $new_style = (array) $this->get_new();
46
+ 			 $all_instances[] = $new_style;
47 47
  		}
48 48
 
49
-        $action_ids = array();
49
+		$action_ids = array();
50 50
 
51 51
  		foreach ( $all_instances as $number => $new_instance ) {
52 52
  			$new_instance = stripslashes_deep( (array) $new_instance);
@@ -54,46 +54,46 @@  discard block
 block discarded – undo
54 54
  			if ( $id != $this->id || ! $_POST || ! isset($_POST['frm_style_setting']) ) {
55 55
 				$all_instances[ $number ] = $new_instance;
56 56
 
57
- 			    if ( $new_instance['menu_order'] && $_POST && empty($_POST['prev_menu_order']) && isset($_POST['frm_style_setting']['menu_order']) ) {
58
- 			        // this style was set to default, so remove default setting on previous default style
59
- 			        $new_instance['menu_order'] = 0;
60
- 			        $action_ids[] = $this->save($new_instance);
61
- 			    }
57
+ 				if ( $new_instance['menu_order'] && $_POST && empty($_POST['prev_menu_order']) && isset($_POST['frm_style_setting']['menu_order']) ) {
58
+ 					// this style was set to default, so remove default setting on previous default style
59
+ 					$new_instance['menu_order'] = 0;
60
+ 					$action_ids[] = $this->save($new_instance);
61
+ 				}
62 62
 
63
- 			    // don't continue if not saving this style
64
- 			    continue;
63
+ 				// don't continue if not saving this style
64
+ 				continue;
65 65
  			}
66 66
 
67 67
  			$new_instance['post_title'] = sanitize_text_field( $_POST['frm_style_setting']['post_title'] );
68 68
  			$new_instance['post_content'] = $_POST['frm_style_setting']['post_content'];
69 69
  			$new_instance['post_type']  = FrmStylesController::$post_type;
70
-            $new_instance['post_status']  = 'publish';
70
+			$new_instance['post_status']  = 'publish';
71 71
 			$new_instance['menu_order']  = isset( $_POST['frm_style_setting']['menu_order'] ) ? absint( $_POST['frm_style_setting']['menu_order'] ) : 0;
72 72
 
73
-            if ( empty($id) ) {
74
-                $new_instance['post_name'] = $new_instance['post_title'];
75
-            }
73
+			if ( empty($id) ) {
74
+				$new_instance['post_name'] = $new_instance['post_title'];
75
+			}
76 76
 
77
-            $default_settings = $this->get_defaults();
77
+			$default_settings = $this->get_defaults();
78 78
 
79
-            foreach ( $default_settings as $setting => $default ) {
79
+			foreach ( $default_settings as $setting => $default ) {
80 80
 				if ( ! isset( $new_instance['post_content'][ $setting ] ) ) {
81 81
 					$new_instance['post_content'][ $setting ] = $default;
82 82
 				}
83 83
 
84 84
 				if ( strpos( $setting, 'color' ) !== false || in_array( $setting, array( 'error_bg', 'error_border', 'error_text' ) ) ) {
85
-                    //if is a color
85
+					//if is a color
86 86
 					$new_instance['post_content'][ $setting ] = str_replace( '#', '', $new_instance['post_content'][ $setting ] );
87 87
 				} else if ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ) ) && ! isset( $new_instance['post_content'][ $setting ] ) ) {
88 88
 					$new_instance['post_content'][ $setting ] = 0;
89
-                } else if ( $setting == 'font' ) {
90
-                	$new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] );
91
-                }
92
-            }
89
+				} else if ( $setting == 'font' ) {
90
+					$new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] );
91
+				}
92
+			}
93 93
 
94 94
 			$all_instances[ $number ] = $new_instance;
95 95
 
96
-            $action_ids[] = $this->save($new_instance);
96
+			$action_ids[] = $this->save($new_instance);
97 97
 
98 98
  		}
99 99
 
@@ -102,16 +102,16 @@  discard block
 block discarded – undo
102 102
  		return $action_ids;
103 103
  	}
104 104
 
105
-    /**
106
-     * Create static css file
107
-     */
105
+	/**
106
+	 * Create static css file
107
+	 */
108 108
 	public function save_settings() {
109 109
 		$filename = FrmAppHelper::plugin_path() . '/css/custom_theme.css.php';
110 110
 		update_option( 'frm_last_style_update', date('njGi') );
111 111
 
112
-        if ( ! is_file($filename) ) {
113
-            return;
114
-        }
112
+		if ( ! is_file($filename) ) {
113
+			return;
114
+		}
115 115
 
116 116
 		$this->clear_cache();
117 117
 
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
 		) );
124 124
 		$create_file->create_file( $css );
125 125
 
126
-        update_option('frmpro_css', $css);
126
+		update_option('frmpro_css', $css);
127 127
 
128
-        set_transient('frmpro_css', $css);
128
+		set_transient('frmpro_css', $css);
129 129
 	}
130 130
 
131 131
 	private function get_css_content( $filename ) {
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
 		$saving = true;
135 135
 		$frm_style = $this;
136 136
 
137
-        ob_start();
138
-        include( $filename );
137
+		ob_start();
138
+		include( $filename );
139 139
 		$css .= preg_replace( '/\/\*(.|\s)*?\*\//', '', str_replace( array( "\r\n", "\r", "\n", "\t", '    ' ), '', ob_get_contents() ) );
140
-        ob_end_clean();
140
+		ob_end_clean();
141 141
 
142 142
 		return $css;
143 143
 	}
@@ -157,269 +157,269 @@  discard block
 block discarded – undo
157 157
 	}
158 158
 
159 159
 	public function destroy( $id ) {
160
-        return wp_delete_post($id);
161
-    }
160
+		return wp_delete_post($id);
161
+	}
162 162
 
163
-    public function get_one() {
164
-        if ( 'default' == $this->id ) {
165
-            $style = $this->get_default_style();
166
-            if ( $style ) {
167
-                $this->id = $style->ID;
168
-            } else {
169
-                $this->id = 0;
170
-            }
171
-            return $style;
172
-        }
163
+	public function get_one() {
164
+		if ( 'default' == $this->id ) {
165
+			$style = $this->get_default_style();
166
+			if ( $style ) {
167
+				$this->id = $style->ID;
168
+			} else {
169
+				$this->id = 0;
170
+			}
171
+			return $style;
172
+		}
173 173
 
174
-        $style = get_post($this->id);
174
+		$style = get_post($this->id);
175 175
 
176
-        if ( ! $style ) {
177
-            return $style;
178
-        }
176
+		if ( ! $style ) {
177
+			return $style;
178
+		}
179 179
 
180
-        $style->post_content = FrmAppHelper::maybe_json_decode($style->post_content);
180
+		$style->post_content = FrmAppHelper::maybe_json_decode($style->post_content);
181 181
 
182
-        $default_values = $this->get_defaults();
182
+		$default_values = $this->get_defaults();
183 183
 
184
-        // fill default values
185
-        $style->post_content = $this->override_defaults($style->post_content);
186
-        $style->post_content = wp_parse_args( $style->post_content, $default_values);
184
+		// fill default values
185
+		$style->post_content = $this->override_defaults($style->post_content);
186
+		$style->post_content = wp_parse_args( $style->post_content, $default_values);
187 187
 
188
-        return $style;
189
-    }
188
+		return $style;
189
+	}
190 190
 
191
-    public function get_all( $orderby = 'title', $order = 'ASC', $limit = 99 ) {
192
-        $post_atts = array(
191
+	public function get_all( $orderby = 'title', $order = 'ASC', $limit = 99 ) {
192
+		$post_atts = array(
193 193
 			'post_type'   => FrmStylesController::$post_type,
194 194
 			'post_status' => 'publish',
195 195
 			'numberposts' => $limit,
196 196
 			'orderby'     => $orderby,
197 197
 			'order'       => $order,
198
-        );
198
+		);
199 199
 
200 200
 		$temp_styles = FrmDb::check_cache( serialize( $post_atts ), 'frm_styles', $post_atts, 'get_posts' );
201 201
 
202
-        if ( empty($temp_styles) ) {
203
-            global $wpdb;
204
-            // make sure there wasn't a conflict with the query
202
+		if ( empty($temp_styles) ) {
203
+			global $wpdb;
204
+			// make sure there wasn't a conflict with the query
205 205
 			$query = $wpdb->prepare( 'SELECT * FROM ' . $wpdb->posts . ' WHERE post_type=%s AND post_status=%s ORDER BY post_title ASC LIMIT 99', FrmStylesController::$post_type, 'publish' );
206
-            $temp_styles = FrmDb::check_cache('frm_backup_style_check', 'frm_styles', $query, 'get_results');
206
+			$temp_styles = FrmDb::check_cache('frm_backup_style_check', 'frm_styles', $query, 'get_results');
207 207
 
208
-            if ( empty($temp_styles) ) {
209
-                // create a new style if there are none
210
-         		$new = $this->get_new();
208
+			if ( empty($temp_styles) ) {
209
+				// create a new style if there are none
210
+		 		$new = $this->get_new();
211 211
 				$new->post_title = __( 'Formidable Style', 'formidable' );
212 212
 				$new->post_name = $new->post_title;
213
-         		$new->menu_order = 1;
214
-         		$new = $this->save( (array) $new);
215
-         		$this->update('default');
216
-
217
-                $post_atts['include'] = $new;
218
-
219
-                $temp_styles = get_posts( $post_atts );
220
-            }
221
-        }
222
-
223
-        $default_values = $this->get_defaults();
224
-        $default_style = false;
225
-
226
-        $styles = array();
227
-        foreach ( $temp_styles as $style ) {
228
-            $this->id = $style->ID;
229
-            if ( $style->menu_order ) {
230
-                if ( $default_style ) {
231
-                    // only return one default
232
-                    $style->menu_order = 0;
233
-                } else {
234
-                    // check for a default style
235
-                    $default_style = $style->ID;
236
-                }
237
-            }
238
-
239
-            $style->post_content = FrmAppHelper::maybe_json_decode($style->post_content);
240
-
241
-            // fill default values
242
-            $style->post_content = $this->override_defaults($style->post_content);
243
-            $style->post_content = wp_parse_args( $style->post_content, $default_values);
213
+		 		$new->menu_order = 1;
214
+		 		$new = $this->save( (array) $new);
215
+		 		$this->update('default');
216
+
217
+				$post_atts['include'] = $new;
218
+
219
+				$temp_styles = get_posts( $post_atts );
220
+			}
221
+		}
222
+
223
+		$default_values = $this->get_defaults();
224
+		$default_style = false;
225
+
226
+		$styles = array();
227
+		foreach ( $temp_styles as $style ) {
228
+			$this->id = $style->ID;
229
+			if ( $style->menu_order ) {
230
+				if ( $default_style ) {
231
+					// only return one default
232
+					$style->menu_order = 0;
233
+				} else {
234
+					// check for a default style
235
+					$default_style = $style->ID;
236
+				}
237
+			}
238
+
239
+			$style->post_content = FrmAppHelper::maybe_json_decode($style->post_content);
240
+
241
+			// fill default values
242
+			$style->post_content = $this->override_defaults($style->post_content);
243
+			$style->post_content = wp_parse_args( $style->post_content, $default_values);
244 244
 
245 245
 			$styles[ $style->ID ] = $style;
246
-        }
246
+		}
247 247
 
248
-        if ( ! $default_style ) {
249
-            $default_style = reset($styles);
248
+		if ( ! $default_style ) {
249
+			$default_style = reset($styles);
250 250
 			$styles[ $default_style->ID ]->menu_order = 1;
251
-        }
251
+		}
252 252
 
253
-        return $styles;
254
-    }
253
+		return $styles;
254
+	}
255 255
 
256 256
 	public function get_default_style( $styles = null ) {
257
-        if ( ! isset($styles) ) {
257
+		if ( ! isset($styles) ) {
258 258
 			$styles = $this->get_all( 'menu_order', 'DESC', 1 );
259
-        }
259
+		}
260 260
 
261
-        foreach ( $styles as $style ) {
262
-            if ( $style->menu_order ) {
263
-                return $style;
264
-            }
265
-        }
266
-    }
261
+		foreach ( $styles as $style ) {
262
+			if ( $style->menu_order ) {
263
+				return $style;
264
+			}
265
+		}
266
+	}
267 267
 
268 268
 	public function override_defaults( $settings ) {
269
-	    if ( ! is_array($settings) ) {
270
-	        return $settings;
271
-	    }
269
+		if ( ! is_array($settings) ) {
270
+			return $settings;
271
+		}
272 272
 
273 273
 		$settings['line_height'] = ( ! isset( $settings['field_height'] ) || $settings['field_height'] == '' || $settings['field_height'] == 'auto' ) ? 'normal' : $settings['field_height'];
274 274
 
275
-	    if ( ! isset($settings['form_desc_size']) && isset($settings['description_font_size']) ) {
276
-	        $settings['form_desc_size'] = $settings['description_font_size'];
277
-	        $settings['form_desc_color'] = $settings['description_color'];
278
-	        $settings['title_color'] = $settings['label_color'];
279
-	    }
275
+		if ( ! isset($settings['form_desc_size']) && isset($settings['description_font_size']) ) {
276
+			$settings['form_desc_size'] = $settings['description_font_size'];
277
+			$settings['form_desc_color'] = $settings['description_color'];
278
+			$settings['title_color'] = $settings['label_color'];
279
+		}
280 280
 
281
-	    if ( ! isset($settings['section_color']) && isset($settings['label_color']) ) {
282
-	        $settings['section_color'] = $settings['label_color'];
283
-	        $settings['section_border_color'] = $settings['border_color'];
284
-	    }
281
+		if ( ! isset($settings['section_color']) && isset($settings['label_color']) ) {
282
+			$settings['section_color'] = $settings['label_color'];
283
+			$settings['section_border_color'] = $settings['border_color'];
284
+		}
285 285
 
286
-	    if ( ! isset($settings['submit_hover_bg_color']) && isset($settings['submit_bg_color']) ) {
287
-	        $settings['submit_hover_bg_color'] = $settings['submit_bg_color'];
288
-	        $settings['submit_hover_color'] = $settings['submit_text_color'];
289
-	        $settings['submit_hover_border_color'] = $settings['submit_border_color'];
286
+		if ( ! isset($settings['submit_hover_bg_color']) && isset($settings['submit_bg_color']) ) {
287
+			$settings['submit_hover_bg_color'] = $settings['submit_bg_color'];
288
+			$settings['submit_hover_color'] = $settings['submit_text_color'];
289
+			$settings['submit_hover_border_color'] = $settings['submit_border_color'];
290 290
 
291
-	        $settings['submit_active_bg_color'] = $settings['submit_bg_color'];
292
-	        $settings['submit_active_color'] = $settings['submit_text_color'];
293
-            $settings['submit_active_border_color'] = $settings['submit_border_color'];
294
-	    }
291
+			$settings['submit_active_bg_color'] = $settings['submit_bg_color'];
292
+			$settings['submit_active_color'] = $settings['submit_text_color'];
293
+			$settings['submit_active_border_color'] = $settings['submit_border_color'];
294
+		}
295 295
 
296
-	    return $settings;
296
+		return $settings;
297 297
 	}
298 298
 
299 299
 	public function get_defaults() {
300
-        return array(
301
-            'theme_css'         => 'ui-lightness',
302
-            'theme_name'        => 'UI Lightness',
300
+		return array(
301
+			'theme_css'         => 'ui-lightness',
302
+			'theme_name'        => 'UI Lightness',
303 303
 
304 304
 			'center_form'       => '',
305
-            'form_width'        => '100%',
306
-            'form_align'        => 'left',
307
-            'direction'         => is_rtl() ? 'rtl' : 'ltr',
308
-            'fieldset'          => '0px',
309
-            'fieldset_color'    => '000000',
310
-            'fieldset_padding'  => '0 0 15px 0',
311
-            'fieldset_bg_color' => '',
312
-
313
-            'title_size'        => '20px',
314
-            'title_color'       => '444444',
305
+			'form_width'        => '100%',
306
+			'form_align'        => 'left',
307
+			'direction'         => is_rtl() ? 'rtl' : 'ltr',
308
+			'fieldset'          => '0px',
309
+			'fieldset_color'    => '000000',
310
+			'fieldset_padding'  => '0 0 15px 0',
311
+			'fieldset_bg_color' => '',
312
+
313
+			'title_size'        => '20px',
314
+			'title_color'       => '444444',
315 315
 			'title_margin_top'  => '10px',
316 316
 			'title_margin_bottom' => '10px',
317
-            'form_desc_size'    => '14px',
318
-            'form_desc_color'   => '666666',
317
+			'form_desc_size'    => '14px',
318
+			'form_desc_color'   => '666666',
319 319
 			'form_desc_margin_top' => '10px',
320 320
 			'form_desc_margin_bottom' => '25px',
321 321
 
322
-            'font'              => '"Lucida Grande","Lucida Sans Unicode",Tahoma,sans-serif',
323
-            'font_size'         => '14px',
324
-            'label_color'       => '444444',
325
-            'weight'            => 'bold',
326
-            'position'          => 'none',
327
-            'align'             => 'left',
328
-            'width'             => '150px',
329
-            'required_color'    => 'B94A48',
330
-            'required_weight'   => 'bold',
331
-            'label_padding'     => '0 0 3px 0',
332
-
333
-            'description_font_size' => '12px',
334
-            'description_color' => '666666',
335
-            'description_weight' => 'normal',
336
-            'description_style' => 'normal',
337
-            'description_align' => 'left',
322
+			'font'              => '"Lucida Grande","Lucida Sans Unicode",Tahoma,sans-serif',
323
+			'font_size'         => '14px',
324
+			'label_color'       => '444444',
325
+			'weight'            => 'bold',
326
+			'position'          => 'none',
327
+			'align'             => 'left',
328
+			'width'             => '150px',
329
+			'required_color'    => 'B94A48',
330
+			'required_weight'   => 'bold',
331
+			'label_padding'     => '0 0 3px 0',
332
+
333
+			'description_font_size' => '12px',
334
+			'description_color' => '666666',
335
+			'description_weight' => 'normal',
336
+			'description_style' => 'normal',
337
+			'description_align' => 'left',
338 338
 			'description_margin' => '0',
339 339
 
340
-            'field_font_size'   => '14px',
341
-            'field_height'      => '32px',
342
-            'line_height'       => 'normal',
343
-            'field_width'       => '100%',
344
-            'auto_width'        => false,
345
-            'field_pad'         => '6px 10px',
346
-            'field_margin'      => '20px',
340
+			'field_font_size'   => '14px',
341
+			'field_height'      => '32px',
342
+			'line_height'       => 'normal',
343
+			'field_width'       => '100%',
344
+			'auto_width'        => false,
345
+			'field_pad'         => '6px 10px',
346
+			'field_margin'      => '20px',
347 347
 			'field_weight' => 'normal',
348
-            'text_color'        => '555555',
349
-            //'border_color_hv'   => 'cccccc',
350
-            'border_color'      => 'cccccc',
351
-            'field_border_width' => '1px',
352
-            'field_border_style' => 'solid',
353
-
354
-            'bg_color'          => 'ffffff',
355
-            //'bg_color_hv'       => 'ffffff',
348
+			'text_color'        => '555555',
349
+			//'border_color_hv'   => 'cccccc',
350
+			'border_color'      => 'cccccc',
351
+			'field_border_width' => '1px',
352
+			'field_border_style' => 'solid',
353
+
354
+			'bg_color'          => 'ffffff',
355
+			//'bg_color_hv'       => 'ffffff',
356 356
 			'remove_box_shadow' => '',
357
-            'bg_color_active'   => 'ffffff',
357
+			'bg_color_active'   => 'ffffff',
358 358
 			'border_color_active' => '66afe9',
359 359
 			'remove_box_shadow_active' => '',
360
-            'text_color_error'  => '444444',
361
-            'bg_color_error'    => 'ffffff',
360
+			'text_color_error'  => '444444',
361
+			'bg_color_error'    => 'ffffff',
362 362
 			'border_color_error' => 'B94A48',
363 363
 			'border_width_error' => '1px',
364 364
 			'border_style_error' => 'solid',
365
-            'bg_color_disabled' => 'ffffff',
366
-            'border_color_disabled' => 'E5E5E5',
367
-            'text_color_disabled' => 'A1A1A1',
368
-
369
-            'radio_align'       => 'block',
370
-            'check_align'       => 'block',
371
-            'check_font_size'   => '13px',
372
-            'check_label_color' => '444444',
373
-            'check_weight'      => 'normal',
374
-
375
-            'section_font_size' => '18px',
376
-            'section_color'     => '444444',
377
-            'section_weight'    => 'bold',
378
-            'section_pad'       => '15px 0 3px 0',
379
-            'section_mar_top'   => '15px',
365
+			'bg_color_disabled' => 'ffffff',
366
+			'border_color_disabled' => 'E5E5E5',
367
+			'text_color_disabled' => 'A1A1A1',
368
+
369
+			'radio_align'       => 'block',
370
+			'check_align'       => 'block',
371
+			'check_font_size'   => '13px',
372
+			'check_label_color' => '444444',
373
+			'check_weight'      => 'normal',
374
+
375
+			'section_font_size' => '18px',
376
+			'section_color'     => '444444',
377
+			'section_weight'    => 'bold',
378
+			'section_pad'       => '15px 0 3px 0',
379
+			'section_mar_top'   => '15px',
380 380
 			'section_mar_bottom' => '12px',
381
-            'section_bg_color'  => '',
382
-            'section_border_color' => 'e8e8e8',
383
-            'section_border_width' => '2px',
384
-            'section_border_style' => 'solid',
385
-            'section_border_loc' => '-top',
386
-            'collapse_icon'     => '6',
387
-            'collapse_pos'      => 'after',
388
-            'repeat_icon'       => '1',
389
-
390
-            'submit_style'      => false,
391
-            'submit_font_size'  => '14px',
392
-            'submit_width'      => 'auto',
393
-            'submit_height'     => 'auto',
394
-            'submit_bg_color'   => 'ffffff',
395
-            'submit_border_color' => 'cccccc',
396
-            'submit_border_width' => '1px',
397
-            'submit_text_color' => '444444',
398
-            'submit_weight'     => 'normal',
399
-            'submit_border_radius' => '4px',
400
-            'submit_bg_img'     => '',
401
-            'submit_margin'     => '10px',
402
-            'submit_padding'    => '6px 11px',
403
-            'submit_shadow_color' => 'eeeeee',
404
-            'submit_hover_bg_color' => 'efefef',
405
-            'submit_hover_color' => '444444',
406
-            'submit_hover_border_color' => 'cccccc',
407
-            'submit_active_bg_color' => 'efefef',
408
-            'submit_active_color' => '444444',
409
-            'submit_active_border_color' => 'cccccc',
410
-
411
-            'border_radius'     => '4px',
412
-            'error_bg'          => 'F2DEDE',
413
-            'error_border'      => 'EBCCD1',
414
-            'error_text'        => 'B94A48',
415
-            'error_font_size'   => '14px',
416
-
417
-            'success_bg_color'  => 'DFF0D8',
418
-            'success_border_color' => 'D6E9C6',
419
-            'success_text_color' => '468847',
420
-            'success_font_size' => '14px',
421
-
422
-            'important_style'   => false,
381
+			'section_bg_color'  => '',
382
+			'section_border_color' => 'e8e8e8',
383
+			'section_border_width' => '2px',
384
+			'section_border_style' => 'solid',
385
+			'section_border_loc' => '-top',
386
+			'collapse_icon'     => '6',
387
+			'collapse_pos'      => 'after',
388
+			'repeat_icon'       => '1',
389
+
390
+			'submit_style'      => false,
391
+			'submit_font_size'  => '14px',
392
+			'submit_width'      => 'auto',
393
+			'submit_height'     => 'auto',
394
+			'submit_bg_color'   => 'ffffff',
395
+			'submit_border_color' => 'cccccc',
396
+			'submit_border_width' => '1px',
397
+			'submit_text_color' => '444444',
398
+			'submit_weight'     => 'normal',
399
+			'submit_border_radius' => '4px',
400
+			'submit_bg_img'     => '',
401
+			'submit_margin'     => '10px',
402
+			'submit_padding'    => '6px 11px',
403
+			'submit_shadow_color' => 'eeeeee',
404
+			'submit_hover_bg_color' => 'efefef',
405
+			'submit_hover_color' => '444444',
406
+			'submit_hover_border_color' => 'cccccc',
407
+			'submit_active_bg_color' => 'efefef',
408
+			'submit_active_color' => '444444',
409
+			'submit_active_border_color' => 'cccccc',
410
+
411
+			'border_radius'     => '4px',
412
+			'error_bg'          => 'F2DEDE',
413
+			'error_border'      => 'EBCCD1',
414
+			'error_text'        => 'B94A48',
415
+			'error_font_size'   => '14px',
416
+
417
+			'success_bg_color'  => 'DFF0D8',
418
+			'success_border_color' => 'D6E9C6',
419
+			'success_text_color' => '468847',
420
+			'success_font_size' => '14px',
421
+
422
+			'important_style'   => false,
423 423
 
424 424
 			'progress_bg_color'     => 'dddddd',
425 425
 			'progress_active_color' => 'ffffff',
@@ -429,9 +429,9 @@  discard block
 block discarded – undo
429 429
 			'progress_border_size'  => '2px',
430 430
 			'progress_size'         => '30px',
431 431
 
432
-            'custom_css'        => '',
433
-        );
434
-    }
432
+			'custom_css'        => '',
433
+		);
434
+	}
435 435
 
436 436
 	public function get_field_name( $field_name, $post_field = 'post_content' ) {
437 437
 		return 'frm_style_setting' . ( empty( $post_field ) ? '' : '[' . $post_field . ']' ) . '[' . $field_name . ']';
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
         $max_slug_value = 2147483647;
17 17
         $min_slug_value = 37; // we want to have at least 2 characters in the slug
18
-        $key = base_convert( rand($min_slug_value, $max_slug_value), 10, 36 );
18
+        $key = base_convert( rand( $min_slug_value, $max_slug_value ), 10, 36 );
19 19
 
20 20
         $style = array(
21 21
             'post_type'     => FrmStylesController::$post_type,
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     public function update( $id = 'default' ) {
42 42
  		$all_instances = $this->get_all();
43 43
 
44
- 		if ( empty($id) ) {
44
+ 		if ( empty( $id ) ) {
45 45
  		     $new_style = (array) $this->get_new();
46 46
  		     $all_instances[] = $new_style;
47 47
  		}
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
         $action_ids = array();
50 50
 
51 51
  		foreach ( $all_instances as $number => $new_instance ) {
52
- 			$new_instance = stripslashes_deep( (array) $new_instance);
52
+ 			$new_instance = stripslashes_deep( (array) $new_instance );
53 53
  			$this->id = $new_instance['ID'];
54
- 			if ( $id != $this->id || ! $_POST || ! isset($_POST['frm_style_setting']) ) {
55
-				$all_instances[ $number ] = $new_instance;
54
+ 			if ( $id != $this->id || ! $_POST || ! isset( $_POST['frm_style_setting'] ) ) {
55
+				$all_instances[$number] = $new_instance;
56 56
 
57
- 			    if ( $new_instance['menu_order'] && $_POST && empty($_POST['prev_menu_order']) && isset($_POST['frm_style_setting']['menu_order']) ) {
57
+ 			    if ( $new_instance['menu_order'] && $_POST && empty( $_POST['prev_menu_order'] ) && isset( $_POST['frm_style_setting']['menu_order'] ) ) {
58 58
  			        // this style was set to default, so remove default setting on previous default style
59 59
  			        $new_instance['menu_order'] = 0;
60
- 			        $action_ids[] = $this->save($new_instance);
60
+ 			        $action_ids[] = $this->save( $new_instance );
61 61
  			    }
62 62
 
63 63
  			    // don't continue if not saving this style
@@ -67,33 +67,33 @@  discard block
 block discarded – undo
67 67
  			$new_instance['post_title'] = sanitize_text_field( $_POST['frm_style_setting']['post_title'] );
68 68
  			$new_instance['post_content'] = $_POST['frm_style_setting']['post_content'];
69 69
  			$new_instance['post_type']  = FrmStylesController::$post_type;
70
-            $new_instance['post_status']  = 'publish';
70
+            $new_instance['post_status'] = 'publish';
71 71
 			$new_instance['menu_order']  = isset( $_POST['frm_style_setting']['menu_order'] ) ? absint( $_POST['frm_style_setting']['menu_order'] ) : 0;
72 72
 
73
-            if ( empty($id) ) {
73
+            if ( empty( $id ) ) {
74 74
                 $new_instance['post_name'] = $new_instance['post_title'];
75 75
             }
76 76
 
77 77
             $default_settings = $this->get_defaults();
78 78
 
79 79
             foreach ( $default_settings as $setting => $default ) {
80
-				if ( ! isset( $new_instance['post_content'][ $setting ] ) ) {
81
-					$new_instance['post_content'][ $setting ] = $default;
80
+				if ( ! isset( $new_instance['post_content'][$setting] ) ) {
81
+					$new_instance['post_content'][$setting] = $default;
82 82
 				}
83 83
 
84 84
 				if ( strpos( $setting, 'color' ) !== false || in_array( $setting, array( 'error_bg', 'error_border', 'error_text' ) ) ) {
85 85
                     //if is a color
86
-					$new_instance['post_content'][ $setting ] = str_replace( '#', '', $new_instance['post_content'][ $setting ] );
87
-				} else if ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ) ) && ! isset( $new_instance['post_content'][ $setting ] ) ) {
88
-					$new_instance['post_content'][ $setting ] = 0;
86
+					$new_instance['post_content'][$setting] = str_replace( '#', '', $new_instance['post_content'][$setting] );
87
+				} else if ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ) ) && ! isset( $new_instance['post_content'][$setting] ) ) {
88
+					$new_instance['post_content'][$setting] = 0;
89 89
                 } else if ( $setting == 'font' ) {
90
-                	$new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] );
90
+                	$new_instance['post_content'][$setting] = $this->force_balanced_quotation( $new_instance['post_content'][$setting] );
91 91
                 }
92 92
             }
93 93
 
94
-			$all_instances[ $number ] = $new_instance;
94
+			$all_instances[$number] = $new_instance;
95 95
 
96
-            $action_ids[] = $this->save($new_instance);
96
+            $action_ids[] = $this->save( $new_instance );
97 97
 
98 98
  		}
99 99
 
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
      */
108 108
 	public function save_settings() {
109 109
 		$filename = FrmAppHelper::plugin_path() . '/css/custom_theme.css.php';
110
-		update_option( 'frm_last_style_update', date('njGi') );
110
+		update_option( 'frm_last_style_update', date( 'njGi' ) );
111 111
 
112
-        if ( ! is_file($filename) ) {
112
+        if ( ! is_file( $filename ) ) {
113 113
             return;
114 114
         }
115 115
 
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
 		) );
124 124
 		$create_file->create_file( $css );
125 125
 
126
-        update_option('frmpro_css', $css);
126
+        update_option( 'frmpro_css', $css );
127 127
 
128
-        set_transient('frmpro_css', $css);
128
+        set_transient( 'frmpro_css', $css );
129 129
 	}
130 130
 
131 131
 	private function get_css_content( $filename ) {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	}
158 158
 
159 159
 	public function destroy( $id ) {
160
-        return wp_delete_post($id);
160
+        return wp_delete_post( $id );
161 161
     }
162 162
 
163 163
     public function get_one() {
@@ -171,19 +171,19 @@  discard block
 block discarded – undo
171 171
             return $style;
172 172
         }
173 173
 
174
-        $style = get_post($this->id);
174
+        $style = get_post( $this->id );
175 175
 
176 176
         if ( ! $style ) {
177 177
             return $style;
178 178
         }
179 179
 
180
-        $style->post_content = FrmAppHelper::maybe_json_decode($style->post_content);
180
+        $style->post_content = FrmAppHelper::maybe_json_decode( $style->post_content );
181 181
 
182 182
         $default_values = $this->get_defaults();
183 183
 
184 184
         // fill default values
185
-        $style->post_content = $this->override_defaults($style->post_content);
186
-        $style->post_content = wp_parse_args( $style->post_content, $default_values);
185
+        $style->post_content = $this->override_defaults( $style->post_content );
186
+        $style->post_content = wp_parse_args( $style->post_content, $default_values );
187 187
 
188 188
         return $style;
189 189
     }
@@ -199,20 +199,20 @@  discard block
 block discarded – undo
199 199
 
200 200
 		$temp_styles = FrmDb::check_cache( serialize( $post_atts ), 'frm_styles', $post_atts, 'get_posts' );
201 201
 
202
-        if ( empty($temp_styles) ) {
202
+        if ( empty( $temp_styles ) ) {
203 203
             global $wpdb;
204 204
             // make sure there wasn't a conflict with the query
205 205
 			$query = $wpdb->prepare( 'SELECT * FROM ' . $wpdb->posts . ' WHERE post_type=%s AND post_status=%s ORDER BY post_title ASC LIMIT 99', FrmStylesController::$post_type, 'publish' );
206
-            $temp_styles = FrmDb::check_cache('frm_backup_style_check', 'frm_styles', $query, 'get_results');
206
+            $temp_styles = FrmDb::check_cache( 'frm_backup_style_check', 'frm_styles', $query, 'get_results' );
207 207
 
208
-            if ( empty($temp_styles) ) {
208
+            if ( empty( $temp_styles ) ) {
209 209
                 // create a new style if there are none
210 210
          		$new = $this->get_new();
211 211
 				$new->post_title = __( 'Formidable Style', 'formidable' );
212 212
 				$new->post_name = $new->post_title;
213 213
          		$new->menu_order = 1;
214
-         		$new = $this->save( (array) $new);
215
-         		$this->update('default');
214
+         		$new = $this->save( (array) $new );
215
+         		$this->update( 'default' );
216 216
 
217 217
                 $post_atts['include'] = $new;
218 218
 
@@ -236,25 +236,25 @@  discard block
 block discarded – undo
236 236
                 }
237 237
             }
238 238
 
239
-            $style->post_content = FrmAppHelper::maybe_json_decode($style->post_content);
239
+            $style->post_content = FrmAppHelper::maybe_json_decode( $style->post_content );
240 240
 
241 241
             // fill default values
242
-            $style->post_content = $this->override_defaults($style->post_content);
243
-            $style->post_content = wp_parse_args( $style->post_content, $default_values);
242
+            $style->post_content = $this->override_defaults( $style->post_content );
243
+            $style->post_content = wp_parse_args( $style->post_content, $default_values );
244 244
 
245
-			$styles[ $style->ID ] = $style;
245
+			$styles[$style->ID] = $style;
246 246
         }
247 247
 
248 248
         if ( ! $default_style ) {
249
-            $default_style = reset($styles);
250
-			$styles[ $default_style->ID ]->menu_order = 1;
249
+            $default_style = reset( $styles );
250
+			$styles[$default_style->ID]->menu_order = 1;
251 251
         }
252 252
 
253 253
         return $styles;
254 254
     }
255 255
 
256 256
 	public function get_default_style( $styles = null ) {
257
-        if ( ! isset($styles) ) {
257
+        if ( ! isset( $styles ) ) {
258 258
 			$styles = $this->get_all( 'menu_order', 'DESC', 1 );
259 259
         }
260 260
 
@@ -266,24 +266,24 @@  discard block
 block discarded – undo
266 266
     }
267 267
 
268 268
 	public function override_defaults( $settings ) {
269
-	    if ( ! is_array($settings) ) {
269
+	    if ( ! is_array( $settings ) ) {
270 270
 	        return $settings;
271 271
 	    }
272 272
 
273 273
 		$settings['line_height'] = ( ! isset( $settings['field_height'] ) || $settings['field_height'] == '' || $settings['field_height'] == 'auto' ) ? 'normal' : $settings['field_height'];
274 274
 
275
-	    if ( ! isset($settings['form_desc_size']) && isset($settings['description_font_size']) ) {
275
+	    if ( ! isset( $settings['form_desc_size'] ) && isset( $settings['description_font_size'] ) ) {
276 276
 	        $settings['form_desc_size'] = $settings['description_font_size'];
277 277
 	        $settings['form_desc_color'] = $settings['description_color'];
278 278
 	        $settings['title_color'] = $settings['label_color'];
279 279
 	    }
280 280
 
281
-	    if ( ! isset($settings['section_color']) && isset($settings['label_color']) ) {
281
+	    if ( ! isset( $settings['section_color'] ) && isset( $settings['label_color'] ) ) {
282 282
 	        $settings['section_color'] = $settings['label_color'];
283 283
 	        $settings['section_border_color'] = $settings['border_color'];
284 284
 	    }
285 285
 
286
-	    if ( ! isset($settings['submit_hover_bg_color']) && isset($settings['submit_bg_color']) ) {
286
+	    if ( ! isset( $settings['submit_hover_bg_color'] ) && isset( $settings['submit_bg_color'] ) ) {
287 287
 	        $settings['submit_hover_bg_color'] = $settings['submit_bg_color'];
288 288
 	        $settings['submit_hover_color'] = $settings['submit_text_color'];
289 289
 	        $settings['submit_hover_border_color'] = $settings['submit_border_color'];
Please login to merge, or discard this patch.