|
1
|
|
|
<?php |
|
2
|
|
|
namespace EventEspresso\modules\ticket_selector; |
|
3
|
|
|
|
|
4
|
|
|
use EventEspresso\core\libraries\iframe_display\Iframe; |
|
5
|
|
|
|
|
6
|
|
|
if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
7
|
|
|
exit( 'No direct script access allowed' ); |
|
8
|
|
|
} |
|
9
|
|
|
|
|
10
|
|
|
|
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* Class TicketSelectorIframe |
|
14
|
|
|
* Description |
|
15
|
|
|
* |
|
16
|
|
|
* @package Event Espresso |
|
17
|
|
|
* @subpackage core |
|
18
|
|
|
* @author Brent Christensen |
|
19
|
|
|
* @since $VID:$ |
|
20
|
|
|
*/ |
|
21
|
|
|
class TicketSelectorIframe extends Iframe |
|
22
|
|
|
{ |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* TicketSelectorIframe constructor. |
|
26
|
|
|
* |
|
27
|
|
|
* @throws \DomainException |
|
28
|
|
|
* @throws \EE_Error |
|
29
|
|
|
*/ |
|
30
|
|
|
public function __construct() |
|
31
|
|
|
{ |
|
32
|
|
|
\EE_Registry::instance()->REQ->set_espresso_page( true ); |
|
33
|
|
|
/** @type \EEM_Event $EEM_Event */ |
|
34
|
|
|
$EEM_Event = \EE_Registry::instance()->load_model( 'Event' ); |
|
35
|
|
|
$event = $EEM_Event->get_one_by_ID( |
|
36
|
|
|
\EE_Registry::instance()->REQ->get( 'event', 0 ) |
|
37
|
|
|
); |
|
38
|
|
|
$ticket_selector = new DisplayTicketSelector(); |
|
39
|
|
|
$ticket_selector->setIframe( true ); |
|
40
|
|
|
parent::__construct( |
|
41
|
|
|
esc_html__( 'Ticket Selector', 'event_espresso' ), |
|
42
|
|
|
$ticket_selector->display( $event ) |
|
|
|
|
|
|
43
|
|
|
); |
|
44
|
|
|
$this->addStylesheets( |
|
45
|
|
|
apply_filters( |
|
46
|
|
|
'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css', |
|
47
|
|
|
array( |
|
48
|
|
|
'ticket_selector_embed' => TICKET_SELECTOR_ASSETS_URL |
|
49
|
|
|
. 'ticket_selector_embed.css?ver=' |
|
50
|
|
|
. EVENT_ESPRESSO_VERSION, |
|
51
|
|
|
'ticket_selector' => TICKET_SELECTOR_ASSETS_URL |
|
52
|
|
|
. 'ticket_selector.css?ver=' |
|
53
|
|
|
. EVENT_ESPRESSO_VERSION, |
|
54
|
|
|
), |
|
55
|
|
|
$this |
|
56
|
|
|
) |
|
57
|
|
|
); |
|
58
|
|
|
if ( ! apply_filters('FHEE__EED_Ticket_Selector__ticket_selector_iframe__load_theme_css', false, $this)) { |
|
59
|
|
|
$this->addStylesheets( array('site_theme' => '' ) ); |
|
60
|
|
|
} |
|
61
|
|
|
$this->addScripts( |
|
62
|
|
|
apply_filters( |
|
63
|
|
|
'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js', |
|
64
|
|
|
array( |
|
65
|
|
|
'ticket_selector_iframe_embed' => TICKET_SELECTOR_ASSETS_URL |
|
66
|
|
|
. 'ticket_selector_iframe_embed.js?ver=' |
|
67
|
|
|
. EVENT_ESPRESSO_VERSION, |
|
68
|
|
|
), |
|
69
|
|
|
$this |
|
70
|
|
|
) |
|
71
|
|
|
); |
|
72
|
|
|
$this->addLocalizedVars( |
|
73
|
|
|
array( |
|
74
|
|
|
'ticket_selector_iframe' => true, |
|
75
|
|
|
'EEDTicketSelectorMsg' => __( |
|
76
|
|
|
'Please choose at least one ticket before continuing.', |
|
77
|
|
|
'event_espresso' |
|
78
|
|
|
), |
|
79
|
|
|
) |
|
80
|
|
|
); |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
} |
|
84
|
|
|
// End of file TicketSelectorIframe.php |
|
85
|
|
|
// Location: /TicketSelectorIframe.php |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.