Completed
Branch FET/11104/replace-deprecated-b... (15008a)
by
unknown
13:29 queued 25s
created
core/admin/templates/admin_wrapper.template.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <div class="wrap espresso-admin">
2 2
 
3
-	<h1><?php esc_attr_e( 'Event Espresso', 'event_espresso' ); ?>&nbsp;-&nbsp;<?php echo $admin_page_title; ?></h1>
3
+	<h1><?php esc_attr_e('Event Espresso', 'event_espresso'); ?>&nbsp;-&nbsp;<?php echo $admin_page_title; ?></h1>
4 4
 
5 5
 	<div id="ajax-notices-container"></div>
6 6
 
7 7
 	<?php echo $nav_tabs; ?>
8 8
 
9 9
 	<?php
10
-	do_action( 'AHEE__admin_wrapper__template__before_admin_page_content' );
10
+	do_action('AHEE__admin_wrapper__template__before_admin_page_content');
11 11
 	echo $before_admin_page_content;
12 12
 	echo $admin_page_content;
13 13
 	echo $after_admin_page_content;
14
-	do_action( 'AHEE__admin_wrapper__template__after_admin_page_content' );
14
+	do_action('AHEE__admin_wrapper__template__after_admin_page_content');
15 15
 	?>
16 16
 
17 17
 </div>
Please login to merge, or discard this patch.
core/admin/templates/admin_wrapper_ajax.template.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <div class="wrap espresso-admin">
2
-	<h1><?php esc_attr_e( 'Event Espresso', 'event_espresso' ); ?>&nbsp;-&nbsp;<?php echo $admin_page_title; ?></h1>
2
+	<h1><?php esc_attr_e('Event Espresso', 'event_espresso'); ?>&nbsp;-&nbsp;<?php echo $admin_page_title; ?></h1>
3 3
 
4
-	<div class="ee-notices"><?php echo isset( $ajax_notices ) ? $ajax_notices : ''; ?></div>
4
+	<div class="ee-notices"><?php echo isset($ajax_notices) ? $ajax_notices : ''; ?></div>
5 5
 	<?php
6
-	do_action( 'AHEE__admin_wrapper__template__before_admin_page_content' );
6
+	do_action('AHEE__admin_wrapper__template__before_admin_page_content');
7 7
 	echo $before_admin_page_content;
8 8
 	echo $admin_page_content;
9 9
 	echo $after_admin_page_content;
10
-	do_action( 'AHEE__admin_wrapper__template__after_admin_page_content' );
10
+	do_action('AHEE__admin_wrapper__template__after_admin_page_content');
11 11
 	?>
12 12
 </div>
13 13
 <!-- espresso-admin -->
14 14
\ No newline at end of file
Please login to merge, or discard this patch.
admin_pages/transactions/templates/txn_admin_details_header.template.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@
 block discarded – undo
1 1
 
2
-		<h3 class="txn-navigation-strip"><?php echo $previous_transaction . '&nbsp;'; echo __( 'Transaction # ', 'event_espresso' ) . $txn_nmbr['value']; echo '&nbsp;' . $next_transaction; ?></h3>
3
-		<h2 id="txn-date-h2" class="txn-date-h2"><?php echo $txn_datetime['value'];?></h2>
2
+		<h3 class="txn-navigation-strip"><?php echo $previous_transaction.'&nbsp;'; echo __('Transaction # ', 'event_espresso').$txn_nmbr['value']; echo '&nbsp;'.$next_transaction; ?></h3>
3
+		<h2 id="txn-date-h2" class="txn-date-h2"><?php echo $txn_datetime['value']; ?></h2>
4 4
 
5 5
 		<?php echo $send_payment_reminder_button; ?>
6 6
 		<h2 id="txn-status-h2" class="txn-status-h2">
7
-			<?php echo __( 'Transaction Status: ', 'event_espresso' );?><span id="txn-status" class="<?php echo $txn_status['class'];?>"><?php echo $txn_status['value'];?></span>
7
+			<?php echo __('Transaction Status: ', 'event_espresso'); ?><span id="txn-status" class="<?php echo $txn_status['class']; ?>"><?php echo $txn_status['value']; ?></span>
8 8
 		</h2>
9 9
 
10 10
 	<?php $attributes = $amount_due ? 'class="txn-amount-due-h2"' : 'class="txn-amount-due-h2 hidden"'; ?>
11 11
 		<h2 id="txn-amount-due-h2" <?php echo $attributes; ?>>
12
-			<?php echo __( 'Total Amount Due: ', 'event_espresso' );?><span id="txn-admin-total-amount-due" class="<?php echo $amount_due_class;?>"><?php echo $amount_due;?></span>
12
+			<?php echo __('Total Amount Due: ', 'event_espresso'); ?><span id="txn-admin-total-amount-due" class="<?php echo $amount_due_class; ?>"><?php echo $amount_due; ?></span>
13 13
 		</h2>
14 14
 
15 15
 		<h3 id="txn-selected-method-of-payment-h3" class="txn-selected-method-of-payment-h3">
16
-			<?php echo __( 'Last Method of Payment: ', 'event_espresso' );?><?php echo $method_of_payment_name;?>
16
+			<?php echo __('Last Method of Payment: ', 'event_espresso'); ?><?php echo $method_of_payment_name; ?>
17 17
 		</h3>
18 18
 
19 19
 
Please login to merge, or discard this patch.
admin_pages/payments/help_tabs/payment_methods_overview.help_tab.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -2,40 +2,40 @@
 block discarded – undo
2 2
 <p>
3 3
 <?php _e('This page shows all available payment methods for Event Espresso.', 'event_espresso'); ?>
4 4
 </p>
5
-<p><strong><?php _e('Common Settings', 'event_espresso' )?></strong></p>
5
+<p><strong><?php _e('Common Settings', 'event_espresso')?></strong></p>
6 6
 <ul>
7 7
 	<li>
8
-		<strong><?php _e( 'Name', 'event_espresso' );?></strong><br>
9
-		<?php _e( 'The name of the payment method as customers see it in the registration form, in emails, in receipts, etc.', 'event_espresso' );?>
8
+		<strong><?php _e('Name', 'event_espresso'); ?></strong><br>
9
+		<?php _e('The name of the payment method as customers see it in the registration form, in emails, in receipts, etc.', 'event_espresso'); ?>
10 10
 	</li>
11 11
 	<li>
12
-		<strong><?php _e( 'Description', 'event_espresso' );?></strong><br/>
13
-		<?php _e( 'The description of how to use the payment method as customers will see it. This is mostly only seen during registration.', 'event_espresso' );?>
12
+		<strong><?php _e('Description', 'event_espresso'); ?></strong><br/>
13
+		<?php _e('The description of how to use the payment method as customers will see it. This is mostly only seen during registration.', 'event_espresso'); ?>
14 14
 	</li>
15
-	<li><strong><?php _e( 'Admin-Only Name', 'event_espresso' );?></strong><br/>
16
-		<?php _e( 'The name of the payment method as seen internally by site administrators and staff.', 'event_espresso' );?>
15
+	<li><strong><?php _e('Admin-Only Name', 'event_espresso'); ?></strong><br/>
16
+		<?php _e('The name of the payment method as seen internally by site administrators and staff.', 'event_espresso'); ?>
17 17
 	</li>
18 18
 	<li>
19
-		<strong><?php _e( 'Admin-Only Description', 'event_espresso' );?></strong><br/>
20
-		<?php _e( 'The description of the payment method as seen internally by site administrators and staff.', 'event_espresso' );?>
19
+		<strong><?php _e('Admin-Only Description', 'event_espresso'); ?></strong><br/>
20
+		<?php _e('The description of the payment method as seen internally by site administrators and staff.', 'event_espresso'); ?>
21 21
 	</li>
22 22
 	<li>
23
-		<strong><?php _e( 'Debug (sandbox) Mode', 'event_espresso' );?></strong><br/>
24
-		<?php _e( 'Many payment methods have a debug/sandbox mode where payments are not processed but are only simulated. This is helpful when setup and debugging.', 'event_espresso' );?>
23
+		<strong><?php _e('Debug (sandbox) Mode', 'event_espresso'); ?></strong><br/>
24
+		<?php _e('Many payment methods have a debug/sandbox mode where payments are not processed but are only simulated. This is helpful when setup and debugging.', 'event_espresso'); ?>
25 25
 	</li>
26 26
 	<li>
27
-		<strong><?php _e( 'Open by Default', 'event_espresso' );?></strong><br/>
28
-		<?php _e( 'If checked, this payment method will be selected by default (assuming no other valid payment methods are also marked as open by default.)', 'event_espresso' );?>
27
+		<strong><?php _e('Open by Default', 'event_espresso'); ?></strong><br/>
28
+		<?php _e('If checked, this payment method will be selected by default (assuming no other valid payment methods are also marked as open by default.)', 'event_espresso'); ?>
29 29
 	</li>
30 30
 	<li>
31
-		<strong><?php _e( 'Button URL', 'event_espresso' );?></strong><br/>
32
-		<?php printf( __( 'The URL of the button image for this payment method in the registration process. You may use any uploaded image on your website (click %s next to the field to select). If left blank, the default button image will be used.', 'event_espresso' ), '<img src="' . admin_url('images/media-button-image.gif') . '">' );?>
31
+		<strong><?php _e('Button URL', 'event_espresso'); ?></strong><br/>
32
+		<?php printf(__('The URL of the button image for this payment method in the registration process. You may use any uploaded image on your website (click %s next to the field to select). If left blank, the default button image will be used.', 'event_espresso'), '<img src="'.admin_url('images/media-button-image.gif').'">'); ?>
33 33
 	</li>
34
-	<li><strong><?php _e( 'Usable From', 'event_espresso' );?></strong><br/>
35
-	<?php _e( 'Where this payment method can be used from.', 'event_espresso' );?>
34
+	<li><strong><?php _e('Usable From', 'event_espresso'); ?></strong><br/>
35
+	<?php _e('Where this payment method can be used from.', 'event_espresso'); ?>
36 36
 		<ul>
37
-			<li><?php _e( 'Front-end Registration Page: the payment method will appear as an option during the normal registration process to customers and they can use it to process payments.', 'event_espresso' );?></li>
38
-			<li><?php _e( 'Admin Registration Page: when recording payments made from the transaction admin page, the payment method will appear as an option. Note: currently payments can only be RECORDED from the admin, they cannot be PROCESSED.', 'event_espresso' );?></li>
37
+			<li><?php _e('Front-end Registration Page: the payment method will appear as an option during the normal registration process to customers and they can use it to process payments.', 'event_espresso'); ?></li>
38
+			<li><?php _e('Admin Registration Page: when recording payments made from the transaction admin page, the payment method will appear as an option. Note: currently payments can only be RECORDED from the admin, they cannot be PROCESSED.', 'event_espresso'); ?></li>
39 39
 		</ul>
40 40
 	</li>
41 41
 </ul>
Please login to merge, or discard this patch.
Mijireh/help_tabs/payment_methods_overview_mijireh.help_tab.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1
-<p><strong><?php _e( 'Mijireh', 'event_espresso' ); ?></strong></p>
1
+<p><strong><?php _e('Mijireh', 'event_espresso'); ?></strong></p>
2 2
 <p>
3
-	<?php _e( 'Adjust the settings for the Mijireh payment gateway.', 'event_espresso' ); ?>
3
+	<?php _e('Adjust the settings for the Mijireh payment gateway.', 'event_espresso'); ?>
4 4
 </p>
5 5
 <p>
6 6
 	<?php
7 7
 	printf(
8
-		__( 'Mijireh is basically a middle-man between Event Espresso and over 90 payment gateways. Most of the configuration occurs on %1$sMijireh\' website%2$s, where you configure your Mijireh store with the %3$spayment gateway of your choice%4$s.', 'event_espresso' ),
8
+		__('Mijireh is basically a middle-man between Event Espresso and over 90 payment gateways. Most of the configuration occurs on %1$sMijireh\' website%2$s, where you configure your Mijireh store with the %3$spayment gateway of your choice%4$s.', 'event_espresso'),
9 9
 		'<a href="http://www.mijireh.com/" target="_blank">',
10 10
 		'</a>',
11 11
 		'<a href="http://www.mijireh.com/docs/payment-gateways/" target="_blank">',
@@ -14,26 +14,26 @@  discard block
 block discarded – undo
14 14
 	?>
15 15
 </p>
16 16
 <p>
17
-	<?php _e( 'For information on what currencies you can use with Mijireh, please consult the payment gateway Mijireh is setup to use.', 'event_espresso' ) ?>
17
+	<?php _e('For information on what currencies you can use with Mijireh, please consult the payment gateway Mijireh is setup to use.', 'event_espresso') ?>
18 18
 </p>
19 19
 <ul>
20 20
 	<li>
21
-		<strong><?php _e( 'Mijireh Access Key', 'event_espresso' ); ?></strong><br/>
21
+		<strong><?php _e('Mijireh Access Key', 'event_espresso'); ?></strong><br/>
22 22
 		<?php
23 23
 		printf(
24
-			__( 'Enter your Access Key for Mijireh. Your Access Key can be found in your %1$sMijireh account dashboard%2$s.', 'event_espresso' ),
24
+			__('Enter your Access Key for Mijireh. Your Access Key can be found in your %1$sMijireh account dashboard%2$s.', 'event_espresso'),
25 25
 			'<a href="https://secure.mijireh.com/login" target="_blank">',
26 26
 			'</a>'
27 27
 		);
28 28
 		?>
29 29
 	</li>
30 30
 	<li>
31
-		<strong><?php _e( 'Button Image URL', 'event_espresso' ); ?></strong><br/>
32
-		<?php _e( 'Change the image that is used for this payment gateway.', 'event_espresso' ); ?>
31
+		<strong><?php _e('Button Image URL', 'event_espresso'); ?></strong><br/>
32
+		<?php _e('Change the image that is used for this payment gateway.', 'event_espresso'); ?>
33 33
 	</li>
34 34
 </ul>
35
-<p><strong><?php _e( 'Mijireh Checkout Page Design', 'event_espresso' ); ?></strong></p>
35
+<p><strong><?php _e('Mijireh Checkout Page Design', 'event_espresso'); ?></strong></p>
36 36
 <p>
37
-	<?php _e( "As you are probably aware, when users pay with Mijireh Payment Method, they are taken to a secure offsite page, hosted by Mijireh. This page can easily be made to have the look-and-feel of your website through a process called 'slurping', where Mijireh 'slurps' up your website's design and uses it on their checkout page.", 'event_espresso' ); ?>
38
-	<?php printf( __( "In order to do this, we automatically create a new WordPress page which is designed to be slurped by Mijireh. You can customize the page like any other, but the page must contain Mijireh's special '{{mijireh-checkout-form}}' shortcode. Once you have finished designing the page, publish it, and %s then click the special 'slurp now' button%s. Mijireh may take several minutes to slurp the page. Once Mijireh is finished slurping, you can delete the page, or mark it as a draft.", 'event_espresso' ), '<a href="http://ee-screenshots.s3.amazonaws.com/ee4/event-espresso-mijireh-slurp-page-example.jpg" target="_blank">', '</a>' ); ?>
37
+	<?php _e("As you are probably aware, when users pay with Mijireh Payment Method, they are taken to a secure offsite page, hosted by Mijireh. This page can easily be made to have the look-and-feel of your website through a process called 'slurping', where Mijireh 'slurps' up your website's design and uses it on their checkout page.", 'event_espresso'); ?>
38
+	<?php printf(__("In order to do this, we automatically create a new WordPress page which is designed to be slurped by Mijireh. You can customize the page like any other, but the page must contain Mijireh's special '{{mijireh-checkout-form}}' shortcode. Once you have finished designing the page, publish it, and %s then click the special 'slurp now' button%s. Mijireh may take several minutes to slurp the page. Once Mijireh is finished slurping, you can delete the page, or mark it as a draft.", 'event_espresso'), '<a href="http://ee-screenshots.s3.amazonaws.com/ee4/event-espresso-mijireh-slurp-page-example.jpg" target="_blank">', '</a>'); ?>
39 39
 </p>
40 40
\ No newline at end of file
Please login to merge, or discard this patch.
caffeinated/admin/hooks/Global_EE_Caf_Hooks.class.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -36,25 +36,25 @@  discard block
 block discarded – undo
36 36
 
37 37
 
38 38
 	private function _do_hooks() {
39
-		add_filter('FHEE_show_sponsors_meta_box', '__return_false', 10 );
40
-		add_filter('FHEE_show_ratings_request_meta_box', '__return_false', 10 );
41
-		add_filter('FHEE__EE_Admin_Page_Core__load_global_scripts_styles__loader_containers', array( $this, 'forums_lazy_loading'), 10 );
42
-		add_action('AHEE__EE_Admin_Page__espresso_news_post_box__after_content', array( $this, 'extra_news_box_content' ), 10 );
39
+		add_filter('FHEE_show_sponsors_meta_box', '__return_false', 10);
40
+		add_filter('FHEE_show_ratings_request_meta_box', '__return_false', 10);
41
+		add_filter('FHEE__EE_Admin_Page_Core__load_global_scripts_styles__loader_containers', array($this, 'forums_lazy_loading'), 10);
42
+		add_action('AHEE__EE_Admin_Page__espresso_news_post_box__after_content', array($this, 'extra_news_box_content'), 10);
43 43
 	}
44 44
 
45 45
 
46 46
 
47 47
 
48
-	public function extra_news_box_content( $content ) {
49
-		echo '<h3 style="margin:0">' . __('From the Forums', 'event_espresso') . '</h3>';
48
+	public function extra_news_box_content($content) {
49
+		echo '<h3 style="margin:0">'.__('From the Forums', 'event_espresso').'</h3>';
50 50
 		echo '<div id="ee_forum_posts_content">';
51 51
 		$url = 'http://eventespresso.com/forum/event-espresso-support/feed/';
52
-		EE_Admin_Page::cached_rss_display( 'ee_forum_posts_content', $url);
52
+		EE_Admin_Page::cached_rss_display('ee_forum_posts_content', $url);
53 53
 		echo '</div>';
54 54
 	}
55 55
 
56 56
 
57
-	public function forums_lazy_loading( $ids ) {
57
+	public function forums_lazy_loading($ids) {
58 58
 		$ids[] = 'ee_forum_posts_content';
59 59
 		return $ids;
60 60
 	}
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
caffeinated/admin/extend/events/help_tabs/import_page.help_tab.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,18 +2,18 @@
 block discarded – undo
2 2
 <p>
3 3
 <?php _e('The importer can be used to import event information into Event Espresso using a CSV file.', 'event_espresso'); ?>
4 4
 </p>
5
-<p><strong><?php _e("Importing from other Event Espresso 4 Sites", 'event_espresso');?></strong></p>
5
+<p><strong><?php _e("Importing from other Event Espresso 4 Sites", 'event_espresso'); ?></strong></p>
6 6
 <p>
7 7
 <?php _e('To import Event Espresso data from another Event Espresso 4 install, export a CSV file from the admin Events overview page, or anywhere you can generate a CSV export file from. Then upload that file here (regardless of what type of information was exported).', 'event_espresso'); ?>
8 8
 </p>
9 9
 <p>
10 10
 <?php _e('Note: its possible that data from the other site have the same IDs as data in this site. The importer recognizes that this data is from a different database and inserts new items for each item in the CSV file, regardless of whether its ID matches that of an item in this site\'s database or not. However, the importer also remembers the mapping from the old site\'s database to this site\'s database, and on subsequent CSV importers from that site, the data in this database will be updated instead of re-inserting new items.', 'event_espresso'); ?>
11 11
 </p>
12
-<p><strong><?php _e("Importing from this Site", 'event_espresso');?></strong></p>
13
-<p><?php _e("You may want to export data from this site, modify it (or modify the database), and re-import it. When this is done, the importer recognizes that the data is from this site\'s database and updates the records (instead of inserting new items like it would have, had the CSV data been from a different site).", 'event_espresso');?></p>
12
+<p><strong><?php _e("Importing from this Site", 'event_espresso'); ?></strong></p>
13
+<p><?php _e("You may want to export data from this site, modify it (or modify the database), and re-import it. When this is done, the importer recognizes that the data is from this site\'s database and updates the records (instead of inserting new items like it would have, had the CSV data been from a different site).", 'event_espresso'); ?></p>
14 14
 
15
-	<p><strong><?php _e("Notes about Generating your own CSV Import Files", "event_espresso");?></strong></p>
16
-	<p><?php _e("If you think you could save time entering data into a CSV file, you can use the sample import file below. Note that creating your own CSV file is more complicated than in Event Espresso 3.1 because of the more advanced data structure, and so we recommend creating/editing your events using the normal web-interface.", "event_espresso");?></p>
17
-	<p><?php _e("The export file is just an export of an event, or if you do not have any events in your system, it will only contain column headers. Do not change those column headers. Add as many rows as you like. ", "event_espresso");?></p>
18
-	<p><?php _e("In the ID columns (columns ending in '_ID'), you should enter 'temporary IDs', which are unique numbers/words that identify that item, which can be used later when you want to refer to that item. (For example, if you assign an event's EVT_ID to be a temporary id of 'my-event-1', then use that same phrase 'my-event-1' to refer to that event in the Datetime model's EVT_ID column)", "event_espresso");?></p>
19
-	<p><?php _e("Also note, you do NOT have to enter info in for each model. (You can, for example, only enter in Term_Taxonomies and Term model data)", "event_espresso");?></p>
20 15
\ No newline at end of file
16
+	<p><strong><?php _e("Notes about Generating your own CSV Import Files", "event_espresso"); ?></strong></p>
17
+	<p><?php _e("If you think you could save time entering data into a CSV file, you can use the sample import file below. Note that creating your own CSV file is more complicated than in Event Espresso 3.1 because of the more advanced data structure, and so we recommend creating/editing your events using the normal web-interface.", "event_espresso"); ?></p>
18
+	<p><?php _e("The export file is just an export of an event, or if you do not have any events in your system, it will only contain column headers. Do not change those column headers. Add as many rows as you like. ", "event_espresso"); ?></p>
19
+	<p><?php _e("In the ID columns (columns ending in '_ID'), you should enter 'temporary IDs', which are unique numbers/words that identify that item, which can be used later when you want to refer to that item. (For example, if you assign an event's EVT_ID to be a temporary id of 'my-event-1', then use that same phrase 'my-event-1' to refer to that event in the Datetime model's EVT_ID column)", "event_espresso"); ?></p>
20
+	<p><?php _e("Also note, you do NOT have to enter info in for each model. (You can, for example, only enter in Term_Taxonomies and Term model data)", "event_espresso"); ?></p>
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
core/libraries/messages/EE_messenger.lib.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 	/**
504 504
 	 * @param $message_types
505 505
 	 * @param array $extra
506
-	 * @return mixed|string
506
+	 * @return string
507 507
 	 */
508 508
 	protected function _get_admin_content_events_edit( $message_types, $extra ) {
509 509
 		//defaults
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
 	 * All this does is set the existing test settings (in the db) for the messenger
772 772
 	 *
773 773
 	 * @access public
774
-	 * @param $settings
774
+	 * @param string $settings
775 775
 	 * @return bool success/fail
776 776
 	 */
777 777
 	public function set_existing_test_settings( $settings ) {
Please login to merge, or discard this patch.
Braces   +17 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,8 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 use \EventEspresso\core\exceptions\SendMessageException;
3 3
 
4
-if (!defined('EVENT_ESPRESSO_VERSION') )
4
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
5 5
 	exit('NO direct script access allowed');
6
+}
6 7
 
7 8
 /**
8 9
  * EE_messenger class
@@ -733,8 +734,9 @@  discard block
 block discarded – undo
733 734
 		$wrapper_template = $this->_tmp_pack->get_wrapper( $this->name, $type );
734 735
 
735 736
 		//check file exists and is readable
736
-		if ( !is_readable( $wrapper_template ) )
737
-			throw new EE_Error( sprintf( __('Unable to access the template file for the %s messenger main content wrapper.  The location being attempted is %s.', 'event_espresso' ), ucwords($this->label['singular']) , $wrapper_template ) );
737
+		if ( !is_readable( $wrapper_template ) ) {
738
+					throw new EE_Error( sprintf( __('Unable to access the template file for the %s messenger main content wrapper.  The location being attempted is %s.', 'event_espresso' ), ucwords($this->label['singular']) , $wrapper_template ) );
739
+		}
738 740
 
739 741
 		//add message type to template args
740 742
 		$this->_template_args['message_type'] = $this->_incoming_message_type;
@@ -809,20 +811,24 @@  discard block
 block discarded – undo
809 811
 	 */
810 812
 	public function get_field_label( $field ) {
811 813
 		//first let's see if the field requests is in the top level array.
812
-		if ( isset( $this->_template_fields[$field] ) && !empty( $this->_template_fields[$field]['label'] ) )
813
-			return $this->_template[$field]['label'];
814
+		if ( isset( $this->_template_fields[$field] ) && !empty( $this->_template_fields[$field]['label'] ) ) {
815
+					return $this->_template[$field]['label'];
816
+		}
814 817
 
815 818
 		//nope so let's look in the extra array to see if it's there HOWEVER if the field exists as a top level index in the extra array then we know the label is in the 'main' index.
816
-		if ( isset( $this->_template_fields['extra'] ) && !empty( $this->_template_fields['extra'][$field] ) && !empty( $this->_template_fields['extra'][$field]['main']['label'] )  )
817
-			return $this->_template_fields['extra'][$field]['main']['label'];
819
+		if ( isset( $this->_template_fields['extra'] ) && !empty( $this->_template_fields['extra'][$field] ) && !empty( $this->_template_fields['extra'][$field]['main']['label'] )  ) {
820
+					return $this->_template_fields['extra'][$field]['main']['label'];
821
+		}
818 822
 
819 823
 		//now it's possible this field may just be existing in any of the extra array items.
820 824
 		if ( !empty( $this->_template_fields['extra'] ) && is_array( $this->_template_fields['extra'] ) ) {
821 825
 			foreach ( $this->_template_fields['extra'] as $main_field => $subfields ) {
822
-				if ( !is_array( $subfields ) )
823
-					continue;
824
-				if ( isset( $subfields[$field] ) && !empty( $subfields[$field]['label'] ) )
825
-					return $subfields[$field]['label'];
826
+				if ( !is_array( $subfields ) ) {
827
+									continue;
828
+				}
829
+				if ( isset( $subfields[$field] ) && !empty( $subfields[$field]['label'] ) ) {
830
+									return $subfields[$field]['label'];
831
+				}
826 832
 			}
827 833
 		}
828 834
 
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -647,15 +647,15 @@
 block discarded – undo
647 647
 
648 648
 		if ( $send ) {
649 649
 			//are we overriding any existing template fields?
650
-            $settings = apply_filters(
651
-                'FHEE__EE_messenger__get_preview__messenger_test_settings',
652
-                $this->get_existing_test_settings(),
653
-                $this,
654
-                $send,
655
-                $message,
656
-                $message_type
657
-            );
658
-            if ( ! empty( $settings ) ) {
650
+			$settings = apply_filters(
651
+				'FHEE__EE_messenger__get_preview__messenger_test_settings',
652
+				$this->get_existing_test_settings(),
653
+				$this,
654
+				$send,
655
+				$message,
656
+				$message_type
657
+			);
658
+			if ( ! empty( $settings ) ) {
659 659
 				foreach ( $settings as $field => $value ) {
660 660
 					$this->_set_template_value( $field, $value );
661 661
 				}
Please login to merge, or discard this patch.
Spacing   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 use \EventEspresso\core\exceptions\SendMessageException;
3 3
 
4
-if (!defined('EVENT_ESPRESSO_VERSION') )
4
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
5 5
 	exit('NO direct script access allowed');
6 6
 
7 7
 /**
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	 * @return void
280 280
 	 */
281 281
 	public function enqueue_scripts_styles() {
282
-		do_action( 'AHEE__EE_messenger__enqueue_scripts_styles');
282
+		do_action('AHEE__EE_messenger__enqueue_scripts_styles');
283 283
 	}
284 284
 
285 285
 
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 
350 350
 		$this->_supports_labels->template_variation_description = __('These are different styles to choose from for the selected template structure.  Usually these affect things like font style, color, borders etc.  In some cases the styles will also make minor layout changes.');
351 351
 
352
-		$this->_supports_labels = apply_filters( 'FHEE__EE_messenger___set_supports_labels_defaults___supports_labels', $this->_supports_labels, $this );
352
+		$this->_supports_labels = apply_filters('FHEE__EE_messenger___set_supports_labels_defaults___supports_labels', $this->_supports_labels, $this);
353 353
 	}
354 354
 
355 355
 
@@ -364,10 +364,10 @@  discard block
 block discarded – undo
364 364
 	 * @return stdClass
365 365
 	 */
366 366
 	public function get_supports_labels() {
367
-		if ( empty( $this->_supports_labels->template_pack ) || empty( $this->_supports_labels->template_variation) ) {
367
+		if (empty($this->_supports_labels->template_pack) || empty($this->_supports_labels->template_variation)) {
368 368
 			$this->_set_supports_labels_defaults();
369 369
 		}
370
-		return apply_filters( 'FHEE__EE_messenger__get_supports_labels', $this->_supports_labels, $this );
370
+		return apply_filters('FHEE__EE_messenger__get_supports_labels', $this->_supports_labels, $this);
371 371
 	}
372 372
 
373 373
 
@@ -387,10 +387,10 @@  discard block
 block discarded – undo
387 387
 	 *
388 388
 	 * @return string                    path or url for the requested variation.
389 389
 	 */
390
-	public function get_variation( EE_Messages_Template_Pack $pack, $message_type_name, $url = FALSE, $type = 'main', $variation = 'default', $skip_filters = FALSE ) {
390
+	public function get_variation(EE_Messages_Template_Pack $pack, $message_type_name, $url = FALSE, $type = 'main', $variation = 'default', $skip_filters = FALSE) {
391 391
 		$this->_tmp_pack = $pack;
392
-		$variation_path = apply_filters( 'EE_messenger__get_variation__variation', false, $pack, $this->name, $message_type_name, $url, $type, $variation, $skip_filters );
393
-		$variation_path = empty( $variation_path ) ? $this->_tmp_pack->get_variation( $this->name, $message_type_name, $type, $variation, $url, '.css', $skip_filters ) : $variation_path;
392
+		$variation_path = apply_filters('EE_messenger__get_variation__variation', false, $pack, $this->name, $message_type_name, $url, $type, $variation, $skip_filters);
393
+		$variation_path = empty($variation_path) ? $this->_tmp_pack->get_variation($this->name, $message_type_name, $type, $variation, $url, '.css', $skip_filters) : $variation_path;
394 394
 		return $variation_path;
395 395
 
396 396
 	}
@@ -408,13 +408,13 @@  discard block
 block discarded – undo
408 408
 	 * @return array
409 409
 	 */
410 410
 	public function get_default_message_types() {
411
-		$class = get_class( $this );
411
+		$class = get_class($this);
412 412
 
413 413
 		//messenger specific filter
414
-		$default_types = apply_filters( 'FHEE__' . $class . '__get_default_message_types__default_types', $this->_default_message_types, $this );
414
+		$default_types = apply_filters('FHEE__'.$class.'__get_default_message_types__default_types', $this->_default_message_types, $this);
415 415
 
416 416
 		//all messengers filter
417
-		$default_types = apply_filters( 'FHEE__EE_messenger__get_default_message_types__default_types', $default_types, $this );
417
+		$default_types = apply_filters('FHEE__EE_messenger__get_default_message_types__default_types', $default_types, $this);
418 418
 		return $default_types;
419 419
 	}
420 420
 
@@ -429,14 +429,14 @@  discard block
 block discarded – undo
429 429
 	 * @return array
430 430
 	 */
431 431
 	public function get_valid_message_types() {
432
-		$class = get_class( $this );
432
+		$class = get_class($this);
433 433
 
434 434
 		//messenger specific filter
435 435
 		//messenger specific filter
436
-		$valid_types = apply_filters( 'FHEE__' . $class . '__get_valid_message_types__valid_types', $this->_valid_message_types, $this );
436
+		$valid_types = apply_filters('FHEE__'.$class.'__get_valid_message_types__valid_types', $this->_valid_message_types, $this);
437 437
 
438 438
 		//all messengers filter
439
-		$valid_types = apply_filters( 'FHEE__EE_messenger__get_valid_message_types__valid_types', $valid_types, $this );
439
+		$valid_types = apply_filters('FHEE__EE_messenger__get_valid_message_types__valid_types', $valid_types, $this);
440 440
 		return $valid_types;
441 441
 	}
442 442
 
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 	 * @access public
451 451
 	 * @param array $new_config Whatever is put in here will reset the _validator_config property
452 452
 	 */
453
-	public function set_validator_config( $new_config ) {
453
+	public function set_validator_config($new_config) {
454 454
 		$this->_validator_config = $new_config;
455 455
 	}
456 456
 
@@ -466,8 +466,8 @@  discard block
 block discarded – undo
466 466
 	public function get_validator_config() {
467 467
 		$class = get_class($this);
468 468
 
469
-		$config = apply_filters( 'FHEE__' . $class . '__get_validator_config', $this->_validator_config, $this );
470
-		$config = apply_filters( 'FHEE__EE_messenger__get_validator_config', $config, $this );
469
+		$config = apply_filters('FHEE__'.$class.'__get_validator_config', $this->_validator_config, $this);
470
+		$config = apply_filters('FHEE__EE_messenger__get_validator_config', $config, $this);
471 471
 		return $config;
472 472
 	}
473 473
 
@@ -484,8 +484,8 @@  discard block
 block discarded – undo
484 484
 	 * @access public
485 485
 	 * @return string content for page
486 486
 	 */
487
-	public function get_messenger_admin_page_content( $page, $action = null, $extra = array(), $message_types = array() ) {
488
-		return $this->_get_admin_page_content( $page, $action, $extra, $message_types );
487
+	public function get_messenger_admin_page_content($page, $action = null, $extra = array(), $message_types = array()) {
488
+		return $this->_get_admin_page_content($page, $action, $extra, $message_types);
489 489
 	}
490 490
 
491 491
 
@@ -495,20 +495,20 @@  discard block
 block discarded – undo
495 495
 	 * @param array $extra
496 496
 	 * @return mixed|string
497 497
 	 */
498
-	protected function _get_admin_content_events_edit( $message_types, $extra ) {
498
+	protected function _get_admin_content_events_edit($message_types, $extra) {
499 499
 		//defaults
500 500
 		$template_args = array();
501 501
 		$selector_rows = '';
502 502
 
503 503
 		//we don't need message types here so we're just going to ignore. we do, however, expect the event id here. The event id is needed to provide a link to setup a custom template for this event.
504
-		$event_id = isset( $extra['event'] ) ? $extra['event'] : NULL;
504
+		$event_id = isset($extra['event']) ? $extra['event'] : NULL;
505 505
 
506
-		$template_wrapper_path = EE_LIBRARIES . 'messages/messenger/admin_templates/event_switcher_wrapper.template.php';
507
-		$template_row_path = EE_LIBRARIES . 'messages/messenger/admin_templates/event_switcher_row.template.php';
506
+		$template_wrapper_path = EE_LIBRARIES.'messages/messenger/admin_templates/event_switcher_wrapper.template.php';
507
+		$template_row_path = EE_LIBRARIES.'messages/messenger/admin_templates/event_switcher_row.template.php';
508 508
 
509 509
 		//array of template objects for global and custom (non-trashed) (but remember just for this messenger!)
510 510
 		$global_templates = EEM_Message_Template_Group::instance()->get_all(
511
-			array( array( 'MTP_messenger' => $this->name, 'MTP_is_global' => true, 'MTP_is_active' => true ) )
511
+			array(array('MTP_messenger' => $this->name, 'MTP_is_global' => true, 'MTP_is_active' => true))
512 512
 		);
513 513
 		$templates_for_event = EEM_Message_Template_Group::instance()->get_all_custom_templates_by_event(
514 514
 			$event_id,
@@ -517,55 +517,55 @@  discard block
 block discarded – undo
517 517
 				'MTP_is_active' => true
518 518
 			)
519 519
 		);
520
-		$templates_for_event = !empty( $templates_for_event ) ? $templates_for_event : array();
520
+		$templates_for_event = ! empty($templates_for_event) ? $templates_for_event : array();
521 521
 
522 522
 		//so we need to setup the rows for the selectors and we use the global mtpgs (cause those will the active message template groups)
523
-		foreach ( $global_templates as $mtpgID => $mtpg ) {
524
-			if ( $mtpg instanceof EE_Message_Template_Group ) {
523
+		foreach ($global_templates as $mtpgID => $mtpg) {
524
+			if ($mtpg instanceof EE_Message_Template_Group) {
525 525
 				//verify this message type is supposed to show on this page
526 526
 				$mtp_obj = $mtpg->message_type_obj();
527
-				if ( ! $mtp_obj instanceof EE_message_type ) {
527
+				if ( ! $mtp_obj instanceof EE_message_type) {
528 528
 					continue;
529 529
 				}
530
-				$mtp_obj->admin_registered_pages = (array)$mtp_obj->admin_registered_pages;
531
-				if ( ! in_array( 'events_edit', $mtp_obj->admin_registered_pages ) ) {
530
+				$mtp_obj->admin_registered_pages = (array) $mtp_obj->admin_registered_pages;
531
+				if ( ! in_array('events_edit', $mtp_obj->admin_registered_pages)) {
532 532
 					continue;
533 533
 				}
534 534
 				$select_values = array();
535
-				$select_values[ $mtpgID ] = __( 'Global', 'event_espresso' );
536
-				$default_value = array_key_exists( $mtpgID, $templates_for_event ) && ! $mtpg->get( 'MTP_is_override' ) ? $mtpgID : null;
535
+				$select_values[$mtpgID] = __('Global', 'event_espresso');
536
+				$default_value = array_key_exists($mtpgID, $templates_for_event) && ! $mtpg->get('MTP_is_override') ? $mtpgID : null;
537 537
 				//if the override has been set for the global template, then that means even if there are custom templates already created we ignore them because of the set override.
538
-				if ( ! $mtpg->get( 'MTP_is_override' ) ) {
538
+				if ( ! $mtpg->get('MTP_is_override')) {
539 539
 					//any custom templates for this message type?
540
-					$custom_templates = EEM_Message_Template_Group::instance()->get_custom_message_template_by_m_and_mt( $this->name, $mtpg->message_type() );
541
-					foreach ( $custom_templates as $cmtpgID => $cmtpg ) {
542
-						$select_values[ $cmtpgID ] = $cmtpg->name();
543
-						$default_value = array_key_exists( $cmtpgID, $templates_for_event ) ? $cmtpgID : $default_value;
540
+					$custom_templates = EEM_Message_Template_Group::instance()->get_custom_message_template_by_m_and_mt($this->name, $mtpg->message_type());
541
+					foreach ($custom_templates as $cmtpgID => $cmtpg) {
542
+						$select_values[$cmtpgID] = $cmtpg->name();
543
+						$default_value = array_key_exists($cmtpgID, $templates_for_event) ? $cmtpgID : $default_value;
544 544
 					}
545 545
 				}
546 546
 				//if there is no $default_value then we set it as the global
547
-				$default_value = empty( $default_value ) ? $mtpgID : $default_value;
548
-				$edit_url = EEH_URL::add_query_args_and_nonce( array( 'page' => 'espresso_messages', 'action' => 'edit_message_template', 'id' => $default_value ), admin_url( 'admin.php' ) );
549
-				$create_url = EEH_URL::add_query_args_and_nonce( array( 'page' => 'espresso_messages', 'action' => 'add_new_message_template', 'GRP_ID' => $default_value ), admin_url( 'admin.php' ) );
550
-				$st_args[ 'mt_name' ] = ucwords( $mtp_obj->label[ 'singular' ] );
551
-				$st_args[ 'mt_slug' ] = $mtpg->message_type();
552
-				$st_args[ 'messenger_slug' ] = $this->name;
553
-				$st_args[ 'selector' ] = EEH_Form_Fields::select_input( 'event_message_templates_relation[' . $mtpgID . ']', $select_values, $default_value, 'data-messenger="' . $this->name . '" data-messagetype="' . $mtpg->message_type() . '"', 'message-template-selector' );
547
+				$default_value = empty($default_value) ? $mtpgID : $default_value;
548
+				$edit_url = EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_messages', 'action' => 'edit_message_template', 'id' => $default_value), admin_url('admin.php'));
549
+				$create_url = EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_messages', 'action' => 'add_new_message_template', 'GRP_ID' => $default_value), admin_url('admin.php'));
550
+				$st_args['mt_name'] = ucwords($mtp_obj->label['singular']);
551
+				$st_args['mt_slug'] = $mtpg->message_type();
552
+				$st_args['messenger_slug'] = $this->name;
553
+				$st_args['selector'] = EEH_Form_Fields::select_input('event_message_templates_relation['.$mtpgID.']', $select_values, $default_value, 'data-messenger="'.$this->name.'" data-messagetype="'.$mtpg->message_type().'"', 'message-template-selector');
554 554
 				//note that  message template group that has override_all_custom set will remove the ability to set a custom message template based off of the global (and that also in turn overrides any other custom templates).
555
-				$st_args[ 'create_button' ] = $mtpg->get( 'MTP_is_override' ) ? '' : '<a data-messenger="' . $this->name . '" data-messagetype="' . $mtpg->message_type() . '" data-grpid="' . $default_value . '" target="_blank" href="' . $create_url . '" class="button button-small create-mtpg-button">' . __( 'Create New Custom', 'event_espresso' ) . '</a>';
556
-				$st_args[ 'create_button' ] = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_messages', 'espresso_messages_add_new_message_template' ) ? $st_args[ 'create_button' ] : '';
557
-				$st_args[ 'edit_button' ] = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $mtpgID ) ? '<a data-messagetype="' . $mtpg->message_type() . '" data-grpid="' . $default_value . '" target="_blank" href="' . $edit_url . '" class="button button-small edit-mtpg-button">' . __( 'Edit', 'event_espresso' ) . '</a>' : '';
558
-				$selector_rows .= EEH_Template::display_template( $template_row_path, $st_args, true );
555
+				$st_args['create_button'] = $mtpg->get('MTP_is_override') ? '' : '<a data-messenger="'.$this->name.'" data-messagetype="'.$mtpg->message_type().'" data-grpid="'.$default_value.'" target="_blank" href="'.$create_url.'" class="button button-small create-mtpg-button">'.__('Create New Custom', 'event_espresso').'</a>';
556
+				$st_args['create_button'] = EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'espresso_messages_add_new_message_template') ? $st_args['create_button'] : '';
557
+				$st_args['edit_button'] = EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $mtpgID) ? '<a data-messagetype="'.$mtpg->message_type().'" data-grpid="'.$default_value.'" target="_blank" href="'.$edit_url.'" class="button button-small edit-mtpg-button">'.__('Edit', 'event_espresso').'</a>' : '';
558
+				$selector_rows .= EEH_Template::display_template($template_row_path, $st_args, true);
559 559
 			}
560 560
 		}
561 561
 
562 562
 		//if no selectors present then get out.
563
-		if ( empty( $selector_rows ) ) {
563
+		if (empty($selector_rows)) {
564 564
 			return '';
565 565
 		}
566 566
 
567 567
 		$template_args['selector_rows'] = $selector_rows;
568
-		return EEH_Template::display_template( $template_wrapper_path, $template_args, TRUE );
568
+		return EEH_Template::display_template($template_wrapper_path, $template_args, TRUE);
569 569
 	}
570 570
 
571 571
 
@@ -580,8 +580,8 @@  discard block
 block discarded – undo
580 580
 	 * @return array $this->_template_fields
581 581
 	 */
582 582
 	public function get_template_fields() {
583
-		$template_fields = apply_filters( 'FHEE__' . get_class($this) . '__get_template_fields', $this->_template_fields, $this );
584
-		$template_fields = apply_filters( 'FHEE__EE_messenger__get_template_fields', $template_fields, $this );
583
+		$template_fields = apply_filters('FHEE__'.get_class($this).'__get_template_fields', $this->_template_fields, $this);
584
+		$template_fields = apply_filters('FHEE__EE_messenger__get_template_fields', $template_fields, $this);
585 585
 		return $template_fields;
586 586
 	}
587 587
 
@@ -595,9 +595,9 @@  discard block
 block discarded – undo
595 595
 	 * @param mixed $value
596 596
 	 */
597 597
 	protected function _set_template_value($item, $value) {
598
-		if ( array_key_exists($item, $this->_template_fields) ) {
599
-			$prop = '_' . $item;
600
-			$this->{$prop}= $value;
598
+		if (array_key_exists($item, $this->_template_fields)) {
599
+			$prop = '_'.$item;
600
+			$this->{$prop} = $value;
601 601
 		}
602 602
 	}
603 603
 
@@ -615,18 +615,18 @@  discard block
 block discarded – undo
615 615
 	 *
616 616
 	 * @throws SendMessageException
617 617
 	 */
618
-	final public function send_message( $message, EE_message_type $message_type ) {
618
+	final public function send_message($message, EE_message_type $message_type) {
619 619
 		try {
620
-			$this->_validate_and_setup( $message );
620
+			$this->_validate_and_setup($message);
621 621
 			$this->_incoming_message_type = $message_type;
622 622
 			$response = $this->_send_message();
623
-			if ( $response instanceof WP_Error ) {
624
-				EE_Error::add_error( $response->get_error_message(), __FILE__, __FUNCTION__, __LINE__ );
623
+			if ($response instanceof WP_Error) {
624
+				EE_Error::add_error($response->get_error_message(), __FILE__, __FUNCTION__, __LINE__);
625 625
 				$response = false;
626 626
 			}
627
-		} catch ( \Exception $e ) {
627
+		} catch (\Exception $e) {
628 628
 			//convert to an instance of SendMessageException
629
-			throw new SendMessageException( $e->getMessage() );
629
+			throw new SendMessageException($e->getMessage());
630 630
 		}
631 631
 		return $response;
632 632
 	}
@@ -640,12 +640,12 @@  discard block
 block discarded – undo
640 640
 	 * @param  bool   $send    true we will actually use the _send method (for test sends). FALSE we just return preview
641 641
 	 * @return string          return the message html content
642 642
 	 */
643
-	public function get_preview( EE_Message $message, EE_message_type $message_type, $send = false ) {
644
-		$this->_validate_and_setup( $message );
643
+	public function get_preview(EE_Message $message, EE_message_type $message_type, $send = false) {
644
+		$this->_validate_and_setup($message);
645 645
 
646 646
 		$this->_incoming_message_type = $message_type;
647 647
 
648
-		if ( $send ) {
648
+		if ($send) {
649 649
 			//are we overriding any existing template fields?
650 650
             $settings = apply_filters(
651 651
                 'FHEE__EE_messenger__get_preview__messenger_test_settings',
@@ -655,20 +655,20 @@  discard block
 block discarded – undo
655 655
                 $message,
656 656
                 $message_type
657 657
             );
658
-            if ( ! empty( $settings ) ) {
659
-				foreach ( $settings as $field => $value ) {
660
-					$this->_set_template_value( $field, $value );
658
+            if ( ! empty($settings)) {
659
+				foreach ($settings as $field => $value) {
660
+					$this->_set_template_value($field, $value);
661 661
 				}
662 662
 			}
663 663
 		}
664 664
 
665 665
 		//enqueue preview js so that any links/buttons on the page are disabled.
666
-		if ( ! $send ) {
666
+		if ( ! $send) {
667 667
 			// the below may seem like duplication.  However, typically if a messenger enqueues scripts/styles,
668 668
 			// it deregisters all existing wp scripts and styles first.  So the second hook ensures our previewer still gets setup.
669
-			add_action( 'admin_enqueue_scripts', array( $this, 'add_preview_script' ), 10 );
670
-			add_action( 'wp_enqueue_scripts', array( $this, 'add_preview_script' ), 10 );
671
-			add_action( 'AHEE__EE_messenger__enqueue_scripts_styles', array( $this, 'add_preview_script' ), 10 );
669
+			add_action('admin_enqueue_scripts', array($this, 'add_preview_script'), 10);
670
+			add_action('wp_enqueue_scripts', array($this, 'add_preview_script'), 10);
671
+			add_action('AHEE__EE_messenger__enqueue_scripts_styles', array($this, 'add_preview_script'), 10);
672 672
 		}
673 673
 
674 674
 		return $send ? $this->_send_message() : $this->_preview();
@@ -686,10 +686,10 @@  discard block
 block discarded – undo
686 686
 	 */
687 687
 	public function add_preview_script() {
688 688
 		//error message
689
-		EE_Registry::$i18n_js_strings[ 'links_disabled' ] = __( 'All the links on this page have been disabled because this is a generated preview message for the purpose of ensuring layout, style, and content setup.  To test generated links, you must trigger an actual message notification.', 'event_espresso' );
690
-		wp_register_script( 'ee-messages-preview-js', EE_LIBRARIES_URL . 'messages/messenger/assets/js/ee-messages-preview.js', array( 'jquery' ), EVENT_ESPRESSO_VERSION, true );
691
-		wp_localize_script( 'ee-messages-preview-js', 'eei18n', EE_Registry::$i18n_js_strings );
692
-		wp_enqueue_script( 'ee-messages-preview-js' );
689
+		EE_Registry::$i18n_js_strings['links_disabled'] = __('All the links on this page have been disabled because this is a generated preview message for the purpose of ensuring layout, style, and content setup.  To test generated links, you must trigger an actual message notification.', 'event_espresso');
690
+		wp_register_script('ee-messages-preview-js', EE_LIBRARIES_URL.'messages/messenger/assets/js/ee-messages-preview.js', array('jquery'), EVENT_ESPRESSO_VERSION, true);
691
+		wp_localize_script('ee-messages-preview-js', 'eei18n', EE_Registry::$i18n_js_strings);
692
+		wp_enqueue_script('ee-messages-preview-js');
693 693
 	}
694 694
 
695 695
 
@@ -700,13 +700,13 @@  discard block
 block discarded – undo
700 700
 	 * @param  EE_Message $message
701 701
 	 * @throws EE_Error
702 702
 	 */
703
-	protected function _validate_and_setup( EE_Message $message ) {
703
+	protected function _validate_and_setup(EE_Message $message) {
704 704
 		$template_pack = $message->get_template_pack();
705 705
 		$variation = $message->get_template_pack_variation();
706 706
 
707 707
 		//verify we have the required template pack value on the $message object.
708
-		if ( ! $template_pack instanceof EE_Messages_Template_Pack ) {
709
-			throw new EE_Error( __('Incoming $message object must have an EE_Messages_Template_Pack object available.', 'event_espresso' ) );
708
+		if ( ! $template_pack instanceof EE_Messages_Template_Pack) {
709
+			throw new EE_Error(__('Incoming $message object must have an EE_Messages_Template_Pack object available.', 'event_espresso'));
710 710
 		}
711 711
 
712 712
 		$this->_tmp_pack = $template_pack;
@@ -715,11 +715,11 @@  discard block
 block discarded – undo
715 715
 
716 716
 		$template_fields = $this->get_template_fields();
717 717
 
718
-		foreach ( $template_fields as $template => $value ) {
719
-			if ( $template !== 'extra' ) {
720
-				$column_value = $message->get_field_or_extra_meta( 'MSG_' . $template );
718
+		foreach ($template_fields as $template => $value) {
719
+			if ($template !== 'extra') {
720
+				$column_value = $message->get_field_or_extra_meta('MSG_'.$template);
721 721
 				$message_template_value = $column_value ? $column_value : null;
722
-				$this->_set_template_value( $template, $message_template_value );
722
+				$this->_set_template_value($template, $message_template_value);
723 723
 			}
724 724
 		}
725 725
 	}
@@ -734,19 +734,19 @@  discard block
 block discarded – undo
734 734
 	 * @return string
735 735
 	 * @throws \EE_Error
736 736
 	 */
737
-	protected function _get_main_template( $preview = FALSE ) {
737
+	protected function _get_main_template($preview = FALSE) {
738 738
 		$type = $preview ? 'preview' : 'main';
739 739
 
740
-		$wrapper_template = $this->_tmp_pack->get_wrapper( $this->name, $type );
740
+		$wrapper_template = $this->_tmp_pack->get_wrapper($this->name, $type);
741 741
 
742 742
 		//check file exists and is readable
743
-		if ( !is_readable( $wrapper_template ) )
744
-			throw new EE_Error( sprintf( __('Unable to access the template file for the %s messenger main content wrapper.  The location being attempted is %s.', 'event_espresso' ), ucwords($this->label['singular']) , $wrapper_template ) );
743
+		if ( ! is_readable($wrapper_template))
744
+			throw new EE_Error(sprintf(__('Unable to access the template file for the %s messenger main content wrapper.  The location being attempted is %s.', 'event_espresso'), ucwords($this->label['singular']), $wrapper_template));
745 745
 
746 746
 		//add message type to template args
747 747
 		$this->_template_args['message_type'] = $this->_incoming_message_type;
748 748
 
749
-		return EEH_Template::display_template( $wrapper_template, $this->_template_args, TRUE );
749
+		return EEH_Template::display_template($wrapper_template, $this->_template_args, TRUE);
750 750
 	}
751 751
 
752 752
 
@@ -782,9 +782,9 @@  discard block
 block discarded – undo
782 782
 	 */
783 783
 	public function get_existing_test_settings() {
784 784
 		/** @var EE_Message_Resource_Manager $Message_Resource_Manager */
785
-		$Message_Resource_Manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' );
785
+		$Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager');
786 786
 		$settings = $Message_Resource_Manager->get_active_messengers_option();
787
-		return isset( $settings[ $this->name ]['test_settings'] ) ? $settings[ $this->name ]['test_settings'] : array();
787
+		return isset($settings[$this->name]['test_settings']) ? $settings[$this->name]['test_settings'] : array();
788 788
 	}
789 789
 
790 790
 
@@ -796,12 +796,12 @@  discard block
 block discarded – undo
796 796
 	 * @param $settings
797 797
 	 * @return bool success/fail
798 798
 	 */
799
-	public function set_existing_test_settings( $settings ) {
799
+	public function set_existing_test_settings($settings) {
800 800
 		/** @var EE_Message_Resource_Manager $Message_Resource_Manager */
801
-		$Message_Resource_Manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' );
801
+		$Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager');
802 802
 		$existing = $Message_Resource_Manager->get_active_messengers_option();
803
-		$existing[ $this->name ]['test_settings'] = $settings;
804
-		return $Message_Resource_Manager->update_active_messengers_option( $existing );
803
+		$existing[$this->name]['test_settings'] = $settings;
804
+		return $Message_Resource_Manager->update_active_messengers_option($existing);
805 805
 	}
806 806
 
807 807
 
@@ -814,21 +814,21 @@  discard block
 block discarded – undo
814 814
 	 * @param string $field The field to retrieve the label for
815 815
 	 * @return string        	  The label
816 816
 	 */
817
-	public function get_field_label( $field ) {
817
+	public function get_field_label($field) {
818 818
 		//first let's see if the field requests is in the top level array.
819
-		if ( isset( $this->_template_fields[$field] ) && !empty( $this->_template_fields[$field]['label'] ) )
819
+		if (isset($this->_template_fields[$field]) && ! empty($this->_template_fields[$field]['label']))
820 820
 			return $this->_template[$field]['label'];
821 821
 
822 822
 		//nope so let's look in the extra array to see if it's there HOWEVER if the field exists as a top level index in the extra array then we know the label is in the 'main' index.
823
-		if ( isset( $this->_template_fields['extra'] ) && !empty( $this->_template_fields['extra'][$field] ) && !empty( $this->_template_fields['extra'][$field]['main']['label'] )  )
823
+		if (isset($this->_template_fields['extra']) && ! empty($this->_template_fields['extra'][$field]) && ! empty($this->_template_fields['extra'][$field]['main']['label']))
824 824
 			return $this->_template_fields['extra'][$field]['main']['label'];
825 825
 
826 826
 		//now it's possible this field may just be existing in any of the extra array items.
827
-		if ( !empty( $this->_template_fields['extra'] ) && is_array( $this->_template_fields['extra'] ) ) {
828
-			foreach ( $this->_template_fields['extra'] as $main_field => $subfields ) {
829
-				if ( !is_array( $subfields ) )
827
+		if ( ! empty($this->_template_fields['extra']) && is_array($this->_template_fields['extra'])) {
828
+			foreach ($this->_template_fields['extra'] as $main_field => $subfields) {
829
+				if ( ! is_array($subfields))
830 830
 					continue;
831
-				if ( isset( $subfields[$field] ) && !empty( $subfields[$field]['label'] ) )
831
+				if (isset($subfields[$field]) && ! empty($subfields[$field]['label']))
832 832
 					return $subfields[$field]['label'];
833 833
 			}
834 834
 		}
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
 	 *
850 850
 	 * @return void
851 851
 	 */
852
-	public function do_secondary_messenger_hooks( $sending_messenger_name ) {
852
+	public function do_secondary_messenger_hooks($sending_messenger_name) {
853 853
 		return;
854 854
 	}
855 855
 
Please login to merge, or discard this patch.
Invoice/templates/invoice_settings_header_gateway.template.php 3 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('No direct script access allowed');
5 5
 /**
6 6
  * Event Espresso
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
  */
27 27
 ?>
28 28
 	<tr>
29
-		<th><h3><?php _e("Invoice Gateway Settings", 'event_espresso');?></h3></th>
29
+		<th><h3><?php _e("Invoice Gateway Settings", 'event_espresso'); ?></h3></th>
30 30
 		<td>
31
-			<span class="description"><?php _e("The following settings affect the functioning of the Invoice gateway.", 'event_espresso');?></span>
31
+			<span class="description"><?php _e("The following settings affect the functioning of the Invoice gateway.", 'event_espresso'); ?></span>
32 32
 		</td>
33 33
 	</tr>
34 34
 <?php
Please login to merge, or discard this patch.
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -3,27 +3,27 @@
 block discarded – undo
3 3
 if (!defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('No direct script access allowed');
5 5
 /**
6
- * Event Espresso
7
- *
8
- * Event Registration and Management Plugin for WordPress
9
- *
10
- * @ package			Event Espresso
11
- * @ author			Seth Shoultes
12
- * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
13
- * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
14
- * @ link					http://www.eventespresso.com
15
- * @ version		 	4.3
16
- *
17
- * ------------------------------------------------------------------------
18
- *
19
- * invoice_settings_header_gateway
20
- *
21
- * @package			Event Espresso
22
- * @subpackage
23
- * @author				Mike Nelson
24
- *
25
- * ------------------------------------------------------------------------
26
- */
6
+	 * Event Espresso
7
+	 *
8
+	 * Event Registration and Management Plugin for WordPress
9
+	 *
10
+	 * @ package			Event Espresso
11
+	 * @ author			Seth Shoultes
12
+	 * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
13
+	 * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
14
+	 * @ link					http://www.eventespresso.com
15
+	 * @ version		 	4.3
16
+	 *
17
+	 * ------------------------------------------------------------------------
18
+	 *
19
+	 * invoice_settings_header_gateway
20
+	 *
21
+	 * @package			Event Espresso
22
+	 * @subpackage
23
+	 * @author				Mike Nelson
24
+	 *
25
+	 * ------------------------------------------------------------------------
26
+	 */
27 27
 ?>
28 28
 	<tr>
29 29
 		<th><h3><?php _e("Invoice Gateway Settings", 'event_espresso');?></h3></th>
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if (!defined('EVENT_ESPRESSO_VERSION')) {
4 4
 	exit('No direct script access allowed');
5
+}
5 6
 /**
6 7
  * Event Espresso
7 8
  *
Please login to merge, or discard this patch.