|
1
|
|
|
<?php |
|
2
|
|
|
namespace EventEspresso\modules\ticket_selector; |
|
3
|
|
|
|
|
4
|
|
|
defined('ABSPATH') || exit; |
|
5
|
|
|
|
|
6
|
|
|
|
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Class TicketSelectorSimple |
|
10
|
|
|
* there's one ticket, and max attendees is set to one, |
|
11
|
|
|
* so if the event is free, then this is a "simple" ticket selector |
|
12
|
|
|
* a.k.a. "Dude Where's my Ticket Selector?" |
|
13
|
|
|
* |
|
14
|
|
|
* @package Event Espresso |
|
15
|
|
|
* @author Brent Christensen |
|
16
|
|
|
* @since 4.9.18 |
|
17
|
|
|
*/ |
|
18
|
|
|
class TicketSelectorSimple extends TicketSelector |
|
19
|
|
|
{ |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* @var \EE_Ticket $ticket |
|
23
|
|
|
*/ |
|
24
|
|
|
protected $ticket; |
|
25
|
|
|
|
|
26
|
|
|
|
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* TicketSelectorSimple constructor. |
|
30
|
|
|
* |
|
31
|
|
|
* @param \EE_Event $event |
|
32
|
|
|
* @param \EE_Ticket $ticket |
|
33
|
|
|
* @param int $max_attendees |
|
34
|
|
|
* @param array $template_args |
|
35
|
|
|
*/ |
|
36
|
|
|
public function __construct(\EE_Event $event, \EE_Ticket $ticket, $max_attendees, array $template_args) |
|
37
|
|
|
{ |
|
38
|
|
|
$this->ticket = $ticket; |
|
39
|
|
|
parent::__construct($event, array($this->ticket), $max_attendees, $template_args); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
|
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* sets any and all template args that are required for this Ticket Selector |
|
46
|
|
|
* |
|
47
|
|
|
* @return void |
|
48
|
|
|
*/ |
|
49
|
|
|
protected function addTemplateArgs() |
|
50
|
|
|
{ |
|
51
|
|
|
unset($this->template_args['tickets']); |
|
52
|
|
|
$this->template_args['ticket'] = $this->ticket; |
|
53
|
|
|
$ticket_selector_row = new TicketSelectorRowSimple( |
|
54
|
|
|
$this->ticket, |
|
55
|
|
|
$this->max_attendees, |
|
56
|
|
|
$this->template_args['date_format'] |
|
57
|
|
|
); |
|
58
|
|
|
$this->template_args['ticket_status_display'] = $ticket_selector_row->getTicketStatusDisplay(); |
|
59
|
|
|
$this->template_args['template_path'] = TICKET_SELECTOR_TEMPLATES_PATH . 'simple_ticket_selector.template.php'; |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
|
|
63
|
|
|
} |
|
64
|
|
|
// End of file TicketSelectorSimple.php |
|
65
|
|
|
// Location: EventEspresso\modules\ticket_selector/TicketSelectorSimple.php |