Completed
Branch BUG-10412-mcrypt-deprecated (d1c48b)
by
unknown
125:36 queued 113:25
created

eventEditorDatetimeFieldSelectorForField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Page;
4
5
6
/**
7
 * EventsAdmin
8
 * Selectors/references for elements in the Events Admin pages
9
 *
10
 * @package Page
11
 * @author  Darren Ethier
12
 * @since   1.0.0
13
 */
14
class EventsAdmin extends CoreAdmin
15
{
16
17
    /**
18
     * Selector for the Add new Event button in the admin.
19
     * @var string
20
     */
21
    const ADD_NEW_EVENT_BUTTON_SELECTOR = '#add-new-event';
22
23
24
    /**
25
     * Selector for the Event Title field in the event editor
26
     * @var string
27
     */
28
    const EVENT_EDITOR_TITLE_FIELD_SELECTOR = "//input[@id='title']";
29
30
    /**
31
     * Selector for the publish submit button in the event editor.
32
     * @var string
33
     */
34
    const EVENT_EDITOR_PUBLISH_BUTTON_SELECTOR = "#publish";
35
36
    /**
37
     * Selector for the view link after publishing an event.
38
     * @var string
39
     */
40
    const EVENT_EDITOR_VIEW_LINK_AFTER_PUBLISH_SELECTOR = "//div[@id='message']/p/a";
41
42
43
    /**
44
     * Selector for the ID of the event in the event editor
45
     * @var string
46
     */
47
    const EVENT_EDITOR_EVT_ID_SELECTOR = "//input[@id='post_ID']";
48
49
50
    /**
51
     * @param string $additional_params
52
     * @return string
53
     */
54
    public static function defaultEventsListTableUrl($additional_params = '')
55
    {
56
        return self::adminUrl('espresso_events', 'default', $additional_params);
57
    }
58
59
60
    /**
61
     * The selector for the DTTname field for the given row in the event editor.
62
     * @param int $row_number
63
     * @return string
64
     */
65
    public static function eventEditorDatetimeNameFieldSelector($row_number = 1)
66
    {
67
        return self::eventEditorDatetimeFieldSelectorForField('DTT_name', $row_number);
68
    }
69
70
71
    /**
72
     * The selector for the DTT_EVT_start field for the given row in the event editor.d
73
     * @param int $row_number
74
     * @return string
75
     */
76
    public static function eventEditorDatetimeStartDateFieldSelector($row_number = 1)
77
    {
78
        return self::eventEditorDatetimeFieldSelectorForField('DTT_EVT_start', $row_number);
79
    }
80
81
82
    /**
83
     * Wrapper for getting the selector for a given field and given row of a datetime in the event editor.
84
     *
85
     * @param string $field_name
86
     * @param int    $row_number
87
     * @return string
88
     */
89
    public static function eventEditorDatetimeFieldSelectorForField($field_name, $row_number = 1)
90
    {
91
        return "//input[@id='event-datetime-$field_name-$row_number']";
92
    }
93
94
95
    /**
96
     * The selector for the TKT_name field for the given display row in the event editor.
97
     * @param int $row_number
98
     * @return string
99
     */
100
    public static function eventEditorTicketNameFieldSelector($row_number = 1)
101
    {
102
        return self::eventEditorTicketFieldSelectorForFieldInDisplayRow('TKT_name', $row_number);
103
    }
104
105
106
    /**
107
     * Wrapper for getting the selector for a given field and given display row of a ticket in the event editor.
108
     * @param     $field_name
109
     * @param int $row_number
110
     * @return string
111
     */
112
    public static function eventEditorTicketFieldSelectorForFieldInDisplayRow($field_name, $row_number = 1)
113
    {
114
        return "//tr[@id='display-ticketrow-$row_number']/td[2]/input[@class='edit-ticket-$field_name ee-large-text-inp']";
115
    }
116
}