@@ -1,6 +1,6 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -1,7 +1,8 @@ discard block |
||
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 |
||
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 |
@@ -1,6 +1,6 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -1,7 +1,8 @@ discard block |
||
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 |
||
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 |
@@ -6,7 +6,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -6,8 +6,9 @@ |
||
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 | * |
@@ -13,8 +13,8 @@ |
||
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 |
@@ -44,33 +44,33 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -48,33 +48,33 @@ discard block |
||
48 | 48 | * @type array payment_method_paths an array of full server paths to folders containing any EE_PMT_Base children, or to the EED_Module files themselves |
49 | 49 | * @return void |
50 | 50 | */ |
51 | - public static function register( $payment_method_id = NULL, $setup_args = array() ) { |
|
51 | + public static function register($payment_method_id = NULL, $setup_args = array()) { |
|
52 | 52 | |
53 | 53 | //required fields MUST be present, so let's make sure they are. |
54 | - if ( empty( $payment_method_id ) || ! is_array( $setup_args ) || empty( $setup_args['payment_method_paths'] )) { |
|
55 | - throw new EE_Error( __( 'In order to register Payment Methods with EE_Register_Payment_Method::register(), you must include a "payment_method_id" (a unique identifier for this set of modules), and an array containing the following keys: "payment_method_paths" (an array of full server paths to folders that contain modules, or to the module files themselves)', 'event_espresso' )); |
|
54 | + if (empty($payment_method_id) || ! is_array($setup_args) || empty($setup_args['payment_method_paths'])) { |
|
55 | + throw new EE_Error(__('In order to register Payment Methods with EE_Register_Payment_Method::register(), you must include a "payment_method_id" (a unique identifier for this set of modules), and an array containing the following keys: "payment_method_paths" (an array of full server paths to folders that contain modules, or to the module files themselves)', 'event_espresso')); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | //make sure we don't register twice |
59 | - if( isset( self::$_settings[ $payment_method_id ] ) ){ |
|
59 | + if (isset(self::$_settings[$payment_method_id])) { |
|
60 | 60 | return; |
61 | 61 | } |
62 | 62 | |
63 | 63 | //make sure this was called in the right place! |
64 | - if ( ! did_action( 'AHEE__EE_System__load_espresso_addons' ) || did_action( 'AHEE__EE_System__register_shortcodes_modules_and_widgets' )) { |
|
64 | + if ( ! did_action('AHEE__EE_System__load_espresso_addons') || did_action('AHEE__EE_System__register_shortcodes_modules_and_widgets')) { |
|
65 | 65 | EE_Error::doing_it_wrong( |
66 | 66 | __METHOD__, |
67 | - __( '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'), |
|
67 | + __('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'), |
|
68 | 68 | '4.3.0' |
69 | 69 | ); |
70 | 70 | } |
71 | 71 | //setup $_settings array from incoming values. |
72 | - self::$_settings[ $payment_method_id ] = array( |
|
72 | + self::$_settings[$payment_method_id] = array( |
|
73 | 73 | // array of full server paths to any EE_PMT_Base children used |
74 | - 'payment_method_paths' => isset( $setup_args['payment_method_paths'] ) ? (array)$setup_args['payment_method_paths'] : array(), |
|
74 | + 'payment_method_paths' => isset($setup_args['payment_method_paths']) ? (array) $setup_args['payment_method_paths'] : array(), |
|
75 | 75 | ); |
76 | 76 | // add to list of modules to be registered |
77 | - add_filter( 'FHEE__EE_Payment_Method_Manager__register_payment_methods__payment_methods_to_register', array( 'EE_Register_Payment_Method', 'add_payment_methods' )); |
|
77 | + add_filter('FHEE__EE_Payment_Method_Manager__register_payment_methods__payment_methods_to_register', array('EE_Register_Payment_Method', 'add_payment_methods')); |
|
78 | 78 | |
79 | 79 | /** |
80 | 80 | * If EE_Payment_Method_Manager::register_payment_methods has already been called, we need it to be called again |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | * will be called only once per payment method from an addon, so going with that assumption we should always do this. |
83 | 83 | * If that assumption is false, we should verify this newly-registered payment method isn't on the EE_Payment_Method_Manager::_payment_method_types array before calling this (this code should be changed to improve performance) |
84 | 84 | */ |
85 | - if ( did_action( 'FHEE__EE_Payment_Method_Manager__register_payment_methods__registered_payment_methods' ) ) { |
|
85 | + if (did_action('FHEE__EE_Payment_Method_Manager__register_payment_methods__registered_payment_methods')) { |
|
86 | 86 | EE_Registry::instance()->load_lib('Payment_Method_Manager'); |
87 | - EE_Payment_Method_Manager::instance()->maybe_register_payment_methods( TRUE ); |
|
87 | + EE_Payment_Method_Manager::instance()->maybe_register_payment_methods(TRUE); |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | * @param array $payment_method_folders array of paths to all payment methods that require registering |
98 | 98 | * @return array |
99 | 99 | */ |
100 | - public static function add_payment_methods( $payment_method_folders ){ |
|
101 | - foreach( self::$_settings as $settings ) { |
|
102 | - $payment_method_folders = array_merge( $payment_method_folders, $settings['payment_method_paths'] ); |
|
100 | + public static function add_payment_methods($payment_method_folders) { |
|
101 | + foreach (self::$_settings as $settings) { |
|
102 | + $payment_method_folders = array_merge($payment_method_folders, $settings['payment_method_paths']); |
|
103 | 103 | } |
104 | 104 | return $payment_method_folders; |
105 | 105 | } |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | * @param string $module_id the name for the module that was previously registered |
115 | 115 | * @return void |
116 | 116 | */ |
117 | - public static function deregister( $module_id = NULL ) { |
|
118 | - if ( isset( self::$_settings[ $module_id ] )) { |
|
119 | - unset( self::$_settings[ $module_id ] ); |
|
117 | + public static function deregister($module_id = NULL) { |
|
118 | + if (isset(self::$_settings[$module_id])) { |
|
119 | + unset(self::$_settings[$module_id]); |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 |
@@ -6,7 +6,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | /** |
@@ -15,18 +15,18 @@ discard block |
||
15 | 15 | * @author Mike Nelson |
16 | 16 | * |
17 | 17 | */ |
18 | -class EE_Phone_Input extends EE_Text_Input{ |
|
18 | +class EE_Phone_Input extends EE_Text_Input { |
|
19 | 19 | /** |
20 | 20 | * @param array $options |
21 | 21 | */ |
22 | - function __construct($options = array()){ |
|
22 | + function __construct($options = array()) { |
|
23 | 23 | $this->_add_validation_strategy( |
24 | 24 | new EE_Text_Validation_Strategy( |
25 | - __( 'Please enter a valid phone number. Eg 123-456-7890 or 1234567890', 'event_espresso' ), |
|
25 | + __('Please enter a valid phone number. Eg 123-456-7890 or 1234567890', 'event_espresso'), |
|
26 | 26 | '~^(([\d]{10})|(^[\d]{3}-[\d]{3}-[\d]{4}))$~' |
27 | 27 | ) |
28 | 28 | ); |
29 | - parent::__construct( $options ); |
|
29 | + parent::__construct($options); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 |
@@ -7,16 +7,16 @@ |
||
7 | 7 | * @subpackage |
8 | 8 | * @author Mike Nelson |
9 | 9 | */ |
10 | -class EE_Credit_Card_Input extends EE_Form_Input_Base{ |
|
10 | +class EE_Credit_Card_Input extends EE_Form_Input_Base { |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * @param array $input_settings |
14 | 14 | */ |
15 | - function __construct($input_settings = array()){ |
|
16 | - $input_settings['required'] = isset( $input_settings['required'] ) ? $input_settings['required'] : TRUE; |
|
15 | + function __construct($input_settings = array()) { |
|
16 | + $input_settings['required'] = isset($input_settings['required']) ? $input_settings['required'] : TRUE; |
|
17 | 17 | $this->_set_display_strategy(new EE_Text_Input_Display_Strategy()); |
18 | 18 | $this->_set_normalization_strategy(new EE_Credit_Card_Normalization()); |
19 | - $this->_add_validation_strategy(new EE_Credit_Card_Validation_Strategy( isset( $input_settings[ 'validation_error_message' ] ) ? $input_settings[ 'validation_error_message' ] : NULL )); |
|
19 | + $this->_add_validation_strategy(new EE_Credit_Card_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL)); |
|
20 | 20 | $this->set_sensitive_data_removal_strategy(new EE_Credit_Card_Sensitive_Data_Removal()); |
21 | 21 | parent::__construct($input_settings); |
22 | 22 | } |