Completed
Branch Gutenberg/espresso-cpt-editor (d57906)
by
unknown
78:21 queued 69:49
created
core/libraries/shortcodes/EE_Payment_List_Shortcodes.lib.php 2 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.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 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
 /**
@@ -32,18 +32,18 @@  discard block
 block discarded – undo
32 32
 		$this->label = __('Payment List Shortcodes', 'event_espresso');
33 33
 		$this->description = __('All shortcodes specific to payment lists', 'event_espresso');
34 34
 		$this->_shortcodes = array(
35
-			'[PAYMENT_LIST_*]' => __('Outputs a list of payment items. Note, this is a dynamic shortcode in that it accepts some attributes for setting certain defaults.  Attributes that are available are:', 'event_espresso') . '<p><ul>' .
36
-				'<li><strong>no_payments</strong>:' . sprintf( __('Indicate with this attribute what will be used if there are no payments present.  Default is: "%sNo approved payments have been received.%s"', 'event_espresso'),  htmlspecialchars('<td class="aln-cntr" colspan="6">'), htmlspecialchars('</td>') ) . '</li>' .
35
+			'[PAYMENT_LIST_*]' => __('Outputs a list of payment items. Note, this is a dynamic shortcode in that it accepts some attributes for setting certain defaults.  Attributes that are available are:', 'event_espresso').'<p><ul>'.
36
+				'<li><strong>no_payments</strong>:'.sprintf(__('Indicate with this attribute what will be used if there are no payments present.  Default is: "%sNo approved payments have been received.%s"', 'event_espresso'), htmlspecialchars('<td class="aln-cntr" colspan="6">'), htmlspecialchars('</td>')).'</li>'.
37 37
 				'</ul></p>'
38 38
 			);
39 39
 	}
40 40
 
41 41
 
42 42
 
43
-	protected function _parser( $shortcode ) {
43
+	protected function _parser($shortcode) {
44 44
 
45
-		if ( strpos( $shortcode, '[PAYMENT_LIST_*' ) !== FALSE ) {
46
-			return $this->_get_payment_list( $shortcode );
45
+		if (strpos($shortcode, '[PAYMENT_LIST_*') !== FALSE) {
46
+			return $this->_get_payment_list($shortcode);
47 47
 		}
48 48
 		return '';
49 49
 	}
@@ -60,32 +60,32 @@  discard block
 block discarded – undo
60 60
 	 *
61 61
 	 * @return string parsed ticket line item list.
62 62
 	 */
63
-	private function _get_payment_list( $shortcode ) {
63
+	private function _get_payment_list($shortcode) {
64 64
 		$this->_validate_list_requirements();
65 65
 
66 66
 
67
-		if ( ! $this->_data['data'] instanceof EE_Messages_Addressee ) {
67
+		if ( ! $this->_data['data'] instanceof EE_Messages_Addressee) {
68 68
 			return '';
69 69
 		}
70 70
 
71
-		$valid_shortcodes = array( 'payment' );
71
+		$valid_shortcodes = array('payment');
72 72
 
73 73
 		$addressee_obj = $this->_data['data'];
74 74
 		$templates = $this->_extra_data['template'];
75
-		$payments = apply_filters( 'FHEE__Payment_List_Shortcodes___get_payments_list__payments', $addressee_obj->payments );
75
+		$payments = apply_filters('FHEE__Payment_List_Shortcodes___get_payments_list__payments', $addressee_obj->payments);
76 76
 
77 77
 		//let's get any attributes that may be present and set the defaults.
78
-		$atts = $this->_get_shortcode_attrs( $shortcode );
78
+		$atts = $this->_get_shortcode_attrs($shortcode);
79 79
 
80
-		$no_payments_msg = empty( $atts['no_payments'] ) ?  __('No approved payments have been received.','event_espresso') : $atts['no_payments'];
80
+		$no_payments_msg = empty($atts['no_payments']) ?  __('No approved payments have been received.', 'event_espresso') : $atts['no_payments'];
81 81
 
82 82
 		//made it here so we have an array of paymnets, so we should have what we need.
83
-		$payment_content = empty( $payments ) ? $no_payments_msg : '';
83
+		$payment_content = empty($payments) ? $no_payments_msg : '';
84 84
 
85 85
 		$payments = (array) $payments;
86 86
 
87
-		foreach ( $payments as $payment ) {
88
-			$payment_content .= $this->_shortcode_helper->parse_payment_list_template( $templates['payment_list'], $payment, $valid_shortcodes, $this->_extra_data );
87
+		foreach ($payments as $payment) {
88
+			$payment_content .= $this->_shortcode_helper->parse_payment_list_template($templates['payment_list'], $payment, $valid_shortcodes, $this->_extra_data);
89 89
 		}
90 90
 
91 91
 		return $payment_content;
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Datetime_Shortcodes.lib.php 2 patches
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.
Spacing   +13 added lines, -13 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
 /**
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
 	 * @param string $shortcode
62 62
 	 * @return string
63 63
 	 */
64
-	protected function _parser( $shortcode ) {
64
+	protected function _parser($shortcode) {
65 65
 
66
-		if ( ! $this->_data instanceof EE_Datetime ) {
66
+		if ( ! $this->_data instanceof EE_Datetime) {
67 67
 			return ''; //get out cause we can only parse with the datetime object.
68 68
 		}
69 69
 
70
-		switch ( $shortcode ) {
70
+		switch ($shortcode) {
71 71
 
72 72
 			case '[DATETIME_START]' :
73 73
 				return $this->_data->get_i18n_datetime('DTT_EVT_start');
@@ -81,27 +81,27 @@  discard block
 block discarded – undo
81 81
 				return $this->_data->get_timezone();
82 82
 				break;
83 83
 			case '[DATE_START]' :
84
-				return $this->_data->get_i18n_datetime( 'DTT_EVT_start', get_option( 'date_format' ) );
84
+				return $this->_data->get_i18n_datetime('DTT_EVT_start', get_option('date_format'));
85 85
 				break;
86 86
 			case '[DATE_END]' :
87
-				return $this->_data->get_i18n_datetime( 'DTT_EVT_end', get_option( 'date_format' ) );
87
+				return $this->_data->get_i18n_datetime('DTT_EVT_end', get_option('date_format'));
88 88
 				break;
89 89
 			case '[TIME_START]' :
90
-				return $this->_data->get_i18n_datetime( 'DTT_EVT_start', get_option( 'time_format' ) );
90
+				return $this->_data->get_i18n_datetime('DTT_EVT_start', get_option('time_format'));
91 91
 				break;
92 92
 			case '[TIME_END]' :
93
-				return $this->_data->get_i18n_datetime( 'DTT_EVT_end', get_option( 'time_format' ) );
93
+				return $this->_data->get_i18n_datetime('DTT_EVT_end', get_option('time_format'));
94 94
 				break;
95 95
 		}
96 96
 
97
-		if ( strpos( $shortcode, '[ICAL_LINK_*') !== FALSE  ) {
98
-			$attrs = $this->_get_shortcode_attrs( $shortcode );
97
+		if (strpos($shortcode, '[ICAL_LINK_*') !== FALSE) {
98
+			$attrs = $this->_get_shortcode_attrs($shortcode);
99 99
 			
100
-			$link_text = empty( $attrs['link_text'] ) ?  __( 'Add to iCal Calendar', 'event_espresso' ) : $attrs['link_text'];
100
+			$link_text = empty($attrs['link_text']) ?  __('Add to iCal Calendar', 'event_espresso') : $attrs['link_text'];
101 101
 			
102
-			$URL = add_query_arg( array( 'ee' => 'download_ics_file', 'ics_id' => $this->_data->ID() ), site_url() );
102
+			$URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $this->_data->ID()), site_url());
103 103
 		
104
-			return '<a class="ee-ical" href="' . $URL . '">' . $link_text . '</a>';
104
+			return '<a class="ee-ical" href="'.$URL.'">'.$link_text.'</a>';
105 105
 			
106 106
 		}
107 107
 
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Recipient_List_Shortcodes.lib.php 2 patches
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 
44 44
 
45 45
 
46
-	protected function _parser( $shortcode ) {
47
-		switch ( $shortcode ) {
46
+	protected function _parser($shortcode) {
47
+		switch ($shortcode) {
48 48
 			case '[RECIPIENT_TICKET_LIST]' :
49 49
 				return $this->_get_recipient_ticket_list();
50 50
 				break;
@@ -66,34 +66,34 @@  discard block
 block discarded – undo
66 66
 	private function _get_recipient_ticket_list() {
67 67
 		$this->_validate_list_requirements();
68 68
 
69
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
70
-			return $this->_get_recipient_ticket_list_parsed( $this->_data['data'] );
71
-		} else if ( $this->_extra_data['data'] instanceof EE_Messages_Addressee ) {
72
-			return $this->_get_recipient_ticket_list_parsed( $this->_extra_data['data'] );
69
+		if ($this->_data['data'] instanceof EE_Messages_Addressee) {
70
+			return $this->_get_recipient_ticket_list_parsed($this->_data['data']);
71
+		} else if ($this->_extra_data['data'] instanceof EE_Messages_Addressee) {
72
+			return $this->_get_recipient_ticket_list_parsed($this->_extra_data['data']);
73 73
 		} else {
74 74
 			return '';
75 75
 		}
76 76
 	}
77 77
 
78 78
 
79
-	private function _get_recipient_ticket_list_parsed( EE_Messages_Addressee $data ) {
79
+	private function _get_recipient_ticket_list_parsed(EE_Messages_Addressee $data) {
80 80
 		//first get registrations just for this attendee.
81 81
 		$att = $data->att_obj;
82 82
 		$registrations_on_attendee = $att instanceof EE_Attendee ? $data->attendees[$att->ID()]['reg_objs'] : array();
83
-		$registrations_on_attendee = empty( $registrations_on_attendee ) && $data->reg_obj instanceof EE_Registration ? array( $data->reg_obj ) : $registrations_on_attendee;
83
+		$registrations_on_attendee = empty($registrations_on_attendee) && $data->reg_obj instanceof EE_Registration ? array($data->reg_obj) : $registrations_on_attendee;
84 84
 		$tkts = array();
85 85
 
86 86
 		//if we're coming in from the main content then $this->_data['data'] is instanceof EE_Messages_Addressee.
87 87
 		//which means we want to get tickets for all events this addressee is a part of.
88
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
89
-			$valid_shortcodes = array('ticket', 'event_list', 'attendee_list','datetime_list', 'registration_details', 'attendee', 'recipient_details');
88
+		if ($this->_data['data'] instanceof EE_Messages_Addressee) {
89
+			$valid_shortcodes = array('ticket', 'event_list', 'attendee_list', 'datetime_list', 'registration_details', 'attendee', 'recipient_details');
90 90
 			$template = $this->_data['template'];
91 91
 
92 92
 			//tickets will be tickets for all registrations on this attendee.
93
-			foreach ( $registrations_on_attendee as $reg ) {
94
-				if ( $reg instanceof EE_Registration ) {
95
-					$ticket = isset( $data->registrations[$reg->ID()] ) && is_array( $data->registrations[$reg->ID()] ) && isset( $data->registrations[$reg->ID()]['tkt_obj'] ) ? $data->registrations[$reg->ID()]['tkt_obj'] : null;
96
-					if ( $ticket instanceof EE_Ticket ) {
93
+			foreach ($registrations_on_attendee as $reg) {
94
+				if ($reg instanceof EE_Registration) {
95
+					$ticket = isset($data->registrations[$reg->ID()]) && is_array($data->registrations[$reg->ID()]) && isset($data->registrations[$reg->ID()]['tkt_obj']) ? $data->registrations[$reg->ID()]['tkt_obj'] : null;
96
+					if ($ticket instanceof EE_Ticket) {
97 97
 						$tkts[$ticket->ID()] = $ticket;
98 98
 					}
99 99
 				}
@@ -102,16 +102,16 @@  discard block
 block discarded – undo
102 102
 
103 103
 		//if coming from the context of the event list parser, then let's return just the tickets for that event.
104 104
 		$event = $this->_data['data'];
105
-		if ( $event instanceof EE_Event ) {
105
+		if ($event instanceof EE_Event) {
106 106
 			$valid_shortcodes = array('ticket', 'attendee_list', 'datetime_list', 'attendee', 'recipient_details');
107
-			$template = is_array($this->_data['template'] ) && isset($this->_data['template']['ticket_list']) ? $this->_data['template']['ticket_list'] : $this->_extra_data['template']['ticket_list'];
107
+			$template = is_array($this->_data['template']) && isset($this->_data['template']['ticket_list']) ? $this->_data['template']['ticket_list'] : $this->_extra_data['template']['ticket_list'];
108 108
 			//let's remove any existing [EVENT_LIST] shortcode from the ticket list template so that we don't get recursion.
109 109
 			$template = str_replace('[EVENT_LIST]', '', $template);
110 110
 			//data will be tickets for this event for this recipient.
111
-			foreach ( $registrations_on_attendee as $reg ) {
112
-				if ( $reg instanceof EE_Registration && $reg->event_ID() == $event->ID() ) {
113
-					$ticket = isset( $data->registrations[$reg->ID()] ) && is_array( $data->registrations[$reg->ID()] ) && isset( $data->registrations[$reg->ID()]['tkt_obj'] ) ? $data->registrations[$reg->ID()]['tkt_obj'] : null;
114
-					if ( $ticket instanceof EE_Ticket ) {
111
+			foreach ($registrations_on_attendee as $reg) {
112
+				if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) {
113
+					$ticket = isset($data->registrations[$reg->ID()]) && is_array($data->registrations[$reg->ID()]) && isset($data->registrations[$reg->ID()]['tkt_obj']) ? $data->registrations[$reg->ID()]['tkt_obj'] : null;
114
+					if ($ticket instanceof EE_Ticket) {
115 115
 						$tkts[$ticket->ID()] = $ticket;
116 116
 					}
117 117
 				}
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
 		}
120 120
 
121 121
 		$tkt_parsed = '';
122
-		foreach ( $tkts as $ticket ) {
123
-			$tkt_parsed .= $this->_shortcode_helper->parse_ticket_list_template( $template, $ticket, $valid_shortcodes, $this->_extra_data );
122
+		foreach ($tkts as $ticket) {
123
+			$tkt_parsed .= $this->_shortcode_helper->parse_ticket_list_template($template, $ticket, $valid_shortcodes, $this->_extra_data);
124 124
 		}
125 125
 		return $tkt_parsed;
126 126
 	}
@@ -135,11 +135,11 @@  discard block
 block discarded – undo
135 135
 	private function _get_recipient_datetime_list() {
136 136
 		$this->_validate_list_requirements();
137 137
 
138
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
139
-			return $this->_get_recipient_datetime_list_parsed( $this->_data['data']  );
138
+		if ($this->_data['data'] instanceof EE_Messages_Addressee)
139
+			return $this->_get_recipient_datetime_list_parsed($this->_data['data']);
140 140
 
141
-		else if ( $this->_extra_data['data'] instanceof EE_Messages_Addressee )
142
-			return $this->_get_recipient_datetime_list_parsed( $this->_extra_data['data'] );
141
+		else if ($this->_extra_data['data'] instanceof EE_Messages_Addressee)
142
+			return $this->_get_recipient_datetime_list_parsed($this->_extra_data['data']);
143 143
 
144 144
 		else
145 145
 			return '';
@@ -147,26 +147,26 @@  discard block
 block discarded – undo
147 147
 	}
148 148
 
149 149
 
150
-	private function _get_recipient_datetime_list_parsed( EE_Messages_Addressee $data ) {
150
+	private function _get_recipient_datetime_list_parsed(EE_Messages_Addressee $data) {
151 151
 		//first get registrations just for this attendee.
152 152
 		$att = $data->att_obj;
153 153
 		$registrations_on_attendee = $att instanceof EE_Attendee ? $data->attendees[$att->ID()]['reg_objs'] : null;
154
-		$registrations_on_attendee = empty( $registrations_on_attendee ) && $data->reg_obj instanceof EE_Registration ? array( $data->reg_obj ) : array();
155
-		$valid_shortcodes = array( 'datetime', 'attendee', 'recipient_details' );
154
+		$registrations_on_attendee = empty($registrations_on_attendee) && $data->reg_obj instanceof EE_Registration ? array($data->reg_obj) : array();
155
+		$valid_shortcodes = array('datetime', 'attendee', 'recipient_details');
156 156
 		$template = '';
157 157
 		$dtts = array();
158 158
 
159 159
 		//setup valid shortcodes depending on what the status of the $this->_data property is
160
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
160
+		if ($this->_data['data'] instanceof EE_Messages_Addressee) {
161 161
 			$template = $this->_data['template'];
162 162
 
163 163
 			//dtts will be datetimes for all registrations on this attendee
164
-			foreach ( $registrations_on_attendee as $reg ) {
165
-				if ( $reg instanceof EE_Registration ) {
166
-					$dtt_objs = isset( $data->registrations[$reg->ID()] ) && is_array( $data->registrations[$reg->ID()] ) && isset( $data->registrations[$reg->ID()]['dtt_objs'] ) ? $data->registrations[$reg->ID()]['dtt_objs'] : array();
164
+			foreach ($registrations_on_attendee as $reg) {
165
+				if ($reg instanceof EE_Registration) {
166
+					$dtt_objs = isset($data->registrations[$reg->ID()]) && is_array($data->registrations[$reg->ID()]) && isset($data->registrations[$reg->ID()]['dtt_objs']) ? $data->registrations[$reg->ID()]['dtt_objs'] : array();
167 167
 					$dtt_objs = (array) $dtt_objs;
168
-					foreach ( $dtt_objs as $dtt_obj ) {
169
-						if ( $dtt_obj instanceof EE_Datetime ) {
168
+					foreach ($dtt_objs as $dtt_obj) {
169
+						if ($dtt_obj instanceof EE_Datetime) {
170 170
 							$dtts[$dtt_obj->ID()] = $dtt_obj;
171 171
 						}
172 172
 					}
@@ -176,18 +176,18 @@  discard block
 block discarded – undo
176 176
 
177 177
 		//if coming from the context of the event list parser, then let's just return the datetimes for the specific event.
178 178
 		$event = $this->_data['data'];
179
-		if ( $event instanceof EE_Event ) {
180
-			$template = is_array( $this->_data['template'] ) && isset($this->_data['template']['datetime_list']) ? $this->_data['template']['datetime_list'] : $this->_extra_data['template']['datetime_list'];
179
+		if ($event instanceof EE_Event) {
180
+			$template = is_array($this->_data['template']) && isset($this->_data['template']['datetime_list']) ? $this->_data['template']['datetime_list'] : $this->_extra_data['template']['datetime_list'];
181 181
 
182 182
 			//data will be datetimes for this event for this recipient
183
-			foreach ( $registrations_on_attendee as $reg ) {
184
-				if ( $reg instanceof EE_Registration && $reg->event_ID() == $event->ID() ) {
185
-					$ticket = isset( $data->registrations[$reg->ID()] ) && is_array( $data->registrations[$reg->ID()] ) && isset( $data->registrations[$reg->ID()]['tkt_obj'] ) ? $data->registrations[$reg->ID()]['tkt_obj'] : null;
186
-					if ( $ticket instanceof EE_Ticket ) {
187
-						$dtt_objs = isset( $data->tickets[$ticket->ID()] ) && is_array( $data->tickets[$ticket->ID()] ) && isset( $data->tickets[$ticket->ID()]['dtt_objs'] ) ? $data->tickets[$ticket->ID()]['dtt_objs'] : array();
183
+			foreach ($registrations_on_attendee as $reg) {
184
+				if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) {
185
+					$ticket = isset($data->registrations[$reg->ID()]) && is_array($data->registrations[$reg->ID()]) && isset($data->registrations[$reg->ID()]['tkt_obj']) ? $data->registrations[$reg->ID()]['tkt_obj'] : null;
186
+					if ($ticket instanceof EE_Ticket) {
187
+						$dtt_objs = isset($data->tickets[$ticket->ID()]) && is_array($data->tickets[$ticket->ID()]) && isset($data->tickets[$ticket->ID()]['dtt_objs']) ? $data->tickets[$ticket->ID()]['dtt_objs'] : array();
188 188
 						$dtt_objs = (array) $dtt_objs;
189
-						foreach ( $dtt_objs as $dtt_obj ) {
190
-							if ( $dtt_obj instanceof EE_Datetime ) {
189
+						foreach ($dtt_objs as $dtt_obj) {
190
+							if ($dtt_obj instanceof EE_Datetime) {
191 191
 								$dtts[$dtt_obj->ID()] = $dtt_obj;
192 192
 							}
193 193
 						}
@@ -197,8 +197,8 @@  discard block
 block discarded – undo
197 197
 		}
198 198
 
199 199
 		$dtt_parsed = '';
200
-		foreach ( $dtts as $datetime ) {
201
-			$dtt_parsed .= $this->_shortcode_helper->parse_datetime_list_template( $template, $datetime, $valid_shortcodes, $this->_extra_data );
200
+		foreach ($dtts as $datetime) {
201
+			$dtt_parsed .= $this->_shortcode_helper->parse_datetime_list_template($template, $datetime, $valid_shortcodes, $this->_extra_data);
202 202
 		}
203 203
 		return $dtt_parsed;
204 204
 	}
Please login to merge, or discard this patch.
Braces   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -135,14 +135,13 @@
 block discarded – undo
135 135
 	private function _get_recipient_datetime_list() {
136 136
 		$this->_validate_list_requirements();
137 137
 
138
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
139
-			return $this->_get_recipient_datetime_list_parsed( $this->_data['data']  );
140
-
141
-		else if ( $this->_extra_data['data'] instanceof EE_Messages_Addressee )
142
-			return $this->_get_recipient_datetime_list_parsed( $this->_extra_data['data'] );
143
-
144
-		else
145
-			return '';
138
+		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
139
+					return $this->_get_recipient_datetime_list_parsed( $this->_data['data']  );
140
+		} else if ( $this->_extra_data['data'] instanceof EE_Messages_Addressee ) {
141
+					return $this->_get_recipient_datetime_list_parsed( $this->_extra_data['data'] );
142
+		} else {
143
+					return '';
144
+		}
146 145
 
147 146
 	}
148 147
 
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Datetime_List_Shortcodes.lib.php 2 patches
Spacing   +12 added lines, -12 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
 /**
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 
45 45
 
46 46
 
47
-	protected function _parser( $shortcode ) {
48
-		switch ( $shortcode ) {
47
+	protected function _parser($shortcode) {
48
+		switch ($shortcode) {
49 49
 			case '[DATETIME_LIST]' :
50 50
 				return $this->_get_datetime_list();
51 51
 				break;
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 	private function _get_datetime_list() {
63 63
 		$this->_validate_list_requirements();
64 64
 
65
-		if ( $this->_data['data'] instanceof EE_Ticket )
65
+		if ($this->_data['data'] instanceof EE_Ticket)
66 66
 			return $this->_get_datetime_list_for_ticket();
67 67
 
68
-		else if ( $this->_data['data'] instanceof EE_Event )
68
+		else if ($this->_data['data'] instanceof EE_Event)
69 69
 			return $this->_get_datetime_list_for_event();
70 70
 
71
-		else if ( $this->_data['data'] instanceof EE_Messages_Addressee && $this->_data['data']->reg_obj instanceof EE_Registration ) {
71
+		else if ($this->_data['data'] instanceof EE_Messages_Addressee && $this->_data['data']->reg_obj instanceof EE_Registration) {
72 72
 			return $this->_get_datetime_list_for_registration();
73 73
 		}
74 74
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	private function _get_datetime_list_for_event() {
87 87
 		$valid_shortcodes = array('datetime', 'attendee');
88
-		$template = is_array($this->_data['template'] ) && isset($this->_data['template']['datetime_list']) ? $this->_data['template']['datetime_list'] : $this->_extra_data['template']['datetime_list'];
88
+		$template = is_array($this->_data['template']) && isset($this->_data['template']['datetime_list']) ? $this->_data['template']['datetime_list'] : $this->_extra_data['template']['datetime_list'];
89 89
 		$event = $this->_data['data'];
90 90
 
91 91
 		//here we're setting up the datetimes for the datetime list template for THIS event.
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		$datetimes = $this->_get_datetimes_from_event($event);
94 94
 
95 95
 		//each datetime in this case should be an datetime object.
96
-		foreach ( $datetimes as $datetime ) {
96
+		foreach ($datetimes as $datetime) {
97 97
 			$dtt_parsed .= $this->_shortcode_helper->parse_datetime_list_template($template, $datetime, $valid_shortcodes, $this->_extra_data);
98 98
 		}
99 99
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	private function _get_datetime_list_for_ticket() {
110 110
 		$valid_shortcodes = array('datetime', 'attendee');
111 111
 
112
-		$template = is_array($this->_data['template'] ) && isset($this->_data['template']['datetime_list']) ? $this->_data['template']['datetime_list'] : $this->_extra_data['template']['datetime_list'];
112
+		$template = is_array($this->_data['template']) && isset($this->_data['template']['datetime_list']) ? $this->_data['template']['datetime_list'] : $this->_extra_data['template']['datetime_list'];
113 113
 		$ticket = $this->_data['data'];
114 114
 
115 115
 		//here we're setting up the datetimes for the datetime list template for THIS ticket.
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		$datetimes = $this->_get_datetimes_from_ticket($ticket);
118 118
 
119 119
 		//each datetime in this case should be an datetime object.
120
-		foreach ( $datetimes as $datetime ) {
120
+		foreach ($datetimes as $datetime) {
121 121
 			$dtt_parsed .= $this->_shortcode_helper->parse_datetime_list_template($template, $datetime, $valid_shortcodes, $this->_extra_data);
122 122
 		}
123 123
 
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 
143 143
 
144 144
 
145
-	private function _get_datetimes_from_event( EE_Event $event, $att = NULL ) {
145
+	private function _get_datetimes_from_event(EE_Event $event, $att = NULL) {
146 146
 		 return isset($this->_extra_data['data']->events) ? $this->_extra_data['data']->events[$event->ID()]['dtt_objs'] : array();
147 147
 	}
148 148
 
149
-	private function _get_datetimes_from_ticket( EE_Ticket $ticket, $att = NULL ) {
149
+	private function _get_datetimes_from_ticket(EE_Ticket $ticket, $att = NULL) {
150 150
 		return isset($this->_extra_data['data']->tickets) ? $this->_extra_data['data']->tickets[$ticket->ID()]['dtt_objs'] : array();
151 151
 	}
152 152
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  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 7
 /**
7 8
  * Event Espresso
@@ -62,19 +63,18 @@  discard block
 block discarded – undo
62 63
 	private function _get_datetime_list() {
63 64
 		$this->_validate_list_requirements();
64 65
 
65
-		if ( $this->_data['data'] instanceof EE_Ticket )
66
-			return $this->_get_datetime_list_for_ticket();
67
-
68
-		else if ( $this->_data['data'] instanceof EE_Event )
69
-			return $this->_get_datetime_list_for_event();
70
-
71
-		else if ( $this->_data['data'] instanceof EE_Messages_Addressee && $this->_data['data']->reg_obj instanceof EE_Registration ) {
66
+		if ( $this->_data['data'] instanceof EE_Ticket ) {
67
+					return $this->_get_datetime_list_for_ticket();
68
+		} else if ( $this->_data['data'] instanceof EE_Event ) {
69
+					return $this->_get_datetime_list_for_event();
70
+		} else if ( $this->_data['data'] instanceof EE_Messages_Addressee && $this->_data['data']->reg_obj instanceof EE_Registration ) {
72 71
 			return $this->_get_datetime_list_for_registration();
73 72
 		}
74 73
 
75 74
 		//prevent recursive loop
76
-		else
77
-			return '';
75
+		else {
76
+					return '';
77
+		}
78 78
 	}
79 79
 
80 80
 
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Attendee_List_Shortcodes.lib.php 2 patches
Spacing   +15 added lines, -15 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
 /**
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 
49 49
 
50 50
 
51
-	protected function _parser( $shortcode ) {
52
-		switch ( $shortcode ) {
51
+	protected function _parser($shortcode) {
52
+		switch ($shortcode) {
53 53
 			case '[ATTENDEE_LIST]' :
54 54
 				return $this->_get_attendee_list();
55 55
 				break;
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
 	private function _get_attendee_list() {
67 67
 		$this->_validate_list_requirements();
68 68
 
69
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
69
+		if ($this->_data['data'] instanceof EE_Messages_Addressee)
70 70
 			return $this->_get_attendee_list_for_main();
71 71
 
72
-		else if ( $this->_data['data'] instanceof EE_Event )
72
+		else if ($this->_data['data'] instanceof EE_Event)
73 73
 			return $this->_get_attendee_list_for_event();
74 74
 
75
-		else if ( $this->_data['data'] instanceof EE_Ticket )
75
+		else if ($this->_data['data'] instanceof EE_Ticket)
76 76
 			return $this->_get_registration_list_for_ticket();
77 77
 
78 78
 		//prevent recursive loop
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
 
94 94
 		//now we need to loop through the attendee list and send data to the EE_Parser helper.
95
-		foreach ( $data->reg_objs as $registration ) {
95
+		foreach ($data->reg_objs as $registration) {
96 96
 			$attnds .= $this->_shortcode_helper->parse_attendee_list_template($template, $registration, $valid_shortcodes, $this->_extra_data);
97 97
 		}
98 98
 
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
 	 * @return string
107 107
 	 */
108 108
 	private function _get_attendee_list_for_event() {
109
-		$valid_shortcodes = array('attendee', 'ticket_list', 'question_list', 'recipient_details' );
110
-		$template = is_array( $this->_data['template'] ) && isset($this->_data['template']['attendee_list']) ? $this->_data['template']['attendee_list'] : $this->_extra_data['template']['attendee_list'];
109
+		$valid_shortcodes = array('attendee', 'ticket_list', 'question_list', 'recipient_details');
110
+		$template = is_array($this->_data['template']) && isset($this->_data['template']['attendee_list']) ? $this->_data['template']['attendee_list'] : $this->_extra_data['template']['attendee_list'];
111 111
 		$event = $this->_data['data'];
112 112
 
113 113
 		//let's remove any existing [EVENT_LIST] shortcode from the attendee list template so that we don't get recursion.
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		$registrations = $this->_get_registrations_from_event($event);
119 119
 
120 120
 		//each attendee in this case should be an attendee object.
121
-		foreach ( $registrations as $registration ) {
121
+		foreach ($registrations as $registration) {
122 122
 			$att_result .= $this->_shortcode_helper->parse_attendee_list_template($template, $registration, $valid_shortcodes, $this->_extra_data);
123 123
 		}
124 124
 
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 	 * @return string
133 133
 	 */
134 134
 	private function _get_registration_list_for_ticket() {
135
-		$valid_shortcodes = array( 'attendee', 'event_list', 'question_list', 'recipient_details' );
136
-		$template = is_array( $this->_data['template'] ) && isset($this->_data['template']['attendee_list']) ? $this->_data['template']['attendee_list'] : $this->_extra_data['template']['attendee_list'];
135
+		$valid_shortcodes = array('attendee', 'event_list', 'question_list', 'recipient_details');
136
+		$template = is_array($this->_data['template']) && isset($this->_data['template']['attendee_list']) ? $this->_data['template']['attendee_list'] : $this->_extra_data['template']['attendee_list'];
137 137
 		$ticket = $this->_data['data'];
138 138
 
139 139
 		//let's remove any existing [TICKET_LIST] (or related) shortcode from the attendee list template so that we don't get recursion.
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
 
144 144
 		//here we're setting up the attendees for the attendee_list template for THIS ticket.
145 145
 		$att_result = '';
146
-		$registrations = isset( $this->_extra_data['data']->tickets ) ? $this->_extra_data['data']->tickets[$ticket->ID()]['reg_objs'] : array();
146
+		$registrations = isset($this->_extra_data['data']->tickets) ? $this->_extra_data['data']->tickets[$ticket->ID()]['reg_objs'] : array();
147 147
 
148 148
 		//each attendee in this case should be an attendee object.
149
-		foreach ( $registrations as $registration ) {
149
+		foreach ($registrations as $registration) {
150 150
 			$att_result .= $this->_shortcode_helper->parse_attendee_list_template($template, $registration, $valid_shortcodes, $this->_extra_data);
151 151
 		}
152 152
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
 
158 158
 
159
-	private function _get_registrations_from_event( EE_Event $event ) {
159
+	private function _get_registrations_from_event(EE_Event $event) {
160 160
 		return isset($this->_extra_data['data']->events) ? $this->_extra_data['data']->events[$event->ID()]['reg_objs'] : array();
161 161
 	}
162 162
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  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 7
 /**
7 8
  * Event Espresso
@@ -66,18 +67,18 @@  discard block
 block discarded – undo
66 67
 	private function _get_attendee_list() {
67 68
 		$this->_validate_list_requirements();
68 69
 
69
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
70
-			return $this->_get_attendee_list_for_main();
71
-
72
-		else if ( $this->_data['data'] instanceof EE_Event )
73
-			return $this->_get_attendee_list_for_event();
74
-
75
-		else if ( $this->_data['data'] instanceof EE_Ticket )
76
-			return $this->_get_registration_list_for_ticket();
70
+		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
71
+					return $this->_get_attendee_list_for_main();
72
+		} else if ( $this->_data['data'] instanceof EE_Event ) {
73
+					return $this->_get_attendee_list_for_event();
74
+		} else if ( $this->_data['data'] instanceof EE_Ticket ) {
75
+					return $this->_get_registration_list_for_ticket();
76
+		}
77 77
 
78 78
 		//prevent recursive loop
79
-		else
80
-			return '';
79
+		else {
80
+					return '';
81
+		}
81 82
 	}
82 83
 
83 84
 
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Line_Item_List_Shortcodes.lib.php 2 patches
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 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
 /**
@@ -34,16 +34,16 @@  discard block
 block discarded – undo
34 34
 		$this->_shortcodes = array(
35 35
 			'[TICKET_LINE_ITEM_LIST]' => __('Outputs a list of ticket line items.', 'event_espresso'),
36 36
 			'[TAX_LINE_ITEM_LIST]' => __('Outputs a list of tax line items.', 'event_espresso'),
37
-			'[ADDITIONAL_LINE_ITEM_LIST]' => __( 'Outputs a list of additional line items (other charges or discounts)', 'event_espresso' ),
37
+			'[ADDITIONAL_LINE_ITEM_LIST]' => __('Outputs a list of additional line items (other charges or discounts)', 'event_espresso'),
38 38
 			'[PRICE_MODIFIER_LINE_ITEM_LIST]' => __('Outputs a list of price modifier line items', 'event_espresso')
39 39
 			);
40 40
 	}
41 41
 
42 42
 
43 43
 
44
-	protected function _parser( $shortcode ) {
44
+	protected function _parser($shortcode) {
45 45
 
46
-		switch ( $shortcode ) {
46
+		switch ($shortcode) {
47 47
 			case '[TICKET_LINE_ITEM_LIST]' :
48 48
 				return $this->_get_ticket_line_item_list();
49 49
 				break;
@@ -79,28 +79,28 @@  discard block
 block discarded – undo
79 79
 	private function _get_ticket_line_item_list() {
80 80
 		$this->_validate_list_requirements();
81 81
 
82
-		if ( ! $this->_data['data'] instanceof EE_Ticket ) {
82
+		if ( ! $this->_data['data'] instanceof EE_Ticket) {
83 83
 			return '';
84 84
 		}
85 85
 
86
-		$valid_shortcodes = array( 'line_item', 'line_item_list', 'ticket' );
86
+		$valid_shortcodes = array('line_item', 'line_item_list', 'ticket');
87 87
 
88 88
 		$ticket = $this->_data['data'];
89 89
 		$templates = $this->_extra_data['template'];
90 90
 		$addressee_obj = $this->_extra_data['data'];
91 91
 
92 92
 		//made it here so we have an EE_Ticket, so we should have what we need.
93
-		$ticket_line_item = isset( $addressee_obj->tickets[$ticket->ID()]['line_item'] ) ? $addressee_obj->tickets[$ticket->ID()]['line_item'] : null;
94
-		$sub_line_items = isset( $addressee_obj->tickets[$ticket->ID()]['sub_line_items'] ) ? $addressee_obj->tickets[$ticket->ID()]['sub_line_items'] : array();
93
+		$ticket_line_item = isset($addressee_obj->tickets[$ticket->ID()]['line_item']) ? $addressee_obj->tickets[$ticket->ID()]['line_item'] : null;
94
+		$sub_line_items = isset($addressee_obj->tickets[$ticket->ID()]['sub_line_items']) ? $addressee_obj->tickets[$ticket->ID()]['sub_line_items'] : array();
95 95
 
96
-		$template = count( $sub_line_items ) < 2 ? $templates['ticket_line_item_no_pms'] : $templates['ticket_line_item_pms'];
96
+		$template = count($sub_line_items) < 2 ? $templates['ticket_line_item_no_pms'] : $templates['ticket_line_item_pms'];
97 97
 
98
-		if ( empty( $ticket_line_item ) || empty( $sub_line_items ) ) {
98
+		if (empty($ticket_line_item) || empty($sub_line_items)) {
99 99
 			return '';
100 100
 		}
101 101
 
102 102
 		//now we just return the appropriate template parsed for each ticket.
103
-		return $this->_shortcode_helper->parse_line_item_list_template( $template, $ticket_line_item, $valid_shortcodes, $this->_extra_data );
103
+		return $this->_shortcode_helper->parse_line_item_list_template($template, $ticket_line_item, $valid_shortcodes, $this->_extra_data);
104 104
 	}
105 105
 
106 106
 
@@ -117,18 +117,18 @@  discard block
 block discarded – undo
117 117
 
118 118
 		$this->_validate_list_requirements();
119 119
 
120
-		if ( ! $this->_data['data'] instanceof EE_Messages_Addressee ) {
120
+		if ( ! $this->_data['data'] instanceof EE_Messages_Addressee) {
121 121
 			return '';
122 122
 		}
123 123
 
124 124
 		//made it here so we're good to go.
125
-		$valid_shortcodes = array( 'line_item' );
125
+		$valid_shortcodes = array('line_item');
126 126
 		$templates = $this->_data['template'];
127 127
 
128 128
 		$tax_line_items = $this->_data['data']->tax_line_items;
129 129
 		$line_item_list = '';
130
-		foreach ( $tax_line_items as $line_item ) {
131
-			$line_item_list .= $this->_shortcode_helper->parse_line_item_list_template( $templates['tax_line_item_list'], $line_item, $valid_shortcodes, $this->_extra_data );
130
+		foreach ($tax_line_items as $line_item) {
131
+			$line_item_list .= $this->_shortcode_helper->parse_line_item_list_template($templates['tax_line_item_list'], $line_item, $valid_shortcodes, $this->_extra_data);
132 132
 		}
133 133
 
134 134
 		return $line_item_list;
@@ -145,18 +145,18 @@  discard block
 block discarded – undo
145 145
 
146 146
 		$this->_validate_list_requirements();
147 147
 
148
-		if ( ! $this->_data['data'] instanceof EE_Messages_Addressee ) {
148
+		if ( ! $this->_data['data'] instanceof EE_Messages_Addressee) {
149 149
 			return '';
150 150
 		}
151 151
 
152 152
 		//made it here so we're good to go.
153
-		$valid_shortcodes = array( 'line_item' );
153
+		$valid_shortcodes = array('line_item');
154 154
 		$templates = $this->_data['template'];
155 155
 
156 156
 		$additional_line_items = $this->_data['data']->additional_line_items;
157 157
 		$line_item_list = '';
158
-		foreach ( $additional_line_items as $line_item ) {
159
-			$line_item_list .= $this->_shortcode_helper->parse_line_item_list_template( $templates['additional_line_item_list'], $line_item, $valid_shortcodes, $this->_extra_data );
158
+		foreach ($additional_line_items as $line_item) {
159
+			$line_item_list .= $this->_shortcode_helper->parse_line_item_list_template($templates['additional_line_item_list'], $line_item, $valid_shortcodes, $this->_extra_data);
160 160
 		}
161 161
 
162 162
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 	private function _get_price_mod_line_item_list() {
179 179
 		$this->_validate_list_requirements();
180 180
 
181
-		if ( ! $this->_data['data'] instanceof EE_Line_Item ) {
181
+		if ( ! $this->_data['data'] instanceof EE_Line_Item) {
182 182
 			return '';
183 183
 		}
184 184
 
@@ -187,16 +187,16 @@  discard block
 block discarded – undo
187 187
 		$templates = $this->_extra_data['template'];
188 188
 		$addressee_obj = $this->_extra_data['data'];
189 189
 
190
-		$valid_shortcodes = array( 'line_item' );
190
+		$valid_shortcodes = array('line_item');
191 191
 
192 192
 		$main_line_item_id = $main_line_item->ID();
193 193
 
194
-		$price_mod_line_items = ! empty( $addressee_obj->line_items_with_children[$main_line_item_id]['children'] ) ? $addressee_obj->line_items_with_children[$main_line_item_id]['children'] : array();
194
+		$price_mod_line_items = ! empty($addressee_obj->line_items_with_children[$main_line_item_id]['children']) ? $addressee_obj->line_items_with_children[$main_line_item_id]['children'] : array();
195 195
 
196 196
 		$line_item_list = '';
197 197
 
198
-		foreach( $price_mod_line_items as $line_item ) {
199
-			$line_item_list .= $this->_shortcode_helper->parse_line_item_list_template( $templates['price_modifier_line_item_list'], $line_item, $valid_shortcodes, $this->_extra_data  );
198
+		foreach ($price_mod_line_items as $line_item) {
199
+			$line_item_list .= $this->_shortcode_helper->parse_line_item_list_template($templates['price_modifier_line_item_list'], $line_item, $valid_shortcodes, $this->_extra_data);
200 200
 		}
201 201
 
202 202
 		return $line_item_list;
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.
core/libraries/batch/JobHandlerBaseClasses/JobHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
13 13
  */
14 14
 namespace EventEspressoBatchRequest\JobHandlerBaseClasses;
15 15
 
16
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
17
-	exit( 'No direct script access allowed' );
16
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
17
+	exit('No direct script access allowed');
18 18
 }
19 19
 
20 20
 
Please login to merge, or discard this patch.
core/libraries/plugin_api/EE_Register_Module.lib.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -44,33 +44,33 @@  discard block
 block discarded – undo
44 44
 	 * @throws EE_Error
45 45
 	 * @return void
46 46
 	 */
47
-	public static function register( $module_id = NULL, $setup_args = array()  ) {
47
+	public static function register($module_id = NULL, $setup_args = array()) {
48 48
 
49 49
 		//required fields MUST be present, so let's make sure they are.
50
-		if ( empty( $module_id ) || ! is_array( $setup_args ) || empty( $setup_args['module_paths'] )) {
51
-			throw new EE_Error( __( 'In order to register Modules with EE_Register_Module::register(), you must include a "module_id" (a unique identifier for this set of modules), and an array containing the following keys: "module_paths" (an array of full server paths to folders that contain modules, or to the module files themselves)', 'event_espresso' ));
50
+		if (empty($module_id) || ! is_array($setup_args) || empty($setup_args['module_paths'])) {
51
+			throw new EE_Error(__('In order to register Modules with EE_Register_Module::register(), you must include a "module_id" (a unique identifier for this set of modules), and an array containing the following keys: "module_paths" (an array of full server paths to folders that contain modules, or to the module files themselves)', 'event_espresso'));
52 52
 		}
53 53
 
54 54
 		//make sure we don't register twice
55
-		if( isset( self::$_settings[ $module_id ] ) ){
55
+		if (isset(self::$_settings[$module_id])) {
56 56
 			return;
57 57
 		}
58 58
 
59 59
 		//make sure this was called in the right place!
60
-		if ( ! did_action( 'AHEE__EE_System__load_espresso_addons' ) || did_action( 'AHEE__EE_System__register_shortcodes_modules_and_widgets' )) {
60
+		if ( ! did_action('AHEE__EE_System__load_espresso_addons') || did_action('AHEE__EE_System__register_shortcodes_modules_and_widgets')) {
61 61
 			EE_Error::doing_it_wrong(
62 62
 				__METHOD__,
63
-				__( 'An attempt to register modules has failed because it was not registered at the correct time.  Please use the "AHEE__EE_System__register_shortcodes_modules_and_widgets" hook to register modules.','event_espresso'),
63
+				__('An attempt to register modules has failed because it was not registered at the correct time.  Please use the "AHEE__EE_System__register_shortcodes_modules_and_widgets" hook to register modules.', 'event_espresso'),
64 64
 				'4.3.0'
65 65
 			);
66 66
 		}
67 67
 		//setup $_settings array from incoming values.
68
-		self::$_settings[ $module_id ] = array(
68
+		self::$_settings[$module_id] = array(
69 69
 			// array of full server paths to any EED_Modules used by the module
70
-			'module_paths'  => isset( $setup_args['module_paths'] ) ? (array)$setup_args['module_paths'] : array(),
70
+			'module_paths'  => isset($setup_args['module_paths']) ? (array) $setup_args['module_paths'] : array(),
71 71
 		);
72 72
 		// add to list of modules to be registered
73
-		add_filter( 'FHEE__EE_Config__register_modules__modules_to_register', array( 'EE_Register_Module', 'add_modules' ));
73
+		add_filter('FHEE__EE_Config__register_modules__modules_to_register', array('EE_Register_Module', 'add_modules'));
74 74
 	}
75 75
 
76 76
 
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
 	 * @param array $modules_to_register  array of paths to all modules that require registering
84 84
 	 * @return array
85 85
 	 */
86
-	public static function add_modules( $modules_to_register ){
87
-		foreach( self::$_settings as $settings ) {
88
-			$modules_to_register = array_merge( $modules_to_register, $settings['module_paths'] );
86
+	public static function add_modules($modules_to_register) {
87
+		foreach (self::$_settings as $settings) {
88
+			$modules_to_register = array_merge($modules_to_register, $settings['module_paths']);
89 89
 		}
90 90
 		return $modules_to_register;
91 91
 	}
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
 	 * @param string  $module_id the name for the module that was previously registered
102 102
 	 * @return void
103 103
 	 */
104
-	public static function deregister( $module_id = NULL ) {
105
-		if ( isset( self::$_settings[ $module_id ] )) {
106
-			unset( self::$_settings[ $module_id ] );
104
+	public static function deregister($module_id = NULL) {
105
+		if (isset(self::$_settings[$module_id])) {
106
+			unset(self::$_settings[$module_id]);
107 107
 		}
108 108
 	}
109 109
 
Please login to merge, or discard this patch.
core/libraries/plugin_api/EE_Register_Model_Extensions.lib.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage plugin api
8 8
  */
9
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' )) { exit('NO direct script access allowed'); }
9
+if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('NO direct script access allowed'); }
10 10
 
11 11
 /**
12 12
  * EE_Register_Model_Extensions
@@ -34,26 +34,26 @@  discard block
 block discarded – undo
34 34
 	 *
35 35
 	 * @return void
36 36
 	 */
37
-	public static function register( $model_id = NULL, $config = array() ) {
37
+	public static function register($model_id = NULL, $config = array()) {
38 38
 		//required fields MUST be present, so let's make sure they are.
39
-		if ( empty( $model_id ) || ! is_array( $config ) || ( empty( $config['model_extension_paths'] ) && empty( $config['class_extension_paths'] ) ) ) {
40
-			throw new EE_Error( __( 'In order to register Model extensions with EE_Register_Model_Extensions::register(), you must include a "model_id" (a unique identifier for this set of models), and an array containing the following keys: "model_extension_paths" (an array of full server paths to folders that contain model extensions), and "class_extension_paths" (an array of full server paths to folders that contain class extensions)', 'event_espresso' ));
39
+		if (empty($model_id) || ! is_array($config) || (empty($config['model_extension_paths']) && empty($config['class_extension_paths']))) {
40
+			throw new EE_Error(__('In order to register Model extensions with EE_Register_Model_Extensions::register(), you must include a "model_id" (a unique identifier for this set of models), and an array containing the following keys: "model_extension_paths" (an array of full server paths to folders that contain model extensions), and "class_extension_paths" (an array of full server paths to folders that contain class extensions)', 'event_espresso'));
41 41
 		}
42 42
 
43 43
 		//make sure we don't register twice
44
-		if( isset( self::$_registry[ $model_id ] ) ){
44
+		if (isset(self::$_registry[$model_id])) {
45 45
 			return;
46 46
 		}
47 47
 		//check correct loading
48
-		if ( ! did_action( 'AHEE__EE_System__load_espresso_addons' ) || did_action( 'AHEE__EE_Admin__loaded'  )) {
48
+		if ( ! did_action('AHEE__EE_System__load_espresso_addons') || did_action('AHEE__EE_Admin__loaded')) {
49 49
 			EE_Error::doing_it_wrong(
50 50
 				__METHOD__,
51 51
 				sprintf(
52
-					__('An attempt was made to register "%1$s" as a Model extension has failed because it was not registered at the correct time.  Please use the "AHEE__EE_System__load_espresso_addons" hook to register models.%2$s Hook Status: %2$s "AHEE__EE_System__load_espresso_addons" : %3$s %2$s "AHEE__EE_Admin__loaded" : %4$s%2$s','event_espresso'),
52
+					__('An attempt was made to register "%1$s" as a Model extension has failed because it was not registered at the correct time.  Please use the "AHEE__EE_System__load_espresso_addons" hook to register models.%2$s Hook Status: %2$s "AHEE__EE_System__load_espresso_addons" : %3$s %2$s "AHEE__EE_Admin__loaded" : %4$s%2$s', 'event_espresso'),
53 53
 					$model_id,
54 54
 					'<br />',
55
-					did_action( 'AHEE__EE_System__load_espresso_addons' ) ? 'action done' : 'action NOT done',
56
-					did_action( 'AHEE__EE_Admin__loaded' ) ? 'action done' : 'action NOT done'
55
+					did_action('AHEE__EE_System__load_espresso_addons') ? 'action done' : 'action NOT done',
56
+					did_action('AHEE__EE_Admin__loaded') ? 'action done' : 'action NOT done'
57 57
 				),
58 58
 				'4.3'
59 59
 			);
@@ -62,26 +62,26 @@  discard block
 block discarded – undo
62 62
 		self::$_registry[$model_id] = $config;
63 63
 		self::$_extensions[$model_id] = array();
64 64
 
65
-		if(isset($config['model_extension_paths'])){
65
+		if (isset($config['model_extension_paths'])) {
66 66
 			require_once(EE_LIBRARIES.'plugin_api/db/EEME_Base.lib.php');
67 67
 			$class_to_filepath_map = EEH_File::get_contents_of_folders($config['model_extension_paths']);
68 68
 			EEH_Autoloader::register_autoloader($class_to_filepath_map);
69
-			foreach(array_keys($class_to_filepath_map) as $classname){
69
+			foreach (array_keys($class_to_filepath_map) as $classname) {
70 70
 				self::$_extensions[$model_id]['models'][$classname] = new $classname;
71 71
 			}
72 72
 			unset($config['model_extension_paths']);
73 73
 		}
74
-		if(isset($config['class_extension_paths'])){
74
+		if (isset($config['class_extension_paths'])) {
75 75
 			require_once(EE_LIBRARIES.'plugin_api/db/EEE_Base_Class.lib.php');
76 76
 			$class_to_filepath_map = EEH_File::get_contents_of_folders($config['class_extension_paths']);
77 77
 			EEH_Autoloader::register_autoloader($class_to_filepath_map);
78
-			foreach(array_keys($class_to_filepath_map) as $classname){
78
+			foreach (array_keys($class_to_filepath_map) as $classname) {
79 79
 				self::$_extensions[$model_id]['classes'][$classname] = new $classname;
80 80
 			}
81 81
 			unset($config['class_extension_paths']);
82 82
 		}
83
-		foreach($config as $unknown_key => $unknown_config){
84
-			throw new EE_Error(sprintf(__("The key '%s' is not a known key for registering a model", "event_espresso"),$unknown_key));
83
+		foreach ($config as $unknown_key => $unknown_config) {
84
+			throw new EE_Error(sprintf(__("The key '%s' is not a known key for registering a model", "event_espresso"), $unknown_key));
85 85
 		}
86 86
 	}
87 87
 
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 	 * deregister
91 91
 	 * @param string $model_id
92 92
 	 */
93
-	public static function deregister( $model_id = NULL ){
94
-		if(isset(self::$_registry[$model_id])){
93
+	public static function deregister($model_id = NULL) {
94
+		if (isset(self::$_registry[$model_id])) {
95 95
 			unset(self::$_registry[$model_id]);
96
-			foreach(self::$_extensions[$model_id] as $extension_of_type){
97
-				foreach($extension_of_type as $extension ){
96
+			foreach (self::$_extensions[$model_id] as $extension_of_type) {
97
+				foreach ($extension_of_type as $extension) {
98 98
 					$extension->deregister();
99 99
 				}
100 100
 			}
Please login to merge, or discard this patch.