Completed
Branch BUG-9583-fix-fetching-term-rel... (646110)
by
unknown
539:15 queued 523:53
created
admin_pages/venues/help_tours/Venues_Categories_Help_Tour.class.php 2 patches
Spacing   +10 added lines, -10 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
 /**
@@ -107,36 +107,36 @@  discard block
 block discarded – undo
107 107
 
108 108
 
109 109
 	protected function _start() {
110
-		$content = '<h3>' . __('Venue Overview', 'event_espresso') . '</h3>';
111
-		$content .= '<p>' . __('This tour of the Venues Overview page will provide an overview of the different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
110
+		$content = '<h3>'.__('Venue Overview', 'event_espresso').'</h3>';
111
+		$content .= '<p>'.__('This tour of the Venues Overview page will provide an overview of the different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
112 112
 		return $content;
113 113
 	}
114 114
 	
115 115
 	protected function _id_stop() {
116
-		return '<p>' . __('View the venue category ID. Can be sorted by ascending or descending order.', 'event_espresso') . '</p>';
116
+		return '<p>'.__('View the venue category ID. Can be sorted by ascending or descending order.', 'event_espresso').'</p>';
117 117
 	}
118 118
 	
119 119
 	protected function _name_stop() {
120
-		return '<p>' . __('View the name of each venue category. Can be sorted by ascending or descending order.', 'event_espresso') . '</p>';
120
+		return '<p>'.__('View the name of each venue category. Can be sorted by ascending or descending order.', 'event_espresso').'</p>';
121 121
 	}
122 122
 
123 123
 	protected function _shortcode_stop() {
124
-		return '<p>' . __('View the shortcode for a venue category. This shortcode can be added to an event, WordPress post, or WordPress page. ', 'event_espresso') . '</p>';
124
+		return '<p>'.__('View the shortcode for a venue category. This shortcode can be added to an event, WordPress post, or WordPress page. ', 'event_espresso').'</p>';
125 125
 	}
126 126
 
127 127
 	protected function _count_stop() {
128
-		return '<p>' . __('View the number of venues that are associated with a category.', 'event_espresso') . '</p>';
128
+		return '<p>'.__('View the number of venues that are associated with a category.', 'event_espresso').'</p>';
129 129
 	}
130 130
 
131 131
 	protected function _bulk_actions_stop() {
132
-		return '<p>' . __('Perform bulk actions to multiple venue categories.', 'event_espresso') . '</p>';
132
+		return '<p>'.__('Perform bulk actions to multiple venue categories.', 'event_espresso').'</p>';
133 133
 	}
134 134
 
135 135
 	protected function _search_stop() {
136
-		return '<p>' . __('Search through venues categories. The following sources will be searched: Venue Category ID, Venue Category Name, Venue Shortcode, and Venue Count.', 'event_espresso') . '</p>';
136
+		return '<p>'.__('Search through venues categories. The following sources will be searched: Venue Category ID, Venue Category Name, Venue Shortcode, and Venue Count.', 'event_espresso').'</p>';
137 137
 	}
138 138
 	
139 139
 	protected function _new_category_stop() {
140
-		return '<p>' . __('Click here to add a new venue category.', 'event_espresso') . '</p>';
140
+		return '<p>'.__('Click here to add a new venue category.', 'event_espresso').'</p>';
141 141
 	}
142 142
 }
143 143
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
admin_pages/venues/help_tours/Venues_Edit_Category_Help_Tour.class.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 				'options' => array(
55 55
 					'tipLocation' => 'right',
56 56
 					'tipAdjustmentY' => -55,
57
-                    'tipAdjustmentX' => 5
57
+					'tipAdjustmentX' => 5
58 58
 					)
59 59
 				),
60 60
 			40 => array(
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 				'options' => array(
64 64
 					'tipLocation' => 'top',
65 65
 					'tipAdjustmentY' => -75,
66
-                    'tipAdjustmentX' => 250
66
+					'tipAdjustmentX' => 250
67 67
 					)
68 68
 				)
69 69
 			);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 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
 /**
@@ -71,21 +71,21 @@  discard block
 block discarded – undo
71 71
 
72 72
 
73 73
 	protected function _stop_one() {
74
-		$content = '<h3>' . __('Edit Venue Category', 'event_espresso') . '</h3>';
75
-		$content .= '<p>' . __('This tour of the Edit Venue Category page will provide an overview of the different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
74
+		$content = '<h3>'.__('Edit Venue Category', 'event_espresso').'</h3>';
75
+		$content .= '<p>'.__('This tour of the Edit Venue Category page will provide an overview of the different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
76 76
 		return $content;
77 77
 	}
78 78
 
79 79
 	protected function _category_name_stop() {
80
-		return '<p>' . __('Edit the name for your venue category.', 'event_espresso') . '</p>';
80
+		return '<p>'.__('Edit the name for your venue category.', 'event_espresso').'</p>';
81 81
 	}
82 82
 
83 83
 	protected function _category_id_stop() {
84
-		return '<p>' . __('View the unique ID for your category (cannot be changed).', 'event_espresso') . '</p>';
84
+		return '<p>'.__('View the unique ID for your category (cannot be changed).', 'event_espresso').'</p>';
85 85
 	}
86 86
 
87 87
 	protected function _category_editor_stop() {
88
-		return '<p>' . __('The rich text editor can be used to edit information about your venue category. Images and links can also be added or removed along with your text.', 'event_espresso') . '</p>';
88
+		return '<p>'.__('The rich text editor can be used to edit information about your venue category. Images and links can also be added or removed along with your text.', 'event_espresso').'</p>';
89 89
 	}
90 90
 
91 91
 }
92 92
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
admin_pages/venues/help_tours/Venues_Edit_Venue_Help_Tour.class.php 2 patches
Spacing   +11 added lines, -11 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
 /**
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 
110 110
 
111 111
 	protected function _stop_one() {
112
-		$content = '<h3>' . __('Edit Venue', 'event_espresso') . '</h3>';
113
-		$content .= '<p>' . __('This tour of the Venue Editor page will provide an overview of the different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
112
+		$content = '<h3>'.__('Edit Venue', 'event_espresso').'</h3>';
113
+		$content .= '<p>'.__('This tour of the Venue Editor page will provide an overview of the different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
114 114
 		return $content;
115 115
 	}
116 116
 
@@ -119,35 +119,35 @@  discard block
 block discarded – undo
119 119
 	}
120 120
 
121 121
 	protected function _venue_editor_stop() {
122
-		return '<p>' . __('The rich text editor can be used to edit information about your venue. Images and links can also be added or removed along with your text.', 'event_espresso') . '</p>';
122
+		return '<p>'.__('The rich text editor can be used to edit information about your venue. Images and links can also be added or removed along with your text.', 'event_espresso').'</p>';
123 123
 	}
124 124
 	
125 125
 	protected function _venue_tags_stop() {
126
-		return '<p>' . __('Quickly edit tags for your venue.', 'event_espresso') . '</p>';
126
+		return '<p>'.__('Quickly edit tags for your venue.', 'event_espresso').'</p>';
127 127
 	}
128 128
 
129 129
 	protected function _venue_categories_stop() {
130
-		return '<p>' . __('Venues can also be categorized if you wish.', 'event_espresso') . '</p>';
130
+		return '<p>'.__('Venues can also be categorized if you wish.', 'event_espresso').'</p>';
131 131
 	}
132 132
 
133 133
 	protected function _venue_physical_location_stop() {
134
-		return '<p>' . __('Edit the physical address for your venue.', 'event_espresso') . '</p>';
134
+		return '<p>'.__('Edit the physical address for your venue.', 'event_espresso').'</p>';
135 135
 	}
136 136
 
137 137
 	protected function _venue_gmap_stop() {
138
-		return '<p>' . __('Enable or disable a Google Map for your venue.', 'event_espresso') . '</p>';
138
+		return '<p>'.__('Enable or disable a Google Map for your venue.', 'event_espresso').'</p>';
139 139
 	}
140 140
 
141 141
 	protected function _venue_virtual_location_stop() {
142
-		return '<p>' . __('Setup a virtual location for your venue.', 'event_espresso') . '</p>';
142
+		return '<p>'.__('Setup a virtual location for your venue.', 'event_espresso').'</p>';
143 143
 	}
144 144
 	
145 145
 	protected function _stop_featured_image() {
146
-		return '<p>' . __('Set a feature image for your venue here.', 'event_espresso') . '</p>';
146
+		return '<p>'.__('Set a feature image for your venue here.', 'event_espresso').'</p>';
147 147
 	}
148 148
 
149 149
 	protected function _stop_publish_box() {
150
-		return '<p>' . __('Easily control the status of your venue. The main options are Published, Pending Review, and Draft.', 'event_espresso') . '</p>';
150
+		return '<p>'.__('Easily control the status of your venue. The main options are Published, Pending Review, and Draft.', 'event_espresso').'</p>';
151 151
 	}
152 152
 	
153 153
 }
154 154
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
admin_pages/venues/help_tours/Venues_Overview_Help_Tour.class.php 2 patches
Spacing   +12 added lines, -12 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
 /**
@@ -125,44 +125,44 @@  discard block
 block discarded – undo
125 125
 
126 126
 
127 127
 	protected function _start() {
128
-		$content = '<h3>' . __('Venue Overview', 'event_espresso') . '</h3>';
129
-		$content .= '<p>' . __('This tour of the Venues Overview page will provide an overview of the different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
128
+		$content = '<h3>'.__('Venue Overview', 'event_espresso').'</h3>';
129
+		$content .= '<p>'.__('This tour of the Venues Overview page will provide an overview of the different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
130 130
 		return $content;
131 131
 	}
132 132
 	
133 133
 	protected function _id_stop() {
134
-		return '<p>' . __('View the venue ID. Can be sorted by ascending or descending order.', 'event_espresso') . '</p>';
134
+		return '<p>'.__('View the venue ID. Can be sorted by ascending or descending order.', 'event_espresso').'</p>';
135 135
 	}
136 136
 	
137 137
 	protected function _name_stop() {
138
-		return '<p>' . __('View the name of each venue. Can be sorted by ascending or descending order.', 'event_espresso') . '</p>';
138
+		return '<p>'.__('View the name of each venue. Can be sorted by ascending or descending order.', 'event_espresso').'</p>';
139 139
 	}
140 140
 	
141 141
 	protected function _address_stop() {
142
-		return '<p>' . __('View the address for each venue.', 'event_espresso') . '</p>';
142
+		return '<p>'.__('View the address for each venue.', 'event_espresso').'</p>';
143 143
 	}
144 144
 	
145 145
 	protected function _city_stop() {
146
-		return '<p>' . __('View the city for each venue. Can be sorted by ascending or descending order.', 'event_espresso') . '</p>';
146
+		return '<p>'.__('View the city for each venue. Can be sorted by ascending or descending order.', 'event_espresso').'</p>';
147 147
 	}
148 148
 	
149 149
 	protected function _capacity_stop() {
150
-		return '<p>' . __('View the capacity for each venue. Can be sorted by ascending or descending order.', 'event_espresso') . '</p>';
150
+		return '<p>'.__('View the capacity for each venue. Can be sorted by ascending or descending order.', 'event_espresso').'</p>';
151 151
 	}
152 152
 
153 153
 	protected function _shortcode_stop() {
154
-		return '<p>' . __('View the shortcode for a venue. This shortcode can be added to an event, WordPress post, or WordPress page. ', 'event_espresso') . '</p>';
154
+		return '<p>'.__('View the shortcode for a venue. This shortcode can be added to an event, WordPress post, or WordPress page. ', 'event_espresso').'</p>';
155 155
 	}
156 156
 
157 157
 	protected function _bulk_actions_stop() {
158
-		return '<p>' . __('Perform bulk actions to multiple venues.', 'event_espresso') . '</p>';
158
+		return '<p>'.__('Perform bulk actions to multiple venues.', 'event_espresso').'</p>';
159 159
 	}
160 160
 
161 161
 	protected function _search_stop() {
162
-		return '<p>' . __('Search through venues. The following sources will be searched: Venue Name, Venue Description, Venue Short Description, Venue Address, Venue City, Venue Zip/Postal Code, Venue Phone, Venue URL, Venue Virtual Phone, Venue Google Map link, Event Name, Event Description, Event Phone, and Event External URL.', 'event_espresso') . '</p>';
162
+		return '<p>'.__('Search through venues. The following sources will be searched: Venue Name, Venue Description, Venue Short Description, Venue Address, Venue City, Venue Zip/Postal Code, Venue Phone, Venue URL, Venue Virtual Phone, Venue Google Map link, Event Name, Event Description, Event Phone, and Event External URL.', 'event_espresso').'</p>';
163 163
 	}
164 164
 	
165 165
 	protected function _new_venue_stop() {
166
-		return '<p>' . __('Click here to add a new venue.', 'event_espresso') . '</p>';
166
+		return '<p>'.__('Click here to add a new venue.', 'event_espresso').'</p>';
167 167
 	}
168 168
 }
169 169
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
venues/templates/event_venues_metabox_content_from_manager.template.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@  discard block
 block discarded – undo
3 3
 		<td valign="top" class="use-ven-manager">
4 4
 		<label><?php _e('Select from Venue Manager List', 'event_espresso'); ?></label>
5 5
 		<?php echo $venue_selector; ?>
6
-		<?php foreach ( $venues as $venue ) :
6
+		<?php foreach ($venues as $venue) :
7 7
 			$selected = $evt_venue_id == $venue->ID() ? '' : ' style="display:none;"';
8
-			$edit_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'edit', 'post' => $venue->ID() ), EE_VENUES_ADMIN_URL );
9
-			$state_name = is_object( $venue->state_obj() ) ? $venue->state_obj()->name() : NULL;
10
-			$country_name = is_object( $venue->country_obj() ) ? $venue->country_obj()->name() : NULL;
8
+			$edit_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $venue->ID()), EE_VENUES_ADMIN_URL);
9
+			$state_name = is_object($venue->state_obj()) ? $venue->state_obj()->name() : NULL;
10
+			$country_name = is_object($venue->country_obj()) ? $venue->country_obj()->name() : NULL;
11 11
 			?>
12 12
 			<fieldset id="eebox_<?php echo $venue->ID(); ?>" class="eebox"<?php echo $selected; ?>>
13 13
 				<ul class="address-view">
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 							<span><?php _e('State:', 'event_espresso'); ?></span> <?php echo $state_name; ?><br />
19 19
 							<span><?php _e('Country:', 'event_espresso'); ?></span> <?php echo $country_name; ?><br />
20 20
 							<span><?php _e('Venue ID:', 'event_espresso'); ?></span> <?php echo $venue->ID(); ?><br /></p>
21
-							<!-- <?php printf( __('This venue\'s shortcode: %s[ESPRESSO_VENUE id="%d"]%s', 'event_espresso'), '<strong class="highlight">', $venue->ID(), '</strong>' ); ?><br /> -->
21
+							<!-- <?php printf(__('This venue\'s shortcode: %s[ESPRESSO_VENUE id="%d"]%s', 'event_espresso'), '<strong class="highlight">', $venue->ID(), '</strong>'); ?><br /> -->
22 22
 							<a href="<?php echo $edit_url; ?>" target="_blank"><?php _e('Edit this Venue', 'event_espresso'); ?></a>
23 23
 					</li>	
24 24
 				</ul>
Please login to merge, or discard this patch.
admin_pages/venues/templates/venue_gmap_metabox_content.template.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 	<tr>
3 3
 		<td valign="top">
4 4
 			<fieldset>
5
-				<?php if( isset( EE_Registry::instance()->CFG->map_settings ) && isset( EE_Registry::instance()->CFG->map_settings->use_google_maps ) && EE_Registry::instance()->CFG->map_settings->use_google_maps ) { ?>
5
+				<?php if (isset(EE_Registry::instance()->CFG->map_settings) && isset(EE_Registry::instance()->CFG->map_settings->use_google_maps) && EE_Registry::instance()->CFG->map_settings->use_google_maps) { ?>
6 6
 				<p>
7 7
 					<label for="enable_for_gmap">
8 8
 						<?php _e('Display Google Map for this venue? ', 'event_espresso') ?>
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
 					<input type="text" name="vnu_google_map_link" value="<?php echo $vnu_google_map_link; ?>" class="all-options" /> 
15 15
 				</p> -->
16 16
 				<?php } ?>
17
-				<?php if( ! isset( EE_Registry::instance()->CFG->map_settings ) || ! isset( EE_Registry::instance()->CFG->map_settings->use_google_maps ) || ! EE_Registry::instance()->CFG->map_settings->use_google_maps ) { ?>
17
+				<?php if ( ! isset(EE_Registry::instance()->CFG->map_settings) || ! isset(EE_Registry::instance()->CFG->map_settings->use_google_maps) || ! EE_Registry::instance()->CFG->map_settings->use_google_maps) { ?>
18 18
 					<p class="ee-notice">
19 19
 						<?php
20 20
 							echo sprintf( 
21
-								__('To display a Google Map for event venues, go to %sEvent Espresso General Settings%sGoogle Maps%s, and set "Activate Google Maps" to "Yes"', 'event_espresso' ),
21
+								__('To display a Google Map for event venues, go to %sEvent Espresso General Settings%sGoogle Maps%s, and set "Activate Google Maps" to "Yes"', 'event_espresso'),
22 22
 								'<b>',
23 23
 								'</b> &raquo; <b>',
24 24
 								'</b>'
Please login to merge, or discard this patch.
admin/extend/messages/espresso_events_Messages_Hooks_Extend.class.php 3 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
 	 *
96 96
 	 * @param  EE_Event $event 	EE event object
97 97
 	 * @param  array    $data   The request data from the form
98
-	 * @return bool     		success or fail
98
+	 * @return integer     		success or fail
99 99
 	 */
100 100
 	public function attach_evt_message_templates( $event, $data ) {
101 101
 		//first we remove all existing relations on the Event for message types.
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 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
 /**
@@ -22,21 +22,21 @@  discard block
 block discarded – undo
22 22
 	 *
23 23
 	 * @param \EE_Admin_Page $admin_page
24 24
 	 */
25
-	public function __construct( EE_Admin_Page $admin_page ) {
25
+	public function __construct(EE_Admin_Page $admin_page) {
26 26
 		/**
27 27
 		 * Add cap restriction ... metaboxes should not show if user does not have the ability to edit_custom_messages
28 28
 		 */
29 29
 		if (
30
-			! EE_Registry::instance()->CAP->current_user_can( 'ee_edit_messages', 'messages_events_editor_metabox' )
30
+			! EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'messages_events_editor_metabox')
31 31
 		) {
32 32
 			return;
33 33
 		}
34 34
 		add_filter(
35 35
 			'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks',
36
-			array( $this, 'caf_updates' ),
36
+			array($this, 'caf_updates'),
37 37
 			10
38 38
 		);
39
-		parent::__construct( $admin_page );
39
+		parent::__construct($admin_page);
40 40
 	}
41 41
 
42 42
 
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	protected function _extend_properties() {
51 51
 
52
-		define( 'EE_MSGS_EXTEND_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/assets/' );
52
+		define('EE_MSGS_EXTEND_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'messages/assets/');
53 53
 		$this->_ajax_func = array(
54 54
 			'ee_msgs_create_new_custom' => 'create_new_custom'
55 55
 			);
56 56
 		$this->_metaboxes = array(
57 57
 			0 => array(
58
-				'page_route' => array('edit','create_new'),
58
+				'page_route' => array('edit', 'create_new'),
59 59
 				'func' => 'messages_metabox',
60 60
 				'label' => __('Notifications', 'event_espresso'),
61 61
 				'priority' => 'high'
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
 		$this->_scripts_styles = array(
67 67
 			'registers' => array(
68 68
 				'events_msg_admin' => array(
69
-					'url' => EE_MSGS_EXTEND_ASSETS_URL . 'events_messages_admin.js',
69
+					'url' => EE_MSGS_EXTEND_ASSETS_URL.'events_messages_admin.js',
70 70
 					'depends' => array('ee-dialog', 'ee-parse-uri', 'ee-serialize-full-array')
71 71
 				),
72 72
 				'events_msg_admin_css' => array(
73
-					'url' => EE_MSGS_EXTEND_ASSETS_URL . 'ee_msg_events_admin.css',
73
+					'url' => EE_MSGS_EXTEND_ASSETS_URL.'ee_msg_events_admin.css',
74 74
 					'type' => 'css'
75 75
 				)
76 76
 			),
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
 	}
83 83
 
84 84
 
85
-	public function caf_updates( $update_callbacks ) {
86
-		$update_callbacks[] = array( $this, 'attach_evt_message_templates' );
85
+	public function caf_updates($update_callbacks) {
86
+		$update_callbacks[] = array($this, 'attach_evt_message_templates');
87 87
 		return $update_callbacks;
88 88
 	}
89 89
 
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
 	 * @param  array    $data   The request data from the form
98 98
 	 * @return bool     		success or fail
99 99
 	 */
100
-	public function attach_evt_message_templates( $event, $data ) {
100
+	public function attach_evt_message_templates($event, $data) {
101 101
 		//first we remove all existing relations on the Event for message types.
102 102
 		$event->_remove_relations('Message_Template_Group');
103 103
 		//now let's just loop through the selected templates and add relations!
104
-		if ( isset( $data[ 'event_message_templates_relation' ] ) ) {
105
-			foreach ( $data[ 'event_message_templates_relation' ] as $grp_ID ) {
106
-				$event->_add_relation_to( $grp_ID, 'Message_Template_Group' );
104
+		if (isset($data['event_message_templates_relation'])) {
105
+			foreach ($data['event_message_templates_relation'] as $grp_ID) {
106
+				$event->_add_relation_to($grp_ID, 'Message_Template_Group');
107 107
 			}
108 108
 		}
109 109
 		//now save
@@ -118,25 +118,25 @@  discard block
 block discarded – undo
118 118
 	 * @return string
119 119
 	 * @throws \EE_Error
120 120
 	 */
121
-	public function messages_metabox( $event, $callback_args ) {
121
+	public function messages_metabox($event, $callback_args) {
122 122
 		//let's get the active messengers (b/c messenger objects have the active message templates)
123 123
 		//convert 'evt_id' to 'EVT_ID'
124
-		$this->_req_data['EVT_ID'] = isset( $this->_req_data['EVT_ID'] ) ? $this->_req_data['EVT_ID'] : NULL;
125
-		$this->_req_data['EVT_ID'] = isset( $this->_req_data['post'] ) && empty( $this->_req_data['EVT_ID'] )
124
+		$this->_req_data['EVT_ID'] = isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL;
125
+		$this->_req_data['EVT_ID'] = isset($this->_req_data['post']) && empty($this->_req_data['EVT_ID'])
126 126
 			? $this->_req_data['post']
127 127
 			: $this->_req_data['EVT_ID'];
128 128
 
129
-		$this->_req_data['EVT_ID'] = empty($this->_req_data['EVT_ID'] ) && isset($this->_req_data['evt_id'] )
129
+		$this->_req_data['EVT_ID'] = empty($this->_req_data['EVT_ID']) && isset($this->_req_data['evt_id'])
130 130
 			? $this->_req_data['evt_id']
131 131
 			: $this->_req_data['EVT_ID'];
132 132
 		/** @type EE_Message_Resource_Manager $message_resource_manager */
133
-		$message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' );
133
+		$message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager');
134 134
 		$active_messengers = $message_resource_manager->active_messengers();
135 135
 		$tabs = array();
136 136
 
137 137
 		//empty messengers?
138 138
 		//Note message types will always have at least one available because every messenger has a default message type associated with it (payment) if no other message types are selected.
139
-		if ( empty( $active_messengers ) ) {
139
+		if (empty($active_messengers)) {
140 140
 			$msg_activate_url = EE_Admin_Page::add_query_args_and_nonce(
141 141
 				array('action' => 'settings'),
142 142
 				EE_MSG_ADMIN_URL
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
 				__('There are no active messengers. So no notifications will go out for %1$sany%2$s events.  You will want to %3$sActivate a Messenger%4$s.', 'event_espresso'),
146 146
 				'<strong>',
147 147
 				'</strong>',
148
-				'<a href="' . $msg_activate_url . '">',
148
+				'<a href="'.$msg_activate_url.'">',
149 149
 				'</a>'
150 150
 			);
151
-			$error_content = '<div class="error"><p>' . $error_msg . '</p></div>';
152
-			$internal_content = '<div id="messages-error"><p>' . $error_msg . '</p></div>';
151
+			$error_content = '<div class="error"><p>'.$error_msg.'</p></div>';
152
+			$internal_content = '<div id="messages-error"><p>'.$error_msg.'</p></div>';
153 153
 
154 154
 			echo $error_content;
155 155
 			echo $internal_content;
@@ -158,20 +158,20 @@  discard block
 block discarded – undo
158 158
 
159 159
 		$event_id = isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL;
160 160
 		//get content for active messengers
161
-		foreach ( $active_messengers as $name => $messenger ) {
161
+		foreach ($active_messengers as $name => $messenger) {
162 162
 			//first check if there are any active message types for this messenger.
163
-			$active_mts = $message_resource_manager->get_active_message_types_for_messenger( $name );
164
-			if ( empty( $active_mts ) ) {
163
+			$active_mts = $message_resource_manager->get_active_message_types_for_messenger($name);
164
+			if (empty($active_mts)) {
165 165
 				continue;
166 166
 			}
167 167
 
168 168
 			$tab_content = $messenger->get_messenger_admin_page_content(
169 169
 				'events',
170 170
 				'edit',
171
-				array( 'event' => $event_id )
171
+				array('event' => $event_id)
172 172
 			);
173 173
 
174
-			if ( ! empty( $tab_content ) ) {
174
+			if ( ! empty($tab_content)) {
175 175
 				$tabs[$name] = $tab_content;
176 176
 			}
177 177
 		}
@@ -179,23 +179,23 @@  discard block
 block discarded – undo
179 179
 
180 180
 		//we want this to be tabbed content so let's use the EEH_Tabbed_Content::display helper.
181 181
 		$tabbed_content = EEH_Tabbed_Content::display($tabs);
182
-		if ( $tabbed_content instanceof WP_Error ) {
182
+		if ($tabbed_content instanceof WP_Error) {
183 183
 			$tabbed_content = $tabbed_content->get_error_message();
184 184
 		}
185 185
 
186 186
 		$notices = '
187 187
 	<div id="espresso-ajax-loading" class="ajax-loader-grey">
188
-		<span class="ee-spinner ee-spin"></span><span class="hidden">' . __('loading...', 'event_espresso') . '</span>
188
+		<span class="ee-spinner ee-spin"></span><span class="hidden">' . __('loading...', 'event_espresso').'</span>
189 189
 	</div>
190 190
 	<div class="ee-notices"></div>';
191 191
 
192
-		if ( defined('DOING_AJAX' ) ) {
192
+		if (defined('DOING_AJAX')) {
193 193
 			return $tabbed_content;
194 194
 		}
195 195
 
196
-		do_action( 'AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__before_content' );
197
-		echo $notices . '<div class="messages-tabs-content">' . $tabbed_content . '</div>';
198
-		do_action( 'AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__after_content' );
196
+		do_action('AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__before_content');
197
+		echo $notices.'<div class="messages-tabs-content">'.$tabbed_content.'</div>';
198
+		do_action('AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__after_content');
199 199
 
200 200
 	}
201 201
 
@@ -210,15 +210,15 @@  discard block
 block discarded – undo
210 210
 	 */
211 211
 	public function create_new_custom() {
212 212
 
213
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_edit_messages', 'create_new_custom_ajax' ) ) {
214
-			wp_die( __('You don\'t have privileges to do this action', 'event_espresso' ) );
213
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'create_new_custom_ajax')) {
214
+			wp_die(__('You don\'t have privileges to do this action', 'event_espresso'));
215 215
 		}
216 216
 
217 217
 		//let's clean up the _POST global a bit for downstream usage of name and description.
218
-		$_POST['templateName'] = !empty( $this->_req_data['custom_template_args']['MTP_name'] )
218
+		$_POST['templateName'] = ! empty($this->_req_data['custom_template_args']['MTP_name'])
219 219
 			? $this->_req_data['custom_template_args']['MTP_name']
220 220
 			: '';
221
-		$_POST['templateDescription'] = !empty( $this->_req_data['custom_template_args']['MTP_description'] )
221
+		$_POST['templateDescription'] = ! empty($this->_req_data['custom_template_args']['MTP_description'])
222 222
 			? $this->_req_data['custom_template_args']['MTP_description']
223 223
 			: '';
224 224
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 		$this->_set_page_object();
228 228
 
229 229
 		// is this a template switch if so EE_Admin_Page child needs this object
230
-		$this->_page_object->set_hook_object( $this );
230
+		$this->_page_object->set_hook_object($this);
231 231
 
232 232
 		$this->_page_object->add_message_template(
233 233
 			$this->_req_data['messageType'],
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	 */
252 252
 	public function edit_admin_footer() {
253 253
 		EEH_Template::display_template(
254
-			EE_CORE_CAF_ADMIN_EXTEND . 'messages/templates/create_custom_template_form.template.php'
254
+			EE_CORE_CAF_ADMIN_EXTEND.'messages/templates/create_custom_template_form.template.php'
255 255
 		);
256 256
 	}
257 257
 
Please login to merge, or discard this patch.
caffeinated/payment_methods/Mijireh/EEG_Mijireh.gateway.php 3 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -99,45 +99,45 @@
 block discarded – undo
99 99
 		'body'=>  json_encode($order)
100 100
 		);
101 101
 		$response = wp_remote_post( $this->_mijireh_api_orders_url, $args );
102
-                $problems_string = false;
102
+				$problems_string = false;
103 103
 		$this->log(array('get checkout url request_args' => $args, 'response' => $response ), $payment);
104 104
 		if( ! $response instanceof WP_Error ){
105 105
 			$response_body = json_decode($response['body']);
106 106
 			if($response_body && isset($response_body->checkout_url)){
107
-                            $payment->set_redirect_url($response_body->checkout_url);
108
-                            $payment->set_txn_id_chq_nmbr($response_body->order_number);
109
-                            $payment->set_details($response['body']);
107
+							$payment->set_redirect_url($response_body->checkout_url);
108
+							$payment->set_txn_id_chq_nmbr($response_body->order_number);
109
+							$payment->set_details($response['body']);
110 110
 			} else {
111
-                           if( is_array( $response_body ) || is_object( $response_body)){
112
-                                    $response_body_as_array = (array)$response_body;
113
-                                    foreach($response_body_as_array as $problem_parameter => $problems){
114
-                                            $problems_string.= sprintf(__('\nProblems with %s: %s','event_espresso'),$problem_parameter,implode(", ",$problems));
115
-                                    }
116
-                            }else{
117
-                                    $problems_string = $response['body'];
118
-                            }
119
-                            if( ! $problems_string ) {
120
-                                //no message to show? wack
121
-                                if( isset( $response[ 'headers' ][ 'status' ] ) ){
122
-                                        $problems_string = $response[ 'headers' ][ 'status' ];
123
-                                }else{
124
-                                        $problems_string = __( 'No response from Mijireh', 'event_espresso' );
125
-                                }
126
-                            }
127
-                        }
111
+						   if( is_array( $response_body ) || is_object( $response_body)){
112
+									$response_body_as_array = (array)$response_body;
113
+									foreach($response_body_as_array as $problem_parameter => $problems){
114
+											$problems_string.= sprintf(__('\nProblems with %s: %s','event_espresso'),$problem_parameter,implode(", ",$problems));
115
+									}
116
+							}else{
117
+									$problems_string = $response['body'];
118
+							}
119
+							if( ! $problems_string ) {
120
+								//no message to show? wack
121
+								if( isset( $response[ 'headers' ][ 'status' ] ) ){
122
+										$problems_string = $response[ 'headers' ][ 'status' ];
123
+								}else{
124
+										$problems_string = __( 'No response from Mijireh', 'event_espresso' );
125
+								}
126
+							}
127
+						}
128 128
 		}else{
129
-                    $problems_string = implode( ",", $response->get_error_messages() );
129
+					$problems_string = implode( ",", $response->get_error_messages() );
130 130
 		}
131 131
                 
132
-                if( $problems_string ) {
133
-                    $payment->set_gateway_response( sprintf( __( 'Errors occurred communicating with Mijireh: %1$s', 'event_espresso'), $problems_string ) );
134
-                    $payment->set_details( $response );
135
-                    $payment->set_redirect_url( null );
136
-                    //even though the payment's status is failed at this point anyways,
137
-                    //let's be explicit about it. The fact that the redirect url is null
138
-                    //should be enough to client code that they can't redirect the user
139
-                    $payment->set_status( $this->_pay_model->failed_status() );
140
-                }
132
+				if( $problems_string ) {
133
+					$payment->set_gateway_response( sprintf( __( 'Errors occurred communicating with Mijireh: %1$s', 'event_espresso'), $problems_string ) );
134
+					$payment->set_details( $response );
135
+					$payment->set_redirect_url( null );
136
+					//even though the payment's status is failed at this point anyways,
137
+					//let's be explicit about it. The fact that the redirect url is null
138
+					//should be enough to client code that they can't redirect the user
139
+					$payment->set_status( $this->_pay_model->failed_status() );
140
+				}
141 141
 		return $payment;
142 142
 	}
143 143
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 					'quantity'=>$line_item->quantity()
49 49
 				);
50 50
 			}
51
-		}else{//its a partial payment
51
+		} else{//its a partial payment
52 52
 			$tax_total = 0;
53 53
 			//partial payment, so just add 1 item
54 54
 			$items[] = array(
@@ -113,19 +113,19 @@  discard block
 block discarded – undo
113 113
                                     foreach($response_body_as_array as $problem_parameter => $problems){
114 114
                                             $problems_string.= sprintf(__('\nProblems with %s: %s','event_espresso'),$problem_parameter,implode(", ",$problems));
115 115
                                     }
116
-                            }else{
116
+                            } else{
117 117
                                     $problems_string = $response['body'];
118 118
                             }
119 119
                             if( ! $problems_string ) {
120 120
                                 //no message to show? wack
121 121
                                 if( isset( $response[ 'headers' ][ 'status' ] ) ){
122 122
                                         $problems_string = $response[ 'headers' ][ 'status' ];
123
-                                }else{
123
+                                } else{
124 124
                                         $problems_string = __( 'No response from Mijireh', 'event_espresso' );
125 125
                                 }
126 126
                             }
127 127
                         }
128
-		}else{
128
+		} else{
129 129
                     $problems_string = implode( ",", $response->get_error_messages() );
130 130
 		}
131 131
                 
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
 				$prepared_data[ $key ] = $this->_prepare_for_mijireh( $datum );
157 157
 			}
158 158
 			return $prepared_data;
159
-		}elseif(is_string( $data ) ){
159
+		} elseif(is_string( $data ) ){
160 160
 			return str_replace( '%', 'percent', $data );
161
-		}else{
161
+		} else{
162 162
 			return $data;
163 163
 		}
164 164
 	}
Please login to merge, or discard this patch.
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @author				Mike Nelson
9 9
  *
10 10
  */
11
-class EEG_Mijireh extends EE_Offsite_Gateway{
11
+class EEG_Mijireh extends EE_Offsite_Gateway {
12 12
 
13 13
 	protected $_access_key;
14 14
 
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
 		$primary_attendee = $primary_registrant->attendee();
38 38
 		$items = array();
39 39
 		//if we're are charging for the full amount, show the normal line items
40
-		if( $this->_can_easily_itemize_transaction_for( $payment )){
40
+		if ($this->_can_easily_itemize_transaction_for($payment)) {
41 41
 			$total_line_item = $transaction->total_line_item();
42 42
 			$tax_total = $total_line_item->get_total_tax();
43
-			foreach($total_line_item->get_items() as $line_item){
43
+			foreach ($total_line_item->get_items() as $line_item) {
44 44
 				$items[] = array(
45 45
 					'name'=>apply_filters(
46 46
 						'FHEE__EEG_Mijireh__set_redirection_info__full_amount_line_item_name',
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 					'quantity'=>$line_item->quantity()
55 55
 				);
56 56
 			}
57
-		}else{//its a partial payment
57
+		} else {//its a partial payment
58 58
 			$tax_total = 0;
59 59
 			//partial payment, so just add 1 item
60 60
 			$items[] = array(
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 					'FHEE__EEG_Mijireh__set_redirection_info__partial_amount_line_item_name',
63 63
 					sprintf(
64 64
 						__("Payment of %s for %s", 'event_espresso'),
65
-						$payment->get_pretty( 'PAY_amount', 'no_currency_code' ),
65
+						$payment->get_pretty('PAY_amount', 'no_currency_code'),
66 66
 						$primary_registrant->event_name()
67 67
 					),
68 68
 					$payment,
@@ -76,18 +76,18 @@  discard block
 block discarded – undo
76 76
 		$order = array(
77 77
 			'total'=>$this->format_currency($payment->amount()),
78 78
 			'return_url'=>$return_url,
79
-			'items'=>$this->_prepare_for_mijireh( $items ),
79
+			'items'=>$this->_prepare_for_mijireh($items),
80 80
 			'email'=>$primary_attendee->email(),
81 81
 			'first_name'=>$primary_attendee->fname(),
82 82
 			'last_name'=>$primary_attendee->lname(),
83 83
 			'tax'=>$this->format_currency($tax_total),
84 84
 			'partner_id'=>'ee');
85 85
 		//setup address?
86
-		if(		$primary_attendee->address()  &&
87
-				$primary_attendee->city()  &&
88
-				$primary_attendee->state_ID()  &&
89
-				$primary_attendee->country_ID()  &&
90
-				$primary_attendee->zip()  ){
86
+		if ($primary_attendee->address() &&
87
+				$primary_attendee->city() &&
88
+				$primary_attendee->state_ID() &&
89
+				$primary_attendee->country_ID() &&
90
+				$primary_attendee->zip()) {
91 91
 			$shipping_address = array(
92 92
 				'first_name'=>$primary_attendee->fname(),
93 93
 				'last_name'=>$primary_attendee->lname(),
@@ -97,62 +97,62 @@  discard block
 block discarded – undo
97 97
 				'zip_code' => $primary_attendee->zip(),
98 98
 				'country' => $primary_attendee->country_ID()
99 99
 			);
100
-			if( $primary_attendee->address2() ){
101
-				$shipping_address[ 'apt_suite' ] = $primary_attendee->address2();
100
+			if ($primary_attendee->address2()) {
101
+				$shipping_address['apt_suite'] = $primary_attendee->address2();
102 102
 			}
103
-			if( $primary_attendee->phone() ){
104
-				$shipping_address[ 'phone' ] = $primary_attendee->phone();
103
+			if ($primary_attendee->phone()) {
104
+				$shipping_address['phone'] = $primary_attendee->phone();
105 105
 			}
106
-			$order[ 'shipping_address' ] = $shipping_address;
106
+			$order['shipping_address'] = $shipping_address;
107 107
 		}
108
-		$order = apply_filters( 'FHEE__EEG_Mijireh__set_redirection_info__order_arguments', $order, $payment, $primary_registrant );
109
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, serialize(get_object_vars($this)) );
108
+		$order = apply_filters('FHEE__EEG_Mijireh__set_redirection_info__order_arguments', $order, $payment, $primary_registrant);
109
+		do_action('AHEE_log', __FILE__, __FUNCTION__, serialize(get_object_vars($this)));
110 110
 		$args = array(
111 111
 			'headers' => array(
112
-				'Authorization' => 'Basic ' . base64_encode( $this->_access_key . ':' ),
112
+				'Authorization' => 'Basic '.base64_encode($this->_access_key.':'),
113 113
 				'Accept'=>'application/json'
114 114
 			),
115 115
 			'body'=>  json_encode($order)
116 116
 		);
117
-		$response = wp_remote_post( $this->_mijireh_api_orders_url, $args );
117
+		$response = wp_remote_post($this->_mijireh_api_orders_url, $args);
118 118
                 $problems_string = false;
119
-		$this->log(array('get checkout url request_args' => $args, 'response' => $response ), $payment);
120
-		if( ! $response instanceof WP_Error ){
119
+		$this->log(array('get checkout url request_args' => $args, 'response' => $response), $payment);
120
+		if ( ! $response instanceof WP_Error) {
121 121
 			$response_body = json_decode($response['body']);
122
-			if($response_body && isset($response_body->checkout_url)){
122
+			if ($response_body && isset($response_body->checkout_url)) {
123 123
                             $payment->set_redirect_url($response_body->checkout_url);
124 124
                             $payment->set_txn_id_chq_nmbr($response_body->order_number);
125 125
                             $payment->set_details($response['body']);
126 126
 			} else {
127
-                           if( is_array( $response_body ) || is_object( $response_body)){
128
-                                    $response_body_as_array = (array)$response_body;
129
-                                    foreach($response_body_as_array as $problem_parameter => $problems){
130
-                                            $problems_string.= sprintf(__('\nProblems with %s: %s','event_espresso'),$problem_parameter,implode(", ",$problems));
127
+                           if (is_array($response_body) || is_object($response_body)) {
128
+                                    $response_body_as_array = (array) $response_body;
129
+                                    foreach ($response_body_as_array as $problem_parameter => $problems) {
130
+                                            $problems_string .= sprintf(__('\nProblems with %s: %s', 'event_espresso'), $problem_parameter, implode(", ", $problems));
131 131
                                     }
132
-                            }else{
132
+                            } else {
133 133
                                     $problems_string = $response['body'];
134 134
                             }
135
-                            if( ! $problems_string ) {
135
+                            if ( ! $problems_string) {
136 136
                                 //no message to show? wack
137
-                                if( isset( $response[ 'headers' ][ 'status' ] ) ){
138
-                                        $problems_string = $response[ 'headers' ][ 'status' ];
139
-                                }else{
140
-                                        $problems_string = __( 'No response from Mijireh', 'event_espresso' );
137
+                                if (isset($response['headers']['status'])) {
138
+                                        $problems_string = $response['headers']['status'];
139
+                                } else {
140
+                                        $problems_string = __('No response from Mijireh', 'event_espresso');
141 141
                                 }
142 142
                             }
143 143
                         }
144
-		}else{
145
-                    $problems_string = implode( ",", $response->get_error_messages() );
144
+		} else {
145
+                    $problems_string = implode(",", $response->get_error_messages());
146 146
 		}
147 147
                 
148
-                if( $problems_string ) {
149
-                    $payment->set_gateway_response( sprintf( __( 'Errors occurred communicating with Mijireh: %1$s', 'event_espresso'), $problems_string ) );
150
-                    $payment->set_details( $response );
151
-                    $payment->set_redirect_url( null );
148
+                if ($problems_string) {
149
+                    $payment->set_gateway_response(sprintf(__('Errors occurred communicating with Mijireh: %1$s', 'event_espresso'), $problems_string));
150
+                    $payment->set_details($response);
151
+                    $payment->set_redirect_url(null);
152 152
                     //even though the payment's status is failed at this point anyways,
153 153
                     //let's be explicit about it. The fact that the redirect url is null
154 154
                     //should be enough to client code that they can't redirect the user
155
-                    $payment->set_status( $this->_pay_model->failed_status() );
155
+                    $payment->set_status($this->_pay_model->failed_status());
156 156
                 }
157 157
 		return $payment;
158 158
 	}
@@ -165,16 +165,16 @@  discard block
 block discarded – undo
165 165
 	 * @param mixed $data
166 166
 	 * @return mixed same type as $data
167 167
 	 */
168
-	private function _prepare_for_mijireh( $data ){
169
-		if( is_array( $data ) ){
168
+	private function _prepare_for_mijireh($data) {
169
+		if (is_array($data)) {
170 170
 			$prepared_data = array();
171
-			foreach($data as $key => $datum ){
172
-				$prepared_data[ $key ] = $this->_prepare_for_mijireh( $datum );
171
+			foreach ($data as $key => $datum) {
172
+				$prepared_data[$key] = $this->_prepare_for_mijireh($datum);
173 173
 			}
174 174
 			return $prepared_data;
175
-		}elseif(is_string( $data ) ){
176
-			return str_replace( '%', 'percent', $data );
177
-		}else{
175
+		}elseif (is_string($data)) {
176
+			return str_replace('%', 'percent', $data);
177
+		} else {
178 178
 			return $data;
179 179
 		}
180 180
 	}
@@ -195,30 +195,30 @@  discard block
 block discarded – undo
195 195
 
196 196
 		$payment = $transaction instanceof EEI_Transaction ? $transaction->last_payment() : NULL;
197 197
 
198
-		if ( ! $payment instanceof EEI_Payment ){
199
-			throw new EE_Error( sprintf( __( "Could not find Mijireh payment for transaction %s", 'event_espresso' ), $transaction->ID() ) );
198
+		if ( ! $payment instanceof EEI_Payment) {
199
+			throw new EE_Error(sprintf(__("Could not find Mijireh payment for transaction %s", 'event_espresso'), $transaction->ID()));
200 200
 		}
201 201
 
202 202
 		$request_args = array(
203 203
 			'headers' => array(
204
-				'Authorization' => 'Basic ' . base64_encode( $this->_access_key . ':' ),
204
+				'Authorization' => 'Basic '.base64_encode($this->_access_key.':'),
205 205
 				'Accept'=>'application/json'
206 206
 			)
207 207
 		);
208 208
 
209 209
 		$response = wp_remote_get(
210
-			$this->_mijireh_api_orders_url . '/' . $payment->txn_id_chq_nmbr(),
210
+			$this->_mijireh_api_orders_url.'/'.$payment->txn_id_chq_nmbr(),
211 211
 			$request_args
212 212
 		);
213 213
 
214 214
 		$this->log(
215
-			array( 'get payment status request_args' => $request_args, 'response' => $response ),
215
+			array('get payment status request_args' => $request_args, 'response' => $response),
216 216
 			$payment
217 217
 		);
218 218
 		// validate response
219
-		$response_body = isset( $response[ 'body' ] ) ? json_decode( $response[ 'body' ] ) : '';
220
-		if( $response && $response_body ){
221
-			switch( $response_body->status ){
219
+		$response_body = isset($response['body']) ? json_decode($response['body']) : '';
220
+		if ($response && $response_body) {
221
+			switch ($response_body->status) {
222 222
 				case 'paid':
223 223
 					$payment->set_status($this->_pay_model->approved_status());
224 224
 					break;
@@ -230,9 +230,9 @@  discard block
 block discarded – undo
230 230
 			}
231 231
 
232 232
 		} else {
233
-			$payment->set_gateway_response( __( 'Response from Mijireh could not be understood.', 'event_espresso' ) );
234
-			$payment->set_details( $response );
235
-			$payment->set_status( $this->_pay_model->failed_status() );
233
+			$payment->set_gateway_response(__('Response from Mijireh could not be understood.', 'event_espresso'));
234
+			$payment->set_details($response);
235
+			$payment->set_status($this->_pay_model->failed_status());
236 236
 		}
237 237
 		// the following is ONLY for testing the Mijireh IPN and should NEVER be uncommented for real usage
238 238
 //		$payment->set_status( $this->_pay_model->pending_status() );
Please login to merge, or discard this patch.
payment_methods/Mijireh/templates/mijireh_settings_after_form.template.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php if (!defined('EVENT_ESPRESSO_VERSION'))
2 2
 	exit('No direct script access allowed');
3 3
 /**
4
- * mijireh_settings_after_form
5
- *
6
- * @package			Event Espresso
7
- * @subpackage
8
- * @author				Mike Nelson
9
- */
4
+	 * mijireh_settings_after_form
5
+	 *
6
+	 * @package			Event Espresso
7
+	 * @subpackage
8
+	 * @author				Mike Nelson
9
+	 */
10 10
 do_action('AHEE__EE_Mijireh__settings_end');
11 11
 ?><br/><?php
12 12
 // End of file mijireh_settings_after_form.template.php
13 13
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION'))
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION'))
2 2
 	exit('No direct script access allowed');
3 3
 /**
4 4
  * mijireh_settings_after_form
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,6 @@
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION'))
1
+<?php if (!defined('EVENT_ESPRESSO_VERSION')) {
2 2
 	exit('No direct script access allowed');
3
+}
3 4
 /**
4 5
  * mijireh_settings_after_form
5 6
  *
Please login to merge, or discard this patch.