@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | |
61 | 61 | /** |
62 | - * @return boolean |
|
62 | + * @return boolean|null |
|
63 | 63 | */ |
64 | 64 | public function process_reg_step() { |
65 | 65 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | |
70 | 70 | /** |
71 | - * @return boolean |
|
71 | + * @return boolean|null |
|
72 | 72 | */ |
73 | 73 | public function update_reg_step() { |
74 | 74 |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_SPCO_Reg_Step_Registration_Confirmation |
|
5 | - * |
|
6 | - * Description |
|
7 | - * |
|
8 | - * @package Event Espresso |
|
9 | - * @subpackage core |
|
10 | - * @author Brent Christensen |
|
11 | - * @since 4.5.0 |
|
12 | - * |
|
13 | - */ |
|
3 | + * |
|
4 | + * Class EE_SPCO_Reg_Step_Registration_Confirmation |
|
5 | + * |
|
6 | + * Description |
|
7 | + * |
|
8 | + * @package Event Espresso |
|
9 | + * @subpackage core |
|
10 | + * @author Brent Christensen |
|
11 | + * @since 4.5.0 |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | class EE_SPCO_Reg_Step_Registration_Confirmation extends EE_SPCO_Reg_Step { |
15 | 15 | |
16 | 16 | /** |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | * @param EE_Checkout $checkout |
21 | 21 | * @return \EE_SPCO_Reg_Step_Registration_Confirmation |
22 | 22 | */ |
23 | - public function __construct( EE_Checkout $checkout ) { |
|
23 | + public function __construct(EE_Checkout $checkout) { |
|
24 | 24 | $this->_slug = 'registration_confirmation'; |
25 | 25 | $this->_name = __('Registration Confirmation', 'event_espresso'); |
26 | - $this->_template = SPCO_REG_STEPS_PATH . $this->_slug . DS . 'registration_page_confirmation.template.php'; |
|
26 | + $this->_template = SPCO_REG_STEPS_PATH.$this->_slug.DS.'registration_page_confirmation.template.php'; |
|
27 | 27 | $this->checkout = $checkout; |
28 | 28 | } |
29 | 29 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @return boolean |
44 | 44 | */ |
45 | 45 | public function initialize_reg_step() { |
46 | - $this->checkout->remove_reg_step( $this->_slug ); |
|
46 | + $this->checkout->remove_reg_step($this->_slug); |
|
47 | 47 | return false; |
48 | 48 | } |
49 | 49 |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * process_ticket_selections |
199 | 199 | * |
200 | 200 | * @access public |
201 | - * @return array or FALSE |
|
201 | + * @return boolean|null or FALSE |
|
202 | 202 | * @throws \EE_Error |
203 | 203 | */ |
204 | 204 | public function process_ticket_selections() { |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * cancel_ticket_selections |
213 | 213 | * |
214 | 214 | * @access public |
215 | - * @return string |
|
215 | + * @return false|null |
|
216 | 216 | */ |
217 | 217 | public static function cancel_ticket_selections() |
218 | 218 | { |
@@ -22,15 +22,15 @@ discard block |
||
22 | 22 | */ |
23 | 23 | class EED_Ticket_Selector extends EED_Module { |
24 | 24 | |
25 | - /** |
|
26 | - * @var EventEspresso\modules\ticket_selector\DisplayTicketSelector $ticket_selector |
|
27 | - */ |
|
28 | - private static $ticket_selector; |
|
25 | + /** |
|
26 | + * @var EventEspresso\modules\ticket_selector\DisplayTicketSelector $ticket_selector |
|
27 | + */ |
|
28 | + private static $ticket_selector; |
|
29 | 29 | |
30 | - /** |
|
31 | - * @var EventEspresso\modules\ticket_selector\TicketSelectorIframeEmbedButton $iframe_embed_button |
|
32 | - */ |
|
33 | - private static $iframe_embed_button; |
|
30 | + /** |
|
31 | + * @var EventEspresso\modules\ticket_selector\TicketSelectorIframeEmbedButton $iframe_embed_button |
|
32 | + */ |
|
33 | + private static $iframe_embed_button; |
|
34 | 34 | |
35 | 35 | |
36 | 36 | |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | // routing |
62 | 62 | EE_Config::register_route( 'iframe', 'EED_Ticket_Selector', 'ticket_selector_iframe', 'ticket_selector' ); |
63 | 63 | EE_Config::register_route( 'process_ticket_selections', 'EED_Ticket_Selector', 'process_ticket_selections' ); |
64 | - EE_Config::register_route('cancel_ticket_selections', 'EED_Ticket_Selector', 'cancel_ticket_selections'); |
|
65 | - add_action( 'wp_loaded', array( 'EED_Ticket_Selector', 'set_definitions' ), 2 ); |
|
64 | + EE_Config::register_route('cancel_ticket_selections', 'EED_Ticket_Selector', 'cancel_ticket_selections'); |
|
65 | + add_action( 'wp_loaded', array( 'EED_Ticket_Selector', 'set_definitions' ), 2 ); |
|
66 | 66 | add_action( 'AHEE_event_details_header_bottom', array( 'EED_Ticket_Selector', 'display_ticket_selector' ), 10, 1 ); |
67 | - add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'translate_js_strings' ), 0 ); |
|
68 | - add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'load_tckt_slctr_assets' ), 10 ); |
|
69 | - EED_Ticket_Selector::loadIframeAssets(); |
|
70 | - } |
|
67 | + add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'translate_js_strings' ), 0 ); |
|
68 | + add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'load_tckt_slctr_assets' ), 10 ); |
|
69 | + EED_Ticket_Selector::loadIframeAssets(); |
|
70 | + } |
|
71 | 71 | |
72 | 72 | |
73 | 73 | |
@@ -86,16 +86,16 @@ discard block |
||
86 | 86 | 10 |
87 | 87 | ); |
88 | 88 | |
89 | - /** |
|
90 | - * Make sure assets for the ticket selector are loaded on the espresso registrations route so admin side |
|
91 | - * registrations work. |
|
92 | - */ |
|
89 | + /** |
|
90 | + * Make sure assets for the ticket selector are loaded on the espresso registrations route so admin side |
|
91 | + * registrations work. |
|
92 | + */ |
|
93 | 93 | add_action( |
94 | - 'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_registrations__new_registration', |
|
95 | - array('EED_Ticket_Selector', 'set_definitions'), |
|
96 | - 10 |
|
97 | - ); |
|
98 | - } |
|
94 | + 'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_registrations__new_registration', |
|
95 | + array('EED_Ticket_Selector', 'set_definitions'), |
|
96 | + 10 |
|
97 | + ); |
|
98 | + } |
|
99 | 99 | |
100 | 100 | |
101 | 101 | |
@@ -111,23 +111,23 @@ discard block |
||
111 | 111 | |
112 | 112 | //if config is not set, initialize |
113 | 113 | if ( ! EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector instanceof EE_Ticket_Selector_Config ) { |
114 | - \EED_Ticket_Selector::instance()->set_config(); |
|
115 | - \EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector = \EED_Ticket_Selector::instance()->config(); |
|
114 | + \EED_Ticket_Selector::instance()->set_config(); |
|
115 | + \EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector = \EED_Ticket_Selector::instance()->config(); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
119 | 119 | |
120 | 120 | |
121 | 121 | /** |
122 | - * @return \EventEspresso\modules\ticket_selector\DisplayTicketSelector |
|
123 | - */ |
|
124 | - public static function ticketSelector() |
|
125 | - { |
|
126 | - if ( ! EED_Ticket_Selector::$ticket_selector instanceof DisplayTicketSelector) { |
|
127 | - EED_Ticket_Selector::$ticket_selector = new DisplayTicketSelector(); |
|
128 | - } |
|
129 | - return EED_Ticket_Selector::$ticket_selector; |
|
130 | - } |
|
122 | + * @return \EventEspresso\modules\ticket_selector\DisplayTicketSelector |
|
123 | + */ |
|
124 | + public static function ticketSelector() |
|
125 | + { |
|
126 | + if ( ! EED_Ticket_Selector::$ticket_selector instanceof DisplayTicketSelector) { |
|
127 | + EED_Ticket_Selector::$ticket_selector = new DisplayTicketSelector(); |
|
128 | + } |
|
129 | + return EED_Ticket_Selector::$ticket_selector; |
|
130 | + } |
|
131 | 131 | |
132 | 132 | |
133 | 133 | /** |
@@ -180,15 +180,15 @@ discard block |
||
180 | 180 | |
181 | 181 | |
182 | 182 | |
183 | - /** |
|
184 | - * creates buttons for selecting number of attendees for an event |
|
185 | - * |
|
186 | - * @access public |
|
187 | - * @param WP_Post|int $event |
|
188 | - * @param bool $view_details |
|
189 | - * @return string |
|
190 | - * @throws \EE_Error |
|
191 | - */ |
|
183 | + /** |
|
184 | + * creates buttons for selecting number of attendees for an event |
|
185 | + * |
|
186 | + * @access public |
|
187 | + * @param WP_Post|int $event |
|
188 | + * @param bool $view_details |
|
189 | + * @return string |
|
190 | + * @throws \EE_Error |
|
191 | + */ |
|
192 | 192 | public static function display_ticket_selector( $event = NULL, $view_details = FALSE ) { |
193 | 193 | return EED_Ticket_Selector::ticketSelector()->display( $event, $view_details ); |
194 | 194 | } |
@@ -209,233 +209,233 @@ discard block |
||
209 | 209 | |
210 | 210 | |
211 | 211 | |
212 | - /** |
|
213 | - * cancel_ticket_selections |
|
214 | - * |
|
215 | - * @access public |
|
216 | - * @return string |
|
217 | - */ |
|
218 | - public static function cancel_ticket_selections() |
|
219 | - { |
|
220 | - $form = new ProcessTicketSelector(); |
|
221 | - return $form->cancelTicketSelections(); |
|
222 | - } |
|
212 | + /** |
|
213 | + * cancel_ticket_selections |
|
214 | + * |
|
215 | + * @access public |
|
216 | + * @return string |
|
217 | + */ |
|
218 | + public static function cancel_ticket_selections() |
|
219 | + { |
|
220 | + $form = new ProcessTicketSelector(); |
|
221 | + return $form->cancelTicketSelections(); |
|
222 | + } |
|
223 | 223 | |
224 | 224 | |
225 | 225 | |
226 | 226 | /** |
227 | - * @return void |
|
228 | - */ |
|
227 | + * @return void |
|
228 | + */ |
|
229 | 229 | public static function translate_js_strings() { |
230 | - EE_Registry::$i18n_js_strings['please_select_date_filter_notice'] = esc_html__( |
|
231 | - 'please select a datetime', 'event_espresso' |
|
232 | - ); |
|
233 | - } |
|
230 | + EE_Registry::$i18n_js_strings['please_select_date_filter_notice'] = esc_html__( |
|
231 | + 'please select a datetime', 'event_espresso' |
|
232 | + ); |
|
233 | + } |
|
234 | 234 | |
235 | 235 | |
236 | 236 | |
237 | 237 | /** |
238 | - * load js |
|
239 | - * |
|
240 | - * @access public |
|
241 | - * @return void |
|
242 | - */ |
|
238 | + * load js |
|
239 | + * |
|
240 | + * @access public |
|
241 | + * @return void |
|
242 | + */ |
|
243 | 243 | public static function load_tckt_slctr_assets() { |
244 | 244 | if ( apply_filters( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', FALSE ) ) { |
245 | - // add some style |
|
245 | + // add some style |
|
246 | 246 | wp_register_style('ticket_selector', TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css'); |
247 | 247 | wp_enqueue_style('ticket_selector'); |
248 | 248 | // make it dance |
249 | 249 | wp_register_script('ticket_selector', TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.js', array('espresso_core'), '', TRUE); |
250 | 250 | wp_enqueue_script('ticket_selector'); |
251 | - require_once( EE_LIBRARIES.'form_sections/strategies/display/EE_Checkbox_Dropdown_Selector_Display_Strategy.strategy.php'); |
|
252 | - \EE_Checkbox_Dropdown_Selector_Display_Strategy::enqueue_styles_and_scripts(); |
|
253 | - } |
|
251 | + require_once( EE_LIBRARIES.'form_sections/strategies/display/EE_Checkbox_Dropdown_Selector_Display_Strategy.strategy.php'); |
|
252 | + \EE_Checkbox_Dropdown_Selector_Display_Strategy::enqueue_styles_and_scripts(); |
|
253 | + } |
|
254 | + } |
|
255 | + |
|
256 | + |
|
257 | + |
|
258 | + /** |
|
259 | + * @return void |
|
260 | + */ |
|
261 | + public static function loadIframeAssets() |
|
262 | + { |
|
263 | + // for event lists |
|
264 | + add_filter( |
|
265 | + 'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__css', |
|
266 | + array('EED_Ticket_Selector', 'iframeCss') |
|
267 | + ); |
|
268 | + add_filter( |
|
269 | + 'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__js', |
|
270 | + array('EED_Ticket_Selector', 'iframeJs') |
|
271 | + ); |
|
272 | + // for ticket selectors |
|
273 | + add_filter( |
|
274 | + 'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css', |
|
275 | + array('EED_Ticket_Selector', 'iframeCss') |
|
276 | + ); |
|
277 | + add_filter( |
|
278 | + 'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js', |
|
279 | + array('EED_Ticket_Selector', 'iframeJs') |
|
280 | + ); |
|
281 | + } |
|
282 | + |
|
283 | + |
|
284 | + |
|
285 | + /** |
|
286 | + * Informs the rest of the forms system what CSS and JS is needed to display the input |
|
287 | + * |
|
288 | + * @param array $iframe_css |
|
289 | + * @return array |
|
290 | + */ |
|
291 | + public static function iframeCss(array $iframe_css) |
|
292 | + { |
|
293 | + $iframe_css['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css'; |
|
294 | + return $iframe_css; |
|
254 | 295 | } |
255 | 296 | |
256 | 297 | |
257 | 298 | |
258 | - /** |
|
259 | - * @return void |
|
260 | - */ |
|
261 | - public static function loadIframeAssets() |
|
262 | - { |
|
263 | - // for event lists |
|
264 | - add_filter( |
|
265 | - 'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__css', |
|
266 | - array('EED_Ticket_Selector', 'iframeCss') |
|
267 | - ); |
|
268 | - add_filter( |
|
269 | - 'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__js', |
|
270 | - array('EED_Ticket_Selector', 'iframeJs') |
|
271 | - ); |
|
272 | - // for ticket selectors |
|
273 | - add_filter( |
|
274 | - 'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css', |
|
275 | - array('EED_Ticket_Selector', 'iframeCss') |
|
276 | - ); |
|
277 | - add_filter( |
|
278 | - 'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js', |
|
279 | - array('EED_Ticket_Selector', 'iframeJs') |
|
280 | - ); |
|
281 | - } |
|
282 | - |
|
283 | - |
|
284 | - |
|
285 | - /** |
|
286 | - * Informs the rest of the forms system what CSS and JS is needed to display the input |
|
287 | - * |
|
288 | - * @param array $iframe_css |
|
289 | - * @return array |
|
290 | - */ |
|
291 | - public static function iframeCss(array $iframe_css) |
|
292 | - { |
|
293 | - $iframe_css['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css'; |
|
294 | - return $iframe_css; |
|
295 | - } |
|
296 | - |
|
297 | - |
|
298 | - |
|
299 | - /** |
|
300 | - * Informs the rest of the forms system what CSS and JS is needed to display the input |
|
301 | - * |
|
302 | - * @param array $iframe_js |
|
303 | - * @return array |
|
304 | - */ |
|
305 | - public static function iframeJs(array $iframe_js) |
|
306 | - { |
|
307 | - $iframe_js['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.js'; |
|
308 | - return $iframe_js; |
|
309 | - } |
|
299 | + /** |
|
300 | + * Informs the rest of the forms system what CSS and JS is needed to display the input |
|
301 | + * |
|
302 | + * @param array $iframe_js |
|
303 | + * @return array |
|
304 | + */ |
|
305 | + public static function iframeJs(array $iframe_js) |
|
306 | + { |
|
307 | + $iframe_js['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.js'; |
|
308 | + return $iframe_js; |
|
309 | + } |
|
310 | 310 | |
311 | 311 | |
312 | 312 | /****************************** DEPRECATED ******************************/ |
313 | 313 | |
314 | 314 | |
315 | 315 | |
316 | - /** |
|
317 | - * @deprecated |
|
318 | - * @return string |
|
319 | - * @throws \EE_Error |
|
320 | - */ |
|
321 | - public static function display_view_details_btn() |
|
322 | - { |
|
323 | - // todo add doing_it_wrong() notice during next major version |
|
324 | - return EED_Ticket_Selector::ticketSelector()->displayViewDetailsButton(); |
|
325 | - } |
|
326 | - |
|
327 | - |
|
328 | - |
|
329 | - /** |
|
330 | - * @deprecated |
|
331 | - * @return string |
|
332 | - * @throws \EE_Error |
|
333 | - */ |
|
334 | - public static function display_ticket_selector_submit() |
|
335 | - { |
|
336 | - // todo add doing_it_wrong() notice during next major version |
|
337 | - return EED_Ticket_Selector::ticketSelector()->displaySubmitButton(); |
|
338 | - } |
|
339 | - |
|
340 | - |
|
341 | - |
|
342 | - /** |
|
343 | - * @deprecated |
|
344 | - * @param string $permalink_string |
|
345 | - * @param int $id |
|
346 | - * @param string $new_title |
|
347 | - * @param string $new_slug |
|
348 | - * @return string |
|
349 | - */ |
|
350 | - public static function iframe_code_button($permalink_string, $id, $new_title = '', $new_slug = '') |
|
351 | - { |
|
352 | - // todo add doing_it_wrong() notice during next major version |
|
353 | - if ( |
|
354 | - \EE_Registry::instance()->REQ->get('page') === 'espresso_events' |
|
355 | - && \EE_Registry::instance()->REQ->get('action') === 'edit' |
|
356 | - ) { |
|
357 | - $iframe_embed_button = \EED_Ticket_Selector::getIframeEmbedButton(); |
|
358 | - $iframe_embed_button->addEventEditorIframeEmbedButton(); |
|
359 | - } |
|
360 | - return ''; |
|
361 | - } |
|
362 | - |
|
363 | - |
|
364 | - |
|
365 | - /** |
|
366 | - * @deprecated |
|
367 | - * @param int $ID |
|
368 | - * @param string $external_url |
|
369 | - * @return string |
|
370 | - */ |
|
371 | - public static function ticket_selector_form_open($ID = 0, $external_url = '') |
|
372 | - { |
|
373 | - // todo add doing_it_wrong() notice during next major version |
|
374 | - return EED_Ticket_Selector::ticketSelector()->formOpen($ID, $external_url); |
|
375 | - } |
|
376 | - |
|
377 | - |
|
378 | - |
|
379 | - /** |
|
380 | - * @deprecated |
|
381 | - * @return string |
|
382 | - */ |
|
383 | - public static function ticket_selector_form_close() |
|
384 | - { |
|
385 | - // todo add doing_it_wrong() notice during next major version |
|
386 | - return EED_Ticket_Selector::ticketSelector()->formClose(); |
|
387 | - } |
|
388 | - |
|
389 | - |
|
390 | - |
|
391 | - /** |
|
392 | - * @deprecated |
|
393 | - * @return string |
|
394 | - */ |
|
395 | - public static function no_tkt_slctr_end_dv() |
|
396 | - { |
|
397 | - // todo add doing_it_wrong() notice during next major version |
|
398 | - return EED_Ticket_Selector::ticketSelector()->ticketSelectorEndDiv(); |
|
399 | - } |
|
400 | - |
|
401 | - |
|
402 | - |
|
403 | - /** |
|
404 | - * @deprecated 4.9.13 |
|
405 | - * @return string |
|
406 | - */ |
|
407 | - public static function tkt_slctr_end_dv() |
|
408 | - { |
|
409 | - return EED_Ticket_Selector::ticketSelector()->clearTicketSelector(); |
|
410 | - } |
|
411 | - |
|
412 | - |
|
413 | - |
|
414 | - /** |
|
415 | - * @deprecated |
|
416 | - * @return string |
|
417 | - */ |
|
418 | - public static function clear_tkt_slctr() |
|
419 | - { |
|
420 | - return EED_Ticket_Selector::ticketSelector()->clearTicketSelector(); |
|
421 | - } |
|
422 | - |
|
423 | - |
|
424 | - |
|
425 | - /** |
|
426 | - * @deprecated |
|
427 | - */ |
|
428 | - public static function load_tckt_slctr_assets_admin() |
|
429 | - { |
|
430 | - // todo add doing_it_wrong() notice during next major version |
|
431 | - if ( |
|
432 | - \EE_Registry::instance()->REQ->get( 'page' ) === 'espresso_events' |
|
433 | - && \EE_Registry::instance()->REQ->get( 'action' ) === 'edit' |
|
434 | - ) { |
|
435 | - $iframe_embed_button = \EED_Ticket_Selector::getIframeEmbedButton(); |
|
436 | - $iframe_embed_button->embedButtonAssets(); |
|
437 | - } |
|
438 | - } |
|
316 | + /** |
|
317 | + * @deprecated |
|
318 | + * @return string |
|
319 | + * @throws \EE_Error |
|
320 | + */ |
|
321 | + public static function display_view_details_btn() |
|
322 | + { |
|
323 | + // todo add doing_it_wrong() notice during next major version |
|
324 | + return EED_Ticket_Selector::ticketSelector()->displayViewDetailsButton(); |
|
325 | + } |
|
326 | + |
|
327 | + |
|
328 | + |
|
329 | + /** |
|
330 | + * @deprecated |
|
331 | + * @return string |
|
332 | + * @throws \EE_Error |
|
333 | + */ |
|
334 | + public static function display_ticket_selector_submit() |
|
335 | + { |
|
336 | + // todo add doing_it_wrong() notice during next major version |
|
337 | + return EED_Ticket_Selector::ticketSelector()->displaySubmitButton(); |
|
338 | + } |
|
339 | + |
|
340 | + |
|
341 | + |
|
342 | + /** |
|
343 | + * @deprecated |
|
344 | + * @param string $permalink_string |
|
345 | + * @param int $id |
|
346 | + * @param string $new_title |
|
347 | + * @param string $new_slug |
|
348 | + * @return string |
|
349 | + */ |
|
350 | + public static function iframe_code_button($permalink_string, $id, $new_title = '', $new_slug = '') |
|
351 | + { |
|
352 | + // todo add doing_it_wrong() notice during next major version |
|
353 | + if ( |
|
354 | + \EE_Registry::instance()->REQ->get('page') === 'espresso_events' |
|
355 | + && \EE_Registry::instance()->REQ->get('action') === 'edit' |
|
356 | + ) { |
|
357 | + $iframe_embed_button = \EED_Ticket_Selector::getIframeEmbedButton(); |
|
358 | + $iframe_embed_button->addEventEditorIframeEmbedButton(); |
|
359 | + } |
|
360 | + return ''; |
|
361 | + } |
|
362 | + |
|
363 | + |
|
364 | + |
|
365 | + /** |
|
366 | + * @deprecated |
|
367 | + * @param int $ID |
|
368 | + * @param string $external_url |
|
369 | + * @return string |
|
370 | + */ |
|
371 | + public static function ticket_selector_form_open($ID = 0, $external_url = '') |
|
372 | + { |
|
373 | + // todo add doing_it_wrong() notice during next major version |
|
374 | + return EED_Ticket_Selector::ticketSelector()->formOpen($ID, $external_url); |
|
375 | + } |
|
376 | + |
|
377 | + |
|
378 | + |
|
379 | + /** |
|
380 | + * @deprecated |
|
381 | + * @return string |
|
382 | + */ |
|
383 | + public static function ticket_selector_form_close() |
|
384 | + { |
|
385 | + // todo add doing_it_wrong() notice during next major version |
|
386 | + return EED_Ticket_Selector::ticketSelector()->formClose(); |
|
387 | + } |
|
388 | + |
|
389 | + |
|
390 | + |
|
391 | + /** |
|
392 | + * @deprecated |
|
393 | + * @return string |
|
394 | + */ |
|
395 | + public static function no_tkt_slctr_end_dv() |
|
396 | + { |
|
397 | + // todo add doing_it_wrong() notice during next major version |
|
398 | + return EED_Ticket_Selector::ticketSelector()->ticketSelectorEndDiv(); |
|
399 | + } |
|
400 | + |
|
401 | + |
|
402 | + |
|
403 | + /** |
|
404 | + * @deprecated 4.9.13 |
|
405 | + * @return string |
|
406 | + */ |
|
407 | + public static function tkt_slctr_end_dv() |
|
408 | + { |
|
409 | + return EED_Ticket_Selector::ticketSelector()->clearTicketSelector(); |
|
410 | + } |
|
411 | + |
|
412 | + |
|
413 | + |
|
414 | + /** |
|
415 | + * @deprecated |
|
416 | + * @return string |
|
417 | + */ |
|
418 | + public static function clear_tkt_slctr() |
|
419 | + { |
|
420 | + return EED_Ticket_Selector::ticketSelector()->clearTicketSelector(); |
|
421 | + } |
|
422 | + |
|
423 | + |
|
424 | + |
|
425 | + /** |
|
426 | + * @deprecated |
|
427 | + */ |
|
428 | + public static function load_tckt_slctr_assets_admin() |
|
429 | + { |
|
430 | + // todo add doing_it_wrong() notice during next major version |
|
431 | + if ( |
|
432 | + \EE_Registry::instance()->REQ->get( 'page' ) === 'espresso_events' |
|
433 | + && \EE_Registry::instance()->REQ->get( 'action' ) === 'edit' |
|
434 | + ) { |
|
435 | + $iframe_embed_button = \EED_Ticket_Selector::getIframeEmbedButton(); |
|
436 | + $iframe_embed_button->embedButtonAssets(); |
|
437 | + } |
|
438 | + } |
|
439 | 439 | |
440 | 440 | |
441 | 441 | } |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | use EventEspresso\modules\ticket_selector\TicketSelectorIframe; |
4 | 4 | use EventEspresso\modules\ticket_selector\TicketSelectorIframeEmbedButton; |
5 | 5 | |
6 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
7 | - exit( 'No direct script access allowed' ); |
|
6 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
7 | + exit('No direct script access allowed'); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | |
@@ -38,15 +38,15 @@ discard block |
||
38 | 38 | * @return EED_Ticket_Selector |
39 | 39 | */ |
40 | 40 | public static function instance() { |
41 | - return parent::get_instance( __CLASS__ ); |
|
41 | + return parent::get_instance(__CLASS__); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | |
46 | - protected function set_config(){ |
|
47 | - $this->set_config_section( 'template_settings' ); |
|
48 | - $this->set_config_class( 'EE_Ticket_Selector_Config' ); |
|
49 | - $this->set_config_name( 'EED_Ticket_Selector' ); |
|
46 | + protected function set_config() { |
|
47 | + $this->set_config_section('template_settings'); |
|
48 | + $this->set_config_class('EE_Ticket_Selector_Config'); |
|
49 | + $this->set_config_name('EED_Ticket_Selector'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | |
@@ -59,13 +59,13 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public static function set_hooks() { |
61 | 61 | // routing |
62 | - EE_Config::register_route( 'iframe', 'EED_Ticket_Selector', 'ticket_selector_iframe', 'ticket_selector' ); |
|
63 | - EE_Config::register_route( 'process_ticket_selections', 'EED_Ticket_Selector', 'process_ticket_selections' ); |
|
62 | + EE_Config::register_route('iframe', 'EED_Ticket_Selector', 'ticket_selector_iframe', 'ticket_selector'); |
|
63 | + EE_Config::register_route('process_ticket_selections', 'EED_Ticket_Selector', 'process_ticket_selections'); |
|
64 | 64 | EE_Config::register_route('cancel_ticket_selections', 'EED_Ticket_Selector', 'cancel_ticket_selections'); |
65 | - add_action( 'wp_loaded', array( 'EED_Ticket_Selector', 'set_definitions' ), 2 ); |
|
66 | - add_action( 'AHEE_event_details_header_bottom', array( 'EED_Ticket_Selector', 'display_ticket_selector' ), 10, 1 ); |
|
67 | - add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'translate_js_strings' ), 0 ); |
|
68 | - add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'load_tckt_slctr_assets' ), 10 ); |
|
65 | + add_action('wp_loaded', array('EED_Ticket_Selector', 'set_definitions'), 2); |
|
66 | + add_action('AHEE_event_details_header_bottom', array('EED_Ticket_Selector', 'display_ticket_selector'), 10, 1); |
|
67 | + add_action('wp_enqueue_scripts', array('EED_Ticket_Selector', 'translate_js_strings'), 0); |
|
68 | + add_action('wp_enqueue_scripts', array('EED_Ticket_Selector', 'load_tckt_slctr_assets'), 10); |
|
69 | 69 | EED_Ticket_Selector::loadIframeAssets(); |
70 | 70 | } |
71 | 71 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | // to load assets for "espresso_events" page on the "edit" route (action) |
83 | 83 | add_action( |
84 | 84 | 'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_events__edit', |
85 | - array( 'EED_Ticket_Selector', 'ticket_selector_iframe_embed_button' ), |
|
85 | + array('EED_Ticket_Selector', 'ticket_selector_iframe_embed_button'), |
|
86 | 86 | 10 |
87 | 87 | ); |
88 | 88 | |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | * @return void |
107 | 107 | */ |
108 | 108 | public static function set_definitions() { |
109 | - define( 'TICKET_SELECTOR_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
110 | - define( 'TICKET_SELECTOR_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS ); |
|
109 | + define('TICKET_SELECTOR_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
110 | + define('TICKET_SELECTOR_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
111 | 111 | |
112 | 112 | //if config is not set, initialize |
113 | - if ( ! EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector instanceof EE_Ticket_Selector_Config ) { |
|
113 | + if ( ! EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector instanceof EE_Ticket_Selector_Config) { |
|
114 | 114 | \EED_Ticket_Selector::instance()->set_config(); |
115 | 115 | \EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector = \EED_Ticket_Selector::instance()->config(); |
116 | 116 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @param WP $WP |
138 | 138 | * @return void |
139 | 139 | */ |
140 | - public function run( $WP ) {} |
|
140 | + public function run($WP) {} |
|
141 | 141 | |
142 | 142 | |
143 | 143 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * @return \EventEspresso\modules\ticket_selector\TicketSelectorIframeEmbedButton |
146 | 146 | */ |
147 | 147 | public static function getIframeEmbedButton() { |
148 | - if ( ! self::$iframe_embed_button instanceof TicketSelectorIframeEmbedButton ) { |
|
148 | + if ( ! self::$iframe_embed_button instanceof TicketSelectorIframeEmbedButton) { |
|
149 | 149 | self::$iframe_embed_button = new TicketSelectorIframeEmbedButton(); |
150 | 150 | } |
151 | 151 | return self::$iframe_embed_button; |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | * @return string |
190 | 190 | * @throws \EE_Error |
191 | 191 | */ |
192 | - public static function display_ticket_selector( $event = NULL, $view_details = FALSE ) { |
|
193 | - return EED_Ticket_Selector::ticketSelector()->display( $event, $view_details ); |
|
192 | + public static function display_ticket_selector($event = NULL, $view_details = FALSE) { |
|
193 | + return EED_Ticket_Selector::ticketSelector()->display($event, $view_details); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | |
@@ -241,14 +241,14 @@ discard block |
||
241 | 241 | * @return void |
242 | 242 | */ |
243 | 243 | public static function load_tckt_slctr_assets() { |
244 | - if ( apply_filters( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', FALSE ) ) { |
|
244 | + if (apply_filters('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', FALSE)) { |
|
245 | 245 | // add some style |
246 | - wp_register_style('ticket_selector', TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css'); |
|
246 | + wp_register_style('ticket_selector', TICKET_SELECTOR_ASSETS_URL.'ticket_selector.css'); |
|
247 | 247 | wp_enqueue_style('ticket_selector'); |
248 | 248 | // make it dance |
249 | - wp_register_script('ticket_selector', TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.js', array('espresso_core'), '', TRUE); |
|
249 | + wp_register_script('ticket_selector', TICKET_SELECTOR_ASSETS_URL.'ticket_selector.js', array('espresso_core'), '', TRUE); |
|
250 | 250 | wp_enqueue_script('ticket_selector'); |
251 | - require_once( EE_LIBRARIES.'form_sections/strategies/display/EE_Checkbox_Dropdown_Selector_Display_Strategy.strategy.php'); |
|
251 | + require_once(EE_LIBRARIES.'form_sections/strategies/display/EE_Checkbox_Dropdown_Selector_Display_Strategy.strategy.php'); |
|
252 | 252 | \EE_Checkbox_Dropdown_Selector_Display_Strategy::enqueue_styles_and_scripts(); |
253 | 253 | } |
254 | 254 | } |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | */ |
291 | 291 | public static function iframeCss(array $iframe_css) |
292 | 292 | { |
293 | - $iframe_css['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css'; |
|
293 | + $iframe_css['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL.'ticket_selector.css'; |
|
294 | 294 | return $iframe_css; |
295 | 295 | } |
296 | 296 | |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | */ |
305 | 305 | public static function iframeJs(array $iframe_js) |
306 | 306 | { |
307 | - $iframe_js['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.js'; |
|
307 | + $iframe_js['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL.'ticket_selector.js'; |
|
308 | 308 | return $iframe_js; |
309 | 309 | } |
310 | 310 | |
@@ -429,8 +429,8 @@ discard block |
||
429 | 429 | { |
430 | 430 | // todo add doing_it_wrong() notice during next major version |
431 | 431 | if ( |
432 | - \EE_Registry::instance()->REQ->get( 'page' ) === 'espresso_events' |
|
433 | - && \EE_Registry::instance()->REQ->get( 'action' ) === 'edit' |
|
432 | + \EE_Registry::instance()->REQ->get('page') === 'espresso_events' |
|
433 | + && \EE_Registry::instance()->REQ->get('action') === 'edit' |
|
434 | 434 | ) { |
435 | 435 | $iframe_embed_button = \EED_Ticket_Selector::getIframeEmbedButton(); |
436 | 436 | $iframe_embed_button->embedButtonAssets(); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * can_use_espresso_conditionals |
144 | 144 | * tests whether the Espresso Conditional tags like is_espresso_event_single() can be called |
145 | 145 | * |
146 | - * @param $conditional_tag |
|
146 | + * @param string $conditional_tag |
|
147 | 147 | * @return bool |
148 | 148 | */ |
149 | 149 | function can_use_espresso_conditionals( $conditional_tag ) { |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | /** |
856 | 856 | * espresso_event_venues |
857 | 857 | * |
858 | - * @return array all venues related to an event |
|
858 | + * @return EE_Venue[] all venues related to an event |
|
859 | 859 | */ |
860 | 860 | function espresso_event_venues() { |
861 | 861 | return EEH_Venue_View::get_event_venues(); |
@@ -888,7 +888,7 @@ discard block |
||
888 | 888 | * |
889 | 889 | * @param int $VNU_ID optional, the venue id to check. |
890 | 890 | * |
891 | - * @return bool | null |
|
891 | + * @return null|boolean | null |
|
892 | 892 | */ |
893 | 893 | function espresso_is_venue_private( $VNU_ID = 0 ) { |
894 | 894 | return EEH_Venue_View::is_venue_private( $VNU_ID ); |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | * returns true or false if a venue is password protected or not |
903 | 903 | * |
904 | 904 | * @param int $VNU_ID optional, the venue id to check. |
905 | - * @return string |
|
905 | + * @return boolean |
|
906 | 906 | */ |
907 | 907 | function espresso_venue_is_password_protected( $VNU_ID = 0 ) { |
908 | 908 | EE_Registry::instance()->load_helper( 'Venue_View' ); |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | * @param int | \EE_Event $event |
28 | 28 | * @return bool |
29 | 29 | */ |
30 | -function is_espresso_event( $event = NULL ) { |
|
31 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
30 | +function is_espresso_event($event = NULL) { |
|
31 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
32 | 32 | // extract EE_Event object from passed param regardless of what it is (within reason of course) |
33 | - $event = EEH_Event_View::get_event( $event ); |
|
33 | + $event = EEH_Event_View::get_event($event); |
|
34 | 34 | // do we have a valid event ? |
35 | - return $event instanceof EE_Event ? TRUE : FALSE; |
|
35 | + return $event instanceof EE_Event ? TRUE : FALSE; |
|
36 | 36 | } |
37 | 37 | return FALSE; |
38 | 38 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @return bool |
45 | 45 | */ |
46 | 46 | function is_espresso_event_single() { |
47 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
47 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
48 | 48 | global $wp_query; |
49 | 49 | // return conditionals set by CPTs |
50 | 50 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_single : FALSE; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @return bool |
60 | 60 | */ |
61 | 61 | function is_espresso_event_archive() { |
62 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
62 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
63 | 63 | global $wp_query; |
64 | 64 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_archive : FALSE; |
65 | 65 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * @return bool |
74 | 74 | */ |
75 | 75 | function is_espresso_event_taxonomy() { |
76 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
76 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
77 | 77 | global $wp_query; |
78 | 78 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_taxonomy : FALSE; |
79 | 79 | } |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | * @param int | \EE_Venue $venue |
88 | 88 | * @return bool |
89 | 89 | */ |
90 | -function is_espresso_venue( $venue = NULL ) { |
|
91 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
90 | +function is_espresso_venue($venue = NULL) { |
|
91 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
92 | 92 | // extract EE_Venue object from passed param regardless of what it is (within reason of course) |
93 | - $venue = EEH_Venue_View::get_venue( $venue, FALSE ); |
|
93 | + $venue = EEH_Venue_View::get_venue($venue, FALSE); |
|
94 | 94 | // do we have a valid event ? |
95 | 95 | return $venue instanceof EE_Venue ? TRUE : FALSE; |
96 | 96 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * @return bool |
105 | 105 | */ |
106 | 106 | function is_espresso_venue_single() { |
107 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
107 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
108 | 108 | global $wp_query; |
109 | 109 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_single : FALSE; |
110 | 110 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * @return bool |
119 | 119 | */ |
120 | 120 | function is_espresso_venue_archive() { |
121 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
121 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
122 | 122 | global $wp_query; |
123 | 123 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_archive : FALSE; |
124 | 124 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * @return bool |
133 | 133 | */ |
134 | 134 | function is_espresso_venue_taxonomy() { |
135 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
135 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
136 | 136 | global $wp_query; |
137 | 137 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_taxonomy : FALSE; |
138 | 138 | } |
@@ -146,12 +146,12 @@ discard block |
||
146 | 146 | * @param $conditional_tag |
147 | 147 | * @return bool |
148 | 148 | */ |
149 | -function can_use_espresso_conditionals( $conditional_tag ) { |
|
150 | - if ( ! did_action( 'AHEE__EE_System__initialize' )) { |
|
149 | +function can_use_espresso_conditionals($conditional_tag) { |
|
150 | + if ( ! did_action('AHEE__EE_System__initialize')) { |
|
151 | 151 | EE_Error::doing_it_wrong( |
152 | 152 | __FUNCTION__, |
153 | 153 | sprintf( |
154 | - __( 'The "%s" conditional tag can not be used until after the "init" hook has run, but works best when used within a theme\'s template files.','event_espresso'), |
|
154 | + __('The "%s" conditional tag can not be used until after the "init" hook has run, but works best when used within a theme\'s template files.', 'event_espresso'), |
|
155 | 155 | $conditional_tag |
156 | 156 | ), |
157 | 157 | '4.4.0' |
@@ -166,13 +166,13 @@ discard block |
||
166 | 166 | |
167 | 167 | /*************************** Event Queries ***************************/ |
168 | 168 | |
169 | -if ( ! function_exists( 'espresso_get_events' )) { |
|
169 | +if ( ! function_exists('espresso_get_events')) { |
|
170 | 170 | /** |
171 | 171 | * espresso_get_events |
172 | 172 | * @param array $params |
173 | 173 | * @return array |
174 | 174 | */ |
175 | - function espresso_get_events( $params = array() ) { |
|
175 | + function espresso_get_events($params = array()) { |
|
176 | 176 | //set default params |
177 | 177 | $default_espresso_events_params = array( |
178 | 178 | 'limit' => 10, |
@@ -183,18 +183,18 @@ discard block |
||
183 | 183 | 'sort' => 'ASC' |
184 | 184 | ); |
185 | 185 | // allow the defaults to be filtered |
186 | - $default_espresso_events_params = apply_filters( 'espresso_get_events__default_espresso_events_params', $default_espresso_events_params ); |
|
186 | + $default_espresso_events_params = apply_filters('espresso_get_events__default_espresso_events_params', $default_espresso_events_params); |
|
187 | 187 | // grab params and merge with defaults, then extract |
188 | - $params = array_merge( $default_espresso_events_params, $params ); |
|
188 | + $params = array_merge($default_espresso_events_params, $params); |
|
189 | 189 | // run the query |
190 | - $events_query = new EE_Event_List_Query( $params ); |
|
190 | + $events_query = new EE_Event_List_Query($params); |
|
191 | 191 | // assign results to a variable so we can return it |
192 | 192 | $events = $events_query->have_posts() ? $events_query->posts : array(); |
193 | 193 | // but first reset the query and postdata |
194 | 194 | wp_reset_query(); |
195 | 195 | wp_reset_postdata(); |
196 | 196 | EED_Events_Archive::remove_all_events_archive_filters(); |
197 | - unset( $events_query ); |
|
197 | + unset($events_query); |
|
198 | 198 | return $events; |
199 | 199 | } |
200 | 200 | } |
@@ -208,32 +208,32 @@ discard block |
||
208 | 208 | * espresso_load_ticket_selector |
209 | 209 | */ |
210 | 210 | function espresso_load_ticket_selector() { |
211 | - EE_Registry::instance()->load_file( EE_MODULES . 'ticket_selector', 'EED_Ticket_Selector', 'module' ); |
|
211 | + EE_Registry::instance()->load_file(EE_MODULES.'ticket_selector', 'EED_Ticket_Selector', 'module'); |
|
212 | 212 | } |
213 | 213 | |
214 | -if ( ! function_exists( 'espresso_ticket_selector' )) { |
|
214 | +if ( ! function_exists('espresso_ticket_selector')) { |
|
215 | 215 | /** |
216 | 216 | * espresso_ticket_selector |
217 | 217 | * @param null $event |
218 | 218 | */ |
219 | - function espresso_ticket_selector( $event = NULL ) { |
|
220 | - if ( ! apply_filters( 'FHEE_disable_espresso_ticket_selector', FALSE ) ) { |
|
219 | + function espresso_ticket_selector($event = NULL) { |
|
220 | + if ( ! apply_filters('FHEE_disable_espresso_ticket_selector', FALSE)) { |
|
221 | 221 | espresso_load_ticket_selector(); |
222 | - echo EED_Ticket_Selector::display_ticket_selector( $event ); |
|
222 | + echo EED_Ticket_Selector::display_ticket_selector($event); |
|
223 | 223 | } |
224 | 224 | } |
225 | 225 | } |
226 | 226 | |
227 | 227 | |
228 | - if ( ! function_exists( 'espresso_view_details_btn' )) { |
|
228 | + if ( ! function_exists('espresso_view_details_btn')) { |
|
229 | 229 | /** |
230 | 230 | * espresso_view_details_btn |
231 | 231 | * @param null $event |
232 | 232 | */ |
233 | - function espresso_view_details_btn( $event = NULL ) { |
|
234 | - if ( ! apply_filters( 'FHEE_disable_espresso_view_details_btn', FALSE ) ) { |
|
233 | + function espresso_view_details_btn($event = NULL) { |
|
234 | + if ( ! apply_filters('FHEE_disable_espresso_view_details_btn', FALSE)) { |
|
235 | 235 | espresso_load_ticket_selector(); |
236 | - echo EED_Ticket_Selector::display_ticket_selector( $event, TRUE ); |
|
236 | + echo EED_Ticket_Selector::display_ticket_selector($event, TRUE); |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | |
244 | 244 | /*************************** EEH_Event_View ***************************/ |
245 | 245 | |
246 | -if ( ! function_exists( 'espresso_load_event_list_assets' )) { |
|
246 | +if ( ! function_exists('espresso_load_event_list_assets')) { |
|
247 | 247 | /** |
248 | 248 | * espresso_load_event_list_assets |
249 | 249 | * ensures that event list styles and scripts are loaded |
@@ -252,13 +252,13 @@ discard block |
||
252 | 252 | */ |
253 | 253 | function espresso_load_event_list_assets() { |
254 | 254 | $event_list = EED_Events_Archive::instance(); |
255 | - add_action( 'AHEE__EE_System__initialize_last', array( $event_list, 'load_event_list_assets' ), 10 ); |
|
256 | - add_filter( 'FHEE_enable_default_espresso_css', '__return_true' ); |
|
255 | + add_action('AHEE__EE_System__initialize_last', array($event_list, 'load_event_list_assets'), 10); |
|
256 | + add_filter('FHEE_enable_default_espresso_css', '__return_true'); |
|
257 | 257 | } |
258 | 258 | } |
259 | 259 | |
260 | 260 | |
261 | -if ( ! function_exists( 'espresso_event_reg_button' )) { |
|
261 | +if ( ! function_exists('espresso_event_reg_button')) { |
|
262 | 262 | /** |
263 | 263 | * espresso_event_reg_button |
264 | 264 | * returns the "Register Now" button if event is active, |
@@ -270,9 +270,9 @@ discard block |
||
270 | 270 | * @param bool $EVT_ID |
271 | 271 | * @return string |
272 | 272 | */ |
273 | - function espresso_event_reg_button( $btn_text_if_active = NULL, $btn_text_if_inactive = FALSE, $EVT_ID = FALSE ) { |
|
274 | - $event_status = EEH_Event_View::event_active_status( $EVT_ID ); |
|
275 | - switch ( $event_status ) { |
|
273 | + function espresso_event_reg_button($btn_text_if_active = NULL, $btn_text_if_inactive = FALSE, $EVT_ID = FALSE) { |
|
274 | + $event_status = EEH_Event_View::event_active_status($EVT_ID); |
|
275 | + switch ($event_status) { |
|
276 | 276 | case EE_Datetime::sold_out : |
277 | 277 | $btn_text = __('Sold Out', 'event_espresso'); |
278 | 278 | $class = 'ee-pink'; |
@@ -288,10 +288,10 @@ discard block |
||
288 | 288 | case EE_Datetime::upcoming : |
289 | 289 | case EE_Datetime::active : |
290 | 290 | default : |
291 | - $btn_text =! empty( $btn_text_if_active ) ? $btn_text_if_active : __( 'Register Now', 'event_espresso' ); |
|
291 | + $btn_text = ! empty($btn_text_if_active) ? $btn_text_if_active : __('Register Now', 'event_espresso'); |
|
292 | 292 | $class = 'ee-green'; |
293 | 293 | } |
294 | - if ( $event_status < 1 && ! empty( $btn_text_if_inactive )) { |
|
294 | + if ($event_status < 1 && ! empty($btn_text_if_inactive)) { |
|
295 | 295 | $btn_text = $btn_text_if_inactive; |
296 | 296 | $class = 'ee-grey'; |
297 | 297 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | |
306 | 306 | |
307 | 307 | |
308 | -if ( ! function_exists( 'espresso_display_ticket_selector' )) { |
|
308 | +if ( ! function_exists('espresso_display_ticket_selector')) { |
|
309 | 309 | /** |
310 | 310 | * espresso_display_ticket_selector |
311 | 311 | * whether or not to display the Ticket Selector for an event |
@@ -313,14 +313,14 @@ discard block |
||
313 | 313 | * @param bool $EVT_ID |
314 | 314 | * @return boolean |
315 | 315 | */ |
316 | - function espresso_display_ticket_selector( $EVT_ID = FALSE ) { |
|
317 | - return EEH_Event_View::display_ticket_selector( $EVT_ID ); |
|
316 | + function espresso_display_ticket_selector($EVT_ID = FALSE) { |
|
317 | + return EEH_Event_View::display_ticket_selector($EVT_ID); |
|
318 | 318 | } |
319 | 319 | } |
320 | 320 | |
321 | 321 | |
322 | 322 | |
323 | -if ( ! function_exists( 'espresso_event_status_banner' )) { |
|
323 | +if ( ! function_exists('espresso_event_status_banner')) { |
|
324 | 324 | /** |
325 | 325 | * espresso_event_status |
326 | 326 | * returns a banner showing the event status if it is sold out, expired, or inactive |
@@ -328,13 +328,13 @@ discard block |
||
328 | 328 | * @param bool $EVT_ID |
329 | 329 | * @return string |
330 | 330 | */ |
331 | - function espresso_event_status_banner( $EVT_ID = FALSE ) { |
|
332 | - return EEH_Event_View::event_status( $EVT_ID ); |
|
331 | + function espresso_event_status_banner($EVT_ID = FALSE) { |
|
332 | + return EEH_Event_View::event_status($EVT_ID); |
|
333 | 333 | } |
334 | 334 | } |
335 | 335 | |
336 | 336 | |
337 | -if ( ! function_exists( 'espresso_event_status' )) { |
|
337 | +if ( ! function_exists('espresso_event_status')) { |
|
338 | 338 | /** |
339 | 339 | * espresso_event_status |
340 | 340 | * returns the event status if it is sold out, expired, or inactive |
@@ -343,17 +343,17 @@ discard block |
||
343 | 343 | * @param bool $echo |
344 | 344 | * @return string |
345 | 345 | */ |
346 | - function espresso_event_status( $EVT_ID = 0, $echo = TRUE ) { |
|
347 | - if ( $echo ) { |
|
348 | - echo EEH_Event_View::event_active_status( $EVT_ID ); |
|
346 | + function espresso_event_status($EVT_ID = 0, $echo = TRUE) { |
|
347 | + if ($echo) { |
|
348 | + echo EEH_Event_View::event_active_status($EVT_ID); |
|
349 | 349 | return ''; |
350 | 350 | } |
351 | - return EEH_Event_View::event_active_status( $EVT_ID ); |
|
351 | + return EEH_Event_View::event_active_status($EVT_ID); |
|
352 | 352 | } |
353 | 353 | } |
354 | 354 | |
355 | 355 | |
356 | -if ( ! function_exists( 'espresso_event_categories' )) { |
|
356 | +if ( ! function_exists('espresso_event_categories')) { |
|
357 | 357 | /** |
358 | 358 | * espresso_event_categories |
359 | 359 | * returns the terms associated with an event |
@@ -363,17 +363,17 @@ discard block |
||
363 | 363 | * @param bool $echo |
364 | 364 | * @return string |
365 | 365 | */ |
366 | - function espresso_event_categories( $EVT_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE ) { |
|
367 | - if ( $echo ) { |
|
368 | - echo EEH_Event_View::event_categories( $EVT_ID, $hide_uncategorized ); |
|
366 | + function espresso_event_categories($EVT_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE) { |
|
367 | + if ($echo) { |
|
368 | + echo EEH_Event_View::event_categories($EVT_ID, $hide_uncategorized); |
|
369 | 369 | return ''; |
370 | 370 | } |
371 | - return EEH_Event_View::event_categories( $EVT_ID, $hide_uncategorized ); |
|
371 | + return EEH_Event_View::event_categories($EVT_ID, $hide_uncategorized); |
|
372 | 372 | } |
373 | 373 | } |
374 | 374 | |
375 | 375 | |
376 | -if ( ! function_exists( 'espresso_event_tickets_available' )) { |
|
376 | +if ( ! function_exists('espresso_event_tickets_available')) { |
|
377 | 377 | /** |
378 | 378 | * espresso_event_tickets_available |
379 | 379 | * returns the ticket types available for purchase for an event |
@@ -383,26 +383,26 @@ discard block |
||
383 | 383 | * @param bool $format |
384 | 384 | * @return string |
385 | 385 | */ |
386 | - function espresso_event_tickets_available( $EVT_ID = 0, $echo = TRUE, $format = TRUE ) { |
|
387 | - $tickets = EEH_Event_View::event_tickets_available( $EVT_ID ); |
|
388 | - if ( is_array( $tickets ) && ! empty( $tickets )) { |
|
386 | + function espresso_event_tickets_available($EVT_ID = 0, $echo = TRUE, $format = TRUE) { |
|
387 | + $tickets = EEH_Event_View::event_tickets_available($EVT_ID); |
|
388 | + if (is_array($tickets) && ! empty($tickets)) { |
|
389 | 389 | // if formatting then $html will be a string, else it will be an array of ticket objects |
390 | - $html = $format ? '<ul id="ee-event-tickets-ul-' . $EVT_ID . '" class="ee-event-tickets-ul">' : array(); |
|
391 | - foreach ( $tickets as $ticket ) { |
|
392 | - if ( $ticket instanceof EE_Ticket ) { |
|
393 | - if ( $format ) { |
|
394 | - $html .= '<li id="ee-event-tickets-li-' . $ticket->ID() . '" class="ee-event-tickets-li">'; |
|
395 | - $html .= $ticket->name() . ' ' . EEH_Template::format_currency( $ticket->get_ticket_total_with_taxes() ); |
|
390 | + $html = $format ? '<ul id="ee-event-tickets-ul-'.$EVT_ID.'" class="ee-event-tickets-ul">' : array(); |
|
391 | + foreach ($tickets as $ticket) { |
|
392 | + if ($ticket instanceof EE_Ticket) { |
|
393 | + if ($format) { |
|
394 | + $html .= '<li id="ee-event-tickets-li-'.$ticket->ID().'" class="ee-event-tickets-li">'; |
|
395 | + $html .= $ticket->name().' '.EEH_Template::format_currency($ticket->get_ticket_total_with_taxes()); |
|
396 | 396 | $html .= '</li>'; |
397 | 397 | } else { |
398 | 398 | $html[] = $ticket; |
399 | 399 | } |
400 | 400 | } |
401 | 401 | } |
402 | - if ( $format ) { |
|
402 | + if ($format) { |
|
403 | 403 | $html .= '</ul>'; |
404 | 404 | } |
405 | - if ( $echo && ! $format ) { |
|
405 | + if ($echo && ! $format) { |
|
406 | 406 | echo $html; |
407 | 407 | return ''; |
408 | 408 | } |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | } |
413 | 413 | } |
414 | 414 | |
415 | -if ( ! function_exists( 'espresso_event_date_obj' )) { |
|
415 | +if ( ! function_exists('espresso_event_date_obj')) { |
|
416 | 416 | /** |
417 | 417 | * espresso_event_date_obj |
418 | 418 | * returns the primary date object for an event |
@@ -420,13 +420,13 @@ discard block |
||
420 | 420 | * @param bool $EVT_ID |
421 | 421 | * @return object |
422 | 422 | */ |
423 | - function espresso_event_date_obj( $EVT_ID = FALSE ) { |
|
424 | - return EEH_Event_View::get_primary_date_obj( $EVT_ID ); |
|
423 | + function espresso_event_date_obj($EVT_ID = FALSE) { |
|
424 | + return EEH_Event_View::get_primary_date_obj($EVT_ID); |
|
425 | 425 | } |
426 | 426 | } |
427 | 427 | |
428 | 428 | |
429 | -if ( ! function_exists( 'espresso_event_date' )) { |
|
429 | +if ( ! function_exists('espresso_event_date')) { |
|
430 | 430 | /** |
431 | 431 | * espresso_event_date |
432 | 432 | * returns the primary date for an event |
@@ -437,22 +437,22 @@ discard block |
||
437 | 437 | * @param bool $echo |
438 | 438 | * @return string |
439 | 439 | */ |
440 | - function espresso_event_date( $date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE ) { |
|
441 | - $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); |
|
442 | - $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); |
|
443 | - $date_format = apply_filters( 'FHEE__espresso_event_date__date_format', $date_format ); |
|
444 | - $time_format = apply_filters( 'FHEE__espresso_event_date__time_format', $time_format ); |
|
445 | - if($echo){ |
|
446 | - echo EEH_Event_View::the_event_date( $date_format, $time_format, $EVT_ID ); |
|
440 | + function espresso_event_date($date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE) { |
|
441 | + $date_format = ! empty($date_format) ? $date_format : get_option('date_format'); |
|
442 | + $time_format = ! empty($time_format) ? $time_format : get_option('time_format'); |
|
443 | + $date_format = apply_filters('FHEE__espresso_event_date__date_format', $date_format); |
|
444 | + $time_format = apply_filters('FHEE__espresso_event_date__time_format', $time_format); |
|
445 | + if ($echo) { |
|
446 | + echo EEH_Event_View::the_event_date($date_format, $time_format, $EVT_ID); |
|
447 | 447 | return ''; |
448 | 448 | } |
449 | - return EEH_Event_View::the_event_date( $date_format, $time_format, $EVT_ID ); |
|
449 | + return EEH_Event_View::the_event_date($date_format, $time_format, $EVT_ID); |
|
450 | 450 | |
451 | 451 | } |
452 | 452 | } |
453 | 453 | |
454 | 454 | |
455 | -if ( ! function_exists( 'espresso_list_of_event_dates' )) { |
|
455 | +if ( ! function_exists('espresso_list_of_event_dates')) { |
|
456 | 456 | /** |
457 | 457 | * espresso_list_of_event_dates |
458 | 458 | * returns a unordered list of dates for an event |
@@ -467,40 +467,40 @@ discard block |
||
467 | 467 | * @param null $limit |
468 | 468 | * @return string |
469 | 469 | */ |
470 | - function espresso_list_of_event_dates( $EVT_ID = 0, $date_format = '', $time_format = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE, $limit = NULL ) { |
|
471 | - $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); |
|
472 | - $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); |
|
473 | - $date_format = apply_filters( 'FHEE__espresso_list_of_event_dates__date_format', $date_format ); |
|
474 | - $time_format = apply_filters( 'FHEE__espresso_list_of_event_dates__time_format', $time_format ); |
|
475 | - $datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID, $show_expired, FALSE, $limit ); |
|
476 | - if ( ! $format ) { |
|
477 | - return apply_filters( 'FHEE__espresso_list_of_event_dates__datetimes', $datetimes ); |
|
470 | + function espresso_list_of_event_dates($EVT_ID = 0, $date_format = '', $time_format = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE, $limit = NULL) { |
|
471 | + $date_format = ! empty($date_format) ? $date_format : get_option('date_format'); |
|
472 | + $time_format = ! empty($time_format) ? $time_format : get_option('time_format'); |
|
473 | + $date_format = apply_filters('FHEE__espresso_list_of_event_dates__date_format', $date_format); |
|
474 | + $time_format = apply_filters('FHEE__espresso_list_of_event_dates__time_format', $time_format); |
|
475 | + $datetimes = EEH_Event_View::get_all_date_obj($EVT_ID, $show_expired, FALSE, $limit); |
|
476 | + if ( ! $format) { |
|
477 | + return apply_filters('FHEE__espresso_list_of_event_dates__datetimes', $datetimes); |
|
478 | 478 | } |
479 | 479 | //d( $datetimes ); |
480 | - if ( is_array( $datetimes ) && ! empty( $datetimes )) { |
|
480 | + if (is_array($datetimes) && ! empty($datetimes)) { |
|
481 | 481 | global $post; |
482 | - $html = $format ? '<ul id="ee-event-datetimes-ul-' . $post->ID . '" class="ee-event-datetimes-ul ee-clearfix">' : ''; |
|
483 | - foreach ( $datetimes as $datetime ) { |
|
484 | - if ( $datetime instanceof EE_Datetime ) { |
|
485 | - $html .= '<li id="ee-event-datetimes-li-' . $datetime->ID(); |
|
486 | - $html .= '" class="ee-event-datetimes-li ee-event-datetimes-li-' . $datetime->get_active_status() . '">'; |
|
482 | + $html = $format ? '<ul id="ee-event-datetimes-ul-'.$post->ID.'" class="ee-event-datetimes-ul ee-clearfix">' : ''; |
|
483 | + foreach ($datetimes as $datetime) { |
|
484 | + if ($datetime instanceof EE_Datetime) { |
|
485 | + $html .= '<li id="ee-event-datetimes-li-'.$datetime->ID(); |
|
486 | + $html .= '" class="ee-event-datetimes-li ee-event-datetimes-li-'.$datetime->get_active_status().'">'; |
|
487 | 487 | $datetime_name = $datetime->name(); |
488 | - $html .= ! empty( $datetime_name ) ? '<strong>' . $datetime_name . '</strong>' : ''; |
|
489 | - $html .= ! empty( $datetime_name ) && $add_breaks ? '<br />' : ''; |
|
490 | - $html .= '<span class="dashicons dashicons-calendar"></span>' . $datetime->date_range( $date_format ) . '<br/>'; |
|
491 | - $html .= '<span class="dashicons dashicons-clock"></span>' . $datetime->time_range( $time_format ); |
|
488 | + $html .= ! empty($datetime_name) ? '<strong>'.$datetime_name.'</strong>' : ''; |
|
489 | + $html .= ! empty($datetime_name) && $add_breaks ? '<br />' : ''; |
|
490 | + $html .= '<span class="dashicons dashicons-calendar"></span>'.$datetime->date_range($date_format).'<br/>'; |
|
491 | + $html .= '<span class="dashicons dashicons-clock"></span>'.$datetime->time_range($time_format); |
|
492 | 492 | $datetime_description = $datetime->description(); |
493 | - $html .= ! empty( $datetime_description ) && $add_breaks ? '<br />' : ''; |
|
494 | - $html .= ! empty( $datetime_description ) ? ' - ' . $datetime_description : ''; |
|
495 | - $html = apply_filters( 'FHEE__espresso_list_of_event_dates__datetime_html', $html, $datetime ); |
|
493 | + $html .= ! empty($datetime_description) && $add_breaks ? '<br />' : ''; |
|
494 | + $html .= ! empty($datetime_description) ? ' - '.$datetime_description : ''; |
|
495 | + $html = apply_filters('FHEE__espresso_list_of_event_dates__datetime_html', $html, $datetime); |
|
496 | 496 | $html .= '</li>'; |
497 | 497 | } |
498 | 498 | } |
499 | 499 | $html .= $format ? '</ul>' : ''; |
500 | 500 | } else { |
501 | - $html = $format ? '<p><span class="dashicons dashicons-marker pink-text"></span>' . __( 'There are no upcoming dates for this event.', 'event_espresso' ) . '</p><br/>' : ''; |
|
501 | + $html = $format ? '<p><span class="dashicons dashicons-marker pink-text"></span>'.__('There are no upcoming dates for this event.', 'event_espresso').'</p><br/>' : ''; |
|
502 | 502 | } |
503 | - if ( $echo ) { |
|
503 | + if ($echo) { |
|
504 | 504 | echo $html; |
505 | 505 | return ''; |
506 | 506 | } |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | } |
510 | 510 | |
511 | 511 | |
512 | -if ( ! function_exists( 'espresso_event_end_date' )) { |
|
512 | +if ( ! function_exists('espresso_event_end_date')) { |
|
513 | 513 | /** |
514 | 514 | * espresso_event_end_date |
515 | 515 | * returns the last date for an event |
@@ -520,20 +520,20 @@ discard block |
||
520 | 520 | * @param bool $echo |
521 | 521 | * @return string |
522 | 522 | */ |
523 | - function espresso_event_end_date( $date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE ) { |
|
524 | - $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); |
|
525 | - $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); |
|
526 | - $date_format = apply_filters( 'FHEE__espresso_event_end_date__date_format', $date_format ); |
|
527 | - $time_format = apply_filters( 'FHEE__espresso_event_end_date__time_format', $time_format ); |
|
528 | - if($echo){ |
|
529 | - echo EEH_Event_View::the_event_end_date( $date_format, $time_format, $EVT_ID ); |
|
523 | + function espresso_event_end_date($date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE) { |
|
524 | + $date_format = ! empty($date_format) ? $date_format : get_option('date_format'); |
|
525 | + $time_format = ! empty($time_format) ? $time_format : get_option('time_format'); |
|
526 | + $date_format = apply_filters('FHEE__espresso_event_end_date__date_format', $date_format); |
|
527 | + $time_format = apply_filters('FHEE__espresso_event_end_date__time_format', $time_format); |
|
528 | + if ($echo) { |
|
529 | + echo EEH_Event_View::the_event_end_date($date_format, $time_format, $EVT_ID); |
|
530 | 530 | return ''; |
531 | 531 | } |
532 | - return EEH_Event_View::the_event_end_date( $date_format, $time_format, $EVT_ID ); |
|
532 | + return EEH_Event_View::the_event_end_date($date_format, $time_format, $EVT_ID); |
|
533 | 533 | } |
534 | 534 | } |
535 | 535 | |
536 | -if ( ! function_exists( 'espresso_event_date_range' )) { |
|
536 | +if ( ! function_exists('espresso_event_date_range')) { |
|
537 | 537 | /** |
538 | 538 | * espresso_event_date_range |
539 | 539 | * returns the first and last chronologically ordered dates for an event (if different) |
@@ -546,31 +546,31 @@ discard block |
||
546 | 546 | * @param bool $echo |
547 | 547 | * @return string |
548 | 548 | */ |
549 | - function espresso_event_date_range( $date_format = '', $time_format = '', $single_date_format = '', $single_time_format = '', $EVT_ID = FALSE, $echo = TRUE ) { |
|
549 | + function espresso_event_date_range($date_format = '', $time_format = '', $single_date_format = '', $single_time_format = '', $EVT_ID = FALSE, $echo = TRUE) { |
|
550 | 550 | // set and filter date and time formats when a range is returned |
551 | - $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); |
|
552 | - $date_format = apply_filters( 'FHEE__espresso_event_date_range__date_format', $date_format ); |
|
551 | + $date_format = ! empty($date_format) ? $date_format : get_option('date_format'); |
|
552 | + $date_format = apply_filters('FHEE__espresso_event_date_range__date_format', $date_format); |
|
553 | 553 | // get the start and end date with NO time portion |
554 | - $the_event_date = EEH_Event_View::the_earliest_event_date( $date_format, '', $EVT_ID ); |
|
555 | - $the_event_end_date = EEH_Event_View::the_latest_event_date( $date_format, '', $EVT_ID ); |
|
554 | + $the_event_date = EEH_Event_View::the_earliest_event_date($date_format, '', $EVT_ID); |
|
555 | + $the_event_end_date = EEH_Event_View::the_latest_event_date($date_format, '', $EVT_ID); |
|
556 | 556 | // now we can determine if date range spans more than one day |
557 | - if ( $the_event_date != $the_event_end_date ) { |
|
558 | - $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); |
|
559 | - $time_format = apply_filters( 'FHEE__espresso_event_date_range__time_format', $time_format ); |
|
557 | + if ($the_event_date != $the_event_end_date) { |
|
558 | + $time_format = ! empty($time_format) ? $time_format : get_option('time_format'); |
|
559 | + $time_format = apply_filters('FHEE__espresso_event_date_range__time_format', $time_format); |
|
560 | 560 | $html = sprintf( |
561 | - __( '%1$s - %2$s', 'event_espresso' ), |
|
562 | - EEH_Event_View::the_earliest_event_date( $date_format, $time_format, $EVT_ID ), |
|
563 | - EEH_Event_View::the_latest_event_date( $date_format, $time_format, $EVT_ID ) |
|
561 | + __('%1$s - %2$s', 'event_espresso'), |
|
562 | + EEH_Event_View::the_earliest_event_date($date_format, $time_format, $EVT_ID), |
|
563 | + EEH_Event_View::the_latest_event_date($date_format, $time_format, $EVT_ID) |
|
564 | 564 | ); |
565 | 565 | } else { |
566 | 566 | // set and filter date and time formats when only a single datetime is returned |
567 | - $single_date_format = ! empty( $single_date_format ) ? $single_date_format : get_option( 'date_format' ); |
|
568 | - $single_time_format = ! empty( $single_time_format ) ? $single_time_format : get_option( 'time_format' ); |
|
569 | - $single_date_format = apply_filters( 'FHEE__espresso_event_date_range__single_date_format', $single_date_format ); |
|
570 | - $single_time_format = apply_filters( 'FHEE__espresso_event_date_range__single_time_format', $single_time_format ); |
|
571 | - $html = EEH_Event_View::the_earliest_event_date( $single_date_format, $single_time_format, $EVT_ID ); |
|
567 | + $single_date_format = ! empty($single_date_format) ? $single_date_format : get_option('date_format'); |
|
568 | + $single_time_format = ! empty($single_time_format) ? $single_time_format : get_option('time_format'); |
|
569 | + $single_date_format = apply_filters('FHEE__espresso_event_date_range__single_date_format', $single_date_format); |
|
570 | + $single_time_format = apply_filters('FHEE__espresso_event_date_range__single_time_format', $single_time_format); |
|
571 | + $html = EEH_Event_View::the_earliest_event_date($single_date_format, $single_time_format, $EVT_ID); |
|
572 | 572 | } |
573 | - if ( $echo ) { |
|
573 | + if ($echo) { |
|
574 | 574 | echo $html; |
575 | 575 | return ''; |
576 | 576 | } |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | } |
580 | 580 | |
581 | 581 | |
582 | -if ( ! function_exists( 'espresso_event_date_as_calendar_page' )) { |
|
582 | +if ( ! function_exists('espresso_event_date_as_calendar_page')) { |
|
583 | 583 | /** |
584 | 584 | * espresso_event_date_as_calendar_page |
585 | 585 | * returns the primary date for an event, stylized to appear as the page of a calendar |
@@ -587,15 +587,15 @@ discard block |
||
587 | 587 | * @param bool $EVT_ID |
588 | 588 | * @return string |
589 | 589 | */ |
590 | - function espresso_event_date_as_calendar_page( $EVT_ID = FALSE ) { |
|
591 | - EEH_Event_View::event_date_as_calendar_page( $EVT_ID ); |
|
590 | + function espresso_event_date_as_calendar_page($EVT_ID = FALSE) { |
|
591 | + EEH_Event_View::event_date_as_calendar_page($EVT_ID); |
|
592 | 592 | } |
593 | 593 | } |
594 | 594 | |
595 | 595 | |
596 | 596 | |
597 | 597 | |
598 | -if ( ! function_exists( 'espresso_event_link_url' )) { |
|
598 | +if ( ! function_exists('espresso_event_link_url')) { |
|
599 | 599 | /** |
600 | 600 | * espresso_event_link_url |
601 | 601 | * |
@@ -603,18 +603,18 @@ discard block |
||
603 | 603 | * @param bool $echo |
604 | 604 | * @return string |
605 | 605 | */ |
606 | - function espresso_event_link_url( $EVT_ID = 0, $echo = TRUE ) { |
|
607 | - if ( $echo ) { |
|
608 | - echo EEH_Event_View::event_link_url( $EVT_ID ); |
|
606 | + function espresso_event_link_url($EVT_ID = 0, $echo = TRUE) { |
|
607 | + if ($echo) { |
|
608 | + echo EEH_Event_View::event_link_url($EVT_ID); |
|
609 | 609 | return ''; |
610 | 610 | } |
611 | - return EEH_Event_View::event_link_url( $EVT_ID ); |
|
611 | + return EEH_Event_View::event_link_url($EVT_ID); |
|
612 | 612 | } |
613 | 613 | } |
614 | 614 | |
615 | 615 | |
616 | 616 | |
617 | -if ( ! function_exists( 'espresso_event_has_content_or_excerpt' )) { |
|
617 | +if ( ! function_exists('espresso_event_has_content_or_excerpt')) { |
|
618 | 618 | /** |
619 | 619 | * espresso_event_has_content_or_excerpt |
620 | 620 | * |
@@ -622,15 +622,15 @@ discard block |
||
622 | 622 | * @param bool $EVT_ID |
623 | 623 | * @return boolean |
624 | 624 | */ |
625 | - function espresso_event_has_content_or_excerpt( $EVT_ID = FALSE ) { |
|
626 | - return EEH_Event_View::event_has_content_or_excerpt( $EVT_ID ); |
|
625 | + function espresso_event_has_content_or_excerpt($EVT_ID = FALSE) { |
|
626 | + return EEH_Event_View::event_has_content_or_excerpt($EVT_ID); |
|
627 | 627 | } |
628 | 628 | } |
629 | 629 | |
630 | 630 | |
631 | 631 | |
632 | 632 | |
633 | -if ( ! function_exists( 'espresso_event_content_or_excerpt' )) { |
|
633 | +if ( ! function_exists('espresso_event_content_or_excerpt')) { |
|
634 | 634 | /** |
635 | 635 | * espresso_event_content_or_excerpt |
636 | 636 | * |
@@ -639,18 +639,18 @@ discard block |
||
639 | 639 | * @param bool $echo |
640 | 640 | * @return string |
641 | 641 | */ |
642 | - function espresso_event_content_or_excerpt( $num_words = 55, $more = NULL, $echo = TRUE ) { |
|
643 | - if ( $echo ) { |
|
644 | - echo EEH_Event_View::event_content_or_excerpt( $num_words, $more ); |
|
642 | + function espresso_event_content_or_excerpt($num_words = 55, $more = NULL, $echo = TRUE) { |
|
643 | + if ($echo) { |
|
644 | + echo EEH_Event_View::event_content_or_excerpt($num_words, $more); |
|
645 | 645 | return ''; |
646 | 646 | } |
647 | - return EEH_Event_View::event_content_or_excerpt( $num_words, $more ); |
|
647 | + return EEH_Event_View::event_content_or_excerpt($num_words, $more); |
|
648 | 648 | } |
649 | 649 | } |
650 | 650 | |
651 | 651 | |
652 | 652 | |
653 | -if ( ! function_exists( 'espresso_event_phone' )) { |
|
653 | +if ( ! function_exists('espresso_event_phone')) { |
|
654 | 654 | /** |
655 | 655 | * espresso_event_phone |
656 | 656 | * |
@@ -658,18 +658,18 @@ discard block |
||
658 | 658 | * @param bool $echo |
659 | 659 | * @return string |
660 | 660 | */ |
661 | - function espresso_event_phone( $EVT_ID = 0, $echo = TRUE ) { |
|
662 | - if ( $echo ) { |
|
663 | - echo EEH_Event_View::event_phone( $EVT_ID ); |
|
661 | + function espresso_event_phone($EVT_ID = 0, $echo = TRUE) { |
|
662 | + if ($echo) { |
|
663 | + echo EEH_Event_View::event_phone($EVT_ID); |
|
664 | 664 | return ''; |
665 | 665 | } |
666 | - return EEH_Event_View::event_phone( $EVT_ID ); |
|
666 | + return EEH_Event_View::event_phone($EVT_ID); |
|
667 | 667 | } |
668 | 668 | } |
669 | 669 | |
670 | 670 | |
671 | 671 | |
672 | -if ( ! function_exists( 'espresso_edit_event_link' )) { |
|
672 | +if ( ! function_exists('espresso_edit_event_link')) { |
|
673 | 673 | /** |
674 | 674 | * espresso_edit_event_link |
675 | 675 | * returns a link to edit an event |
@@ -678,39 +678,39 @@ discard block |
||
678 | 678 | * @param bool $echo |
679 | 679 | * @return string |
680 | 680 | */ |
681 | - function espresso_edit_event_link( $EVT_ID = 0, $echo = TRUE ) { |
|
682 | - if ( $echo ) { |
|
683 | - echo EEH_Event_View::edit_event_link( $EVT_ID ); |
|
681 | + function espresso_edit_event_link($EVT_ID = 0, $echo = TRUE) { |
|
682 | + if ($echo) { |
|
683 | + echo EEH_Event_View::edit_event_link($EVT_ID); |
|
684 | 684 | return ''; |
685 | 685 | } |
686 | - return EEH_Event_View::edit_event_link( $EVT_ID ); |
|
686 | + return EEH_Event_View::edit_event_link($EVT_ID); |
|
687 | 687 | } |
688 | 688 | } |
689 | 689 | |
690 | 690 | |
691 | -if ( ! function_exists( 'espresso_organization_name' )) { |
|
691 | +if ( ! function_exists('espresso_organization_name')) { |
|
692 | 692 | /** |
693 | 693 | * espresso_organization_name |
694 | 694 | * @param bool $echo |
695 | 695 | * @return string |
696 | 696 | */ |
697 | 697 | function espresso_organization_name($echo = TRUE) { |
698 | - if($echo){ |
|
699 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'name' ); |
|
698 | + if ($echo) { |
|
699 | + echo EE_Registry::instance()->CFG->organization->get_pretty('name'); |
|
700 | 700 | return ''; |
701 | 701 | } |
702 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'name' ); |
|
702 | + return EE_Registry::instance()->CFG->organization->get_pretty('name'); |
|
703 | 703 | } |
704 | 704 | } |
705 | 705 | |
706 | -if ( ! function_exists( 'espresso_organization_address' )) { |
|
706 | +if ( ! function_exists('espresso_organization_address')) { |
|
707 | 707 | /** |
708 | 708 | * espresso_organization_address |
709 | 709 | * @param string $type |
710 | 710 | * @return string |
711 | 711 | */ |
712 | - function espresso_organization_address( $type = 'inline' ) { |
|
713 | - if ( EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config ) { |
|
712 | + function espresso_organization_address($type = 'inline') { |
|
713 | + if (EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config) { |
|
714 | 714 | $address = new EventEspresso\core\domain\entities\GenericAddress( |
715 | 715 | EE_Registry::instance()->CFG->organization->address_1, |
716 | 716 | EE_Registry::instance()->CFG->organization->address_2, |
@@ -719,129 +719,129 @@ discard block |
||
719 | 719 | EE_Registry::instance()->CFG->organization->zip, |
720 | 720 | EE_Registry::instance()->CFG->organization->CNT_ISO |
721 | 721 | ); |
722 | - return EEH_Address::format( $address, $type ); |
|
722 | + return EEH_Address::format($address, $type); |
|
723 | 723 | } |
724 | 724 | return ''; |
725 | 725 | } |
726 | 726 | } |
727 | 727 | |
728 | -if ( ! function_exists( 'espresso_organization_email' )) { |
|
728 | +if ( ! function_exists('espresso_organization_email')) { |
|
729 | 729 | /** |
730 | 730 | * espresso_organization_email |
731 | 731 | * @param bool $echo |
732 | 732 | * @return string |
733 | 733 | */ |
734 | - function espresso_organization_email( $echo = TRUE ) { |
|
735 | - if($echo){ |
|
736 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'email' ); |
|
734 | + function espresso_organization_email($echo = TRUE) { |
|
735 | + if ($echo) { |
|
736 | + echo EE_Registry::instance()->CFG->organization->get_pretty('email'); |
|
737 | 737 | return ''; |
738 | 738 | } |
739 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'email' ); |
|
739 | + return EE_Registry::instance()->CFG->organization->get_pretty('email'); |
|
740 | 740 | } |
741 | 741 | } |
742 | 742 | |
743 | -if ( ! function_exists( 'espresso_organization_logo_url' )) { |
|
743 | +if ( ! function_exists('espresso_organization_logo_url')) { |
|
744 | 744 | /** |
745 | 745 | * espresso_organization_logo_url |
746 | 746 | * @param bool $echo |
747 | 747 | * @return string |
748 | 748 | */ |
749 | - function espresso_organization_logo_url( $echo = TRUE ) { |
|
750 | - if($echo){ |
|
751 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' ); |
|
749 | + function espresso_organization_logo_url($echo = TRUE) { |
|
750 | + if ($echo) { |
|
751 | + echo EE_Registry::instance()->CFG->organization->get_pretty('logo_url'); |
|
752 | 752 | return ''; |
753 | 753 | } |
754 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' ); |
|
754 | + return EE_Registry::instance()->CFG->organization->get_pretty('logo_url'); |
|
755 | 755 | } |
756 | 756 | } |
757 | 757 | |
758 | -if ( ! function_exists( 'espresso_organization_facebook' )) { |
|
758 | +if ( ! function_exists('espresso_organization_facebook')) { |
|
759 | 759 | /** |
760 | 760 | * espresso_organization_facebook |
761 | 761 | * @param bool $echo |
762 | 762 | * @return string |
763 | 763 | */ |
764 | - function espresso_organization_facebook( $echo = TRUE ) { |
|
765 | - if($echo){ |
|
766 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' ); |
|
764 | + function espresso_organization_facebook($echo = TRUE) { |
|
765 | + if ($echo) { |
|
766 | + echo EE_Registry::instance()->CFG->organization->get_pretty('facebook'); |
|
767 | 767 | return ''; |
768 | 768 | } |
769 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' ); |
|
769 | + return EE_Registry::instance()->CFG->organization->get_pretty('facebook'); |
|
770 | 770 | } |
771 | 771 | } |
772 | 772 | |
773 | -if ( ! function_exists( 'espresso_organization_twitter' )) { |
|
773 | +if ( ! function_exists('espresso_organization_twitter')) { |
|
774 | 774 | /** |
775 | 775 | * espresso_organization_twitter |
776 | 776 | * @param bool $echo |
777 | 777 | * @return string |
778 | 778 | */ |
779 | - function espresso_organization_twitter( $echo = TRUE ) { |
|
780 | - if($echo){ |
|
781 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' ); |
|
779 | + function espresso_organization_twitter($echo = TRUE) { |
|
780 | + if ($echo) { |
|
781 | + echo EE_Registry::instance()->CFG->organization->get_pretty('twitter'); |
|
782 | 782 | return ''; |
783 | 783 | } |
784 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' ); |
|
784 | + return EE_Registry::instance()->CFG->organization->get_pretty('twitter'); |
|
785 | 785 | } |
786 | 786 | } |
787 | 787 | |
788 | -if ( ! function_exists( 'espresso_organization_linkedin' )) { |
|
788 | +if ( ! function_exists('espresso_organization_linkedin')) { |
|
789 | 789 | /** |
790 | 790 | * espresso_organization_linkedin |
791 | 791 | * @param bool $echo |
792 | 792 | * @return string |
793 | 793 | */ |
794 | - function espresso_organization_linkedin( $echo = TRUE ) { |
|
795 | - if($echo){ |
|
796 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' ); |
|
794 | + function espresso_organization_linkedin($echo = TRUE) { |
|
795 | + if ($echo) { |
|
796 | + echo EE_Registry::instance()->CFG->organization->get_pretty('linkedin'); |
|
797 | 797 | return ''; |
798 | 798 | } |
799 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' ); |
|
799 | + return EE_Registry::instance()->CFG->organization->get_pretty('linkedin'); |
|
800 | 800 | } |
801 | 801 | } |
802 | 802 | |
803 | -if ( ! function_exists( 'espresso_organization_pinterest' )) { |
|
803 | +if ( ! function_exists('espresso_organization_pinterest')) { |
|
804 | 804 | /** |
805 | 805 | * espresso_organization_pinterest |
806 | 806 | * @param bool $echo |
807 | 807 | * @return string |
808 | 808 | */ |
809 | - function espresso_organization_pinterest( $echo = TRUE ) { |
|
810 | - if($echo){ |
|
811 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' ); |
|
809 | + function espresso_organization_pinterest($echo = TRUE) { |
|
810 | + if ($echo) { |
|
811 | + echo EE_Registry::instance()->CFG->organization->get_pretty('pinterest'); |
|
812 | 812 | return ''; |
813 | 813 | } |
814 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' ); |
|
814 | + return EE_Registry::instance()->CFG->organization->get_pretty('pinterest'); |
|
815 | 815 | } |
816 | 816 | } |
817 | 817 | |
818 | -if ( ! function_exists( 'espresso_organization_google' )) { |
|
818 | +if ( ! function_exists('espresso_organization_google')) { |
|
819 | 819 | /** |
820 | 820 | * espresso_organization_google |
821 | 821 | * @param bool $echo |
822 | 822 | * @return string |
823 | 823 | */ |
824 | - function espresso_organization_google( $echo = TRUE ) { |
|
825 | - if($echo){ |
|
826 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'google' ); |
|
824 | + function espresso_organization_google($echo = TRUE) { |
|
825 | + if ($echo) { |
|
826 | + echo EE_Registry::instance()->CFG->organization->get_pretty('google'); |
|
827 | 827 | return ''; |
828 | 828 | } |
829 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'google' ); |
|
829 | + return EE_Registry::instance()->CFG->organization->get_pretty('google'); |
|
830 | 830 | } |
831 | 831 | } |
832 | 832 | |
833 | -if ( ! function_exists( 'espresso_organization_instagram' )) { |
|
833 | +if ( ! function_exists('espresso_organization_instagram')) { |
|
834 | 834 | /** |
835 | 835 | * espresso_organization_instagram |
836 | 836 | * @param bool $echo |
837 | 837 | * @return string |
838 | 838 | */ |
839 | - function espresso_organization_instagram( $echo = TRUE ) { |
|
840 | - if($echo){ |
|
841 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' ); |
|
839 | + function espresso_organization_instagram($echo = TRUE) { |
|
840 | + if ($echo) { |
|
841 | + echo EE_Registry::instance()->CFG->organization->get_pretty('instagram'); |
|
842 | 842 | return ''; |
843 | 843 | } |
844 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' ); |
|
844 | + return EE_Registry::instance()->CFG->organization->get_pretty('instagram'); |
|
845 | 845 | } |
846 | 846 | } |
847 | 847 | |
@@ -851,7 +851,7 @@ discard block |
||
851 | 851 | |
852 | 852 | |
853 | 853 | |
854 | -if ( ! function_exists( 'espresso_event_venues' )) { |
|
854 | +if ( ! function_exists('espresso_event_venues')) { |
|
855 | 855 | /** |
856 | 856 | * espresso_event_venues |
857 | 857 | * |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | |
866 | 866 | |
867 | 867 | |
868 | -if ( ! function_exists( 'espresso_venue_id' )) { |
|
868 | +if ( ! function_exists('espresso_venue_id')) { |
|
869 | 869 | /** |
870 | 870 | * espresso_venue_name |
871 | 871 | * |
@@ -873,15 +873,15 @@ discard block |
||
873 | 873 | * @param int $EVT_ID |
874 | 874 | * @return string |
875 | 875 | */ |
876 | - function espresso_venue_id( $EVT_ID = 0 ) { |
|
877 | - $venue = EEH_Venue_View::get_venue( $EVT_ID ); |
|
876 | + function espresso_venue_id($EVT_ID = 0) { |
|
877 | + $venue = EEH_Venue_View::get_venue($EVT_ID); |
|
878 | 878 | return $venue instanceof EE_Venue ? $venue->ID() : 0; |
879 | 879 | } |
880 | 880 | } |
881 | 881 | |
882 | 882 | |
883 | 883 | |
884 | -if ( ! function_exists( 'espresso_is_venue_private' ) ) { |
|
884 | +if ( ! function_exists('espresso_is_venue_private')) { |
|
885 | 885 | /** |
886 | 886 | * Return whether a venue is private or not. |
887 | 887 | * @see EEH_Venue_View::get_venue() for more info on expected return results. |
@@ -890,45 +890,45 @@ discard block |
||
890 | 890 | * |
891 | 891 | * @return bool | null |
892 | 892 | */ |
893 | - function espresso_is_venue_private( $VNU_ID = 0 ) { |
|
894 | - return EEH_Venue_View::is_venue_private( $VNU_ID ); |
|
893 | + function espresso_is_venue_private($VNU_ID = 0) { |
|
894 | + return EEH_Venue_View::is_venue_private($VNU_ID); |
|
895 | 895 | } |
896 | 896 | } |
897 | 897 | |
898 | 898 | |
899 | 899 | |
900 | -if ( ! function_exists( 'espresso_venue_is_password_protected' ) ) { |
|
900 | +if ( ! function_exists('espresso_venue_is_password_protected')) { |
|
901 | 901 | /** |
902 | 902 | * returns true or false if a venue is password protected or not |
903 | 903 | * |
904 | 904 | * @param int $VNU_ID optional, the venue id to check. |
905 | 905 | * @return string |
906 | 906 | */ |
907 | - function espresso_venue_is_password_protected( $VNU_ID = 0 ) { |
|
908 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
909 | - return EEH_Venue_View::is_venue_password_protected( $VNU_ID ); |
|
907 | + function espresso_venue_is_password_protected($VNU_ID = 0) { |
|
908 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
909 | + return EEH_Venue_View::is_venue_password_protected($VNU_ID); |
|
910 | 910 | } |
911 | 911 | } |
912 | 912 | |
913 | 913 | |
914 | 914 | |
915 | -if ( ! function_exists( 'espresso_password_protected_venue_form' ) ) { |
|
915 | +if ( ! function_exists('espresso_password_protected_venue_form')) { |
|
916 | 916 | /** |
917 | 917 | * Returns a password form if venue is password protected. |
918 | 918 | * |
919 | 919 | * @param int $VNU_ID optional, the venue id to check. |
920 | 920 | * @return string |
921 | 921 | */ |
922 | - function espresso_password_protected_venue_form( $VNU_ID = 0 ) { |
|
923 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
924 | - return EEH_Venue_View::password_protected_venue_form( $VNU_ID ); |
|
922 | + function espresso_password_protected_venue_form($VNU_ID = 0) { |
|
923 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
924 | + return EEH_Venue_View::password_protected_venue_form($VNU_ID); |
|
925 | 925 | } |
926 | 926 | } |
927 | 927 | |
928 | 928 | |
929 | 929 | |
930 | 930 | |
931 | -if ( ! function_exists( 'espresso_venue_name' )) { |
|
931 | +if ( ! function_exists('espresso_venue_name')) { |
|
932 | 932 | /** |
933 | 933 | * espresso_venue_name |
934 | 934 | * |
@@ -938,19 +938,19 @@ discard block |
||
938 | 938 | * @param bool $echo |
939 | 939 | * @return string |
940 | 940 | */ |
941 | - function espresso_venue_name( $VNU_ID = 0, $link_to = 'details', $echo = TRUE ) { |
|
942 | - if($echo){ |
|
943 | - echo EEH_Venue_View::venue_name( $link_to, $VNU_ID ); |
|
941 | + function espresso_venue_name($VNU_ID = 0, $link_to = 'details', $echo = TRUE) { |
|
942 | + if ($echo) { |
|
943 | + echo EEH_Venue_View::venue_name($link_to, $VNU_ID); |
|
944 | 944 | return ''; |
945 | 945 | } |
946 | - return EEH_Venue_View::venue_name( $link_to, $VNU_ID ); |
|
946 | + return EEH_Venue_View::venue_name($link_to, $VNU_ID); |
|
947 | 947 | } |
948 | 948 | } |
949 | 949 | |
950 | 950 | |
951 | 951 | |
952 | 952 | |
953 | -if ( ! function_exists( 'espresso_venue_link' )) { |
|
953 | +if ( ! function_exists('espresso_venue_link')) { |
|
954 | 954 | /** |
955 | 955 | * espresso_venue_link |
956 | 956 | * |
@@ -959,14 +959,14 @@ discard block |
||
959 | 959 | * @param string $text |
960 | 960 | * @return string |
961 | 961 | */ |
962 | - function espresso_venue_link( $VNU_ID = 0, $text = '' ) { |
|
963 | - return EEH_Venue_View::venue_details_link( $VNU_ID, $text ); |
|
962 | + function espresso_venue_link($VNU_ID = 0, $text = '') { |
|
963 | + return EEH_Venue_View::venue_details_link($VNU_ID, $text); |
|
964 | 964 | } |
965 | 965 | } |
966 | 966 | |
967 | 967 | |
968 | 968 | |
969 | -if ( ! function_exists( 'espresso_venue_description' )) { |
|
969 | +if ( ! function_exists('espresso_venue_description')) { |
|
970 | 970 | /** |
971 | 971 | * espresso_venue_description |
972 | 972 | * |
@@ -975,17 +975,17 @@ discard block |
||
975 | 975 | * @param bool $echo |
976 | 976 | * @return string |
977 | 977 | */ |
978 | - function espresso_venue_description( $VNU_ID = FALSE, $echo = TRUE ) { |
|
979 | - if($echo){ |
|
980 | - echo EEH_Venue_View::venue_description( $VNU_ID ); |
|
978 | + function espresso_venue_description($VNU_ID = FALSE, $echo = TRUE) { |
|
979 | + if ($echo) { |
|
980 | + echo EEH_Venue_View::venue_description($VNU_ID); |
|
981 | 981 | return ''; |
982 | 982 | } |
983 | - return EEH_Venue_View::venue_description( $VNU_ID ); |
|
983 | + return EEH_Venue_View::venue_description($VNU_ID); |
|
984 | 984 | } |
985 | 985 | } |
986 | 986 | |
987 | 987 | |
988 | -if ( ! function_exists( 'espresso_venue_excerpt' )) { |
|
988 | +if ( ! function_exists('espresso_venue_excerpt')) { |
|
989 | 989 | /** |
990 | 990 | * espresso_venue_excerpt |
991 | 991 | * |
@@ -994,18 +994,18 @@ discard block |
||
994 | 994 | * @param bool $echo |
995 | 995 | * @return string |
996 | 996 | */ |
997 | - function espresso_venue_excerpt( $VNU_ID = 0, $echo = TRUE ) { |
|
998 | - if ( $echo ) { |
|
999 | - echo EEH_Venue_View::venue_excerpt( $VNU_ID ); |
|
997 | + function espresso_venue_excerpt($VNU_ID = 0, $echo = TRUE) { |
|
998 | + if ($echo) { |
|
999 | + echo EEH_Venue_View::venue_excerpt($VNU_ID); |
|
1000 | 1000 | return ''; |
1001 | 1001 | } |
1002 | - return EEH_Venue_View::venue_excerpt( $VNU_ID ); |
|
1002 | + return EEH_Venue_View::venue_excerpt($VNU_ID); |
|
1003 | 1003 | } |
1004 | 1004 | } |
1005 | 1005 | |
1006 | 1006 | |
1007 | 1007 | |
1008 | -if ( ! function_exists( 'espresso_venue_categories' )) { |
|
1008 | +if ( ! function_exists('espresso_venue_categories')) { |
|
1009 | 1009 | /** |
1010 | 1010 | * espresso_venue_categories |
1011 | 1011 | * returns the terms associated with a venue |
@@ -1015,17 +1015,17 @@ discard block |
||
1015 | 1015 | * @param bool $echo |
1016 | 1016 | * @return string |
1017 | 1017 | */ |
1018 | - function espresso_venue_categories( $VNU_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE ) { |
|
1019 | - if ( $echo ) { |
|
1020 | - echo EEH_Venue_View::venue_categories( $VNU_ID, $hide_uncategorized ); |
|
1018 | + function espresso_venue_categories($VNU_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE) { |
|
1019 | + if ($echo) { |
|
1020 | + echo EEH_Venue_View::venue_categories($VNU_ID, $hide_uncategorized); |
|
1021 | 1021 | return ''; |
1022 | 1022 | } |
1023 | - return EEH_Venue_View::venue_categories( $VNU_ID, $hide_uncategorized ); |
|
1023 | + return EEH_Venue_View::venue_categories($VNU_ID, $hide_uncategorized); |
|
1024 | 1024 | } |
1025 | 1025 | } |
1026 | 1026 | |
1027 | 1027 | |
1028 | -if ( ! function_exists( 'espresso_venue_address' )) { |
|
1028 | +if ( ! function_exists('espresso_venue_address')) { |
|
1029 | 1029 | /** |
1030 | 1030 | * espresso_venue_address |
1031 | 1031 | * returns a formatted block of html for displaying a venue's address |
@@ -1035,17 +1035,17 @@ discard block |
||
1035 | 1035 | * @param bool $echo |
1036 | 1036 | * @return string |
1037 | 1037 | */ |
1038 | - function espresso_venue_address( $type = 'multiline', $VNU_ID = 0, $echo = TRUE ) { |
|
1039 | - if ( $echo ) { |
|
1040 | - echo EEH_Venue_View::venue_address( $type, $VNU_ID ); |
|
1038 | + function espresso_venue_address($type = 'multiline', $VNU_ID = 0, $echo = TRUE) { |
|
1039 | + if ($echo) { |
|
1040 | + echo EEH_Venue_View::venue_address($type, $VNU_ID); |
|
1041 | 1041 | return ''; |
1042 | 1042 | } |
1043 | - return EEH_Venue_View::venue_address( $type, $VNU_ID ); |
|
1043 | + return EEH_Venue_View::venue_address($type, $VNU_ID); |
|
1044 | 1044 | } |
1045 | 1045 | } |
1046 | 1046 | |
1047 | 1047 | |
1048 | -if ( ! function_exists( 'espresso_venue_raw_address' )) { |
|
1048 | +if ( ! function_exists('espresso_venue_raw_address')) { |
|
1049 | 1049 | /** |
1050 | 1050 | * espresso_venue_address |
1051 | 1051 | * returns an UN-formatted string containing a venue's address |
@@ -1055,17 +1055,17 @@ discard block |
||
1055 | 1055 | * @param bool $echo |
1056 | 1056 | * @return string |
1057 | 1057 | */ |
1058 | - function espresso_venue_raw_address( $type = 'multiline', $VNU_ID = 0, $echo = TRUE ) { |
|
1059 | - if ( $echo ) { |
|
1060 | - echo EEH_Venue_View::venue_address( $type, $VNU_ID, FALSE, FALSE ); |
|
1058 | + function espresso_venue_raw_address($type = 'multiline', $VNU_ID = 0, $echo = TRUE) { |
|
1059 | + if ($echo) { |
|
1060 | + echo EEH_Venue_View::venue_address($type, $VNU_ID, FALSE, FALSE); |
|
1061 | 1061 | return ''; |
1062 | 1062 | } |
1063 | - return EEH_Venue_View::venue_address( $type, $VNU_ID, FALSE, FALSE ); |
|
1063 | + return EEH_Venue_View::venue_address($type, $VNU_ID, FALSE, FALSE); |
|
1064 | 1064 | } |
1065 | 1065 | } |
1066 | 1066 | |
1067 | 1067 | |
1068 | -if ( ! function_exists( 'espresso_venue_has_address' )) { |
|
1068 | +if ( ! function_exists('espresso_venue_has_address')) { |
|
1069 | 1069 | /** |
1070 | 1070 | * espresso_venue_has_address |
1071 | 1071 | * returns TRUE or FALSE if a Venue has address information |
@@ -1073,13 +1073,13 @@ discard block |
||
1073 | 1073 | * @param int $VNU_ID |
1074 | 1074 | * @return bool |
1075 | 1075 | */ |
1076 | - function espresso_venue_has_address( $VNU_ID = 0 ) { |
|
1077 | - return EEH_Venue_View::venue_has_address( $VNU_ID ); |
|
1076 | + function espresso_venue_has_address($VNU_ID = 0) { |
|
1077 | + return EEH_Venue_View::venue_has_address($VNU_ID); |
|
1078 | 1078 | } |
1079 | 1079 | } |
1080 | 1080 | |
1081 | 1081 | |
1082 | -if ( ! function_exists( 'espresso_venue_gmap' )) { |
|
1082 | +if ( ! function_exists('espresso_venue_gmap')) { |
|
1083 | 1083 | /** |
1084 | 1084 | * espresso_venue_gmap |
1085 | 1085 | * returns a google map for the venue address |
@@ -1090,17 +1090,17 @@ discard block |
||
1090 | 1090 | * @param bool $echo |
1091 | 1091 | * @return string |
1092 | 1092 | */ |
1093 | - function espresso_venue_gmap( $VNU_ID = 0, $map_ID = FALSE, $gmap = array(), $echo = TRUE ) { |
|
1094 | - if ( $echo ) { |
|
1095 | - echo EEH_Venue_View::venue_gmap( $VNU_ID, $map_ID, $gmap ); |
|
1093 | + function espresso_venue_gmap($VNU_ID = 0, $map_ID = FALSE, $gmap = array(), $echo = TRUE) { |
|
1094 | + if ($echo) { |
|
1095 | + echo EEH_Venue_View::venue_gmap($VNU_ID, $map_ID, $gmap); |
|
1096 | 1096 | return ''; |
1097 | 1097 | } |
1098 | - return EEH_Venue_View::venue_gmap( $VNU_ID, $map_ID, $gmap ); |
|
1098 | + return EEH_Venue_View::venue_gmap($VNU_ID, $map_ID, $gmap); |
|
1099 | 1099 | } |
1100 | 1100 | } |
1101 | 1101 | |
1102 | 1102 | |
1103 | -if ( ! function_exists( 'espresso_venue_phone' )) { |
|
1103 | +if ( ! function_exists('espresso_venue_phone')) { |
|
1104 | 1104 | /** |
1105 | 1105 | * espresso_venue_phone |
1106 | 1106 | * |
@@ -1108,18 +1108,18 @@ discard block |
||
1108 | 1108 | * @param bool $echo |
1109 | 1109 | * @return string |
1110 | 1110 | */ |
1111 | - function espresso_venue_phone( $VNU_ID = 0, $echo = TRUE ) { |
|
1112 | - if ( $echo ) { |
|
1113 | - echo EEH_Venue_View::venue_phone( $VNU_ID ); |
|
1111 | + function espresso_venue_phone($VNU_ID = 0, $echo = TRUE) { |
|
1112 | + if ($echo) { |
|
1113 | + echo EEH_Venue_View::venue_phone($VNU_ID); |
|
1114 | 1114 | return ''; |
1115 | 1115 | } |
1116 | - return EEH_Venue_View::venue_phone( $VNU_ID ); |
|
1116 | + return EEH_Venue_View::venue_phone($VNU_ID); |
|
1117 | 1117 | } |
1118 | 1118 | } |
1119 | 1119 | |
1120 | 1120 | |
1121 | 1121 | |
1122 | -if ( ! function_exists( 'espresso_venue_website' )) { |
|
1122 | +if ( ! function_exists('espresso_venue_website')) { |
|
1123 | 1123 | /** |
1124 | 1124 | * espresso_venue_website |
1125 | 1125 | * |
@@ -1127,18 +1127,18 @@ discard block |
||
1127 | 1127 | * @param bool $echo |
1128 | 1128 | * @return string |
1129 | 1129 | */ |
1130 | - function espresso_venue_website( $VNU_ID = 0, $echo = TRUE ) { |
|
1131 | - if ( $echo ) { |
|
1132 | - echo EEH_Venue_View::venue_website_link( $VNU_ID ); |
|
1130 | + function espresso_venue_website($VNU_ID = 0, $echo = TRUE) { |
|
1131 | + if ($echo) { |
|
1132 | + echo EEH_Venue_View::venue_website_link($VNU_ID); |
|
1133 | 1133 | return ''; |
1134 | 1134 | } |
1135 | - return EEH_Venue_View::venue_website_link( $VNU_ID ); |
|
1135 | + return EEH_Venue_View::venue_website_link($VNU_ID); |
|
1136 | 1136 | } |
1137 | 1137 | } |
1138 | 1138 | |
1139 | 1139 | |
1140 | 1140 | |
1141 | -if ( ! function_exists( 'espresso_edit_venue_link' )) { |
|
1141 | +if ( ! function_exists('espresso_edit_venue_link')) { |
|
1142 | 1142 | /** |
1143 | 1143 | * espresso_edit_venue_link |
1144 | 1144 | * |
@@ -1146,12 +1146,12 @@ discard block |
||
1146 | 1146 | * @param bool $echo |
1147 | 1147 | * @return string |
1148 | 1148 | */ |
1149 | - function espresso_edit_venue_link( $VNU_ID = 0, $echo = TRUE ) { |
|
1150 | - if($echo){ |
|
1151 | - echo EEH_Venue_View::edit_venue_link( $VNU_ID ); |
|
1149 | + function espresso_edit_venue_link($VNU_ID = 0, $echo = TRUE) { |
|
1150 | + if ($echo) { |
|
1151 | + echo EEH_Venue_View::edit_venue_link($VNU_ID); |
|
1152 | 1152 | return ''; |
1153 | 1153 | } |
1154 | - return EEH_Venue_View::edit_venue_link( $VNU_ID ); |
|
1154 | + return EEH_Venue_View::edit_venue_link($VNU_ID); |
|
1155 | 1155 | } |
1156 | 1156 | } |
1157 | 1157 |
@@ -1,24 +1,24 @@ |
||
1 | 1 | <?php |
2 | 2 | /** @type array $registrations_for_free_events */ |
3 | 3 | |
4 | -if( is_array( $registrations_for_free_events ) && ! empty( $registrations_for_free_events ) ) { |
|
4 | +if (is_array($registrations_for_free_events) && ! empty($registrations_for_free_events)) { |
|
5 | 5 | echo apply_filters( |
6 | 6 | 'FHEE__registration_page_payment_options__no_payment_required_hdr', |
7 | 7 | sprintf( |
8 | - __( '%1$sNo Payment Required%2$s', 'event_espresso' ), |
|
8 | + __('%1$sNo Payment Required%2$s', 'event_espresso'), |
|
9 | 9 | '<h6>', |
10 | 10 | '</h6>' |
11 | 11 | ) |
12 | 12 | ); |
13 | - foreach ( $registrations_for_free_events as $registration_for_free_event ) { |
|
14 | - if ( $registration_for_free_event instanceof EE_Registration && $registration_for_free_event->ticket()->is_free() ) { |
|
15 | - if ( $registration_for_free_event->event() instanceof EE_Event ) { |
|
13 | + foreach ($registrations_for_free_events as $registration_for_free_event) { |
|
14 | + if ($registration_for_free_event instanceof EE_Registration && $registration_for_free_event->ticket()->is_free()) { |
|
15 | + if ($registration_for_free_event->event() instanceof EE_Event) { |
|
16 | 16 | ?> |
17 | 17 | <p> |
18 | 18 | <?php echo apply_filters( |
19 | 19 | 'FHEE__registration_page_payment_options__no_payment_required_pg', |
20 | 20 | sprintf( |
21 | - __( '"%1$s" for "%2$s" is free, so no payment is required and no billing will occur.', 'event_espresso' ), |
|
21 | + __('"%1$s" for "%2$s" is free, so no payment is required and no billing will occur.', 'event_espresso'), |
|
22 | 22 | $registration_for_free_event->ticket()->name(), |
23 | 23 | $registration_for_free_event->event()->name() |
24 | 24 | ) |
@@ -43,23 +43,23 @@ discard block |
||
43 | 43 | '4.9.12', |
44 | 44 | '5.0.0' |
45 | 45 | ); |
46 | - if ( $this->registration = EE_Registry::instance()->load_model( 'Registration' )->get_registration_for_reg_url_link( $url_link)) { |
|
46 | + if ($this->registration = EE_Registry::instance()->load_model('Registration')->get_registration_for_reg_url_link($url_link)) { |
|
47 | 47 | $this->transaction = $this->registration->transaction(); |
48 | 48 | |
49 | - $payment_settings = EE_Config::instance()->gateway->payment_settings;//get_user_meta(EE_Registry::instance()->CFG->wp_user, 'payment_settings', TRUE); |
|
50 | - $this->invoice_payment_method = EEM_Payment_Method::instance()->get_one_of_type( 'Invoice' ); |
|
49 | + $payment_settings = EE_Config::instance()->gateway->payment_settings; //get_user_meta(EE_Registry::instance()->CFG->wp_user, 'payment_settings', TRUE); |
|
50 | + $this->invoice_payment_method = EEM_Payment_Method::instance()->get_one_of_type('Invoice'); |
|
51 | 51 | } else { |
52 | - EE_Error::add_error( __( 'Your request appears to be missing some required data, and no information for your transaction could be retrieved.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
52 | + EE_Error::add_error(__('Your request appears to be missing some required data, and no information for your transaction could be retrieved.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | } |
56 | 56 | |
57 | - public function send_invoice( $download = FALSE ) { |
|
57 | + public function send_invoice($download = FALSE) { |
|
58 | 58 | $template_args = array(); |
59 | 59 | $EE = EE_Registry::instance(); |
60 | 60 | |
61 | 61 | //allow the request to override the default theme defined in the invoice settings |
62 | - $theme_requested = ( isset( $_REQUEST['theme'] ) && $_REQUEST['theme'] > 0 && $_REQUEST['theme'] < 8 ) ? absint( $_REQUEST['theme'] ) : null; |
|
62 | + $theme_requested = (isset($_REQUEST['theme']) && $_REQUEST['theme'] > 0 && $_REQUEST['theme'] < 8) ? absint($_REQUEST['theme']) : null; |
|
63 | 63 | $themes = array( |
64 | 64 | 1 => "simple.css", |
65 | 65 | 2 => "bauhaus.css", |
@@ -70,26 +70,26 @@ discard block |
||
70 | 70 | 7 => "union.css" |
71 | 71 | ); |
72 | 72 | //Get the CSS file |
73 | - if( isset( $themes[ $theme_requested ] ) ) { |
|
74 | - $template_args['invoice_css'] = $themes[ $theme_requested ]; |
|
75 | - }else{ |
|
76 | - $template_args['invoice_css'] = $this->invoice_payment_method->get_extra_meta( 'legacy_invoice_css', TRUE, 'simple.css' ); |
|
73 | + if (isset($themes[$theme_requested])) { |
|
74 | + $template_args['invoice_css'] = $themes[$theme_requested]; |
|
75 | + } else { |
|
76 | + $template_args['invoice_css'] = $this->invoice_payment_method->get_extra_meta('legacy_invoice_css', TRUE, 'simple.css'); |
|
77 | 77 | } |
78 | 78 | |
79 | - if (is_dir(EVENT_ESPRESSO_GATEWAY_DIR . '/invoice')) { |
|
80 | - $template_args['base_url'] = EVENT_ESPRESSO_GATEWAY_URL . 'Invoice/lib/templates/'; |
|
79 | + if (is_dir(EVENT_ESPRESSO_GATEWAY_DIR.'/invoice')) { |
|
80 | + $template_args['base_url'] = EVENT_ESPRESSO_GATEWAY_URL.'Invoice/lib/templates/'; |
|
81 | 81 | } else { |
82 | - $template_args['base_url'] = EE_GATEWAYS . '/Invoice/lib/templates/'; |
|
82 | + $template_args['base_url'] = EE_GATEWAYS.'/Invoice/lib/templates/'; |
|
83 | 83 | } |
84 | 84 | $primary_attendee = $this->transaction->primary_registration()->attendee(); |
85 | 85 | |
86 | - $template_args['organization'] = $EE->CFG->organization->get_pretty( 'name' ); |
|
87 | - $template_args['street'] = empty( $EE->CFG->organization->address_2 ) ? $EE->CFG->organization->get_pretty( 'address_1' ) : $EE->CFG->organization->get_pretty( 'address_1' ) . '<br>' . $EE->CFG->organization->get_pretty( 'address_2' ); |
|
88 | - $template_args['city'] = $EE->CFG->organization->get_pretty( 'city' ); |
|
89 | - $template_args['state'] = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $EE->CFG->organization->STA_ID ); |
|
90 | - $template_args['country'] = EE_Registry::instance()->load_model( 'Country' )->get_one_by_ID( $EE->CFG->organization->CNT_ISO ); |
|
91 | - $template_args['zip'] = $EE->CFG->organization->get_pretty( 'zip' ); |
|
92 | - $template_args['email'] = $EE->CFG->organization->get_pretty( 'email' ); |
|
86 | + $template_args['organization'] = $EE->CFG->organization->get_pretty('name'); |
|
87 | + $template_args['street'] = empty($EE->CFG->organization->address_2) ? $EE->CFG->organization->get_pretty('address_1') : $EE->CFG->organization->get_pretty('address_1').'<br>'.$EE->CFG->organization->get_pretty('address_2'); |
|
88 | + $template_args['city'] = $EE->CFG->organization->get_pretty('city'); |
|
89 | + $template_args['state'] = EE_Registry::instance()->load_model('State')->get_one_by_ID($EE->CFG->organization->STA_ID); |
|
90 | + $template_args['country'] = EE_Registry::instance()->load_model('Country')->get_one_by_ID($EE->CFG->organization->CNT_ISO); |
|
91 | + $template_args['zip'] = $EE->CFG->organization->get_pretty('zip'); |
|
92 | + $template_args['email'] = $EE->CFG->organization->get_pretty('email'); |
|
93 | 93 | |
94 | 94 | $template_args['registration_code'] = $this->registration->reg_code(); |
95 | 95 | $template_args['registration_date'] = $this->registration->date(); |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | $template_args['attendee_address2'] = $primary_attendee->address2(); |
99 | 99 | $template_args['attendee_city'] = $primary_attendee->city(); |
100 | 100 | $attendee_state = $primary_attendee->state_obj(); |
101 | - if($attendee_state){ |
|
101 | + if ($attendee_state) { |
|
102 | 102 | $attendee_state_name = $attendee_state->name(); |
103 | - }else{ |
|
103 | + } else { |
|
104 | 104 | $attendee_state_name = ''; |
105 | 105 | } |
106 | 106 | $template_args['attendee_state'] = $attendee_state_name; |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | if ($template_args['amount_pd'] != $template_args['total_cost']) { |
125 | 125 | //$template_args['net_total'] = $this->espressoInvoiceTotals( __('SubTotal', 'event_espresso'), $this->transaction->total());//$this->session_data['cart']['REG']['sub_total']); |
126 | 126 | $tax_items = $this->transaction->tax_items(); |
127 | - if(!empty($tax_items) ){ |
|
127 | + if ( ! empty($tax_items)) { |
|
128 | 128 | foreach ($tax_items as $tax) { |
129 | - $template_args['net_total'] .= $this->espressoInvoiceTotals( $tax->name(), $tax->total()); |
|
129 | + $template_args['net_total'] .= $this->espressoInvoiceTotals($tax->name(), $tax->total()); |
|
130 | 130 | } |
131 | 131 | } |
132 | 132 | |
@@ -136,30 +136,30 @@ discard block |
||
136 | 136 | } else { |
137 | 137 | $text = __('Extra', 'event_espresso'); |
138 | 138 | } |
139 | - $template_args['discount'] = $this->espressoInvoiceTotals( $text, $difference ); |
|
139 | + $template_args['discount'] = $this->espressoInvoiceTotals($text, $difference); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | $template_args['currency_symbol'] = $EE->CFG->currency->sign; |
143 | - $template_args['template_payment_instructions'] = wpautop(stripslashes_deep(html_entity_decode($this->invoice_payment_method->get_extra_meta( 'pdf_instructions', TRUE ), ENT_QUOTES))); |
|
144 | - $template_args['shameless_plug'] = apply_filters( 'FHEE_Invoice__send_invoice__shameless_plug',true ); |
|
145 | - if(isset($_GET['receipt'])){ |
|
143 | + $template_args['template_payment_instructions'] = wpautop(stripslashes_deep(html_entity_decode($this->invoice_payment_method->get_extra_meta('pdf_instructions', TRUE), ENT_QUOTES))); |
|
144 | + $template_args['shameless_plug'] = apply_filters('FHEE_Invoice__send_invoice__shameless_plug', true); |
|
145 | + if (isset($_GET['receipt'])) { |
|
146 | 146 | //receipt-specific stuff |
147 | 147 | $events_for_txn = EEM_Event::instance()->get_all(array(array('Registration.TXN_ID'=>$this->transaction->ID()))); |
148 | 148 | $ticket_line_items_per_event = array(); |
149 | 149 | $registrations_per_line_item = array(); |
150 | 150 | $venues_for_events = array(); |
151 | - foreach($events_for_txn as $event_id => $event){ |
|
152 | - $line_items_for_this_event = EEM_Line_Item::instance()->get_all(array(array('Ticket.Datetime.EVT_ID'=>$event_id,'TXN_ID'=>$this->transaction->ID()))); |
|
151 | + foreach ($events_for_txn as $event_id => $event) { |
|
152 | + $line_items_for_this_event = EEM_Line_Item::instance()->get_all(array(array('Ticket.Datetime.EVT_ID'=>$event_id, 'TXN_ID'=>$this->transaction->ID()))); |
|
153 | 153 | $ticket_line_items_per_event[$event_id] = $line_items_for_this_event; |
154 | - foreach($line_items_for_this_event as $line_item_id => $line_item){ |
|
154 | + foreach ($line_items_for_this_event as $line_item_id => $line_item) { |
|
155 | 155 | $ticket = $line_item->ticket(); |
156 | - $registrations_for_this_ticket = EEM_Registration::instance()->get_all(array(array('TKT_ID'=>$ticket->ID(),'TXN_ID'=>$this->transaction->ID()))); |
|
156 | + $registrations_for_this_ticket = EEM_Registration::instance()->get_all(array(array('TKT_ID'=>$ticket->ID(), 'TXN_ID'=>$this->transaction->ID()))); |
|
157 | 157 | $registrations_per_line_item[$line_item_id] = $registrations_for_this_ticket; |
158 | 158 | } |
159 | 159 | $venues_for_events = array_merge($venues_for_events, $event->venues()); |
160 | 160 | } |
161 | - $tax_total_line_item = EEM_Line_Item::instance()->get_one(array(array('TXN_ID'=>$this->transaction->ID(),'LIN_type'=> EEM_Line_Item::type_tax_sub_total))); |
|
162 | - $questions_to_skip = array(EEM_Attendee::system_question_fname,EEM_Attendee::system_question_lname, EEM_Attendee::system_question_email); |
|
161 | + $tax_total_line_item = EEM_Line_Item::instance()->get_one(array(array('TXN_ID'=>$this->transaction->ID(), 'LIN_type'=> EEM_Line_Item::type_tax_sub_total))); |
|
162 | + $questions_to_skip = array(EEM_Attendee::system_question_fname, EEM_Attendee::system_question_lname, EEM_Attendee::system_question_email); |
|
163 | 163 | |
164 | 164 | |
165 | 165 | $template_args['events_for_txn'] = $events_for_txn; |
@@ -170,53 +170,53 @@ discard block |
||
170 | 170 | $template_args['questions_to_skip'] = $questions_to_skip; |
171 | 171 | // d($template_args); |
172 | 172 | $template_args['download_link'] = $this->registration->receipt_url('download'); |
173 | - }else{ |
|
173 | + } else { |
|
174 | 174 | //it's just an invoice we're accessing |
175 | 175 | $template_args['download_link'] = $this->registration->invoice_url('download'); |
176 | 176 | } |
177 | 177 | |
178 | 178 | //Get the HTML as an object |
179 | 179 | $templates_relative_path = 'modules/gateways/Invoice/lib/templates/'; |
180 | - $template_header = EEH_Template::locate_template( $templates_relative_path . 'invoice_header.template.php', $template_args, TRUE, TRUE ); |
|
181 | - if(isset($_GET['receipt'])){ |
|
182 | - $template_body = EEH_Template::locate_template( $templates_relative_path . 'receipt_body.template.php', $template_args, TRUE, TRUE ); |
|
183 | - }else{ |
|
184 | - $template_body = EEH_Template::locate_template( $templates_relative_path . 'invoice_body.template.php', $template_args, TRUE, TRUE ); |
|
180 | + $template_header = EEH_Template::locate_template($templates_relative_path.'invoice_header.template.php', $template_args, TRUE, TRUE); |
|
181 | + if (isset($_GET['receipt'])) { |
|
182 | + $template_body = EEH_Template::locate_template($templates_relative_path.'receipt_body.template.php', $template_args, TRUE, TRUE); |
|
183 | + } else { |
|
184 | + $template_body = EEH_Template::locate_template($templates_relative_path.'invoice_body.template.php', $template_args, TRUE, TRUE); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | |
188 | - $template_footer = EEH_Template::locate_template( $templates_relative_path . 'invoice_footer.template.php', $template_args, TRUE, TRUE ); |
|
188 | + $template_footer = EEH_Template::locate_template($templates_relative_path.'invoice_footer.template.php', $template_args, TRUE, TRUE); |
|
189 | 189 | |
190 | - $copies = ! empty( $_REQUEST['copies'] ) ? $_REQUEST['copies'] : 1; |
|
190 | + $copies = ! empty($_REQUEST['copies']) ? $_REQUEST['copies'] : 1; |
|
191 | 191 | |
192 | 192 | $content = $this->espresso_replace_invoice_shortcodes($template_header); |
193 | - for( $x = 1; $x <= $copies; $x++ ) { |
|
193 | + for ($x = 1; $x <= $copies; $x++) { |
|
194 | 194 | $content .= $this->espresso_replace_invoice_shortcodes($template_body); |
195 | 195 | } |
196 | 196 | $content .= $this->espresso_replace_invoice_shortcodes($template_footer); |
197 | 197 | |
198 | 198 | //Check if debugging or mobile is set |
199 | - if (!empty($_REQUEST['html'])) { |
|
199 | + if ( ! empty($_REQUEST['html'])) { |
|
200 | 200 | echo $content; |
201 | 201 | exit(0); |
202 | 202 | } |
203 | - $invoice_name = $template_args['organization'] . ' ' . __('Invoice #', 'event_espresso') . $template_args['registration_code'] . __(' for ', 'event_espresso') . $template_args['name']; |
|
204 | - $invoice_name = str_replace( ' ', '_', $invoice_name ); |
|
203 | + $invoice_name = $template_args['organization'].' '.__('Invoice #', 'event_espresso').$template_args['registration_code'].__(' for ', 'event_espresso').$template_args['name']; |
|
204 | + $invoice_name = str_replace(' ', '_', $invoice_name); |
|
205 | 205 | //Create the PDF |
206 | - if(array_key_exists('html',$_GET)){ |
|
206 | + if (array_key_exists('html', $_GET)) { |
|
207 | 207 | echo $content; |
208 | - }else{ |
|
208 | + } else { |
|
209 | 209 | //only load dompdf if nobody else has yet... |
210 | - if( ! defined('DOMPDF_DIR')){ |
|
210 | + if ( ! defined('DOMPDF_DIR')) { |
|
211 | 211 | define('DOMPDF_ENABLE_REMOTE', TRUE); |
212 | 212 | define('DOMPDF_ENABLE_JAVASCRIPT', FALSE); |
213 | 213 | define('DOMPDF_ENABLE_CSS_FLOAT', TRUE); |
214 | - require_once(EE_THIRD_PARTY . 'dompdf/dompdf_config.inc.php'); |
|
214 | + require_once(EE_THIRD_PARTY.'dompdf/dompdf_config.inc.php'); |
|
215 | 215 | } |
216 | 216 | $dompdf = new DOMPDF(); |
217 | 217 | $dompdf->load_html($content); |
218 | 218 | $dompdf->render(); |
219 | - $dompdf->stream($invoice_name . ".pdf", array( 'Attachment' => $download )); |
|
219 | + $dompdf->stream($invoice_name.".pdf", array('Attachment' => $download)); |
|
220 | 220 | } |
221 | 221 | exit(0); |
222 | 222 | } |
@@ -226,12 +226,12 @@ discard block |
||
226 | 226 | * @param EE_Line_Item $line_item |
227 | 227 | * @return boolean |
228 | 228 | */ |
229 | - function check_if_any_line_items_have_a_description(EE_Line_Item $line_item){ |
|
230 | - if($line_item->desc()){ |
|
229 | + function check_if_any_line_items_have_a_description(EE_Line_Item $line_item) { |
|
230 | + if ($line_item->desc()) { |
|
231 | 231 | return true; |
232 | - }else{ |
|
233 | - foreach($line_item->children() as $child_line_item){ |
|
234 | - if($this->check_if_any_line_items_have_a_description($child_line_item)){ |
|
232 | + } else { |
|
233 | + foreach ($line_item->children() as $child_line_item) { |
|
234 | + if ($this->check_if_any_line_items_have_a_description($child_line_item)) { |
|
235 | 235 | return true; |
236 | 236 | } |
237 | 237 | } |
@@ -241,14 +241,14 @@ discard block |
||
241 | 241 | } |
242 | 242 | |
243 | 243 | //Perform the shortcode replacement |
244 | - function espresso_replace_invoice_shortcodes( $content ) { |
|
244 | + function espresso_replace_invoice_shortcodes($content) { |
|
245 | 245 | |
246 | 246 | $EE = EE_Registry::instance(); |
247 | 247 | //Create the logo |
248 | - $invoice_logo_url = $this->invoice_payment_method->get_extra_meta('pdf_logo_image', TRUE, $EE->CFG->organization->logo_url ); |
|
249 | - if (!empty($invoice_logo_url)) { |
|
248 | + $invoice_logo_url = $this->invoice_payment_method->get_extra_meta('pdf_logo_image', TRUE, $EE->CFG->organization->logo_url); |
|
249 | + if ( ! empty($invoice_logo_url)) { |
|
250 | 250 | $image_size = getimagesize($invoice_logo_url); |
251 | - $invoice_logo_image = '<img class="logo screen" src="' . $invoice_logo_url . '" ' . $image_size[3] . ' alt="logo" /> '; |
|
251 | + $invoice_logo_image = '<img class="logo screen" src="'.$invoice_logo_url.'" '.$image_size[3].' alt="logo" /> '; |
|
252 | 252 | } else { |
253 | 253 | $invoice_logo_image = ''; |
254 | 254 | } |
@@ -270,28 +270,28 @@ discard block |
||
270 | 270 | "[instructions]", |
271 | 271 | ); |
272 | 272 | $primary_attendee = $this->transaction->primary_registration()->attendee(); |
273 | - $org_state = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $EE->CFG->organization->STA_ID ); |
|
274 | - if($org_state){ |
|
273 | + $org_state = EE_Registry::instance()->load_model('State')->get_one_by_ID($EE->CFG->organization->STA_ID); |
|
274 | + if ($org_state) { |
|
275 | 275 | $org_state_name = $org_state->name(); |
276 | - }else{ |
|
276 | + } else { |
|
277 | 277 | $org_state_name = ''; |
278 | 278 | } |
279 | 279 | $ReplaceValues = array( |
280 | - $EE->CFG->organization->get_pretty( 'name' ), |
|
280 | + $EE->CFG->organization->get_pretty('name'), |
|
281 | 281 | $this->registration->reg_code(), |
282 | 282 | $this->transaction->ID(), |
283 | 283 | $primary_attendee->full_name(), |
284 | - (is_dir(EVENT_ESPRESSO_GATEWAY_DIR . '/invoice')) ? EVENT_ESPRESSO_GATEWAY_URL . 'Invoice/lib/templates/' : EE_GATEWAYS_URL . 'Invoice/lib/templates/', |
|
285 | - $this->registration->invoice_url(),//home_url() . '/?download_invoice=true&id=' . $this->registration->reg_url_link(), |
|
284 | + (is_dir(EVENT_ESPRESSO_GATEWAY_DIR.'/invoice')) ? EVENT_ESPRESSO_GATEWAY_URL.'Invoice/lib/templates/' : EE_GATEWAYS_URL.'Invoice/lib/templates/', |
|
285 | + $this->registration->invoice_url(), //home_url() . '/?download_invoice=true&id=' . $this->registration->reg_url_link(), |
|
286 | 286 | $invoice_logo_image, |
287 | - empty( $EE->CFG->organization->address_2 ) ? $EE->CFG->organization->get_pretty( 'address_1' ) : $EE->CFG->organization->get_pretty( 'address_1' ) . '<br>' . $EE->CFG->organization->get_pretty( 'address_2' ), |
|
288 | - $EE->CFG->organization->get_pretty( 'city' ), |
|
287 | + empty($EE->CFG->organization->address_2) ? $EE->CFG->organization->get_pretty('address_1') : $EE->CFG->organization->get_pretty('address_1').'<br>'.$EE->CFG->organization->get_pretty('address_2'), |
|
288 | + $EE->CFG->organization->get_pretty('city'), |
|
289 | 289 | $org_state_name, |
290 | - $EE->CFG->organization->get_pretty( 'zip' ), |
|
291 | - $EE->CFG->organization->get_pretty( 'email' ), |
|
290 | + $EE->CFG->organization->get_pretty('zip'), |
|
291 | + $EE->CFG->organization->get_pretty('email'), |
|
292 | 292 | $EE->CFG->organization->vat, |
293 | - $this->registration->get_i18n_datetime( 'REG_date', get_option( 'date_format' ) ), |
|
294 | - $this->invoice_payment_method->get_extra_meta( 'pdf_instructions', TRUE ), |
|
293 | + $this->registration->get_i18n_datetime('REG_date', get_option('date_format')), |
|
294 | + $this->invoice_payment_method->get_extra_meta('pdf_instructions', TRUE), |
|
295 | 295 | ); |
296 | 296 | |
297 | 297 | return str_replace($SearchValues, $ReplaceValues, $content); |
@@ -314,12 +314,12 @@ discard block |
||
314 | 314 | if ($total_cost < 0) { |
315 | 315 | $total_cost = (-1) * $total_cost; |
316 | 316 | } |
317 | - $find = array( ' ' ); |
|
318 | - $replace = array( '-' ); |
|
319 | - $row_id = strtolower( str_replace( $find, $replace, $text )); |
|
317 | + $find = array(' '); |
|
318 | + $replace = array('-'); |
|
319 | + $row_id = strtolower(str_replace($find, $replace, $text)); |
|
320 | 320 | $html .= '<tr id="'.$row_id.'-tr"><td colspan="4"> </td>'; |
321 | - $html .= '<td class="item_r">' . $text . '</td>'; |
|
322 | - $html .= '<td class="item_r">' . $total_cost . '</td>'; |
|
321 | + $html .= '<td class="item_r">'.$text.'</td>'; |
|
322 | + $html .= '<td class="item_r">'.$total_cost.'</td>'; |
|
323 | 323 | $html .= '</tr>'; |
324 | 324 | return $html; |
325 | 325 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | //Get the CSS file |
73 | 73 | if( isset( $themes[ $theme_requested ] ) ) { |
74 | 74 | $template_args['invoice_css'] = $themes[ $theme_requested ]; |
75 | - }else{ |
|
75 | + } else{ |
|
76 | 76 | $template_args['invoice_css'] = $this->invoice_payment_method->get_extra_meta( 'legacy_invoice_css', TRUE, 'simple.css' ); |
77 | 77 | } |
78 | 78 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $attendee_state = $primary_attendee->state_obj(); |
101 | 101 | if($attendee_state){ |
102 | 102 | $attendee_state_name = $attendee_state->name(); |
103 | - }else{ |
|
103 | + } else{ |
|
104 | 104 | $attendee_state_name = ''; |
105 | 105 | } |
106 | 106 | $template_args['attendee_state'] = $attendee_state_name; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $template_args['questions_to_skip'] = $questions_to_skip; |
171 | 171 | // d($template_args); |
172 | 172 | $template_args['download_link'] = $this->registration->receipt_url('download'); |
173 | - }else{ |
|
173 | + } else{ |
|
174 | 174 | //it's just an invoice we're accessing |
175 | 175 | $template_args['download_link'] = $this->registration->invoice_url('download'); |
176 | 176 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $template_header = EEH_Template::locate_template( $templates_relative_path . 'invoice_header.template.php', $template_args, TRUE, TRUE ); |
181 | 181 | if(isset($_GET['receipt'])){ |
182 | 182 | $template_body = EEH_Template::locate_template( $templates_relative_path . 'receipt_body.template.php', $template_args, TRUE, TRUE ); |
183 | - }else{ |
|
183 | + } else{ |
|
184 | 184 | $template_body = EEH_Template::locate_template( $templates_relative_path . 'invoice_body.template.php', $template_args, TRUE, TRUE ); |
185 | 185 | } |
186 | 186 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | //Create the PDF |
206 | 206 | if(array_key_exists('html',$_GET)){ |
207 | 207 | echo $content; |
208 | - }else{ |
|
208 | + } else{ |
|
209 | 209 | //only load dompdf if nobody else has yet... |
210 | 210 | if( ! defined('DOMPDF_DIR')){ |
211 | 211 | define('DOMPDF_ENABLE_REMOTE', TRUE); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | function check_if_any_line_items_have_a_description(EE_Line_Item $line_item){ |
230 | 230 | if($line_item->desc()){ |
231 | 231 | return true; |
232 | - }else{ |
|
232 | + } else{ |
|
233 | 233 | foreach($line_item->children() as $child_line_item){ |
234 | 234 | if($this->check_if_any_line_items_have_a_description($child_line_item)){ |
235 | 235 | return true; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $org_state = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $EE->CFG->organization->STA_ID ); |
274 | 274 | if($org_state){ |
275 | 275 | $org_state_name = $org_state->name(); |
276 | - }else{ |
|
276 | + } else{ |
|
277 | 277 | $org_state_name = ''; |
278 | 278 | } |
279 | 279 | $ReplaceValues = array( |
@@ -300,8 +300,9 @@ discard block |
||
300 | 300 | public function espressoLoadData($items) { |
301 | 301 | $lines = $items; |
302 | 302 | $data = array(); |
303 | - foreach ($lines as $line) |
|
304 | - $data[] = explode(';', chop($line)); |
|
303 | + foreach ($lines as $line) { |
|
304 | + $data[] = explode(';', chop($line)); |
|
305 | + } |
|
305 | 306 | |
306 | 307 | return $data; |
307 | 308 | } |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | </label> |
19 | 19 | </th> |
20 | 20 | <td> |
21 | - <?php echo EEH_Form_Fields::select_input('use_full_logging', $values, $use_full_logging ); ?> |
|
21 | + <?php echo EEH_Form_Fields::select_input('use_full_logging', $values, $use_full_logging); ?> |
|
22 | 22 | <p class="description"> |
23 | 23 | <span class="reminder-spn"> |
24 | 24 | <?php _e('Please use caution when using this feature. These files may be publicly available.', 'event_espresso'); ?> |
25 | 25 | </span><br/> |
26 | - <?php echo sprintf( __('Once saved, this file will be available at: %s', 'event_espresso'), '<br /><b>/wp-content/uploads/espresso/logs/' . EE_Registry::instance()->CFG->admin->log_file_name() . '</b>' ); ?> |
|
26 | + <?php echo sprintf(__('Once saved, this file will be available at: %s', 'event_espresso'), '<br /><b>/wp-content/uploads/espresso/logs/'.EE_Registry::instance()->CFG->admin->log_file_name().'</b>'); ?> |
|
27 | 27 | </p> |
28 | 28 | |
29 | 29 | </td> |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | </label> |
38 | 38 | </th> |
39 | 39 | <td> |
40 | - <?php echo EEH_Form_Fields::select_input('use_remote_logging', $values, $use_remote_logging ); ?> |
|
40 | + <?php echo EEH_Form_Fields::select_input('use_remote_logging', $values, $use_remote_logging); ?> |
|
41 | 41 | <p class="description"> |
42 | 42 | <?php _e('Send debugging data to the remote URL below.', 'event_espresso'); ?> |
43 | 43 | </p> |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | </label> |
53 | 53 | </th> |
54 | 54 | <td> |
55 | - <input name="remote_logging_url" id="remote_logging_url" size="20" class="regular-text" type="text" value="<?php echo $remote_logging_url;?>" /> |
|
55 | + <input name="remote_logging_url" id="remote_logging_url" size="20" class="regular-text" type="text" value="<?php echo $remote_logging_url; ?>" /> |
|
56 | 56 | <p class="description"> |
57 | 57 | <?php _e('Example: http://requestb.in/MY_UNIQUE_ID', 'event_espresso'); ?> |
58 | 58 |
@@ -1,5 +1,5 @@ |
||
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 | /** |
@@ -1,6 +1,7 @@ |
||
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 |
@@ -1,5 +1,5 @@ |
||
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 | /** |
@@ -1,6 +1,7 @@ |
||
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 |
@@ -1,5 +1,5 @@ |
||
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 | /** |
@@ -1,6 +1,7 @@ |
||
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 |