@@ -15,137 +15,137 @@ |
||
15 | 15 | class Message_Templates_Edit_Help_Tour extends EE_Help_Tour |
16 | 16 | { |
17 | 17 | |
18 | - protected function _set_tour_properties() |
|
19 | - { |
|
20 | - $this->_label = __('Message Template Editor Tour', 'event_espresso'); |
|
21 | - $this->_slug = 'messages-templates-edit-joyride'; |
|
22 | - } |
|
23 | - |
|
24 | - |
|
25 | - protected function _set_tour_stops() |
|
26 | - { |
|
27 | - $this->_stops = array( |
|
28 | - 10 => array( |
|
29 | - 'content' => $this->_start(), |
|
30 | - ), |
|
31 | - 20 => array( |
|
32 | - 'id' => 'submit-msg-context-switcher-sbmt', |
|
33 | - 'content' => $this->_context_switcher_stop(), |
|
34 | - 'options' => array( |
|
35 | - 'tipLocation' => 'bottom', |
|
36 | - 'tipAdjustmentY' => -30, |
|
37 | - 'tipAdjustmentX' => -60, |
|
38 | - ), |
|
39 | - ), |
|
40 | - 30 => array( |
|
41 | - 'class' => 'messages-preview-button"', |
|
42 | - 'content' => $this->_preview_button_stop(), |
|
43 | - 'options' => array( |
|
44 | - 'tipLocation' => 'bottom', |
|
45 | - 'tipAdjustmentY' => -30, |
|
46 | - ), |
|
47 | - ), |
|
48 | - 40 => array( |
|
49 | - 'content' => $this->_template_area_stop(), |
|
50 | - 'options' => array( |
|
51 | - 'tipAdjustmentY' => -100, |
|
52 | - 'tipAdjustmentX' => -60, |
|
53 | - ), |
|
54 | - ), |
|
55 | - 50 => array( |
|
56 | - 'id' => 'mtp_valid_shortcodes', |
|
57 | - 'content' => $this->_mtp_valid_shortcodes_stop(), |
|
58 | - 'options' => array( |
|
59 | - 'tipLocation' => 'left', |
|
60 | - 'tipAdjustmentY' => -50, |
|
61 | - 'tipAdjustmentX' => -15, |
|
62 | - ), |
|
63 | - ), |
|
64 | - 60 => array( |
|
65 | - 'id' => 'mtp_extra_actions', |
|
66 | - 'content' => $this->_mtp_extra_actions_stop(), |
|
67 | - 'options' => array( |
|
68 | - 'tipLocation' => 'left', |
|
69 | - 'tipAdjustmentY' => -50, |
|
70 | - 'tipAdjustmentX' => -15, |
|
71 | - ), |
|
72 | - ), |
|
73 | - 70 => array( |
|
74 | - 'id' => 'espresso_espresso_messages_editor_overview', |
|
75 | - 'content' => $this->_update_metabox_stop(), |
|
76 | - 'options' => array( |
|
77 | - 'tipLocation' => 'left', |
|
78 | - 'tipAdjustmentY' => -50, |
|
79 | - 'tipAdjustmentX' => -15, |
|
80 | - ), |
|
81 | - ), |
|
82 | - ); |
|
83 | - } |
|
84 | - |
|
85 | - |
|
86 | - protected function _start() |
|
87 | - { |
|
88 | - $content = '<h3>' . __('Message Template Editor', 'event_espresso') . '</h3>'; |
|
89 | - $content .= '<p>' |
|
90 | - . __( |
|
91 | - 'This tour of the Message Template Editor page will go over different areas of the screen to help you understand what they are used for.', |
|
92 | - 'event_espresso' |
|
93 | - ) . '</p>'; |
|
94 | - return $content; |
|
95 | - } |
|
96 | - |
|
97 | - |
|
98 | - protected function _context_switcher_stop() |
|
99 | - { |
|
100 | - return '<p>' |
|
101 | - . __( |
|
102 | - 'This dropdown allows you to swap between the different recipients templates that are available in this message type. Be sure to save changes befor switching to a different context.', |
|
103 | - 'event_espresso' |
|
104 | - ) . '</p>'; |
|
105 | - } |
|
106 | - |
|
107 | - |
|
108 | - protected function _preview_button_stop() |
|
109 | - { |
|
110 | - return '<p>' |
|
111 | - . __( |
|
112 | - 'Clicking this button will show you a preview of how your message will look.', |
|
113 | - 'event_espresso' |
|
114 | - ) . '</p>'; |
|
115 | - } |
|
116 | - |
|
117 | - |
|
118 | - protected function _template_area_stop() |
|
119 | - { |
|
120 | - return '<p>' |
|
121 | - . __( |
|
122 | - 'Depending on the messenger (recipient) and the message type, the main screen can show different boxes. Overall the screen allows you to confirm who the messages go to and who from, and the actual content of the message.', |
|
123 | - 'event_espresso' |
|
124 | - ) . '</p>'; |
|
125 | - } |
|
126 | - |
|
127 | - protected function _mtp_valid_shortcodes_stop() |
|
128 | - { |
|
129 | - return '<p>' |
|
130 | - . __( |
|
131 | - 'These shortcodes allow you to quickly add data into your messages, without touching code. From emails, to ticket details, to your company logo, building messages with shortcodes is easy and fast.', |
|
132 | - 'event_espresso' |
|
133 | - ) . '</p>'; |
|
134 | - } |
|
135 | - |
|
136 | - |
|
137 | - protected function _mtp_extra_actions_stop() |
|
138 | - { |
|
139 | - return '<p>' |
|
140 | - . __( |
|
141 | - 'Here you will find miscellaneous options to assist you, including a test send button and a reset button.', |
|
142 | - 'event_espresso' |
|
143 | - ) . '</p>'; |
|
144 | - } |
|
145 | - |
|
146 | - |
|
147 | - protected function _update_metabox_stop() |
|
148 | - { |
|
149 | - return '<p>' . __('When done creating your message, click here to save it.', 'event_espresso') . '</p>'; |
|
150 | - } |
|
18 | + protected function _set_tour_properties() |
|
19 | + { |
|
20 | + $this->_label = __('Message Template Editor Tour', 'event_espresso'); |
|
21 | + $this->_slug = 'messages-templates-edit-joyride'; |
|
22 | + } |
|
23 | + |
|
24 | + |
|
25 | + protected function _set_tour_stops() |
|
26 | + { |
|
27 | + $this->_stops = array( |
|
28 | + 10 => array( |
|
29 | + 'content' => $this->_start(), |
|
30 | + ), |
|
31 | + 20 => array( |
|
32 | + 'id' => 'submit-msg-context-switcher-sbmt', |
|
33 | + 'content' => $this->_context_switcher_stop(), |
|
34 | + 'options' => array( |
|
35 | + 'tipLocation' => 'bottom', |
|
36 | + 'tipAdjustmentY' => -30, |
|
37 | + 'tipAdjustmentX' => -60, |
|
38 | + ), |
|
39 | + ), |
|
40 | + 30 => array( |
|
41 | + 'class' => 'messages-preview-button"', |
|
42 | + 'content' => $this->_preview_button_stop(), |
|
43 | + 'options' => array( |
|
44 | + 'tipLocation' => 'bottom', |
|
45 | + 'tipAdjustmentY' => -30, |
|
46 | + ), |
|
47 | + ), |
|
48 | + 40 => array( |
|
49 | + 'content' => $this->_template_area_stop(), |
|
50 | + 'options' => array( |
|
51 | + 'tipAdjustmentY' => -100, |
|
52 | + 'tipAdjustmentX' => -60, |
|
53 | + ), |
|
54 | + ), |
|
55 | + 50 => array( |
|
56 | + 'id' => 'mtp_valid_shortcodes', |
|
57 | + 'content' => $this->_mtp_valid_shortcodes_stop(), |
|
58 | + 'options' => array( |
|
59 | + 'tipLocation' => 'left', |
|
60 | + 'tipAdjustmentY' => -50, |
|
61 | + 'tipAdjustmentX' => -15, |
|
62 | + ), |
|
63 | + ), |
|
64 | + 60 => array( |
|
65 | + 'id' => 'mtp_extra_actions', |
|
66 | + 'content' => $this->_mtp_extra_actions_stop(), |
|
67 | + 'options' => array( |
|
68 | + 'tipLocation' => 'left', |
|
69 | + 'tipAdjustmentY' => -50, |
|
70 | + 'tipAdjustmentX' => -15, |
|
71 | + ), |
|
72 | + ), |
|
73 | + 70 => array( |
|
74 | + 'id' => 'espresso_espresso_messages_editor_overview', |
|
75 | + 'content' => $this->_update_metabox_stop(), |
|
76 | + 'options' => array( |
|
77 | + 'tipLocation' => 'left', |
|
78 | + 'tipAdjustmentY' => -50, |
|
79 | + 'tipAdjustmentX' => -15, |
|
80 | + ), |
|
81 | + ), |
|
82 | + ); |
|
83 | + } |
|
84 | + |
|
85 | + |
|
86 | + protected function _start() |
|
87 | + { |
|
88 | + $content = '<h3>' . __('Message Template Editor', 'event_espresso') . '</h3>'; |
|
89 | + $content .= '<p>' |
|
90 | + . __( |
|
91 | + 'This tour of the Message Template Editor page will go over different areas of the screen to help you understand what they are used for.', |
|
92 | + 'event_espresso' |
|
93 | + ) . '</p>'; |
|
94 | + return $content; |
|
95 | + } |
|
96 | + |
|
97 | + |
|
98 | + protected function _context_switcher_stop() |
|
99 | + { |
|
100 | + return '<p>' |
|
101 | + . __( |
|
102 | + 'This dropdown allows you to swap between the different recipients templates that are available in this message type. Be sure to save changes befor switching to a different context.', |
|
103 | + 'event_espresso' |
|
104 | + ) . '</p>'; |
|
105 | + } |
|
106 | + |
|
107 | + |
|
108 | + protected function _preview_button_stop() |
|
109 | + { |
|
110 | + return '<p>' |
|
111 | + . __( |
|
112 | + 'Clicking this button will show you a preview of how your message will look.', |
|
113 | + 'event_espresso' |
|
114 | + ) . '</p>'; |
|
115 | + } |
|
116 | + |
|
117 | + |
|
118 | + protected function _template_area_stop() |
|
119 | + { |
|
120 | + return '<p>' |
|
121 | + . __( |
|
122 | + 'Depending on the messenger (recipient) and the message type, the main screen can show different boxes. Overall the screen allows you to confirm who the messages go to and who from, and the actual content of the message.', |
|
123 | + 'event_espresso' |
|
124 | + ) . '</p>'; |
|
125 | + } |
|
126 | + |
|
127 | + protected function _mtp_valid_shortcodes_stop() |
|
128 | + { |
|
129 | + return '<p>' |
|
130 | + . __( |
|
131 | + 'These shortcodes allow you to quickly add data into your messages, without touching code. From emails, to ticket details, to your company logo, building messages with shortcodes is easy and fast.', |
|
132 | + 'event_espresso' |
|
133 | + ) . '</p>'; |
|
134 | + } |
|
135 | + |
|
136 | + |
|
137 | + protected function _mtp_extra_actions_stop() |
|
138 | + { |
|
139 | + return '<p>' |
|
140 | + . __( |
|
141 | + 'Here you will find miscellaneous options to assist you, including a test send button and a reset button.', |
|
142 | + 'event_espresso' |
|
143 | + ) . '</p>'; |
|
144 | + } |
|
145 | + |
|
146 | + |
|
147 | + protected function _update_metabox_stop() |
|
148 | + { |
|
149 | + return '<p>' . __('When done creating your message, click here to save it.', 'event_espresso') . '</p>'; |
|
150 | + } |
|
151 | 151 | } |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | |
86 | 86 | protected function _start() |
87 | 87 | { |
88 | - $content = '<h3>' . __('Message Template Editor', 'event_espresso') . '</h3>'; |
|
88 | + $content = '<h3>'.__('Message Template Editor', 'event_espresso').'</h3>'; |
|
89 | 89 | $content .= '<p>' |
90 | 90 | . __( |
91 | 91 | 'This tour of the Message Template Editor page will go over different areas of the screen to help you understand what they are used for.', |
92 | 92 | 'event_espresso' |
93 | - ) . '</p>'; |
|
93 | + ).'</p>'; |
|
94 | 94 | return $content; |
95 | 95 | } |
96 | 96 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | . __( |
102 | 102 | 'This dropdown allows you to swap between the different recipients templates that are available in this message type. Be sure to save changes befor switching to a different context.', |
103 | 103 | 'event_espresso' |
104 | - ) . '</p>'; |
|
104 | + ).'</p>'; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | . __( |
112 | 112 | 'Clicking this button will show you a preview of how your message will look.', |
113 | 113 | 'event_espresso' |
114 | - ) . '</p>'; |
|
114 | + ).'</p>'; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | . __( |
122 | 122 | 'Depending on the messenger (recipient) and the message type, the main screen can show different boxes. Overall the screen allows you to confirm who the messages go to and who from, and the actual content of the message.', |
123 | 123 | 'event_espresso' |
124 | - ) . '</p>'; |
|
124 | + ).'</p>'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | protected function _mtp_valid_shortcodes_stop() |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | . __( |
131 | 131 | 'These shortcodes allow you to quickly add data into your messages, without touching code. From emails, to ticket details, to your company logo, building messages with shortcodes is easy and fast.', |
132 | 132 | 'event_espresso' |
133 | - ) . '</p>'; |
|
133 | + ).'</p>'; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | |
@@ -140,12 +140,12 @@ discard block |
||
140 | 140 | . __( |
141 | 141 | 'Here you will find miscellaneous options to assist you, including a test send button and a reset button.', |
142 | 142 | 'event_espresso' |
143 | - ) . '</p>'; |
|
143 | + ).'</p>'; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | |
147 | 147 | protected function _update_metabox_stop() |
148 | 148 | { |
149 | - return '<p>' . __('When done creating your message, click here to save it.', 'event_espresso') . '</p>'; |
|
149 | + return '<p>'.__('When done creating your message, click here to save it.', 'event_espresso').'</p>'; |
|
150 | 150 | } |
151 | 151 | } |
@@ -15,112 +15,112 @@ |
||
15 | 15 | class Messages_Settings_Help_Tour extends EE_Help_Tour |
16 | 16 | { |
17 | 17 | |
18 | - protected function _set_tour_properties() |
|
19 | - { |
|
20 | - $this->_label = __('Messages Settings Tour', 'event_espresso'); |
|
21 | - $this->_slug = 'messages-settings-joyride'; |
|
22 | - } |
|
18 | + protected function _set_tour_properties() |
|
19 | + { |
|
20 | + $this->_label = __('Messages Settings Tour', 'event_espresso'); |
|
21 | + $this->_slug = 'messages-settings-joyride'; |
|
22 | + } |
|
23 | 23 | |
24 | 24 | |
25 | - protected function _set_tour_stops() |
|
26 | - { |
|
27 | - $this->_stops = array( |
|
28 | - 10 => array( |
|
29 | - 'content' => $this->_start(), |
|
30 | - ), |
|
31 | - 20 => array( |
|
32 | - 'class' => 'messenger_links', |
|
33 | - 'content' => $this->_messenger_links_stop(), |
|
34 | - 'options' => array( |
|
35 | - 'tipLocation' => 'bottom', |
|
36 | - 'tipAdjustmentX' => -5, |
|
37 | - 'tipAdjustmentY' => -25, |
|
38 | - ), |
|
39 | - ), |
|
40 | - 30 => array( |
|
41 | - 'id' => 'espresso_email_settings', |
|
42 | - 'content' => $this->_email_settings_metabox_stop(), |
|
43 | - 'options' => array( |
|
44 | - 'tipLocation' => 'top', |
|
45 | - 'tipAdjustmentX' => 20, |
|
46 | - 'tipAdjustmentY' => -30, |
|
47 | - ), |
|
48 | - ), |
|
49 | - 40 => array( |
|
50 | - 'id' => 'on-off-email', |
|
51 | - 'content' => $this->_on_off_toggle_stop(), |
|
52 | - 'options' => array( |
|
53 | - 'tipLocation' => 'left', |
|
54 | - 'tipAdjustmentY' => -50, |
|
55 | - 'tipAdjustmentX' => -15, |
|
56 | - ), |
|
57 | - ), |
|
58 | - 50 => array( |
|
59 | - 'id' => 'active-message-types', |
|
60 | - 'content' => $this->_active_mts_container_stop(), |
|
61 | - 'options' => array( |
|
62 | - 'tipLocation' => 'top', |
|
63 | - 'tipAdjustmentY' => -30, |
|
64 | - ), |
|
65 | - ), |
|
66 | - 60 => array( |
|
67 | - 'id' => 'inactive-message-types', |
|
68 | - 'content' => $this->_inactive_mts_container_stop(), |
|
69 | - 'options' => array( |
|
70 | - 'tipLocation' => 'left', |
|
71 | - 'tipAdjustmentY' => -50, |
|
72 | - 'tipAdjustmentX' => -15, |
|
73 | - ), |
|
74 | - ), |
|
75 | - ); |
|
76 | - } |
|
25 | + protected function _set_tour_stops() |
|
26 | + { |
|
27 | + $this->_stops = array( |
|
28 | + 10 => array( |
|
29 | + 'content' => $this->_start(), |
|
30 | + ), |
|
31 | + 20 => array( |
|
32 | + 'class' => 'messenger_links', |
|
33 | + 'content' => $this->_messenger_links_stop(), |
|
34 | + 'options' => array( |
|
35 | + 'tipLocation' => 'bottom', |
|
36 | + 'tipAdjustmentX' => -5, |
|
37 | + 'tipAdjustmentY' => -25, |
|
38 | + ), |
|
39 | + ), |
|
40 | + 30 => array( |
|
41 | + 'id' => 'espresso_email_settings', |
|
42 | + 'content' => $this->_email_settings_metabox_stop(), |
|
43 | + 'options' => array( |
|
44 | + 'tipLocation' => 'top', |
|
45 | + 'tipAdjustmentX' => 20, |
|
46 | + 'tipAdjustmentY' => -30, |
|
47 | + ), |
|
48 | + ), |
|
49 | + 40 => array( |
|
50 | + 'id' => 'on-off-email', |
|
51 | + 'content' => $this->_on_off_toggle_stop(), |
|
52 | + 'options' => array( |
|
53 | + 'tipLocation' => 'left', |
|
54 | + 'tipAdjustmentY' => -50, |
|
55 | + 'tipAdjustmentX' => -15, |
|
56 | + ), |
|
57 | + ), |
|
58 | + 50 => array( |
|
59 | + 'id' => 'active-message-types', |
|
60 | + 'content' => $this->_active_mts_container_stop(), |
|
61 | + 'options' => array( |
|
62 | + 'tipLocation' => 'top', |
|
63 | + 'tipAdjustmentY' => -30, |
|
64 | + ), |
|
65 | + ), |
|
66 | + 60 => array( |
|
67 | + 'id' => 'inactive-message-types', |
|
68 | + 'content' => $this->_inactive_mts_container_stop(), |
|
69 | + 'options' => array( |
|
70 | + 'tipLocation' => 'left', |
|
71 | + 'tipAdjustmentY' => -50, |
|
72 | + 'tipAdjustmentX' => -15, |
|
73 | + ), |
|
74 | + ), |
|
75 | + ); |
|
76 | + } |
|
77 | 77 | |
78 | 78 | |
79 | - protected function _start() |
|
80 | - { |
|
81 | - $content = '<h3>' . __('Messages Settings', 'event_espresso') . '</h3>'; |
|
82 | - $content .= '<p>' |
|
83 | - . __( |
|
84 | - 'This tour of the Messages Settings page will go over different areas of the screen to help you understand what they are used for.', |
|
85 | - 'event_espresso' |
|
86 | - ) . '</p>'; |
|
87 | - return $content; |
|
88 | - } |
|
79 | + protected function _start() |
|
80 | + { |
|
81 | + $content = '<h3>' . __('Messages Settings', 'event_espresso') . '</h3>'; |
|
82 | + $content .= '<p>' |
|
83 | + . __( |
|
84 | + 'This tour of the Messages Settings page will go over different areas of the screen to help you understand what they are used for.', |
|
85 | + 'event_espresso' |
|
86 | + ) . '</p>'; |
|
87 | + return $content; |
|
88 | + } |
|
89 | 89 | |
90 | - protected function _messenger_links_stop() |
|
91 | - { |
|
92 | - return '<p>' . __('Available messengers are shown above.', 'event_espresso') . '</p>'; |
|
93 | - } |
|
90 | + protected function _messenger_links_stop() |
|
91 | + { |
|
92 | + return '<p>' . __('Available messengers are shown above.', 'event_espresso') . '</p>'; |
|
93 | + } |
|
94 | 94 | |
95 | - protected function _email_settings_metabox_stop() |
|
96 | - { |
|
97 | - return '<p>' . __('View the different message types that are currently active.', 'event_espresso') . '</p>'; |
|
98 | - } |
|
95 | + protected function _email_settings_metabox_stop() |
|
96 | + { |
|
97 | + return '<p>' . __('View the different message types that are currently active.', 'event_espresso') . '</p>'; |
|
98 | + } |
|
99 | 99 | |
100 | - protected function _on_off_toggle_stop() |
|
101 | - { |
|
102 | - return '<p>' |
|
103 | - . __( |
|
104 | - 'This toggle will turn all messages on or off for this message type.', |
|
105 | - 'event_espresso' |
|
106 | - ) . '</p>'; |
|
107 | - } |
|
100 | + protected function _on_off_toggle_stop() |
|
101 | + { |
|
102 | + return '<p>' |
|
103 | + . __( |
|
104 | + 'This toggle will turn all messages on or off for this message type.', |
|
105 | + 'event_espresso' |
|
106 | + ) . '</p>'; |
|
107 | + } |
|
108 | 108 | |
109 | - protected function _active_mts_container_stop() |
|
110 | - { |
|
111 | - return '<p>' |
|
112 | - . __( |
|
113 | - 'These are your active message types. Click them to see a description and settings for each one.', |
|
114 | - 'event_espresso' |
|
115 | - ) . '</p>'; |
|
116 | - } |
|
109 | + protected function _active_mts_container_stop() |
|
110 | + { |
|
111 | + return '<p>' |
|
112 | + . __( |
|
113 | + 'These are your active message types. Click them to see a description and settings for each one.', |
|
114 | + 'event_espresso' |
|
115 | + ) . '</p>'; |
|
116 | + } |
|
117 | 117 | |
118 | - protected function _inactive_mts_container_stop() |
|
119 | - { |
|
120 | - return '<p>' |
|
121 | - . __( |
|
122 | - 'Drag message types here to deactivate them. Drag them from here to the active box to reactivate them.', |
|
123 | - 'event_espresso' |
|
124 | - ) . '</p>'; |
|
125 | - } |
|
118 | + protected function _inactive_mts_container_stop() |
|
119 | + { |
|
120 | + return '<p>' |
|
121 | + . __( |
|
122 | + 'Drag message types here to deactivate them. Drag them from here to the active box to reactivate them.', |
|
123 | + 'event_espresso' |
|
124 | + ) . '</p>'; |
|
125 | + } |
|
126 | 126 | } |
@@ -78,23 +78,23 @@ discard block |
||
78 | 78 | |
79 | 79 | protected function _start() |
80 | 80 | { |
81 | - $content = '<h3>' . __('Messages Settings', 'event_espresso') . '</h3>'; |
|
81 | + $content = '<h3>'.__('Messages Settings', 'event_espresso').'</h3>'; |
|
82 | 82 | $content .= '<p>' |
83 | 83 | . __( |
84 | 84 | 'This tour of the Messages Settings page will go over different areas of the screen to help you understand what they are used for.', |
85 | 85 | 'event_espresso' |
86 | - ) . '</p>'; |
|
86 | + ).'</p>'; |
|
87 | 87 | return $content; |
88 | 88 | } |
89 | 89 | |
90 | 90 | protected function _messenger_links_stop() |
91 | 91 | { |
92 | - return '<p>' . __('Available messengers are shown above.', 'event_espresso') . '</p>'; |
|
92 | + return '<p>'.__('Available messengers are shown above.', 'event_espresso').'</p>'; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | protected function _email_settings_metabox_stop() |
96 | 96 | { |
97 | - return '<p>' . __('View the different message types that are currently active.', 'event_espresso') . '</p>'; |
|
97 | + return '<p>'.__('View the different message types that are currently active.', 'event_espresso').'</p>'; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | protected function _on_off_toggle_stop() |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | . __( |
104 | 104 | 'This toggle will turn all messages on or off for this message type.', |
105 | 105 | 'event_espresso' |
106 | - ) . '</p>'; |
|
106 | + ).'</p>'; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | protected function _active_mts_container_stop() |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | . __( |
113 | 113 | 'These are your active message types. Click them to see a description and settings for each one.', |
114 | 114 | 'event_espresso' |
115 | - ) . '</p>'; |
|
115 | + ).'</p>'; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | protected function _inactive_mts_container_stop() |
@@ -121,6 +121,6 @@ discard block |
||
121 | 121 | . __( |
122 | 122 | 'Drag message types here to deactivate them. Drag them from here to the active box to reactivate them.', |
123 | 123 | 'event_espresso' |
124 | - ) . '</p>'; |
|
124 | + ).'</p>'; |
|
125 | 125 | } |
126 | 126 | } |
@@ -15,131 +15,131 @@ |
||
15 | 15 | class Messages_Overview_Help_Tour extends EE_Help_Tour |
16 | 16 | { |
17 | 17 | |
18 | - protected function _set_tour_properties() |
|
19 | - { |
|
20 | - $this->_label = __('Messages Overview Tour', 'event_espresso'); |
|
21 | - $this->_slug = 'messages-overview-joyride'; |
|
22 | - } |
|
18 | + protected function _set_tour_properties() |
|
19 | + { |
|
20 | + $this->_label = __('Messages Overview Tour', 'event_espresso'); |
|
21 | + $this->_slug = 'messages-overview-joyride'; |
|
22 | + } |
|
23 | 23 | |
24 | 24 | |
25 | - protected function _set_tour_stops() |
|
26 | - { |
|
27 | - $this->_stops = array( |
|
28 | - 10 => array( |
|
29 | - 'content' => $this->_start(), |
|
30 | - ), |
|
31 | - 20 => array( |
|
32 | - 'id' => 'event', |
|
33 | - 'content' => $this->event_column_stop(), |
|
34 | - 'options' => array( |
|
35 | - 'tipLocation' => 'top', |
|
36 | - 'tipAdjustmentX' => -5, |
|
37 | - 'tipAdjustmentY' => -30, |
|
38 | - ), |
|
39 | - ), |
|
40 | - 30 => array( |
|
41 | - 'id' => 'message_type', |
|
42 | - 'content' => $this->_message_type_column_stop(), |
|
43 | - 'options' => array( |
|
44 | - 'tipLocation' => 'top', |
|
45 | - 'tipAdjustmentX' => 20, |
|
46 | - 'tipAdjustmentY' => -30, |
|
47 | - ), |
|
48 | - ), |
|
49 | - 40 => array( |
|
50 | - 'id' => 'messenger', |
|
51 | - 'content' => $this->_messenger_column_stop(), |
|
52 | - 'options' => array( |
|
53 | - 'tipLocation' => 'top', |
|
54 | - 'tipAdjustmentX' => 5, |
|
55 | - 'tipAdjustmentY' => -30, |
|
56 | - ), |
|
57 | - ), |
|
58 | - 50 => array( |
|
59 | - 'id' => 'description', |
|
60 | - 'content' => $this->_description_column_stop(), |
|
61 | - 'options' => array( |
|
62 | - 'tipLocation' => 'top', |
|
63 | - 'tipAdjustmentX' => 5, |
|
64 | - 'tipAdjustmentY' => -30, |
|
65 | - ), |
|
66 | - ), |
|
67 | - 60 => array( |
|
68 | - 'class' => 'bulkactions', |
|
69 | - 'content' => $this->_bulk_actions_stop(), |
|
70 | - 'options' => array( |
|
71 | - 'tipLocation' => 'top', |
|
72 | - 'tipAdjustmentX' => 25, |
|
73 | - 'tipAdjustmentY' => -35, |
|
74 | - ), |
|
75 | - ), |
|
76 | - 70 => array( |
|
77 | - 'id' => 'ee_messenger_filter_by', |
|
78 | - 'content' => $this->_filters_stop(), |
|
79 | - 'options' => array( |
|
80 | - 'tipLocation' => 'top', |
|
81 | - 'tipAdjustmentX' => 25, |
|
82 | - 'tipAdjustmentY' => -30, |
|
83 | - ), |
|
84 | - ), |
|
85 | - ); |
|
86 | - } |
|
25 | + protected function _set_tour_stops() |
|
26 | + { |
|
27 | + $this->_stops = array( |
|
28 | + 10 => array( |
|
29 | + 'content' => $this->_start(), |
|
30 | + ), |
|
31 | + 20 => array( |
|
32 | + 'id' => 'event', |
|
33 | + 'content' => $this->event_column_stop(), |
|
34 | + 'options' => array( |
|
35 | + 'tipLocation' => 'top', |
|
36 | + 'tipAdjustmentX' => -5, |
|
37 | + 'tipAdjustmentY' => -30, |
|
38 | + ), |
|
39 | + ), |
|
40 | + 30 => array( |
|
41 | + 'id' => 'message_type', |
|
42 | + 'content' => $this->_message_type_column_stop(), |
|
43 | + 'options' => array( |
|
44 | + 'tipLocation' => 'top', |
|
45 | + 'tipAdjustmentX' => 20, |
|
46 | + 'tipAdjustmentY' => -30, |
|
47 | + ), |
|
48 | + ), |
|
49 | + 40 => array( |
|
50 | + 'id' => 'messenger', |
|
51 | + 'content' => $this->_messenger_column_stop(), |
|
52 | + 'options' => array( |
|
53 | + 'tipLocation' => 'top', |
|
54 | + 'tipAdjustmentX' => 5, |
|
55 | + 'tipAdjustmentY' => -30, |
|
56 | + ), |
|
57 | + ), |
|
58 | + 50 => array( |
|
59 | + 'id' => 'description', |
|
60 | + 'content' => $this->_description_column_stop(), |
|
61 | + 'options' => array( |
|
62 | + 'tipLocation' => 'top', |
|
63 | + 'tipAdjustmentX' => 5, |
|
64 | + 'tipAdjustmentY' => -30, |
|
65 | + ), |
|
66 | + ), |
|
67 | + 60 => array( |
|
68 | + 'class' => 'bulkactions', |
|
69 | + 'content' => $this->_bulk_actions_stop(), |
|
70 | + 'options' => array( |
|
71 | + 'tipLocation' => 'top', |
|
72 | + 'tipAdjustmentX' => 25, |
|
73 | + 'tipAdjustmentY' => -35, |
|
74 | + ), |
|
75 | + ), |
|
76 | + 70 => array( |
|
77 | + 'id' => 'ee_messenger_filter_by', |
|
78 | + 'content' => $this->_filters_stop(), |
|
79 | + 'options' => array( |
|
80 | + 'tipLocation' => 'top', |
|
81 | + 'tipAdjustmentX' => 25, |
|
82 | + 'tipAdjustmentY' => -30, |
|
83 | + ), |
|
84 | + ), |
|
85 | + ); |
|
86 | + } |
|
87 | 87 | |
88 | 88 | |
89 | - protected function _start() |
|
90 | - { |
|
91 | - $content = '<h3>' . __('Messages Overview', 'event_espresso') . '</h3>'; |
|
92 | - $content .= '<p>' |
|
93 | - . __( |
|
94 | - 'This tour of the Messages Overview page will go over different areas of the screen to help you understand what they are used for.', |
|
95 | - 'event_espresso' |
|
96 | - ) . '</p>'; |
|
97 | - return $content; |
|
98 | - } |
|
89 | + protected function _start() |
|
90 | + { |
|
91 | + $content = '<h3>' . __('Messages Overview', 'event_espresso') . '</h3>'; |
|
92 | + $content .= '<p>' |
|
93 | + . __( |
|
94 | + 'This tour of the Messages Overview page will go over different areas of the screen to help you understand what they are used for.', |
|
95 | + 'event_espresso' |
|
96 | + ) . '</p>'; |
|
97 | + return $content; |
|
98 | + } |
|
99 | 99 | |
100 | - protected function event_column_stop() |
|
101 | - { |
|
102 | - return '<p>' |
|
103 | - . __( |
|
104 | - 'View if a message is associated with one event or multiple events. Can be sorted in ascending and descending order.', |
|
105 | - 'event_espresso' |
|
106 | - ) . '</p>'; |
|
107 | - } |
|
100 | + protected function event_column_stop() |
|
101 | + { |
|
102 | + return '<p>' |
|
103 | + . __( |
|
104 | + 'View if a message is associated with one event or multiple events. Can be sorted in ascending and descending order.', |
|
105 | + 'event_espresso' |
|
106 | + ) . '</p>'; |
|
107 | + } |
|
108 | 108 | |
109 | - protected function _message_type_column_stop() |
|
110 | - { |
|
111 | - return '<p>' |
|
112 | - . __( |
|
113 | - 'View the type of message. Can be sorted in ascending or descending order.', |
|
114 | - 'event_espresso' |
|
115 | - ) . '</p>'; |
|
116 | - } |
|
109 | + protected function _message_type_column_stop() |
|
110 | + { |
|
111 | + return '<p>' |
|
112 | + . __( |
|
113 | + 'View the type of message. Can be sorted in ascending or descending order.', |
|
114 | + 'event_espresso' |
|
115 | + ) . '</p>'; |
|
116 | + } |
|
117 | 117 | |
118 | - protected function _messenger_column_stop() |
|
119 | - { |
|
120 | - return '<p>' |
|
121 | - . __( |
|
122 | - 'View who messages will be sent to. Can be sorted in ascending or descending order.', |
|
123 | - 'event_espresso' |
|
124 | - ) . '</p>'; |
|
125 | - } |
|
118 | + protected function _messenger_column_stop() |
|
119 | + { |
|
120 | + return '<p>' |
|
121 | + . __( |
|
122 | + 'View who messages will be sent to. Can be sorted in ascending or descending order.', |
|
123 | + 'event_espresso' |
|
124 | + ) . '</p>'; |
|
125 | + } |
|
126 | 126 | |
127 | - protected function _description_column_stop() |
|
128 | - { |
|
129 | - return '<p>' . __('View the description for each message type.', 'event_espresso') . '</p>'; |
|
130 | - } |
|
127 | + protected function _description_column_stop() |
|
128 | + { |
|
129 | + return '<p>' . __('View the description for each message type.', 'event_espresso') . '</p>'; |
|
130 | + } |
|
131 | 131 | |
132 | - protected function _bulk_actions_stop() |
|
133 | - { |
|
134 | - return '<p>' . __('Perform bulk actions to multiple message types.', 'event_espresso') . '</p>'; |
|
135 | - } |
|
132 | + protected function _bulk_actions_stop() |
|
133 | + { |
|
134 | + return '<p>' . __('Perform bulk actions to multiple message types.', 'event_espresso') . '</p>'; |
|
135 | + } |
|
136 | 136 | |
137 | - protected function _filters_stop() |
|
138 | - { |
|
139 | - return '<p>' |
|
140 | - . __( |
|
141 | - 'You can filter by different notifications by making a selection below and clicking on the filter button. To reset your selection, just click on the reset filters button.', |
|
142 | - 'event_espresso' |
|
143 | - ) . '</p>'; |
|
144 | - } |
|
137 | + protected function _filters_stop() |
|
138 | + { |
|
139 | + return '<p>' |
|
140 | + . __( |
|
141 | + 'You can filter by different notifications by making a selection below and clicking on the filter button. To reset your selection, just click on the reset filters button.', |
|
142 | + 'event_espresso' |
|
143 | + ) . '</p>'; |
|
144 | + } |
|
145 | 145 | } |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | |
89 | 89 | protected function _start() |
90 | 90 | { |
91 | - $content = '<h3>' . __('Messages Overview', 'event_espresso') . '</h3>'; |
|
91 | + $content = '<h3>'.__('Messages Overview', 'event_espresso').'</h3>'; |
|
92 | 92 | $content .= '<p>' |
93 | 93 | . __( |
94 | 94 | 'This tour of the Messages Overview page will go over different areas of the screen to help you understand what they are used for.', |
95 | 95 | 'event_espresso' |
96 | - ) . '</p>'; |
|
96 | + ).'</p>'; |
|
97 | 97 | return $content; |
98 | 98 | } |
99 | 99 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | . __( |
104 | 104 | 'View if a message is associated with one event or multiple events. Can be sorted in ascending and descending order.', |
105 | 105 | 'event_espresso' |
106 | - ) . '</p>'; |
|
106 | + ).'</p>'; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | protected function _message_type_column_stop() |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | . __( |
113 | 113 | 'View the type of message. Can be sorted in ascending or descending order.', |
114 | 114 | 'event_espresso' |
115 | - ) . '</p>'; |
|
115 | + ).'</p>'; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | protected function _messenger_column_stop() |
@@ -121,17 +121,17 @@ discard block |
||
121 | 121 | . __( |
122 | 122 | 'View who messages will be sent to. Can be sorted in ascending or descending order.', |
123 | 123 | 'event_espresso' |
124 | - ) . '</p>'; |
|
124 | + ).'</p>'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | protected function _description_column_stop() |
128 | 128 | { |
129 | - return '<p>' . __('View the description for each message type.', 'event_espresso') . '</p>'; |
|
129 | + return '<p>'.__('View the description for each message type.', 'event_espresso').'</p>'; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | protected function _bulk_actions_stop() |
133 | 133 | { |
134 | - return '<p>' . __('Perform bulk actions to multiple message types.', 'event_espresso') . '</p>'; |
|
134 | + return '<p>'.__('Perform bulk actions to multiple message types.', 'event_espresso').'</p>'; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | protected function _filters_stop() |
@@ -140,6 +140,6 @@ discard block |
||
140 | 140 | . __( |
141 | 141 | 'You can filter by different notifications by making a selection below and clicking on the filter button. To reset your selection, just click on the reset filters button.', |
142 | 142 | 'event_espresso' |
143 | - ) . '</p>'; |
|
143 | + ).'</p>'; |
|
144 | 144 | } |
145 | 145 | } |
@@ -12,434 +12,434 @@ |
||
12 | 12 | { |
13 | 13 | |
14 | 14 | |
15 | - /** |
|
16 | - * @return Messages_Admin_Page |
|
17 | - */ |
|
18 | - public function get_admin_page() |
|
19 | - { |
|
20 | - return $this->_admin_page; |
|
21 | - } |
|
22 | - |
|
23 | - |
|
24 | - protected function _setup_data() |
|
25 | - { |
|
26 | - $this->_data = $this->_get_messages($this->_per_page, $this->_view); |
|
27 | - $this->_all_data_count = $this->_get_messages($this->_per_page, $this->_view, true); |
|
28 | - } |
|
29 | - |
|
30 | - |
|
31 | - protected function _set_properties() |
|
32 | - { |
|
33 | - $this->_wp_list_args = array( |
|
34 | - 'singular' => __('Message', 'event_espresso'), |
|
35 | - 'plural' => __('Messages', 'event_espresso'), |
|
36 | - 'ajax' => true, |
|
37 | - 'screen' => $this->get_admin_page()->get_current_screen()->id, |
|
38 | - ); |
|
39 | - |
|
40 | - $this->_columns = array( |
|
41 | - 'cb' => '<input type="checkbox" />', |
|
42 | - 'to' => __('To', 'event_espresso'), |
|
43 | - 'from' => __('From', 'event_espresso'), |
|
44 | - 'messenger' => __('Messenger', 'event_espresso'), |
|
45 | - 'message_type' => __('Message Type', 'event_espresso'), |
|
46 | - 'context' => __('Context', 'event_espresso'), |
|
47 | - 'modified' => __('Modified', 'event_espresso'), |
|
48 | - 'action' => __('Actions', 'event_espresso'), |
|
49 | - 'msg_id' => __('ID', 'event_espresso'), |
|
50 | - ); |
|
51 | - |
|
52 | - $this->_sortable_columns = array( |
|
53 | - 'modified' => array('MSG_modified' => true), |
|
54 | - 'message_type' => array('MSG_message_type' => false), |
|
55 | - 'messenger' => array('MSG_messenger' => false), |
|
56 | - 'to' => array('MSG_to' => false), |
|
57 | - 'from' => array('MSG_from' => false), |
|
58 | - 'context' => array('MSG_context' => false), |
|
59 | - 'msg_id' => array('MSG_ID', false), |
|
60 | - ); |
|
61 | - |
|
62 | - $this->_primary_column = 'to'; |
|
63 | - |
|
64 | - $this->_hidden_columns = array( |
|
65 | - 'msg_id', |
|
66 | - ); |
|
67 | - } |
|
68 | - |
|
69 | - |
|
70 | - /** |
|
71 | - * This simply sets up the row class for the table rows. |
|
72 | - * Allows for easier overriding of child methods for setting up sorting. |
|
73 | - * |
|
74 | - * @param object $item the current item |
|
75 | - * @return string |
|
76 | - */ |
|
77 | - protected function _get_row_class($item) |
|
78 | - { |
|
79 | - $class = parent::_get_row_class($item); |
|
80 | - // add status class |
|
81 | - $class .= ' ee-status-strip msg-status-' . $item->STS_ID(); |
|
82 | - if ($this->_has_checkbox_column) { |
|
83 | - $class .= ' has-checkbox-column'; |
|
84 | - } |
|
85 | - return $class; |
|
86 | - } |
|
87 | - |
|
88 | - |
|
89 | - /** |
|
90 | - * _get_table_filters |
|
91 | - * We use this to assemble and return any filters that are associated with this table that help further refine what |
|
92 | - * get's shown in the table. |
|
93 | - * |
|
94 | - * @abstract |
|
95 | - * @access protected |
|
96 | - * @return string |
|
97 | - * @throws \EE_Error |
|
98 | - */ |
|
99 | - protected function _get_table_filters() |
|
100 | - { |
|
101 | - $filters = array(); |
|
102 | - |
|
103 | - // get select_inputs |
|
104 | - $select_inputs = array( |
|
105 | - $this->_get_messengers_dropdown_filter(), |
|
106 | - $this->_get_message_types_dropdown_filter(), |
|
107 | - $this->_get_contexts_for_message_types_dropdown_filter(), |
|
108 | - ); |
|
109 | - |
|
110 | - // set filters to select inputs if they aren't empty |
|
111 | - foreach ($select_inputs as $select_input) { |
|
112 | - if ($select_input) { |
|
113 | - $filters[] = $select_input; |
|
114 | - } |
|
115 | - } |
|
116 | - return $filters; |
|
117 | - } |
|
118 | - |
|
119 | - |
|
120 | - protected function _add_view_counts() |
|
121 | - { |
|
122 | - foreach ($this->_views as $view => $args) { |
|
123 | - $this->_views[ $view ]['count'] = $this->_get_messages($this->_per_page, $view, true, true); |
|
124 | - } |
|
125 | - } |
|
126 | - |
|
127 | - |
|
128 | - /** |
|
129 | - * @param EE_Message $message |
|
130 | - * @return string checkbox |
|
131 | - * @throws \EE_Error |
|
132 | - */ |
|
133 | - public function column_cb($message) |
|
134 | - { |
|
135 | - return sprintf('<input type="checkbox" name="MSG_ID[%s]" value="1" />', $message->ID()); |
|
136 | - } |
|
137 | - |
|
138 | - |
|
139 | - /** |
|
140 | - * @param EE_Message $message |
|
141 | - * @return string |
|
142 | - * @throws \EE_Error |
|
143 | - */ |
|
144 | - public function column_msg_id(EE_Message $message) |
|
145 | - { |
|
146 | - return $message->ID(); |
|
147 | - } |
|
148 | - |
|
149 | - |
|
150 | - /** |
|
151 | - * @param EE_Message $message |
|
152 | - * @return string The recipient of the message |
|
153 | - * @throws \EE_Error |
|
154 | - */ |
|
155 | - public function column_to(EE_Message $message) |
|
156 | - { |
|
157 | - EE_Registry::instance()->load_helper('URL'); |
|
158 | - $actions = array(); |
|
159 | - $actions['delete'] = '<a href="' |
|
160 | - . EEH_URL::add_query_args_and_nonce( |
|
161 | - array( |
|
162 | - 'page' => 'espresso_messages', |
|
163 | - 'action' => 'delete_ee_message', |
|
164 | - 'MSG_ID' => $message->ID(), |
|
165 | - ), |
|
166 | - admin_url('admin.php') |
|
167 | - ) |
|
168 | - . '">' . __('Delete', 'event_espresso') . '</a>'; |
|
169 | - return esc_html($message->to()) . $this->row_actions($actions); |
|
170 | - } |
|
171 | - |
|
172 | - |
|
173 | - /** |
|
174 | - * @param EE_Message $message |
|
175 | - * @return string The sender of the message |
|
176 | - */ |
|
177 | - public function column_from(EE_Message $message) |
|
178 | - { |
|
179 | - return esc_html($message->from()); |
|
180 | - } |
|
181 | - |
|
182 | - |
|
183 | - /** |
|
184 | - * @param EE_Message $message |
|
185 | - * @return string The messenger used to send the message. |
|
186 | - */ |
|
187 | - public function column_messenger(EE_Message $message) |
|
188 | - { |
|
189 | - return ucwords($message->messenger_label()); |
|
190 | - } |
|
191 | - |
|
192 | - |
|
193 | - /** |
|
194 | - * @param EE_Message $message |
|
195 | - * @return string The message type used to generate the message. |
|
196 | - */ |
|
197 | - public function column_message_type(EE_Message $message) |
|
198 | - { |
|
199 | - return ucwords($message->message_type_label()); |
|
200 | - } |
|
201 | - |
|
202 | - |
|
203 | - /** |
|
204 | - * @param EE_Message $message |
|
205 | - * @return string The context the message was generated for. |
|
206 | - */ |
|
207 | - public function column_context(EE_Message $message) |
|
208 | - { |
|
209 | - return $message->context_label(); |
|
210 | - } |
|
211 | - |
|
212 | - |
|
213 | - /** |
|
214 | - * @param EE_Message $message |
|
215 | - * @return string The timestamp when this message was last modified. |
|
216 | - */ |
|
217 | - public function column_modified(EE_Message $message) |
|
218 | - { |
|
219 | - return $message->modified(); |
|
220 | - } |
|
221 | - |
|
222 | - |
|
223 | - /** |
|
224 | - * @param EE_Message $message |
|
225 | - * @return string Actions that can be done on the current message. |
|
226 | - */ |
|
227 | - public function column_action(EE_Message $message) |
|
228 | - { |
|
229 | - EE_Registry::instance()->load_helper('MSG_Template'); |
|
230 | - $action_links = array( |
|
231 | - 'view' => EEH_MSG_Template::get_message_action_link('view', $message), |
|
232 | - 'error' => EEH_MSG_Template::get_message_action_link('error', $message), |
|
233 | - 'generate_now' => EEH_MSG_Template::get_message_action_link('generate_now', $message), |
|
234 | - 'send_now' => EEH_MSG_Template::get_message_action_link('send_now', $message), |
|
235 | - 'queue_for_resending' => EEH_MSG_Template::get_message_action_link('queue_for_resending', $message), |
|
236 | - 'view_transaction' => EEH_MSG_Template::get_message_action_link('view_transaction', $message), |
|
237 | - ); |
|
238 | - $content = ''; |
|
239 | - switch ($message->STS_ID()) { |
|
240 | - case EEM_Message::status_sent: |
|
241 | - $content = $action_links['view'] . $action_links['queue_for_resending'] . $action_links['view_transaction']; |
|
242 | - break; |
|
243 | - case EEM_Message::status_resend: |
|
244 | - $content = $action_links['view'] . $action_links['send_now'] . $action_links['view_transaction']; |
|
245 | - break; |
|
246 | - case EEM_Message::status_retry: |
|
247 | - $content = $action_links['view'] . $action_links['send_now'] . $action_links['error'] . $action_links['view_transaction']; |
|
248 | - break; |
|
249 | - case EEM_Message::status_failed: |
|
250 | - case EEM_Message::status_debug_only: |
|
251 | - $content = $action_links['error'] . $action_links['view_transaction']; |
|
252 | - break; |
|
253 | - case EEM_Message::status_idle: |
|
254 | - $content = $action_links['view'] . $action_links['send_now'] . $action_links['view_transaction']; |
|
255 | - break; |
|
256 | - case EEM_Message::status_incomplete: |
|
257 | - $content = $action_links['generate_now'] . $action_links['view_transaction']; |
|
258 | - break; |
|
259 | - } |
|
260 | - return $content; |
|
261 | - } |
|
262 | - |
|
263 | - |
|
264 | - /** |
|
265 | - * Retrieve the EE_Message objects for the list table. |
|
266 | - * |
|
267 | - * @param int $perpage The number of items per page |
|
268 | - * @param string $view The view items are being retrieved for |
|
269 | - * @param bool $count Whether to just return a count or not. |
|
270 | - * @param bool $all Disregard any paging info (no limit on data returned). |
|
271 | - * @return int|EE_Message[] |
|
272 | - * @throws \EE_Error |
|
273 | - */ |
|
274 | - protected function _get_messages($perpage = 10, $view = 'all', $count = false, $all = false) |
|
275 | - { |
|
276 | - |
|
277 | - $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) |
|
278 | - ? $this->_req_data['paged'] |
|
279 | - : 1; |
|
280 | - |
|
281 | - $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) |
|
282 | - ? $this->_req_data['perpage'] |
|
283 | - : $perpage; |
|
284 | - |
|
285 | - $offset = ($current_page - 1) * $per_page; |
|
286 | - $limit = $all || $count ? null : array($offset, $per_page); |
|
287 | - $query_params = array( |
|
288 | - 'order_by' => empty($this->_req_data['orderby']) ? 'MSG_modified' : $this->_req_data['orderby'], |
|
289 | - 'order' => empty($this->_req_data['order']) ? 'DESC' : $this->_req_data['order'], |
|
290 | - 'limit' => $limit, |
|
291 | - ); |
|
292 | - |
|
293 | - /** |
|
294 | - * Any filters coming in from other routes? |
|
295 | - */ |
|
296 | - if (isset($this->_req_data['filterby'])) { |
|
297 | - $query_params = array_merge($query_params, EEM_Message::instance()->filter_by_query_params()); |
|
298 | - if (! $count) { |
|
299 | - $query_params['group_by'] = 'MSG_ID'; |
|
300 | - } |
|
301 | - } |
|
302 | - |
|
303 | - // view conditionals |
|
304 | - if ($view !== 'all' && $count && $all) { |
|
305 | - $query_params[0]['AND*view_conditional'] = array( |
|
306 | - 'STS_ID' => strtoupper($view), |
|
307 | - ); |
|
308 | - } |
|
309 | - |
|
310 | - if (! $all && ! empty($this->_req_data['status']) && $this->_req_data['status'] !== 'all') { |
|
311 | - $query_params[0]['AND*view_conditional'] = $this->_req_data === EEM_Message::status_failed |
|
312 | - ? array( |
|
313 | - 'STS_ID' => array( |
|
314 | - 'IN', |
|
315 | - array(EEM_Message::status_failed, EEM_Message::status_messenger_executing), |
|
316 | - ), |
|
317 | - ) |
|
318 | - : array('STS_ID' => strtoupper($this->_req_data['status'])); |
|
319 | - } |
|
320 | - |
|
321 | - if (! $all && ! empty($this->_req_data['s'])) { |
|
322 | - $search_string = '%' . $this->_req_data['s'] . '%'; |
|
323 | - $query_params[0]['OR'] = array( |
|
324 | - 'MSG_to' => array('LIKE', $search_string), |
|
325 | - 'MSG_from' => array('LIKE', $search_string), |
|
326 | - 'MSG_subject' => array('LIKE', $search_string), |
|
327 | - 'MSG_content' => array('LIKE', $search_string), |
|
328 | - ); |
|
329 | - } |
|
330 | - |
|
331 | - // account for debug only status. We don't show Messages with the EEM_Message::status_debug_only to clients when |
|
332 | - // the messages system is in debug mode. |
|
333 | - // Note: for backward compat with previous iterations, this is necessary because there may be EEM_Message::status_debug_only |
|
334 | - // messages in the database. |
|
335 | - if (! EEM_Message::debug()) { |
|
336 | - $query_params[0]['AND*debug_only_conditional'] = array( |
|
337 | - 'STS_ID' => array('!=', EEM_Message::status_debug_only), |
|
338 | - ); |
|
339 | - } |
|
340 | - |
|
341 | - // account for filters |
|
342 | - if (! $all |
|
343 | - && isset($this->_req_data['ee_messenger_filter_by']) |
|
344 | - && $this->_req_data['ee_messenger_filter_by'] !== 'none_selected' |
|
345 | - ) { |
|
346 | - $query_params[0]['AND*messenger_filter'] = array( |
|
347 | - 'MSG_messenger' => $this->_req_data['ee_messenger_filter_by'], |
|
348 | - ); |
|
349 | - } |
|
350 | - if (! $all |
|
351 | - && ! empty($this->_req_data['ee_message_type_filter_by']) |
|
352 | - && $this->_req_data['ee_message_type_filter_by'] !== 'none_selected' |
|
353 | - ) { |
|
354 | - $query_params[0]['AND*message_type_filter'] = array( |
|
355 | - 'MSG_message_type' => $this->_req_data['ee_message_type_filter_by'], |
|
356 | - ); |
|
357 | - } |
|
358 | - |
|
359 | - if (! $all |
|
360 | - && ! empty($this->_req_data['ee_context_filter_by']) |
|
361 | - && $this->_req_data['ee_context_filter_by'] !== 'none_selected' |
|
362 | - ) { |
|
363 | - $query_params[0]['AND*context_filter'] = array( |
|
364 | - 'MSG_context' => array('IN', explode(',', $this->_req_data['ee_context_filter_by'])), |
|
365 | - ); |
|
366 | - } |
|
367 | - |
|
368 | - return $count |
|
369 | - /** @type int */ |
|
370 | - ? EEM_Message::instance()->count($query_params, null, true) |
|
371 | - /** @type EE_Message[] */ |
|
372 | - : EEM_Message::instance()->get_all($query_params); |
|
373 | - } |
|
374 | - |
|
375 | - |
|
376 | - /** |
|
377 | - * Generate dropdown filter select input for messengers. |
|
378 | - * |
|
379 | - * @return string |
|
380 | - */ |
|
381 | - protected function _get_messengers_dropdown_filter() |
|
382 | - { |
|
383 | - $messenger_options = array(); |
|
384 | - $active_messages_grouped_by_messenger = EEM_Message::instance()->get_all(array('group_by' => 'MSG_messenger')); |
|
385 | - |
|
386 | - // setup array of messenger options |
|
387 | - foreach ($active_messages_grouped_by_messenger as $active_message) { |
|
388 | - if ($active_message instanceof EE_Message) { |
|
389 | - $messenger_options[ $active_message->messenger() ] = ucwords($active_message->messenger_label()); |
|
390 | - } |
|
391 | - } |
|
392 | - return $this->get_admin_page()->get_messengers_select_input($messenger_options); |
|
393 | - } |
|
394 | - |
|
395 | - |
|
396 | - /** |
|
397 | - * Generate dropdown filter select input for message types |
|
398 | - * |
|
399 | - * @return string |
|
400 | - */ |
|
401 | - protected function _get_message_types_dropdown_filter() |
|
402 | - { |
|
403 | - $message_type_options = array(); |
|
404 | - $active_messages_grouped_by_message_type = EEM_Message::instance()->get_all( |
|
405 | - array('group_by' => 'MSG_message_type') |
|
406 | - ); |
|
407 | - |
|
408 | - // setup array of message type options |
|
409 | - foreach ($active_messages_grouped_by_message_type as $active_message) { |
|
410 | - if ($active_message instanceof EE_Message) { |
|
411 | - $message_type_options[ $active_message->message_type() ] = ucwords( |
|
412 | - $active_message->message_type_label() |
|
413 | - ); |
|
414 | - } |
|
415 | - } |
|
416 | - return $this->get_admin_page()->get_message_types_select_input($message_type_options); |
|
417 | - } |
|
418 | - |
|
419 | - |
|
420 | - /** |
|
421 | - * Generate dropdown filter select input for message type contexts |
|
422 | - * |
|
423 | - * @return string |
|
424 | - */ |
|
425 | - protected function _get_contexts_for_message_types_dropdown_filter() |
|
426 | - { |
|
427 | - $context_options = array(); |
|
428 | - $active_messages_grouped_by_context = EEM_Message::instance()->get_all(array('group_by' => 'MSG_context')); |
|
429 | - |
|
430 | - // setup array of context options |
|
431 | - foreach ($active_messages_grouped_by_context as $active_message) { |
|
432 | - if ($active_message instanceof EE_Message) { |
|
433 | - $message_type = $active_message->message_type_object(); |
|
434 | - if ($message_type instanceof EE_message_type) { |
|
435 | - foreach ($message_type->get_contexts() as $context => $context_details) { |
|
436 | - if (isset($context_details['label'])) { |
|
437 | - $context_options[ $context ] = $context_details['label']; |
|
438 | - } |
|
439 | - } |
|
440 | - } |
|
441 | - } |
|
442 | - } |
|
443 | - return $this->get_admin_page()->get_contexts_for_message_types_select_input($context_options); |
|
444 | - } |
|
15 | + /** |
|
16 | + * @return Messages_Admin_Page |
|
17 | + */ |
|
18 | + public function get_admin_page() |
|
19 | + { |
|
20 | + return $this->_admin_page; |
|
21 | + } |
|
22 | + |
|
23 | + |
|
24 | + protected function _setup_data() |
|
25 | + { |
|
26 | + $this->_data = $this->_get_messages($this->_per_page, $this->_view); |
|
27 | + $this->_all_data_count = $this->_get_messages($this->_per_page, $this->_view, true); |
|
28 | + } |
|
29 | + |
|
30 | + |
|
31 | + protected function _set_properties() |
|
32 | + { |
|
33 | + $this->_wp_list_args = array( |
|
34 | + 'singular' => __('Message', 'event_espresso'), |
|
35 | + 'plural' => __('Messages', 'event_espresso'), |
|
36 | + 'ajax' => true, |
|
37 | + 'screen' => $this->get_admin_page()->get_current_screen()->id, |
|
38 | + ); |
|
39 | + |
|
40 | + $this->_columns = array( |
|
41 | + 'cb' => '<input type="checkbox" />', |
|
42 | + 'to' => __('To', 'event_espresso'), |
|
43 | + 'from' => __('From', 'event_espresso'), |
|
44 | + 'messenger' => __('Messenger', 'event_espresso'), |
|
45 | + 'message_type' => __('Message Type', 'event_espresso'), |
|
46 | + 'context' => __('Context', 'event_espresso'), |
|
47 | + 'modified' => __('Modified', 'event_espresso'), |
|
48 | + 'action' => __('Actions', 'event_espresso'), |
|
49 | + 'msg_id' => __('ID', 'event_espresso'), |
|
50 | + ); |
|
51 | + |
|
52 | + $this->_sortable_columns = array( |
|
53 | + 'modified' => array('MSG_modified' => true), |
|
54 | + 'message_type' => array('MSG_message_type' => false), |
|
55 | + 'messenger' => array('MSG_messenger' => false), |
|
56 | + 'to' => array('MSG_to' => false), |
|
57 | + 'from' => array('MSG_from' => false), |
|
58 | + 'context' => array('MSG_context' => false), |
|
59 | + 'msg_id' => array('MSG_ID', false), |
|
60 | + ); |
|
61 | + |
|
62 | + $this->_primary_column = 'to'; |
|
63 | + |
|
64 | + $this->_hidden_columns = array( |
|
65 | + 'msg_id', |
|
66 | + ); |
|
67 | + } |
|
68 | + |
|
69 | + |
|
70 | + /** |
|
71 | + * This simply sets up the row class for the table rows. |
|
72 | + * Allows for easier overriding of child methods for setting up sorting. |
|
73 | + * |
|
74 | + * @param object $item the current item |
|
75 | + * @return string |
|
76 | + */ |
|
77 | + protected function _get_row_class($item) |
|
78 | + { |
|
79 | + $class = parent::_get_row_class($item); |
|
80 | + // add status class |
|
81 | + $class .= ' ee-status-strip msg-status-' . $item->STS_ID(); |
|
82 | + if ($this->_has_checkbox_column) { |
|
83 | + $class .= ' has-checkbox-column'; |
|
84 | + } |
|
85 | + return $class; |
|
86 | + } |
|
87 | + |
|
88 | + |
|
89 | + /** |
|
90 | + * _get_table_filters |
|
91 | + * We use this to assemble and return any filters that are associated with this table that help further refine what |
|
92 | + * get's shown in the table. |
|
93 | + * |
|
94 | + * @abstract |
|
95 | + * @access protected |
|
96 | + * @return string |
|
97 | + * @throws \EE_Error |
|
98 | + */ |
|
99 | + protected function _get_table_filters() |
|
100 | + { |
|
101 | + $filters = array(); |
|
102 | + |
|
103 | + // get select_inputs |
|
104 | + $select_inputs = array( |
|
105 | + $this->_get_messengers_dropdown_filter(), |
|
106 | + $this->_get_message_types_dropdown_filter(), |
|
107 | + $this->_get_contexts_for_message_types_dropdown_filter(), |
|
108 | + ); |
|
109 | + |
|
110 | + // set filters to select inputs if they aren't empty |
|
111 | + foreach ($select_inputs as $select_input) { |
|
112 | + if ($select_input) { |
|
113 | + $filters[] = $select_input; |
|
114 | + } |
|
115 | + } |
|
116 | + return $filters; |
|
117 | + } |
|
118 | + |
|
119 | + |
|
120 | + protected function _add_view_counts() |
|
121 | + { |
|
122 | + foreach ($this->_views as $view => $args) { |
|
123 | + $this->_views[ $view ]['count'] = $this->_get_messages($this->_per_page, $view, true, true); |
|
124 | + } |
|
125 | + } |
|
126 | + |
|
127 | + |
|
128 | + /** |
|
129 | + * @param EE_Message $message |
|
130 | + * @return string checkbox |
|
131 | + * @throws \EE_Error |
|
132 | + */ |
|
133 | + public function column_cb($message) |
|
134 | + { |
|
135 | + return sprintf('<input type="checkbox" name="MSG_ID[%s]" value="1" />', $message->ID()); |
|
136 | + } |
|
137 | + |
|
138 | + |
|
139 | + /** |
|
140 | + * @param EE_Message $message |
|
141 | + * @return string |
|
142 | + * @throws \EE_Error |
|
143 | + */ |
|
144 | + public function column_msg_id(EE_Message $message) |
|
145 | + { |
|
146 | + return $message->ID(); |
|
147 | + } |
|
148 | + |
|
149 | + |
|
150 | + /** |
|
151 | + * @param EE_Message $message |
|
152 | + * @return string The recipient of the message |
|
153 | + * @throws \EE_Error |
|
154 | + */ |
|
155 | + public function column_to(EE_Message $message) |
|
156 | + { |
|
157 | + EE_Registry::instance()->load_helper('URL'); |
|
158 | + $actions = array(); |
|
159 | + $actions['delete'] = '<a href="' |
|
160 | + . EEH_URL::add_query_args_and_nonce( |
|
161 | + array( |
|
162 | + 'page' => 'espresso_messages', |
|
163 | + 'action' => 'delete_ee_message', |
|
164 | + 'MSG_ID' => $message->ID(), |
|
165 | + ), |
|
166 | + admin_url('admin.php') |
|
167 | + ) |
|
168 | + . '">' . __('Delete', 'event_espresso') . '</a>'; |
|
169 | + return esc_html($message->to()) . $this->row_actions($actions); |
|
170 | + } |
|
171 | + |
|
172 | + |
|
173 | + /** |
|
174 | + * @param EE_Message $message |
|
175 | + * @return string The sender of the message |
|
176 | + */ |
|
177 | + public function column_from(EE_Message $message) |
|
178 | + { |
|
179 | + return esc_html($message->from()); |
|
180 | + } |
|
181 | + |
|
182 | + |
|
183 | + /** |
|
184 | + * @param EE_Message $message |
|
185 | + * @return string The messenger used to send the message. |
|
186 | + */ |
|
187 | + public function column_messenger(EE_Message $message) |
|
188 | + { |
|
189 | + return ucwords($message->messenger_label()); |
|
190 | + } |
|
191 | + |
|
192 | + |
|
193 | + /** |
|
194 | + * @param EE_Message $message |
|
195 | + * @return string The message type used to generate the message. |
|
196 | + */ |
|
197 | + public function column_message_type(EE_Message $message) |
|
198 | + { |
|
199 | + return ucwords($message->message_type_label()); |
|
200 | + } |
|
201 | + |
|
202 | + |
|
203 | + /** |
|
204 | + * @param EE_Message $message |
|
205 | + * @return string The context the message was generated for. |
|
206 | + */ |
|
207 | + public function column_context(EE_Message $message) |
|
208 | + { |
|
209 | + return $message->context_label(); |
|
210 | + } |
|
211 | + |
|
212 | + |
|
213 | + /** |
|
214 | + * @param EE_Message $message |
|
215 | + * @return string The timestamp when this message was last modified. |
|
216 | + */ |
|
217 | + public function column_modified(EE_Message $message) |
|
218 | + { |
|
219 | + return $message->modified(); |
|
220 | + } |
|
221 | + |
|
222 | + |
|
223 | + /** |
|
224 | + * @param EE_Message $message |
|
225 | + * @return string Actions that can be done on the current message. |
|
226 | + */ |
|
227 | + public function column_action(EE_Message $message) |
|
228 | + { |
|
229 | + EE_Registry::instance()->load_helper('MSG_Template'); |
|
230 | + $action_links = array( |
|
231 | + 'view' => EEH_MSG_Template::get_message_action_link('view', $message), |
|
232 | + 'error' => EEH_MSG_Template::get_message_action_link('error', $message), |
|
233 | + 'generate_now' => EEH_MSG_Template::get_message_action_link('generate_now', $message), |
|
234 | + 'send_now' => EEH_MSG_Template::get_message_action_link('send_now', $message), |
|
235 | + 'queue_for_resending' => EEH_MSG_Template::get_message_action_link('queue_for_resending', $message), |
|
236 | + 'view_transaction' => EEH_MSG_Template::get_message_action_link('view_transaction', $message), |
|
237 | + ); |
|
238 | + $content = ''; |
|
239 | + switch ($message->STS_ID()) { |
|
240 | + case EEM_Message::status_sent: |
|
241 | + $content = $action_links['view'] . $action_links['queue_for_resending'] . $action_links['view_transaction']; |
|
242 | + break; |
|
243 | + case EEM_Message::status_resend: |
|
244 | + $content = $action_links['view'] . $action_links['send_now'] . $action_links['view_transaction']; |
|
245 | + break; |
|
246 | + case EEM_Message::status_retry: |
|
247 | + $content = $action_links['view'] . $action_links['send_now'] . $action_links['error'] . $action_links['view_transaction']; |
|
248 | + break; |
|
249 | + case EEM_Message::status_failed: |
|
250 | + case EEM_Message::status_debug_only: |
|
251 | + $content = $action_links['error'] . $action_links['view_transaction']; |
|
252 | + break; |
|
253 | + case EEM_Message::status_idle: |
|
254 | + $content = $action_links['view'] . $action_links['send_now'] . $action_links['view_transaction']; |
|
255 | + break; |
|
256 | + case EEM_Message::status_incomplete: |
|
257 | + $content = $action_links['generate_now'] . $action_links['view_transaction']; |
|
258 | + break; |
|
259 | + } |
|
260 | + return $content; |
|
261 | + } |
|
262 | + |
|
263 | + |
|
264 | + /** |
|
265 | + * Retrieve the EE_Message objects for the list table. |
|
266 | + * |
|
267 | + * @param int $perpage The number of items per page |
|
268 | + * @param string $view The view items are being retrieved for |
|
269 | + * @param bool $count Whether to just return a count or not. |
|
270 | + * @param bool $all Disregard any paging info (no limit on data returned). |
|
271 | + * @return int|EE_Message[] |
|
272 | + * @throws \EE_Error |
|
273 | + */ |
|
274 | + protected function _get_messages($perpage = 10, $view = 'all', $count = false, $all = false) |
|
275 | + { |
|
276 | + |
|
277 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) |
|
278 | + ? $this->_req_data['paged'] |
|
279 | + : 1; |
|
280 | + |
|
281 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) |
|
282 | + ? $this->_req_data['perpage'] |
|
283 | + : $perpage; |
|
284 | + |
|
285 | + $offset = ($current_page - 1) * $per_page; |
|
286 | + $limit = $all || $count ? null : array($offset, $per_page); |
|
287 | + $query_params = array( |
|
288 | + 'order_by' => empty($this->_req_data['orderby']) ? 'MSG_modified' : $this->_req_data['orderby'], |
|
289 | + 'order' => empty($this->_req_data['order']) ? 'DESC' : $this->_req_data['order'], |
|
290 | + 'limit' => $limit, |
|
291 | + ); |
|
292 | + |
|
293 | + /** |
|
294 | + * Any filters coming in from other routes? |
|
295 | + */ |
|
296 | + if (isset($this->_req_data['filterby'])) { |
|
297 | + $query_params = array_merge($query_params, EEM_Message::instance()->filter_by_query_params()); |
|
298 | + if (! $count) { |
|
299 | + $query_params['group_by'] = 'MSG_ID'; |
|
300 | + } |
|
301 | + } |
|
302 | + |
|
303 | + // view conditionals |
|
304 | + if ($view !== 'all' && $count && $all) { |
|
305 | + $query_params[0]['AND*view_conditional'] = array( |
|
306 | + 'STS_ID' => strtoupper($view), |
|
307 | + ); |
|
308 | + } |
|
309 | + |
|
310 | + if (! $all && ! empty($this->_req_data['status']) && $this->_req_data['status'] !== 'all') { |
|
311 | + $query_params[0]['AND*view_conditional'] = $this->_req_data === EEM_Message::status_failed |
|
312 | + ? array( |
|
313 | + 'STS_ID' => array( |
|
314 | + 'IN', |
|
315 | + array(EEM_Message::status_failed, EEM_Message::status_messenger_executing), |
|
316 | + ), |
|
317 | + ) |
|
318 | + : array('STS_ID' => strtoupper($this->_req_data['status'])); |
|
319 | + } |
|
320 | + |
|
321 | + if (! $all && ! empty($this->_req_data['s'])) { |
|
322 | + $search_string = '%' . $this->_req_data['s'] . '%'; |
|
323 | + $query_params[0]['OR'] = array( |
|
324 | + 'MSG_to' => array('LIKE', $search_string), |
|
325 | + 'MSG_from' => array('LIKE', $search_string), |
|
326 | + 'MSG_subject' => array('LIKE', $search_string), |
|
327 | + 'MSG_content' => array('LIKE', $search_string), |
|
328 | + ); |
|
329 | + } |
|
330 | + |
|
331 | + // account for debug only status. We don't show Messages with the EEM_Message::status_debug_only to clients when |
|
332 | + // the messages system is in debug mode. |
|
333 | + // Note: for backward compat with previous iterations, this is necessary because there may be EEM_Message::status_debug_only |
|
334 | + // messages in the database. |
|
335 | + if (! EEM_Message::debug()) { |
|
336 | + $query_params[0]['AND*debug_only_conditional'] = array( |
|
337 | + 'STS_ID' => array('!=', EEM_Message::status_debug_only), |
|
338 | + ); |
|
339 | + } |
|
340 | + |
|
341 | + // account for filters |
|
342 | + if (! $all |
|
343 | + && isset($this->_req_data['ee_messenger_filter_by']) |
|
344 | + && $this->_req_data['ee_messenger_filter_by'] !== 'none_selected' |
|
345 | + ) { |
|
346 | + $query_params[0]['AND*messenger_filter'] = array( |
|
347 | + 'MSG_messenger' => $this->_req_data['ee_messenger_filter_by'], |
|
348 | + ); |
|
349 | + } |
|
350 | + if (! $all |
|
351 | + && ! empty($this->_req_data['ee_message_type_filter_by']) |
|
352 | + && $this->_req_data['ee_message_type_filter_by'] !== 'none_selected' |
|
353 | + ) { |
|
354 | + $query_params[0]['AND*message_type_filter'] = array( |
|
355 | + 'MSG_message_type' => $this->_req_data['ee_message_type_filter_by'], |
|
356 | + ); |
|
357 | + } |
|
358 | + |
|
359 | + if (! $all |
|
360 | + && ! empty($this->_req_data['ee_context_filter_by']) |
|
361 | + && $this->_req_data['ee_context_filter_by'] !== 'none_selected' |
|
362 | + ) { |
|
363 | + $query_params[0]['AND*context_filter'] = array( |
|
364 | + 'MSG_context' => array('IN', explode(',', $this->_req_data['ee_context_filter_by'])), |
|
365 | + ); |
|
366 | + } |
|
367 | + |
|
368 | + return $count |
|
369 | + /** @type int */ |
|
370 | + ? EEM_Message::instance()->count($query_params, null, true) |
|
371 | + /** @type EE_Message[] */ |
|
372 | + : EEM_Message::instance()->get_all($query_params); |
|
373 | + } |
|
374 | + |
|
375 | + |
|
376 | + /** |
|
377 | + * Generate dropdown filter select input for messengers. |
|
378 | + * |
|
379 | + * @return string |
|
380 | + */ |
|
381 | + protected function _get_messengers_dropdown_filter() |
|
382 | + { |
|
383 | + $messenger_options = array(); |
|
384 | + $active_messages_grouped_by_messenger = EEM_Message::instance()->get_all(array('group_by' => 'MSG_messenger')); |
|
385 | + |
|
386 | + // setup array of messenger options |
|
387 | + foreach ($active_messages_grouped_by_messenger as $active_message) { |
|
388 | + if ($active_message instanceof EE_Message) { |
|
389 | + $messenger_options[ $active_message->messenger() ] = ucwords($active_message->messenger_label()); |
|
390 | + } |
|
391 | + } |
|
392 | + return $this->get_admin_page()->get_messengers_select_input($messenger_options); |
|
393 | + } |
|
394 | + |
|
395 | + |
|
396 | + /** |
|
397 | + * Generate dropdown filter select input for message types |
|
398 | + * |
|
399 | + * @return string |
|
400 | + */ |
|
401 | + protected function _get_message_types_dropdown_filter() |
|
402 | + { |
|
403 | + $message_type_options = array(); |
|
404 | + $active_messages_grouped_by_message_type = EEM_Message::instance()->get_all( |
|
405 | + array('group_by' => 'MSG_message_type') |
|
406 | + ); |
|
407 | + |
|
408 | + // setup array of message type options |
|
409 | + foreach ($active_messages_grouped_by_message_type as $active_message) { |
|
410 | + if ($active_message instanceof EE_Message) { |
|
411 | + $message_type_options[ $active_message->message_type() ] = ucwords( |
|
412 | + $active_message->message_type_label() |
|
413 | + ); |
|
414 | + } |
|
415 | + } |
|
416 | + return $this->get_admin_page()->get_message_types_select_input($message_type_options); |
|
417 | + } |
|
418 | + |
|
419 | + |
|
420 | + /** |
|
421 | + * Generate dropdown filter select input for message type contexts |
|
422 | + * |
|
423 | + * @return string |
|
424 | + */ |
|
425 | + protected function _get_contexts_for_message_types_dropdown_filter() |
|
426 | + { |
|
427 | + $context_options = array(); |
|
428 | + $active_messages_grouped_by_context = EEM_Message::instance()->get_all(array('group_by' => 'MSG_context')); |
|
429 | + |
|
430 | + // setup array of context options |
|
431 | + foreach ($active_messages_grouped_by_context as $active_message) { |
|
432 | + if ($active_message instanceof EE_Message) { |
|
433 | + $message_type = $active_message->message_type_object(); |
|
434 | + if ($message_type instanceof EE_message_type) { |
|
435 | + foreach ($message_type->get_contexts() as $context => $context_details) { |
|
436 | + if (isset($context_details['label'])) { |
|
437 | + $context_options[ $context ] = $context_details['label']; |
|
438 | + } |
|
439 | + } |
|
440 | + } |
|
441 | + } |
|
442 | + } |
|
443 | + return $this->get_admin_page()->get_contexts_for_message_types_select_input($context_options); |
|
444 | + } |
|
445 | 445 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $class = parent::_get_row_class($item); |
80 | 80 | // add status class |
81 | - $class .= ' ee-status-strip msg-status-' . $item->STS_ID(); |
|
81 | + $class .= ' ee-status-strip msg-status-'.$item->STS_ID(); |
|
82 | 82 | if ($this->_has_checkbox_column) { |
83 | 83 | $class .= ' has-checkbox-column'; |
84 | 84 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | protected function _add_view_counts() |
121 | 121 | { |
122 | 122 | foreach ($this->_views as $view => $args) { |
123 | - $this->_views[ $view ]['count'] = $this->_get_messages($this->_per_page, $view, true, true); |
|
123 | + $this->_views[$view]['count'] = $this->_get_messages($this->_per_page, $view, true, true); |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | ), |
166 | 166 | admin_url('admin.php') |
167 | 167 | ) |
168 | - . '">' . __('Delete', 'event_espresso') . '</a>'; |
|
169 | - return esc_html($message->to()) . $this->row_actions($actions); |
|
168 | + . '">'.__('Delete', 'event_espresso').'</a>'; |
|
169 | + return esc_html($message->to()).$this->row_actions($actions); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
@@ -238,23 +238,23 @@ discard block |
||
238 | 238 | $content = ''; |
239 | 239 | switch ($message->STS_ID()) { |
240 | 240 | case EEM_Message::status_sent: |
241 | - $content = $action_links['view'] . $action_links['queue_for_resending'] . $action_links['view_transaction']; |
|
241 | + $content = $action_links['view'].$action_links['queue_for_resending'].$action_links['view_transaction']; |
|
242 | 242 | break; |
243 | 243 | case EEM_Message::status_resend: |
244 | - $content = $action_links['view'] . $action_links['send_now'] . $action_links['view_transaction']; |
|
244 | + $content = $action_links['view'].$action_links['send_now'].$action_links['view_transaction']; |
|
245 | 245 | break; |
246 | 246 | case EEM_Message::status_retry: |
247 | - $content = $action_links['view'] . $action_links['send_now'] . $action_links['error'] . $action_links['view_transaction']; |
|
247 | + $content = $action_links['view'].$action_links['send_now'].$action_links['error'].$action_links['view_transaction']; |
|
248 | 248 | break; |
249 | 249 | case EEM_Message::status_failed: |
250 | 250 | case EEM_Message::status_debug_only: |
251 | - $content = $action_links['error'] . $action_links['view_transaction']; |
|
251 | + $content = $action_links['error'].$action_links['view_transaction']; |
|
252 | 252 | break; |
253 | 253 | case EEM_Message::status_idle: |
254 | - $content = $action_links['view'] . $action_links['send_now'] . $action_links['view_transaction']; |
|
254 | + $content = $action_links['view'].$action_links['send_now'].$action_links['view_transaction']; |
|
255 | 255 | break; |
256 | 256 | case EEM_Message::status_incomplete: |
257 | - $content = $action_links['generate_now'] . $action_links['view_transaction']; |
|
257 | + $content = $action_links['generate_now'].$action_links['view_transaction']; |
|
258 | 258 | break; |
259 | 259 | } |
260 | 260 | return $content; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | */ |
296 | 296 | if (isset($this->_req_data['filterby'])) { |
297 | 297 | $query_params = array_merge($query_params, EEM_Message::instance()->filter_by_query_params()); |
298 | - if (! $count) { |
|
298 | + if ( ! $count) { |
|
299 | 299 | $query_params['group_by'] = 'MSG_ID'; |
300 | 300 | } |
301 | 301 | } |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | ); |
308 | 308 | } |
309 | 309 | |
310 | - if (! $all && ! empty($this->_req_data['status']) && $this->_req_data['status'] !== 'all') { |
|
310 | + if ( ! $all && ! empty($this->_req_data['status']) && $this->_req_data['status'] !== 'all') { |
|
311 | 311 | $query_params[0]['AND*view_conditional'] = $this->_req_data === EEM_Message::status_failed |
312 | 312 | ? array( |
313 | 313 | 'STS_ID' => array( |
@@ -318,8 +318,8 @@ discard block |
||
318 | 318 | : array('STS_ID' => strtoupper($this->_req_data['status'])); |
319 | 319 | } |
320 | 320 | |
321 | - if (! $all && ! empty($this->_req_data['s'])) { |
|
322 | - $search_string = '%' . $this->_req_data['s'] . '%'; |
|
321 | + if ( ! $all && ! empty($this->_req_data['s'])) { |
|
322 | + $search_string = '%'.$this->_req_data['s'].'%'; |
|
323 | 323 | $query_params[0]['OR'] = array( |
324 | 324 | 'MSG_to' => array('LIKE', $search_string), |
325 | 325 | 'MSG_from' => array('LIKE', $search_string), |
@@ -332,14 +332,14 @@ discard block |
||
332 | 332 | // the messages system is in debug mode. |
333 | 333 | // Note: for backward compat with previous iterations, this is necessary because there may be EEM_Message::status_debug_only |
334 | 334 | // messages in the database. |
335 | - if (! EEM_Message::debug()) { |
|
335 | + if ( ! EEM_Message::debug()) { |
|
336 | 336 | $query_params[0]['AND*debug_only_conditional'] = array( |
337 | 337 | 'STS_ID' => array('!=', EEM_Message::status_debug_only), |
338 | 338 | ); |
339 | 339 | } |
340 | 340 | |
341 | 341 | // account for filters |
342 | - if (! $all |
|
342 | + if ( ! $all |
|
343 | 343 | && isset($this->_req_data['ee_messenger_filter_by']) |
344 | 344 | && $this->_req_data['ee_messenger_filter_by'] !== 'none_selected' |
345 | 345 | ) { |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | 'MSG_messenger' => $this->_req_data['ee_messenger_filter_by'], |
348 | 348 | ); |
349 | 349 | } |
350 | - if (! $all |
|
350 | + if ( ! $all |
|
351 | 351 | && ! empty($this->_req_data['ee_message_type_filter_by']) |
352 | 352 | && $this->_req_data['ee_message_type_filter_by'] !== 'none_selected' |
353 | 353 | ) { |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | ); |
357 | 357 | } |
358 | 358 | |
359 | - if (! $all |
|
359 | + if ( ! $all |
|
360 | 360 | && ! empty($this->_req_data['ee_context_filter_by']) |
361 | 361 | && $this->_req_data['ee_context_filter_by'] !== 'none_selected' |
362 | 362 | ) { |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | // setup array of messenger options |
387 | 387 | foreach ($active_messages_grouped_by_messenger as $active_message) { |
388 | 388 | if ($active_message instanceof EE_Message) { |
389 | - $messenger_options[ $active_message->messenger() ] = ucwords($active_message->messenger_label()); |
|
389 | + $messenger_options[$active_message->messenger()] = ucwords($active_message->messenger_label()); |
|
390 | 390 | } |
391 | 391 | } |
392 | 392 | return $this->get_admin_page()->get_messengers_select_input($messenger_options); |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | // setup array of message type options |
409 | 409 | foreach ($active_messages_grouped_by_message_type as $active_message) { |
410 | 410 | if ($active_message instanceof EE_Message) { |
411 | - $message_type_options[ $active_message->message_type() ] = ucwords( |
|
411 | + $message_type_options[$active_message->message_type()] = ucwords( |
|
412 | 412 | $active_message->message_type_label() |
413 | 413 | ); |
414 | 414 | } |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | if ($message_type instanceof EE_message_type) { |
435 | 435 | foreach ($message_type->get_contexts() as $context => $context_details) { |
436 | 436 | if (isset($context_details['label'])) { |
437 | - $context_options[ $context ] = $context_details['label']; |
|
437 | + $context_options[$context] = $context_details['label']; |
|
438 | 438 | } |
439 | 439 | } |
440 | 440 | } |
@@ -247,6 +247,7 @@ discard block |
||
247 | 247 | * @access public |
248 | 248 | * @param mixed boolean|string $join_terms pass TRUE or term string, doesn't really matter since this value |
249 | 249 | * doesn't really get used for anything yet |
250 | + * @param string $join_terms |
|
250 | 251 | * @return string |
251 | 252 | */ |
252 | 253 | public static function posts_join_sql_for_terms($join_terms = null) |
@@ -422,7 +423,7 @@ discard block |
||
422 | 423 | * or else some of the table references below will result in MySQL errors |
423 | 424 | * |
424 | 425 | * @access public |
425 | - * @param boolean $orderby_params |
|
426 | + * @param string[] $orderby_params |
|
426 | 427 | * @return string |
427 | 428 | */ |
428 | 429 | public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC') |
@@ -535,7 +536,7 @@ discard block |
||
535 | 536 | * |
536 | 537 | * @access public |
537 | 538 | * @param string $content |
538 | - * @return void |
|
539 | + * @return string |
|
539 | 540 | */ |
540 | 541 | public function event_details($content) |
541 | 542 | { |
@@ -552,7 +553,7 @@ discard block |
||
552 | 553 | * |
553 | 554 | * @access public |
554 | 555 | * @param string $content |
555 | - * @return void |
|
556 | + * @return string |
|
556 | 557 | */ |
557 | 558 | public function event_tickets($content) |
558 | 559 | { |
@@ -569,7 +570,7 @@ discard block |
||
569 | 570 | * |
570 | 571 | * @access public |
571 | 572 | * @param string $content |
572 | - * @return void |
|
573 | + * @return string |
|
573 | 574 | */ |
574 | 575 | public function event_datetimes($content) |
575 | 576 | { |
@@ -586,7 +587,7 @@ discard block |
||
586 | 587 | * |
587 | 588 | * @access public |
588 | 589 | * @param string $content |
589 | - * @return void |
|
590 | + * @return string |
|
590 | 591 | */ |
591 | 592 | public function event_venues($content) |
592 | 593 | { |
@@ -635,7 +636,7 @@ discard block |
||
635 | 636 | * excerpt_length |
636 | 637 | * |
637 | 638 | * @access public |
638 | - * @return void |
|
639 | + * @return integer|null |
|
639 | 640 | */ |
640 | 641 | public function excerpt_length($length) |
641 | 642 | { |
@@ -665,7 +666,7 @@ discard block |
||
665 | 666 | * excerpt_more |
666 | 667 | * |
667 | 668 | * @access public |
668 | - * @return void |
|
669 | + * @return string |
|
669 | 670 | */ |
670 | 671 | public function excerpt_more($more) |
671 | 672 | { |
@@ -866,7 +867,7 @@ discard block |
||
866 | 867 | * get_template_part |
867 | 868 | * |
868 | 869 | * @access public |
869 | - * @return void |
|
870 | + * @return string|null |
|
870 | 871 | */ |
871 | 872 | public static function get_template_part() |
872 | 873 | { |
@@ -910,7 +911,7 @@ discard block |
||
910 | 911 | * event_list_css |
911 | 912 | * |
912 | 913 | * @access public |
913 | - * @return void |
|
914 | + * @return string |
|
914 | 915 | */ |
915 | 916 | public static function event_list_css($extra_class = '') |
916 | 917 | { |
@@ -946,7 +947,7 @@ discard block |
||
946 | 947 | * display_description |
947 | 948 | * |
948 | 949 | * @access public |
949 | - * @return void |
|
950 | + * @return boolean |
|
950 | 951 | */ |
951 | 952 | public static function display_description($value) |
952 | 953 | { |
@@ -961,7 +962,7 @@ discard block |
||
961 | 962 | * display_venue_details |
962 | 963 | * |
963 | 964 | * @access public |
964 | - * @return void |
|
965 | + * @return boolean |
|
965 | 966 | */ |
966 | 967 | public static function display_venue_details() |
967 | 968 | { |
@@ -977,7 +978,7 @@ discard block |
||
977 | 978 | * display_address |
978 | 979 | * |
979 | 980 | * @access public |
980 | - * @return void |
|
981 | + * @return boolean |
|
981 | 982 | */ |
982 | 983 | public static function display_address() |
983 | 984 | { |
@@ -993,7 +994,7 @@ discard block |
||
993 | 994 | * pagination |
994 | 995 | * |
995 | 996 | * @access public |
996 | - * @return void |
|
997 | + * @return string |
|
997 | 998 | */ |
998 | 999 | public static function pagination() |
999 | 1000 | { |
@@ -12,1025 +12,1025 @@ |
||
12 | 12 | { |
13 | 13 | |
14 | 14 | |
15 | - /** |
|
16 | - * @return EED_Events_Archive_Filters |
|
17 | - */ |
|
18 | - public static function instance() |
|
19 | - { |
|
20 | - return parent::get_instance(__CLASS__); |
|
21 | - } |
|
22 | - |
|
23 | - |
|
24 | - /** |
|
25 | - * Start Date |
|
26 | - * |
|
27 | - * @var $_elf_month |
|
28 | - * @access protected |
|
29 | - */ |
|
30 | - protected $_elf_month = null; |
|
31 | - |
|
32 | - |
|
33 | - /** |
|
34 | - * Category |
|
35 | - * |
|
36 | - * @var $_elf_category |
|
37 | - * @access protected |
|
38 | - */ |
|
39 | - protected $_elf_category = null; |
|
40 | - |
|
41 | - |
|
42 | - /** |
|
43 | - * whether to display expired events in the event list |
|
44 | - * |
|
45 | - * @var $_show_expired |
|
46 | - * @access protected |
|
47 | - */ |
|
48 | - protected $_show_expired = null; |
|
49 | - |
|
50 | - |
|
51 | - /** |
|
52 | - * whether to display the event list as a grid or list |
|
53 | - * |
|
54 | - * @var $_type |
|
55 | - * @access protected |
|
56 | - */ |
|
57 | - protected static $_type = null; |
|
58 | - |
|
59 | - |
|
60 | - /** |
|
61 | - * array of existing event list views |
|
62 | - * |
|
63 | - * @var $_types |
|
64 | - * @access protected |
|
65 | - */ |
|
66 | - protected static $_types = array('grid', 'text', 'dates'); |
|
67 | - |
|
68 | - |
|
69 | - |
|
70 | - /** |
|
71 | - * set_hooks - for hooking into EE Core, other modules, etc |
|
72 | - * |
|
73 | - * @access public |
|
74 | - * @return void |
|
75 | - */ |
|
76 | - public static function set_hooks() |
|
77 | - { |
|
78 | - } |
|
79 | - |
|
80 | - /** |
|
81 | - * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
|
82 | - * |
|
83 | - * @access public |
|
84 | - * @return void |
|
85 | - */ |
|
86 | - public static function set_hooks_admin() |
|
87 | - { |
|
88 | - } |
|
89 | - |
|
90 | - |
|
91 | - /** |
|
92 | - * set_definitions |
|
93 | - * |
|
94 | - * @access public |
|
95 | - * @return void |
|
96 | - */ |
|
97 | - public static function set_definitions() |
|
98 | - { |
|
99 | - } |
|
100 | - |
|
101 | - |
|
102 | - /** |
|
103 | - * run - initial module setup |
|
104 | - * |
|
105 | - * @access public |
|
106 | - * @return void |
|
107 | - */ |
|
108 | - public function run($WP) |
|
109 | - { |
|
110 | - } |
|
111 | - |
|
112 | - |
|
113 | - /** |
|
114 | - * event_list |
|
115 | - * |
|
116 | - * @access public |
|
117 | - * @return void |
|
118 | - */ |
|
119 | - public function event_list() |
|
120 | - { |
|
121 | - // load other required components |
|
122 | - $this->_load_assests(); |
|
123 | - } |
|
124 | - |
|
125 | - |
|
126 | - /** |
|
127 | - * _filter_query_parts |
|
128 | - * |
|
129 | - * @access public |
|
130 | - * @return void |
|
131 | - */ |
|
132 | - private function _filter_query_parts() |
|
133 | - { |
|
134 | - // build event list query |
|
135 | - add_filter('posts_join', array($this, 'posts_join'), 1, 2); |
|
136 | - add_filter('posts_where', array($this, 'posts_where'), 1, 2); |
|
137 | - add_filter('posts_orderby', array($this, 'posts_orderby'), 1, 2); |
|
138 | - } |
|
139 | - |
|
140 | - /** |
|
141 | - * _type - the type of event list : grid, text, dates |
|
142 | - * |
|
143 | - * @access public |
|
144 | - * @return string |
|
145 | - */ |
|
146 | - public static function set_type() |
|
147 | - { |
|
148 | - do_action('AHEE__EED_Events_Archive_Filters__before_set_type'); |
|
149 | - EED_Events_Archive_Filters::$_types = apply_filters( |
|
150 | - 'EED_Events_Archive_Filters__set_type__types', |
|
151 | - EED_Events_Archive_Filters::$_types |
|
152 | - ); |
|
153 | - $view = isset(EE_Registry::instance()->CFG->EED_Events_Archive_Filters['default_type']) ? EE_Registry::instance( |
|
154 | - )->CFG->EED_Events_Archive_Filters['default_type'] : 'grid'; |
|
155 | - $elf_type = EE_Registry::instance()->REQ->is_set('elf_type') ? sanitize_text_field( |
|
156 | - EE_Registry::instance()->REQ->get('elf_type') |
|
157 | - ) : ''; |
|
158 | - $view = ! empty($elf_type) ? $elf_type : $view; |
|
159 | - $view = apply_filters('EED_Events_Archive_Filters__set_type__type', $view); |
|
160 | - if (! empty($view) && in_array($view, EED_Events_Archive_Filters::$_types)) { |
|
161 | - self::$_type = $view; |
|
162 | - } |
|
163 | - } |
|
164 | - |
|
165 | - /** |
|
166 | - * _show_expired |
|
167 | - * |
|
168 | - * @access private |
|
169 | - * @param boolean $req_only if TRUE, then ignore defaults and only return $_POST value |
|
170 | - * @return boolean |
|
171 | - */ |
|
172 | - private static function _show_expired($req_only = false) |
|
173 | - { |
|
174 | - // get default value for "display_expired_events" as set in the EE General Settings > Templates > Event Listings |
|
175 | - $show_expired = ! $req_only && isset( |
|
176 | - EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events'] |
|
177 | - ) ? EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events'] : false; |
|
178 | - // override default expired option if set via filter |
|
179 | - $show_expired = EE_Registry::instance()->REQ->is_set('elf_expired_chk') ? absint( |
|
180 | - EE_Registry::instance()->REQ->get('elf_expired_chk') |
|
181 | - ) : $show_expired; |
|
182 | - return $show_expired ? true : false; |
|
183 | - } |
|
184 | - |
|
185 | - /** |
|
186 | - * _event_category_slug |
|
187 | - * |
|
188 | - * @access private |
|
189 | - * @return string |
|
190 | - */ |
|
191 | - private static function _event_category_slug() |
|
192 | - { |
|
193 | - return EE_Registry::instance()->REQ->is_set('elf_category_dd') ? sanitize_text_field( |
|
194 | - EE_Registry::instance()->REQ->get('elf_category_dd') |
|
195 | - ) : ''; |
|
196 | - } |
|
197 | - |
|
198 | - /** |
|
199 | - * _display_month - what month should the event list display events for? |
|
200 | - * |
|
201 | - * @access private |
|
202 | - * @return string |
|
203 | - */ |
|
204 | - private static function _display_month() |
|
205 | - { |
|
206 | - return EE_Registry::instance()->REQ->is_set('elf_month_dd') ? sanitize_text_field( |
|
207 | - EE_Registry::instance()->REQ->get('elf_month_dd') |
|
208 | - ) : ''; |
|
209 | - } |
|
210 | - |
|
211 | - |
|
212 | - /** |
|
213 | - * get_post_data |
|
214 | - * |
|
215 | - * @access public |
|
216 | - * @return void |
|
217 | - */ |
|
218 | - public function get_post_data() |
|
219 | - { |
|
220 | - $this->_elf_month = EED_Events_Archive_Filters::_display_month(); |
|
221 | - $this->_elf_category = EED_Events_Archive_Filters::_event_category_slug(); |
|
222 | - $this->_show_expired = EED_Events_Archive_Filters::_show_expired(true); |
|
223 | - } |
|
224 | - |
|
225 | - |
|
226 | - /** |
|
227 | - * posts_join |
|
228 | - * |
|
229 | - * @access public |
|
230 | - * @return void |
|
231 | - */ |
|
232 | - public function posts_join($SQL, WP_Query $wp_query) |
|
233 | - { |
|
234 | - if (isset($wp_query->query) && isset($wp_query->query['post_type']) && $wp_query->query['post_type'] == 'espresso_events') { |
|
235 | - // Category |
|
236 | - $SQL .= EED_Events_Archive_Filters::posts_join_sql_for_terms( |
|
237 | - EED_Events_Archive_Filters::_event_category_slug() |
|
238 | - ); |
|
239 | - } |
|
240 | - return $SQL; |
|
241 | - } |
|
242 | - |
|
243 | - |
|
244 | - /** |
|
245 | - * posts_join_sql_for_terms |
|
246 | - * |
|
247 | - * @access public |
|
248 | - * @param mixed boolean|string $join_terms pass TRUE or term string, doesn't really matter since this value |
|
249 | - * doesn't really get used for anything yet |
|
250 | - * @return string |
|
251 | - */ |
|
252 | - public static function posts_join_sql_for_terms($join_terms = null) |
|
253 | - { |
|
254 | - $SQL = ''; |
|
255 | - if (! empty($join_terms)) { |
|
256 | - global $wpdb; |
|
257 | - $SQL .= " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)"; |
|
258 | - $SQL .= " LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)"; |
|
259 | - $SQL .= " LEFT JOIN $wpdb->terms ON ($wpdb->terms.term_id = $wpdb->term_taxonomy.term_id) "; |
|
260 | - } |
|
261 | - return $SQL; |
|
262 | - } |
|
263 | - |
|
264 | - |
|
265 | - /** |
|
266 | - * posts_join_for_orderby |
|
267 | - * usage: $SQL .= EED_Events_Archive_Filters::posts_join_for_orderby( $orderby_params ); |
|
268 | - * |
|
269 | - * @access public |
|
270 | - * @param array $orderby_params |
|
271 | - * @return string |
|
272 | - */ |
|
273 | - public static function posts_join_for_orderby($orderby_params = array()) |
|
274 | - { |
|
275 | - global $wpdb; |
|
276 | - $SQL = ''; |
|
277 | - $orderby_params = is_array($orderby_params) ? $orderby_params : array($orderby_params); |
|
278 | - foreach ($orderby_params as $orderby) { |
|
279 | - switch ($orderby) { |
|
280 | - case 'ticket_start': |
|
281 | - case 'ticket_end': |
|
282 | - $SQL .= ' LEFT JOIN ' . EEM_Datetime_Ticket::instance()->table() . ' ON (' |
|
283 | - . EEM_Datetime::instance()->table() . '.DTT_ID = ' |
|
284 | - . EEM_Datetime_Ticket::instance()->table() . '.DTT_ID )'; |
|
285 | - $SQL .= ' LEFT JOIN ' . EEM_Ticket::instance()->table() . ' ON (' |
|
286 | - . EEM_Datetime_Ticket::instance()->table() . '.TKT_ID = ' |
|
287 | - . EEM_Ticket::instance()->table() . '.TKT_ID )'; |
|
288 | - break; |
|
289 | - |
|
290 | - case 'venue_title': |
|
291 | - case 'city': |
|
292 | - $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = ' |
|
293 | - . EEM_Event_Venue::instance()->table() . '.EVT_ID )'; |
|
294 | - $SQL .= ' LEFT JOIN ' . EEM_Venue::instance()->table() . ' ON (' |
|
295 | - . EEM_Event_Venue::instance()->table() . '.VNU_ID = ' |
|
296 | - . EEM_Venue::instance()->table() . '.VNU_ID )'; |
|
297 | - break; |
|
298 | - |
|
299 | - case 'state': |
|
300 | - $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = ' |
|
301 | - . EEM_Event_Venue::instance()->table() . '.EVT_ID )'; |
|
302 | - $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->second_table() . ' ON (' |
|
303 | - . EEM_Event_Venue::instance()->table() . '.VNU_ID = ' |
|
304 | - . EEM_Event_Venue::instance()->second_table() . '.VNU_ID )'; |
|
305 | - break; |
|
306 | - } |
|
307 | - } |
|
308 | - return $SQL; |
|
309 | - } |
|
310 | - |
|
311 | - |
|
312 | - /** |
|
313 | - * posts_where |
|
314 | - * |
|
315 | - * @access public |
|
316 | - * @return void |
|
317 | - */ |
|
318 | - public function posts_where($SQL, WP_Query $wp_query) |
|
319 | - { |
|
320 | - if (isset($wp_query->query_vars) && isset($wp_query->query_vars['post_type']) && $wp_query->query_vars['post_type'] == 'espresso_events') { |
|
321 | - // Show Expired ? |
|
322 | - $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_show_expired( |
|
323 | - EED_Events_Archive_Filters::_show_expired() |
|
324 | - ); |
|
325 | - // Category |
|
326 | - // $elf_category = EED_Events_Archive_Filters::_event_category_slug(); |
|
327 | - $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_category_slug( |
|
328 | - EED_Events_Archive_Filters::_event_category_slug() |
|
329 | - ); |
|
330 | - // Start Date |
|
331 | - // $elf_month = EED_Events_Archive_Filters::_display_month(); |
|
332 | - $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_list_month( |
|
333 | - EED_Events_Archive_Filters::_display_month() |
|
334 | - ); |
|
335 | - } |
|
336 | - return $SQL; |
|
337 | - } |
|
338 | - |
|
339 | - |
|
340 | - /** |
|
341 | - * posts_where_sql_for_show_expired |
|
342 | - * |
|
343 | - * @access public |
|
344 | - * @param boolean $show_expired if TRUE, then displayed past events |
|
345 | - * @return string |
|
346 | - */ |
|
347 | - public static function posts_where_sql_for_show_expired($show_expired = false) |
|
348 | - { |
|
349 | - return ! $show_expired |
|
350 | - ? ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end > "' . date('Y-m-d H:s:i') . '" ' |
|
351 | - : ''; |
|
352 | - } |
|
353 | - |
|
354 | - |
|
355 | - /** |
|
356 | - * posts_where_sql_for_event_category_slug |
|
357 | - * |
|
358 | - * @access public |
|
359 | - * @param boolean $event_category_slug |
|
360 | - * @return string |
|
361 | - */ |
|
362 | - public static function posts_where_sql_for_event_category_slug($event_category_slug = null) |
|
363 | - { |
|
364 | - global $wpdb; |
|
365 | - return ! empty($event_category_slug) ? ' AND ' . $wpdb->terms . '.slug = "' . $event_category_slug . '" ' : ''; |
|
366 | - } |
|
367 | - |
|
368 | - /** |
|
369 | - * posts_where_sql_for_event_list_month |
|
370 | - * |
|
371 | - * @access public |
|
372 | - * @param boolean $month |
|
373 | - * @return string |
|
374 | - */ |
|
375 | - public static function posts_where_sql_for_event_list_month($month = null) |
|
376 | - { |
|
377 | - $SQL = ''; |
|
378 | - if (! empty($month)) { |
|
379 | - // event start date is LESS than the end of the month ( so nothing that doesn't start until next month ) |
|
380 | - $SQL = ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start'; |
|
381 | - $SQL .= ' <= "' . date('Y-m-t 23:59:59', \EEH_DTT_Helper::first_of_month_timestamp($month)) . '"'; |
|
382 | - // event end date is GREATER than the start of the month ( so nothing that ended before this month ) |
|
383 | - $SQL .= ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end'; |
|
384 | - $SQL .= ' >= "' . date('Y-m-d 0:0:00', \EEH_DTT_Helper::first_of_month_timestamp($month)) . '" '; |
|
385 | - } |
|
386 | - return $SQL; |
|
387 | - } |
|
388 | - |
|
389 | - |
|
390 | - /** |
|
391 | - * posts_orderby |
|
392 | - * |
|
393 | - * @access public |
|
394 | - * @return void |
|
395 | - */ |
|
396 | - public function posts_orderby($SQL, WP_Query $wp_query) |
|
397 | - { |
|
398 | - if (isset($wp_query->query) && isset($wp_query->query['post_type']) && $wp_query->query['post_type'] == 'espresso_events') { |
|
399 | - $SQL = EED_Events_Archive_Filters::posts_orderby_sql(array('start_date')); |
|
400 | - } |
|
401 | - return $SQL; |
|
402 | - } |
|
403 | - |
|
404 | - |
|
405 | - /** |
|
406 | - * posts_orderby_sql |
|
407 | - * |
|
408 | - * possible parameters: |
|
409 | - * ID |
|
410 | - * start_date |
|
411 | - * end_date |
|
412 | - * event_name |
|
413 | - * category_slug |
|
414 | - * ticket_start |
|
415 | - * ticket_end |
|
416 | - * venue_title |
|
417 | - * city |
|
418 | - * state |
|
419 | - * |
|
420 | - * **IMPORTANT** |
|
421 | - * make sure to also send the $orderby_params array to the posts_join_for_orderby() method |
|
422 | - * or else some of the table references below will result in MySQL errors |
|
423 | - * |
|
424 | - * @access public |
|
425 | - * @param boolean $orderby_params |
|
426 | - * @return string |
|
427 | - */ |
|
428 | - public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC') |
|
429 | - { |
|
430 | - global $wpdb; |
|
431 | - $SQL = ''; |
|
432 | - $cntr = 1; |
|
433 | - $orderby_params = is_array($orderby_params) ? $orderby_params : array($orderby_params); |
|
434 | - foreach ($orderby_params as $orderby) { |
|
435 | - $glue = $cntr == 1 || $cntr == count($orderby_params) ? ' ' : ', '; |
|
436 | - switch ($orderby) { |
|
437 | - case 'id': |
|
438 | - case 'ID': |
|
439 | - $SQL .= $glue . $wpdb->posts . '.ID ' . $sort; |
|
440 | - break; |
|
441 | - |
|
442 | - case 'start_date': |
|
443 | - $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_start ' . $sort; |
|
444 | - break; |
|
445 | - |
|
446 | - case 'end_date': |
|
447 | - $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_end ' . $sort; |
|
448 | - break; |
|
449 | - |
|
450 | - case 'event_name': |
|
451 | - $SQL .= $glue . $wpdb->posts . '.post_title ' . $sort; |
|
452 | - break; |
|
453 | - |
|
454 | - case 'category_slug': |
|
455 | - $SQL .= $glue . $wpdb->terms . '.slug ' . $sort; |
|
456 | - break; |
|
457 | - |
|
458 | - case 'ticket_start': |
|
459 | - $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_start_date ' . $sort; |
|
460 | - break; |
|
461 | - |
|
462 | - case 'ticket_end': |
|
463 | - $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_end_date ' . $sort; |
|
464 | - break; |
|
465 | - |
|
466 | - case 'venue_title': |
|
467 | - $SQL .= $glue . 'venue_title ' . $sort; |
|
468 | - break; |
|
469 | - |
|
470 | - case 'city': |
|
471 | - $SQL .= $glue . EEM_Venue::instance()->second_table() . '.VNU_city ' . $sort; |
|
472 | - break; |
|
473 | - |
|
474 | - case 'state': |
|
475 | - $SQL .= $glue . EEM_State::instance()->table() . '.STA_name ' . $sort; |
|
476 | - break; |
|
477 | - } |
|
478 | - $cntr++; |
|
479 | - } |
|
480 | - // echo '<h4>$SQL : ' . $SQL . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>'; |
|
481 | - return $SQL; |
|
482 | - } |
|
483 | - |
|
484 | - |
|
485 | - /** |
|
486 | - * template_redirect |
|
487 | - * |
|
488 | - * @access public |
|
489 | - * @return void |
|
490 | - */ |
|
491 | - public function template_redirect() |
|
492 | - { |
|
493 | - // add event list filters |
|
494 | - add_action('loop_start', array($this, 'event_list_template_filters')); |
|
495 | - // and pagination |
|
496 | - add_action('loop_start', array($this, 'event_list_pagination')); |
|
497 | - add_action('loop_end', array($this, 'event_list_pagination')); |
|
498 | - // if NOT a custom template |
|
499 | - if (EE_Registry::instance() |
|
500 | - ->load_core('Front_Controller', array(), false, true) |
|
501 | - ->get_selected_template() != 'archive-espresso_events.php' |
|
502 | - ) { |
|
503 | - // don't know if theme uses the_excerpt |
|
504 | - add_filter('the_excerpt', array($this, 'event_details'), 100); |
|
505 | - add_filter('the_excerpt', array($this, 'event_tickets'), 110); |
|
506 | - add_filter('the_excerpt', array($this, 'event_datetimes'), 120); |
|
507 | - add_filter('the_excerpt', array($this, 'event_venues'), 130); |
|
508 | - // or the_content |
|
509 | - add_filter('the_content', array($this, 'event_details'), 100); |
|
510 | - add_filter('the_content', array($this, 'event_tickets'), 110); |
|
511 | - add_filter('the_content', array($this, 'event_datetimes'), 120); |
|
512 | - add_filter('the_content', array($this, 'event_venues'), 130); |
|
513 | - } else { |
|
514 | - remove_all_filters('excerpt_length'); |
|
515 | - add_filter('excerpt_length', array($this, 'excerpt_length'), 10); |
|
516 | - add_filter('excerpt_more', array($this, 'excerpt_more'), 10); |
|
517 | - } |
|
518 | - } |
|
519 | - |
|
520 | - |
|
521 | - /** |
|
522 | - * event_list_pagination |
|
523 | - * |
|
524 | - * @access public |
|
525 | - * @return void |
|
526 | - */ |
|
527 | - public function event_list_pagination() |
|
528 | - { |
|
529 | - echo '<div class="ee-pagination-dv ee-clear-float">' . espresso_event_list_pagination() . '</div>'; |
|
530 | - } |
|
531 | - |
|
532 | - |
|
533 | - /** |
|
534 | - * event_details |
|
535 | - * |
|
536 | - * @access public |
|
537 | - * @param string $content |
|
538 | - * @return void |
|
539 | - */ |
|
540 | - public function event_details($content) |
|
541 | - { |
|
542 | - return EEH_Template::display_template( |
|
543 | - EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-details.php', |
|
544 | - array('the_content' => $content), |
|
545 | - true |
|
546 | - ); |
|
547 | - } |
|
548 | - |
|
549 | - |
|
550 | - /** |
|
551 | - * event_tickets |
|
552 | - * |
|
553 | - * @access public |
|
554 | - * @param string $content |
|
555 | - * @return void |
|
556 | - */ |
|
557 | - public function event_tickets($content) |
|
558 | - { |
|
559 | - return $content |
|
560 | - . EEH_Template::display_template( |
|
561 | - EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-tickets.php', |
|
562 | - array(), |
|
563 | - true |
|
564 | - ); |
|
565 | - } |
|
566 | - |
|
567 | - /** |
|
568 | - * event_datetimes |
|
569 | - * |
|
570 | - * @access public |
|
571 | - * @param string $content |
|
572 | - * @return void |
|
573 | - */ |
|
574 | - public function event_datetimes($content) |
|
575 | - { |
|
576 | - return $content |
|
577 | - . EEH_Template::display_template( |
|
578 | - EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-datetimes.php', |
|
579 | - array(), |
|
580 | - true |
|
581 | - ); |
|
582 | - } |
|
583 | - |
|
584 | - /** |
|
585 | - * event_venues |
|
586 | - * |
|
587 | - * @access public |
|
588 | - * @param string $content |
|
589 | - * @return void |
|
590 | - */ |
|
591 | - public function event_venues($content) |
|
592 | - { |
|
593 | - return $content |
|
594 | - . EEH_Template::display_template( |
|
595 | - EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-venues.php', |
|
596 | - array(), |
|
597 | - true |
|
598 | - ); |
|
599 | - } |
|
600 | - |
|
601 | - |
|
602 | - /** |
|
603 | - * _initial_setup |
|
604 | - * |
|
605 | - * @access public |
|
606 | - * @return void |
|
607 | - */ |
|
608 | - private function _load_assests() |
|
609 | - { |
|
610 | - do_action('AHEE__EED_Events_Archive_Filters__before_load_assests'); |
|
611 | - wp_enqueue_style('espresso_default'); |
|
612 | - wp_enqueue_style('espresso_custom_css'); |
|
613 | - add_filter('FHEE_load_EE_Session', '__return_true'); |
|
614 | - add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
615 | - if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
616 | - add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
617 | - } |
|
618 | - // add_filter( 'the_excerpt', array( $this, 'the_excerpt' ), 999 ); |
|
619 | - } |
|
620 | - |
|
621 | - |
|
622 | - /** |
|
623 | - * _get_template |
|
624 | - * |
|
625 | - * @access private |
|
626 | - * @return string |
|
627 | - */ |
|
628 | - private function _get_template($which = 'part') |
|
629 | - { |
|
630 | - return EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php'; |
|
631 | - } |
|
632 | - |
|
633 | - |
|
634 | - /** |
|
635 | - * excerpt_length |
|
636 | - * |
|
637 | - * @access public |
|
638 | - * @return void |
|
639 | - */ |
|
640 | - public function excerpt_length($length) |
|
641 | - { |
|
642 | - |
|
643 | - if (self::$_type == 'grid') { |
|
644 | - return 36; |
|
645 | - } |
|
646 | - |
|
647 | - switch (EE_Registry::instance()->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size) { |
|
648 | - case 'tiny': |
|
649 | - return 12; |
|
650 | - break; |
|
651 | - case 'small': |
|
652 | - return 24; |
|
653 | - break; |
|
654 | - case 'large': |
|
655 | - return 48; |
|
656 | - break; |
|
657 | - case 'medium': |
|
658 | - default: |
|
659 | - return 36; |
|
660 | - } |
|
661 | - } |
|
662 | - |
|
663 | - |
|
664 | - /** |
|
665 | - * excerpt_more |
|
666 | - * |
|
667 | - * @access public |
|
668 | - * @return void |
|
669 | - */ |
|
670 | - public function excerpt_more($more) |
|
671 | - { |
|
672 | - return '…'; |
|
673 | - } |
|
674 | - |
|
675 | - |
|
676 | - |
|
677 | - |
|
678 | - /** |
|
679 | - * wp_enqueue_scripts |
|
680 | - * |
|
681 | - * @access public |
|
682 | - * @return void |
|
683 | - */ |
|
684 | - public function wp_enqueue_scripts() |
|
685 | - { |
|
686 | - // get some style |
|
687 | - if (apply_filters('FHEE_enable_default_espresso_css', false)) { |
|
688 | - // first check uploads folder |
|
689 | - if (is_readable( |
|
690 | - get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css' |
|
691 | - )) { |
|
692 | - wp_register_style( |
|
693 | - 'archive-espresso_events', |
|
694 | - get_stylesheet_directory_uri() . EE_Config::get_current_theme( |
|
695 | - ) . DS . 'archive-espresso_events.css', |
|
696 | - array('dashicons', 'espresso_default') |
|
697 | - ); |
|
698 | - } else { |
|
699 | - wp_register_style( |
|
700 | - 'archive-espresso_events', |
|
701 | - EE_TEMPLATES_URL . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css', |
|
702 | - array('dashicons', 'espresso_default') |
|
703 | - ); |
|
704 | - } |
|
705 | - if (is_readable( |
|
706 | - get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.js' |
|
707 | - )) { |
|
708 | - wp_register_script( |
|
709 | - 'archive-espresso_events', |
|
710 | - get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.js', |
|
711 | - array('jquery-masonry'), |
|
712 | - '1.0', |
|
713 | - true |
|
714 | - ); |
|
715 | - } else { |
|
716 | - wp_register_script( |
|
717 | - 'archive-espresso_events', |
|
718 | - EVENTS_ARCHIVE_ASSETS_URL . 'archive-espresso_events.js', |
|
719 | - array('jquery-masonry'), |
|
720 | - '1.0', |
|
721 | - true |
|
722 | - ); |
|
723 | - } |
|
724 | - wp_enqueue_style('archive-espresso_events'); |
|
725 | - wp_enqueue_script('jquery-masonry'); |
|
726 | - wp_enqueue_script('archive-espresso_events'); |
|
727 | - add_action('wp_footer', array('EED_Events_Archive_Filters', 'localize_grid_event_lists'), 1); |
|
728 | - } |
|
729 | - } |
|
730 | - |
|
731 | - |
|
732 | - /** |
|
733 | - * template_settings_form |
|
734 | - * |
|
735 | - * @access public |
|
736 | - * @static |
|
737 | - * @return void |
|
738 | - */ |
|
739 | - public static function localize_grid_event_lists() |
|
740 | - { |
|
741 | - wp_localize_script( |
|
742 | - 'archive-espresso_events', |
|
743 | - 'espresso_grid_event_lists', |
|
744 | - EED_Events_Archive_Filters::$espresso_grid_event_lists |
|
745 | - ); |
|
746 | - } |
|
747 | - |
|
748 | - |
|
749 | - /** |
|
750 | - * template_settings_form |
|
751 | - * |
|
752 | - * @access public |
|
753 | - * @static |
|
754 | - * @return void |
|
755 | - */ |
|
756 | - public static function template_settings_form() |
|
757 | - { |
|
758 | - $EE = EE_Registry::instance(); |
|
759 | - $EE->CFG->template_settings->EED_Events_Archive_Filters = isset($EE->CFG->template_settings->EED_Events_Archive_Filters) |
|
760 | - ? $EE->CFG->template_settings->EED_Events_Archive_Filters : new EE_Events_Archive_Config(); |
|
761 | - $EE->CFG->template_settings->EED_Events_Archive_Filters = apply_filters( |
|
762 | - 'FHEE__Event_List__template_settings_form__event_list_config', |
|
763 | - $EE->CFG->template_settings->EED_Events_Archive_Filters |
|
764 | - ); |
|
765 | - EEH_Template::display_template( |
|
766 | - EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php', |
|
767 | - $EE->CFG->template_settings->EED_Events_Archive_Filters |
|
768 | - ); |
|
769 | - } |
|
770 | - |
|
771 | - |
|
772 | - /** |
|
773 | - * set_default_settings |
|
774 | - * |
|
775 | - * @access public |
|
776 | - * @static |
|
777 | - * @return void |
|
778 | - */ |
|
779 | - public static function set_default_settings($CFG) |
|
780 | - { |
|
781 | - // EEH_Debug_Tools::printr( $CFG, '$CFG <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
782 | - $CFG->display_description = isset($CFG->display_description) && ! empty($CFG->display_description) |
|
783 | - ? $CFG->display_description : 1; |
|
784 | - $CFG->display_address = isset($CFG->display_address) && ! empty($CFG->display_address) ? $CFG->display_address |
|
785 | - : true; |
|
786 | - $CFG->display_venue_details = isset($CFG->display_venue_details) && ! empty($CFG->display_venue_details) |
|
787 | - ? $CFG->display_venue_details : true; |
|
788 | - $CFG->display_expired_events = isset($CFG->display_expired_events) && ! empty($CFG->display_expired_events) |
|
789 | - ? $CFG->display_expired_events : false; |
|
790 | - $CFG->default_type = isset($CFG->default_type) && ! empty($CFG->default_type) ? $CFG->default_type : 'grid'; |
|
791 | - $CFG->event_list_grid_size = isset($CFG->event_list_grid_size) && ! empty($CFG->event_list_grid_size) |
|
792 | - ? $CFG->event_list_grid_size : 'medium'; |
|
793 | - $CFG->templates['full'] = isset($CFG->templates['full']) && ! empty($CFG->templates['full']) |
|
794 | - ? $CFG->templates['full'] |
|
795 | - : EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php'; |
|
796 | - $CFG->templates['part'] = isset($CFG->templates['part']) && ! empty($CFG->templates['part']) |
|
797 | - ? $CFG->templates['part'] |
|
798 | - : EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-grid-view.php'; |
|
799 | - return $CFG; |
|
800 | - } |
|
801 | - |
|
802 | - |
|
803 | - /** |
|
804 | - * filter_config |
|
805 | - * |
|
806 | - * @access public |
|
807 | - * @return void |
|
808 | - */ |
|
809 | - public function filter_config($CFG) |
|
810 | - { |
|
811 | - return $CFG; |
|
812 | - } |
|
813 | - |
|
814 | - |
|
815 | - /** |
|
816 | - * filter_config |
|
817 | - * |
|
818 | - * @access public |
|
819 | - * @return void |
|
820 | - */ |
|
821 | - public static function update_template_settings($CFG, $REQ) |
|
822 | - { |
|
823 | - // $CFG->template_settings->EED_Events_Archive_Filters = new stdClass(); |
|
824 | - $CFG->EED_Events_Archive_Filters->display_description = isset($REQ['display_description_in_event_list']) |
|
825 | - ? absint($REQ['display_description_in_event_list']) : 1; |
|
826 | - $CFG->EED_Events_Archive_Filters->display_address = isset($REQ['display_address_in_event_list']) ? absint( |
|
827 | - $REQ['display_address_in_event_list'] |
|
828 | - ) : true; |
|
829 | - $CFG->EED_Events_Archive_Filters->display_venue_details = isset($REQ['display_venue_details_in_event_list']) |
|
830 | - ? absint($REQ['display_venue_details_in_event_list']) : true; |
|
831 | - $CFG->EED_Events_Archive_Filters->display_expired_events = isset($REQ['display_expired_events']) ? absint( |
|
832 | - $REQ['display_expired_events'] |
|
833 | - ) : false; |
|
834 | - $CFG->EED_Events_Archive_Filters->default_type = isset($REQ['default_type']) ? sanitize_text_field( |
|
835 | - $REQ['default_type'] |
|
836 | - ) : 'grid'; |
|
837 | - $CFG->EED_Events_Archive_Filters->event_list_grid_size = isset($REQ['event_list_grid_size']) |
|
838 | - ? sanitize_text_field($REQ['event_list_grid_size']) : 'medium'; |
|
839 | - $CFG->EED_Events_Archive_Filters->templates = array( |
|
840 | - 'full' => EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php', |
|
841 | - ); |
|
842 | - |
|
843 | - switch ($CFG->EED_Events_Archive_Filters->default_type) { |
|
844 | - case 'dates': |
|
845 | - $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() |
|
846 | - . DS . 'archive-espresso_events-dates-view.php'; |
|
847 | - break; |
|
848 | - case 'text': |
|
849 | - $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() |
|
850 | - . DS . 'archive-espresso_events-text-view.php'; |
|
851 | - break; |
|
852 | - default: |
|
853 | - $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() |
|
854 | - . DS . 'archive-espresso_events-grid-view.php'; |
|
855 | - } |
|
856 | - |
|
857 | - $CFG->EED_Events_Archive_Filters = isset($REQ['reset_event_list_settings']) |
|
858 | - && absint($REQ['reset_event_list_settings']) == 1 |
|
859 | - ? new EE_Events_Archive_Config() |
|
860 | - : $CFG->EED_Events_Archive_Filters; |
|
861 | - return $CFG; |
|
862 | - } |
|
863 | - |
|
864 | - |
|
865 | - /** |
|
866 | - * get_template_part |
|
867 | - * |
|
868 | - * @access public |
|
869 | - * @return void |
|
870 | - */ |
|
871 | - public static function get_template_part() |
|
872 | - { |
|
873 | - switch (self::$_type) { |
|
874 | - case 'dates': |
|
875 | - return 'archive-espresso_events-dates-view.php'; |
|
876 | - break; |
|
877 | - case 'text': |
|
878 | - return 'archive-espresso_events-text-view.php'; |
|
879 | - break; |
|
880 | - default: |
|
881 | - return 'archive-espresso_events-grid-view.php'; |
|
882 | - } |
|
883 | - } |
|
884 | - |
|
885 | - |
|
886 | - /** |
|
887 | - * event_list_template_filters |
|
888 | - * |
|
889 | - * @access public |
|
890 | - * @return void |
|
891 | - */ |
|
892 | - public function event_list_template_filters() |
|
893 | - { |
|
894 | - $args = array( |
|
895 | - 'form_url' => get_post_type_archive_link('espresso_events'), |
|
896 | - // add_query_arg( array( 'post_type' => 'espresso_events' ), home_url() ), |
|
897 | - 'elf_month' => EED_Events_Archive_Filters::_display_month(), |
|
898 | - 'elf_category' => EED_Events_Archive_Filters::_event_category_slug(), |
|
899 | - 'elf_show_expired' => EED_Events_Archive_Filters::_show_expired(), |
|
900 | - 'elf_type' => self::$_type, |
|
901 | - ); |
|
902 | - EEH_Template::display_template( |
|
903 | - EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-filters.php', |
|
904 | - $args |
|
905 | - ); |
|
906 | - } |
|
907 | - |
|
908 | - |
|
909 | - /** |
|
910 | - * event_list_css |
|
911 | - * |
|
912 | - * @access public |
|
913 | - * @return void |
|
914 | - */ |
|
915 | - public static function event_list_css($extra_class = '') |
|
916 | - { |
|
917 | - $EE = EE_Registry::instance(); |
|
918 | - $event_list_css = ! empty($extra_class) ? array($extra_class) : array(); |
|
919 | - $event_list_css[] = 'espresso-event-list-event'; |
|
920 | - if (self::$_type == 'grid') { |
|
921 | - $event_list_grid_size = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size) |
|
922 | - ? $EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size : 'medium'; |
|
923 | - $event_list_css[] = $event_list_grid_size . '-event-list-grid'; |
|
924 | - } |
|
925 | - $event_list_css = apply_filters( |
|
926 | - 'EED_Events_Archive_Filters__event_list_css__event_list_css_array', |
|
927 | - $event_list_css |
|
928 | - ); |
|
929 | - return implode(' ', $event_list_css); |
|
930 | - } |
|
931 | - |
|
932 | - |
|
933 | - /** |
|
934 | - * event_categories |
|
935 | - * |
|
936 | - * @access public |
|
937 | - * @return void |
|
938 | - */ |
|
939 | - public static function event_categories() |
|
940 | - { |
|
941 | - return EE_Registry::instance()->load_model('Term')->get_all_ee_categories(); |
|
942 | - } |
|
943 | - |
|
944 | - |
|
945 | - /** |
|
946 | - * display_description |
|
947 | - * |
|
948 | - * @access public |
|
949 | - * @return void |
|
950 | - */ |
|
951 | - public static function display_description($value) |
|
952 | - { |
|
953 | - $EE = EE_Registry::instance(); |
|
954 | - $display_description = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_description) |
|
955 | - ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_description : 1; |
|
956 | - return $display_description === $value ? true : false; |
|
957 | - } |
|
958 | - |
|
959 | - |
|
960 | - /** |
|
961 | - * display_venue_details |
|
962 | - * |
|
963 | - * @access public |
|
964 | - * @return void |
|
965 | - */ |
|
966 | - public static function display_venue_details() |
|
967 | - { |
|
968 | - $EE = EE_Registry::instance(); |
|
969 | - $display_venue_details = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details) |
|
970 | - ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details : true; |
|
971 | - $venue_name = EEH_Venue_View::venue_name(); |
|
972 | - return $display_venue_details && ! empty($venue_name) ? true : false; |
|
973 | - } |
|
974 | - |
|
975 | - |
|
976 | - /** |
|
977 | - * display_address |
|
978 | - * |
|
979 | - * @access public |
|
980 | - * @return void |
|
981 | - */ |
|
982 | - public static function display_address() |
|
983 | - { |
|
984 | - $EE = EE_Registry::instance(); |
|
985 | - $display_address = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_address) |
|
986 | - ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_address : false; |
|
987 | - $venue_name = EEH_Venue_View::venue_name(); |
|
988 | - return $display_address && ! empty($venue_name) ? true : false; |
|
989 | - } |
|
990 | - |
|
991 | - |
|
992 | - /** |
|
993 | - * pagination |
|
994 | - * |
|
995 | - * @access public |
|
996 | - * @return void |
|
997 | - */ |
|
998 | - public static function pagination() |
|
999 | - { |
|
1000 | - global $wp_query; |
|
1001 | - $big = 999999999; // need an unlikely integer |
|
1002 | - $pagination = paginate_links( |
|
1003 | - array( |
|
1004 | - 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
1005 | - 'format' => '?paged=%#%', |
|
1006 | - 'current' => max(1, get_query_var('paged')), |
|
1007 | - 'total' => $wp_query->max_num_pages, |
|
1008 | - 'show_all' => true, |
|
1009 | - 'end_size' => 10, |
|
1010 | - 'mid_size' => 6, |
|
1011 | - 'prev_next' => true, |
|
1012 | - 'prev_text' => __('‹ PREV', 'event_espresso'), |
|
1013 | - 'next_text' => __('NEXT ›', 'event_espresso'), |
|
1014 | - 'type' => 'plain', |
|
1015 | - 'add_args' => false, |
|
1016 | - 'add_fragment' => '', |
|
1017 | - ) |
|
1018 | - ); |
|
1019 | - return ! empty($pagination) ? '<div class="ee-pagination-dv clear">' . $pagination . '</div>' : ''; |
|
1020 | - } |
|
1021 | - |
|
1022 | - |
|
1023 | - /** |
|
1024 | - * event_list_title |
|
1025 | - * |
|
1026 | - * @access public |
|
1027 | - * @return void |
|
1028 | - */ |
|
1029 | - public static function event_list_title() |
|
1030 | - { |
|
1031 | - return apply_filters( |
|
1032 | - 'EED_Events_Archive_Filters__event_list_title__event_list_title', |
|
1033 | - __('Upcoming Events', 'event_espresso') |
|
1034 | - ); |
|
1035 | - } |
|
15 | + /** |
|
16 | + * @return EED_Events_Archive_Filters |
|
17 | + */ |
|
18 | + public static function instance() |
|
19 | + { |
|
20 | + return parent::get_instance(__CLASS__); |
|
21 | + } |
|
22 | + |
|
23 | + |
|
24 | + /** |
|
25 | + * Start Date |
|
26 | + * |
|
27 | + * @var $_elf_month |
|
28 | + * @access protected |
|
29 | + */ |
|
30 | + protected $_elf_month = null; |
|
31 | + |
|
32 | + |
|
33 | + /** |
|
34 | + * Category |
|
35 | + * |
|
36 | + * @var $_elf_category |
|
37 | + * @access protected |
|
38 | + */ |
|
39 | + protected $_elf_category = null; |
|
40 | + |
|
41 | + |
|
42 | + /** |
|
43 | + * whether to display expired events in the event list |
|
44 | + * |
|
45 | + * @var $_show_expired |
|
46 | + * @access protected |
|
47 | + */ |
|
48 | + protected $_show_expired = null; |
|
49 | + |
|
50 | + |
|
51 | + /** |
|
52 | + * whether to display the event list as a grid or list |
|
53 | + * |
|
54 | + * @var $_type |
|
55 | + * @access protected |
|
56 | + */ |
|
57 | + protected static $_type = null; |
|
58 | + |
|
59 | + |
|
60 | + /** |
|
61 | + * array of existing event list views |
|
62 | + * |
|
63 | + * @var $_types |
|
64 | + * @access protected |
|
65 | + */ |
|
66 | + protected static $_types = array('grid', 'text', 'dates'); |
|
67 | + |
|
68 | + |
|
69 | + |
|
70 | + /** |
|
71 | + * set_hooks - for hooking into EE Core, other modules, etc |
|
72 | + * |
|
73 | + * @access public |
|
74 | + * @return void |
|
75 | + */ |
|
76 | + public static function set_hooks() |
|
77 | + { |
|
78 | + } |
|
79 | + |
|
80 | + /** |
|
81 | + * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
|
82 | + * |
|
83 | + * @access public |
|
84 | + * @return void |
|
85 | + */ |
|
86 | + public static function set_hooks_admin() |
|
87 | + { |
|
88 | + } |
|
89 | + |
|
90 | + |
|
91 | + /** |
|
92 | + * set_definitions |
|
93 | + * |
|
94 | + * @access public |
|
95 | + * @return void |
|
96 | + */ |
|
97 | + public static function set_definitions() |
|
98 | + { |
|
99 | + } |
|
100 | + |
|
101 | + |
|
102 | + /** |
|
103 | + * run - initial module setup |
|
104 | + * |
|
105 | + * @access public |
|
106 | + * @return void |
|
107 | + */ |
|
108 | + public function run($WP) |
|
109 | + { |
|
110 | + } |
|
111 | + |
|
112 | + |
|
113 | + /** |
|
114 | + * event_list |
|
115 | + * |
|
116 | + * @access public |
|
117 | + * @return void |
|
118 | + */ |
|
119 | + public function event_list() |
|
120 | + { |
|
121 | + // load other required components |
|
122 | + $this->_load_assests(); |
|
123 | + } |
|
124 | + |
|
125 | + |
|
126 | + /** |
|
127 | + * _filter_query_parts |
|
128 | + * |
|
129 | + * @access public |
|
130 | + * @return void |
|
131 | + */ |
|
132 | + private function _filter_query_parts() |
|
133 | + { |
|
134 | + // build event list query |
|
135 | + add_filter('posts_join', array($this, 'posts_join'), 1, 2); |
|
136 | + add_filter('posts_where', array($this, 'posts_where'), 1, 2); |
|
137 | + add_filter('posts_orderby', array($this, 'posts_orderby'), 1, 2); |
|
138 | + } |
|
139 | + |
|
140 | + /** |
|
141 | + * _type - the type of event list : grid, text, dates |
|
142 | + * |
|
143 | + * @access public |
|
144 | + * @return string |
|
145 | + */ |
|
146 | + public static function set_type() |
|
147 | + { |
|
148 | + do_action('AHEE__EED_Events_Archive_Filters__before_set_type'); |
|
149 | + EED_Events_Archive_Filters::$_types = apply_filters( |
|
150 | + 'EED_Events_Archive_Filters__set_type__types', |
|
151 | + EED_Events_Archive_Filters::$_types |
|
152 | + ); |
|
153 | + $view = isset(EE_Registry::instance()->CFG->EED_Events_Archive_Filters['default_type']) ? EE_Registry::instance( |
|
154 | + )->CFG->EED_Events_Archive_Filters['default_type'] : 'grid'; |
|
155 | + $elf_type = EE_Registry::instance()->REQ->is_set('elf_type') ? sanitize_text_field( |
|
156 | + EE_Registry::instance()->REQ->get('elf_type') |
|
157 | + ) : ''; |
|
158 | + $view = ! empty($elf_type) ? $elf_type : $view; |
|
159 | + $view = apply_filters('EED_Events_Archive_Filters__set_type__type', $view); |
|
160 | + if (! empty($view) && in_array($view, EED_Events_Archive_Filters::$_types)) { |
|
161 | + self::$_type = $view; |
|
162 | + } |
|
163 | + } |
|
164 | + |
|
165 | + /** |
|
166 | + * _show_expired |
|
167 | + * |
|
168 | + * @access private |
|
169 | + * @param boolean $req_only if TRUE, then ignore defaults and only return $_POST value |
|
170 | + * @return boolean |
|
171 | + */ |
|
172 | + private static function _show_expired($req_only = false) |
|
173 | + { |
|
174 | + // get default value for "display_expired_events" as set in the EE General Settings > Templates > Event Listings |
|
175 | + $show_expired = ! $req_only && isset( |
|
176 | + EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events'] |
|
177 | + ) ? EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events'] : false; |
|
178 | + // override default expired option if set via filter |
|
179 | + $show_expired = EE_Registry::instance()->REQ->is_set('elf_expired_chk') ? absint( |
|
180 | + EE_Registry::instance()->REQ->get('elf_expired_chk') |
|
181 | + ) : $show_expired; |
|
182 | + return $show_expired ? true : false; |
|
183 | + } |
|
184 | + |
|
185 | + /** |
|
186 | + * _event_category_slug |
|
187 | + * |
|
188 | + * @access private |
|
189 | + * @return string |
|
190 | + */ |
|
191 | + private static function _event_category_slug() |
|
192 | + { |
|
193 | + return EE_Registry::instance()->REQ->is_set('elf_category_dd') ? sanitize_text_field( |
|
194 | + EE_Registry::instance()->REQ->get('elf_category_dd') |
|
195 | + ) : ''; |
|
196 | + } |
|
197 | + |
|
198 | + /** |
|
199 | + * _display_month - what month should the event list display events for? |
|
200 | + * |
|
201 | + * @access private |
|
202 | + * @return string |
|
203 | + */ |
|
204 | + private static function _display_month() |
|
205 | + { |
|
206 | + return EE_Registry::instance()->REQ->is_set('elf_month_dd') ? sanitize_text_field( |
|
207 | + EE_Registry::instance()->REQ->get('elf_month_dd') |
|
208 | + ) : ''; |
|
209 | + } |
|
210 | + |
|
211 | + |
|
212 | + /** |
|
213 | + * get_post_data |
|
214 | + * |
|
215 | + * @access public |
|
216 | + * @return void |
|
217 | + */ |
|
218 | + public function get_post_data() |
|
219 | + { |
|
220 | + $this->_elf_month = EED_Events_Archive_Filters::_display_month(); |
|
221 | + $this->_elf_category = EED_Events_Archive_Filters::_event_category_slug(); |
|
222 | + $this->_show_expired = EED_Events_Archive_Filters::_show_expired(true); |
|
223 | + } |
|
224 | + |
|
225 | + |
|
226 | + /** |
|
227 | + * posts_join |
|
228 | + * |
|
229 | + * @access public |
|
230 | + * @return void |
|
231 | + */ |
|
232 | + public function posts_join($SQL, WP_Query $wp_query) |
|
233 | + { |
|
234 | + if (isset($wp_query->query) && isset($wp_query->query['post_type']) && $wp_query->query['post_type'] == 'espresso_events') { |
|
235 | + // Category |
|
236 | + $SQL .= EED_Events_Archive_Filters::posts_join_sql_for_terms( |
|
237 | + EED_Events_Archive_Filters::_event_category_slug() |
|
238 | + ); |
|
239 | + } |
|
240 | + return $SQL; |
|
241 | + } |
|
242 | + |
|
243 | + |
|
244 | + /** |
|
245 | + * posts_join_sql_for_terms |
|
246 | + * |
|
247 | + * @access public |
|
248 | + * @param mixed boolean|string $join_terms pass TRUE or term string, doesn't really matter since this value |
|
249 | + * doesn't really get used for anything yet |
|
250 | + * @return string |
|
251 | + */ |
|
252 | + public static function posts_join_sql_for_terms($join_terms = null) |
|
253 | + { |
|
254 | + $SQL = ''; |
|
255 | + if (! empty($join_terms)) { |
|
256 | + global $wpdb; |
|
257 | + $SQL .= " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)"; |
|
258 | + $SQL .= " LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)"; |
|
259 | + $SQL .= " LEFT JOIN $wpdb->terms ON ($wpdb->terms.term_id = $wpdb->term_taxonomy.term_id) "; |
|
260 | + } |
|
261 | + return $SQL; |
|
262 | + } |
|
263 | + |
|
264 | + |
|
265 | + /** |
|
266 | + * posts_join_for_orderby |
|
267 | + * usage: $SQL .= EED_Events_Archive_Filters::posts_join_for_orderby( $orderby_params ); |
|
268 | + * |
|
269 | + * @access public |
|
270 | + * @param array $orderby_params |
|
271 | + * @return string |
|
272 | + */ |
|
273 | + public static function posts_join_for_orderby($orderby_params = array()) |
|
274 | + { |
|
275 | + global $wpdb; |
|
276 | + $SQL = ''; |
|
277 | + $orderby_params = is_array($orderby_params) ? $orderby_params : array($orderby_params); |
|
278 | + foreach ($orderby_params as $orderby) { |
|
279 | + switch ($orderby) { |
|
280 | + case 'ticket_start': |
|
281 | + case 'ticket_end': |
|
282 | + $SQL .= ' LEFT JOIN ' . EEM_Datetime_Ticket::instance()->table() . ' ON (' |
|
283 | + . EEM_Datetime::instance()->table() . '.DTT_ID = ' |
|
284 | + . EEM_Datetime_Ticket::instance()->table() . '.DTT_ID )'; |
|
285 | + $SQL .= ' LEFT JOIN ' . EEM_Ticket::instance()->table() . ' ON (' |
|
286 | + . EEM_Datetime_Ticket::instance()->table() . '.TKT_ID = ' |
|
287 | + . EEM_Ticket::instance()->table() . '.TKT_ID )'; |
|
288 | + break; |
|
289 | + |
|
290 | + case 'venue_title': |
|
291 | + case 'city': |
|
292 | + $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = ' |
|
293 | + . EEM_Event_Venue::instance()->table() . '.EVT_ID )'; |
|
294 | + $SQL .= ' LEFT JOIN ' . EEM_Venue::instance()->table() . ' ON (' |
|
295 | + . EEM_Event_Venue::instance()->table() . '.VNU_ID = ' |
|
296 | + . EEM_Venue::instance()->table() . '.VNU_ID )'; |
|
297 | + break; |
|
298 | + |
|
299 | + case 'state': |
|
300 | + $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = ' |
|
301 | + . EEM_Event_Venue::instance()->table() . '.EVT_ID )'; |
|
302 | + $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->second_table() . ' ON (' |
|
303 | + . EEM_Event_Venue::instance()->table() . '.VNU_ID = ' |
|
304 | + . EEM_Event_Venue::instance()->second_table() . '.VNU_ID )'; |
|
305 | + break; |
|
306 | + } |
|
307 | + } |
|
308 | + return $SQL; |
|
309 | + } |
|
310 | + |
|
311 | + |
|
312 | + /** |
|
313 | + * posts_where |
|
314 | + * |
|
315 | + * @access public |
|
316 | + * @return void |
|
317 | + */ |
|
318 | + public function posts_where($SQL, WP_Query $wp_query) |
|
319 | + { |
|
320 | + if (isset($wp_query->query_vars) && isset($wp_query->query_vars['post_type']) && $wp_query->query_vars['post_type'] == 'espresso_events') { |
|
321 | + // Show Expired ? |
|
322 | + $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_show_expired( |
|
323 | + EED_Events_Archive_Filters::_show_expired() |
|
324 | + ); |
|
325 | + // Category |
|
326 | + // $elf_category = EED_Events_Archive_Filters::_event_category_slug(); |
|
327 | + $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_category_slug( |
|
328 | + EED_Events_Archive_Filters::_event_category_slug() |
|
329 | + ); |
|
330 | + // Start Date |
|
331 | + // $elf_month = EED_Events_Archive_Filters::_display_month(); |
|
332 | + $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_list_month( |
|
333 | + EED_Events_Archive_Filters::_display_month() |
|
334 | + ); |
|
335 | + } |
|
336 | + return $SQL; |
|
337 | + } |
|
338 | + |
|
339 | + |
|
340 | + /** |
|
341 | + * posts_where_sql_for_show_expired |
|
342 | + * |
|
343 | + * @access public |
|
344 | + * @param boolean $show_expired if TRUE, then displayed past events |
|
345 | + * @return string |
|
346 | + */ |
|
347 | + public static function posts_where_sql_for_show_expired($show_expired = false) |
|
348 | + { |
|
349 | + return ! $show_expired |
|
350 | + ? ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end > "' . date('Y-m-d H:s:i') . '" ' |
|
351 | + : ''; |
|
352 | + } |
|
353 | + |
|
354 | + |
|
355 | + /** |
|
356 | + * posts_where_sql_for_event_category_slug |
|
357 | + * |
|
358 | + * @access public |
|
359 | + * @param boolean $event_category_slug |
|
360 | + * @return string |
|
361 | + */ |
|
362 | + public static function posts_where_sql_for_event_category_slug($event_category_slug = null) |
|
363 | + { |
|
364 | + global $wpdb; |
|
365 | + return ! empty($event_category_slug) ? ' AND ' . $wpdb->terms . '.slug = "' . $event_category_slug . '" ' : ''; |
|
366 | + } |
|
367 | + |
|
368 | + /** |
|
369 | + * posts_where_sql_for_event_list_month |
|
370 | + * |
|
371 | + * @access public |
|
372 | + * @param boolean $month |
|
373 | + * @return string |
|
374 | + */ |
|
375 | + public static function posts_where_sql_for_event_list_month($month = null) |
|
376 | + { |
|
377 | + $SQL = ''; |
|
378 | + if (! empty($month)) { |
|
379 | + // event start date is LESS than the end of the month ( so nothing that doesn't start until next month ) |
|
380 | + $SQL = ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start'; |
|
381 | + $SQL .= ' <= "' . date('Y-m-t 23:59:59', \EEH_DTT_Helper::first_of_month_timestamp($month)) . '"'; |
|
382 | + // event end date is GREATER than the start of the month ( so nothing that ended before this month ) |
|
383 | + $SQL .= ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end'; |
|
384 | + $SQL .= ' >= "' . date('Y-m-d 0:0:00', \EEH_DTT_Helper::first_of_month_timestamp($month)) . '" '; |
|
385 | + } |
|
386 | + return $SQL; |
|
387 | + } |
|
388 | + |
|
389 | + |
|
390 | + /** |
|
391 | + * posts_orderby |
|
392 | + * |
|
393 | + * @access public |
|
394 | + * @return void |
|
395 | + */ |
|
396 | + public function posts_orderby($SQL, WP_Query $wp_query) |
|
397 | + { |
|
398 | + if (isset($wp_query->query) && isset($wp_query->query['post_type']) && $wp_query->query['post_type'] == 'espresso_events') { |
|
399 | + $SQL = EED_Events_Archive_Filters::posts_orderby_sql(array('start_date')); |
|
400 | + } |
|
401 | + return $SQL; |
|
402 | + } |
|
403 | + |
|
404 | + |
|
405 | + /** |
|
406 | + * posts_orderby_sql |
|
407 | + * |
|
408 | + * possible parameters: |
|
409 | + * ID |
|
410 | + * start_date |
|
411 | + * end_date |
|
412 | + * event_name |
|
413 | + * category_slug |
|
414 | + * ticket_start |
|
415 | + * ticket_end |
|
416 | + * venue_title |
|
417 | + * city |
|
418 | + * state |
|
419 | + * |
|
420 | + * **IMPORTANT** |
|
421 | + * make sure to also send the $orderby_params array to the posts_join_for_orderby() method |
|
422 | + * or else some of the table references below will result in MySQL errors |
|
423 | + * |
|
424 | + * @access public |
|
425 | + * @param boolean $orderby_params |
|
426 | + * @return string |
|
427 | + */ |
|
428 | + public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC') |
|
429 | + { |
|
430 | + global $wpdb; |
|
431 | + $SQL = ''; |
|
432 | + $cntr = 1; |
|
433 | + $orderby_params = is_array($orderby_params) ? $orderby_params : array($orderby_params); |
|
434 | + foreach ($orderby_params as $orderby) { |
|
435 | + $glue = $cntr == 1 || $cntr == count($orderby_params) ? ' ' : ', '; |
|
436 | + switch ($orderby) { |
|
437 | + case 'id': |
|
438 | + case 'ID': |
|
439 | + $SQL .= $glue . $wpdb->posts . '.ID ' . $sort; |
|
440 | + break; |
|
441 | + |
|
442 | + case 'start_date': |
|
443 | + $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_start ' . $sort; |
|
444 | + break; |
|
445 | + |
|
446 | + case 'end_date': |
|
447 | + $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_end ' . $sort; |
|
448 | + break; |
|
449 | + |
|
450 | + case 'event_name': |
|
451 | + $SQL .= $glue . $wpdb->posts . '.post_title ' . $sort; |
|
452 | + break; |
|
453 | + |
|
454 | + case 'category_slug': |
|
455 | + $SQL .= $glue . $wpdb->terms . '.slug ' . $sort; |
|
456 | + break; |
|
457 | + |
|
458 | + case 'ticket_start': |
|
459 | + $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_start_date ' . $sort; |
|
460 | + break; |
|
461 | + |
|
462 | + case 'ticket_end': |
|
463 | + $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_end_date ' . $sort; |
|
464 | + break; |
|
465 | + |
|
466 | + case 'venue_title': |
|
467 | + $SQL .= $glue . 'venue_title ' . $sort; |
|
468 | + break; |
|
469 | + |
|
470 | + case 'city': |
|
471 | + $SQL .= $glue . EEM_Venue::instance()->second_table() . '.VNU_city ' . $sort; |
|
472 | + break; |
|
473 | + |
|
474 | + case 'state': |
|
475 | + $SQL .= $glue . EEM_State::instance()->table() . '.STA_name ' . $sort; |
|
476 | + break; |
|
477 | + } |
|
478 | + $cntr++; |
|
479 | + } |
|
480 | + // echo '<h4>$SQL : ' . $SQL . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>'; |
|
481 | + return $SQL; |
|
482 | + } |
|
483 | + |
|
484 | + |
|
485 | + /** |
|
486 | + * template_redirect |
|
487 | + * |
|
488 | + * @access public |
|
489 | + * @return void |
|
490 | + */ |
|
491 | + public function template_redirect() |
|
492 | + { |
|
493 | + // add event list filters |
|
494 | + add_action('loop_start', array($this, 'event_list_template_filters')); |
|
495 | + // and pagination |
|
496 | + add_action('loop_start', array($this, 'event_list_pagination')); |
|
497 | + add_action('loop_end', array($this, 'event_list_pagination')); |
|
498 | + // if NOT a custom template |
|
499 | + if (EE_Registry::instance() |
|
500 | + ->load_core('Front_Controller', array(), false, true) |
|
501 | + ->get_selected_template() != 'archive-espresso_events.php' |
|
502 | + ) { |
|
503 | + // don't know if theme uses the_excerpt |
|
504 | + add_filter('the_excerpt', array($this, 'event_details'), 100); |
|
505 | + add_filter('the_excerpt', array($this, 'event_tickets'), 110); |
|
506 | + add_filter('the_excerpt', array($this, 'event_datetimes'), 120); |
|
507 | + add_filter('the_excerpt', array($this, 'event_venues'), 130); |
|
508 | + // or the_content |
|
509 | + add_filter('the_content', array($this, 'event_details'), 100); |
|
510 | + add_filter('the_content', array($this, 'event_tickets'), 110); |
|
511 | + add_filter('the_content', array($this, 'event_datetimes'), 120); |
|
512 | + add_filter('the_content', array($this, 'event_venues'), 130); |
|
513 | + } else { |
|
514 | + remove_all_filters('excerpt_length'); |
|
515 | + add_filter('excerpt_length', array($this, 'excerpt_length'), 10); |
|
516 | + add_filter('excerpt_more', array($this, 'excerpt_more'), 10); |
|
517 | + } |
|
518 | + } |
|
519 | + |
|
520 | + |
|
521 | + /** |
|
522 | + * event_list_pagination |
|
523 | + * |
|
524 | + * @access public |
|
525 | + * @return void |
|
526 | + */ |
|
527 | + public function event_list_pagination() |
|
528 | + { |
|
529 | + echo '<div class="ee-pagination-dv ee-clear-float">' . espresso_event_list_pagination() . '</div>'; |
|
530 | + } |
|
531 | + |
|
532 | + |
|
533 | + /** |
|
534 | + * event_details |
|
535 | + * |
|
536 | + * @access public |
|
537 | + * @param string $content |
|
538 | + * @return void |
|
539 | + */ |
|
540 | + public function event_details($content) |
|
541 | + { |
|
542 | + return EEH_Template::display_template( |
|
543 | + EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-details.php', |
|
544 | + array('the_content' => $content), |
|
545 | + true |
|
546 | + ); |
|
547 | + } |
|
548 | + |
|
549 | + |
|
550 | + /** |
|
551 | + * event_tickets |
|
552 | + * |
|
553 | + * @access public |
|
554 | + * @param string $content |
|
555 | + * @return void |
|
556 | + */ |
|
557 | + public function event_tickets($content) |
|
558 | + { |
|
559 | + return $content |
|
560 | + . EEH_Template::display_template( |
|
561 | + EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-tickets.php', |
|
562 | + array(), |
|
563 | + true |
|
564 | + ); |
|
565 | + } |
|
566 | + |
|
567 | + /** |
|
568 | + * event_datetimes |
|
569 | + * |
|
570 | + * @access public |
|
571 | + * @param string $content |
|
572 | + * @return void |
|
573 | + */ |
|
574 | + public function event_datetimes($content) |
|
575 | + { |
|
576 | + return $content |
|
577 | + . EEH_Template::display_template( |
|
578 | + EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-datetimes.php', |
|
579 | + array(), |
|
580 | + true |
|
581 | + ); |
|
582 | + } |
|
583 | + |
|
584 | + /** |
|
585 | + * event_venues |
|
586 | + * |
|
587 | + * @access public |
|
588 | + * @param string $content |
|
589 | + * @return void |
|
590 | + */ |
|
591 | + public function event_venues($content) |
|
592 | + { |
|
593 | + return $content |
|
594 | + . EEH_Template::display_template( |
|
595 | + EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-venues.php', |
|
596 | + array(), |
|
597 | + true |
|
598 | + ); |
|
599 | + } |
|
600 | + |
|
601 | + |
|
602 | + /** |
|
603 | + * _initial_setup |
|
604 | + * |
|
605 | + * @access public |
|
606 | + * @return void |
|
607 | + */ |
|
608 | + private function _load_assests() |
|
609 | + { |
|
610 | + do_action('AHEE__EED_Events_Archive_Filters__before_load_assests'); |
|
611 | + wp_enqueue_style('espresso_default'); |
|
612 | + wp_enqueue_style('espresso_custom_css'); |
|
613 | + add_filter('FHEE_load_EE_Session', '__return_true'); |
|
614 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
615 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
616 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
617 | + } |
|
618 | + // add_filter( 'the_excerpt', array( $this, 'the_excerpt' ), 999 ); |
|
619 | + } |
|
620 | + |
|
621 | + |
|
622 | + /** |
|
623 | + * _get_template |
|
624 | + * |
|
625 | + * @access private |
|
626 | + * @return string |
|
627 | + */ |
|
628 | + private function _get_template($which = 'part') |
|
629 | + { |
|
630 | + return EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php'; |
|
631 | + } |
|
632 | + |
|
633 | + |
|
634 | + /** |
|
635 | + * excerpt_length |
|
636 | + * |
|
637 | + * @access public |
|
638 | + * @return void |
|
639 | + */ |
|
640 | + public function excerpt_length($length) |
|
641 | + { |
|
642 | + |
|
643 | + if (self::$_type == 'grid') { |
|
644 | + return 36; |
|
645 | + } |
|
646 | + |
|
647 | + switch (EE_Registry::instance()->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size) { |
|
648 | + case 'tiny': |
|
649 | + return 12; |
|
650 | + break; |
|
651 | + case 'small': |
|
652 | + return 24; |
|
653 | + break; |
|
654 | + case 'large': |
|
655 | + return 48; |
|
656 | + break; |
|
657 | + case 'medium': |
|
658 | + default: |
|
659 | + return 36; |
|
660 | + } |
|
661 | + } |
|
662 | + |
|
663 | + |
|
664 | + /** |
|
665 | + * excerpt_more |
|
666 | + * |
|
667 | + * @access public |
|
668 | + * @return void |
|
669 | + */ |
|
670 | + public function excerpt_more($more) |
|
671 | + { |
|
672 | + return '…'; |
|
673 | + } |
|
674 | + |
|
675 | + |
|
676 | + |
|
677 | + |
|
678 | + /** |
|
679 | + * wp_enqueue_scripts |
|
680 | + * |
|
681 | + * @access public |
|
682 | + * @return void |
|
683 | + */ |
|
684 | + public function wp_enqueue_scripts() |
|
685 | + { |
|
686 | + // get some style |
|
687 | + if (apply_filters('FHEE_enable_default_espresso_css', false)) { |
|
688 | + // first check uploads folder |
|
689 | + if (is_readable( |
|
690 | + get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css' |
|
691 | + )) { |
|
692 | + wp_register_style( |
|
693 | + 'archive-espresso_events', |
|
694 | + get_stylesheet_directory_uri() . EE_Config::get_current_theme( |
|
695 | + ) . DS . 'archive-espresso_events.css', |
|
696 | + array('dashicons', 'espresso_default') |
|
697 | + ); |
|
698 | + } else { |
|
699 | + wp_register_style( |
|
700 | + 'archive-espresso_events', |
|
701 | + EE_TEMPLATES_URL . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css', |
|
702 | + array('dashicons', 'espresso_default') |
|
703 | + ); |
|
704 | + } |
|
705 | + if (is_readable( |
|
706 | + get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.js' |
|
707 | + )) { |
|
708 | + wp_register_script( |
|
709 | + 'archive-espresso_events', |
|
710 | + get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.js', |
|
711 | + array('jquery-masonry'), |
|
712 | + '1.0', |
|
713 | + true |
|
714 | + ); |
|
715 | + } else { |
|
716 | + wp_register_script( |
|
717 | + 'archive-espresso_events', |
|
718 | + EVENTS_ARCHIVE_ASSETS_URL . 'archive-espresso_events.js', |
|
719 | + array('jquery-masonry'), |
|
720 | + '1.0', |
|
721 | + true |
|
722 | + ); |
|
723 | + } |
|
724 | + wp_enqueue_style('archive-espresso_events'); |
|
725 | + wp_enqueue_script('jquery-masonry'); |
|
726 | + wp_enqueue_script('archive-espresso_events'); |
|
727 | + add_action('wp_footer', array('EED_Events_Archive_Filters', 'localize_grid_event_lists'), 1); |
|
728 | + } |
|
729 | + } |
|
730 | + |
|
731 | + |
|
732 | + /** |
|
733 | + * template_settings_form |
|
734 | + * |
|
735 | + * @access public |
|
736 | + * @static |
|
737 | + * @return void |
|
738 | + */ |
|
739 | + public static function localize_grid_event_lists() |
|
740 | + { |
|
741 | + wp_localize_script( |
|
742 | + 'archive-espresso_events', |
|
743 | + 'espresso_grid_event_lists', |
|
744 | + EED_Events_Archive_Filters::$espresso_grid_event_lists |
|
745 | + ); |
|
746 | + } |
|
747 | + |
|
748 | + |
|
749 | + /** |
|
750 | + * template_settings_form |
|
751 | + * |
|
752 | + * @access public |
|
753 | + * @static |
|
754 | + * @return void |
|
755 | + */ |
|
756 | + public static function template_settings_form() |
|
757 | + { |
|
758 | + $EE = EE_Registry::instance(); |
|
759 | + $EE->CFG->template_settings->EED_Events_Archive_Filters = isset($EE->CFG->template_settings->EED_Events_Archive_Filters) |
|
760 | + ? $EE->CFG->template_settings->EED_Events_Archive_Filters : new EE_Events_Archive_Config(); |
|
761 | + $EE->CFG->template_settings->EED_Events_Archive_Filters = apply_filters( |
|
762 | + 'FHEE__Event_List__template_settings_form__event_list_config', |
|
763 | + $EE->CFG->template_settings->EED_Events_Archive_Filters |
|
764 | + ); |
|
765 | + EEH_Template::display_template( |
|
766 | + EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php', |
|
767 | + $EE->CFG->template_settings->EED_Events_Archive_Filters |
|
768 | + ); |
|
769 | + } |
|
770 | + |
|
771 | + |
|
772 | + /** |
|
773 | + * set_default_settings |
|
774 | + * |
|
775 | + * @access public |
|
776 | + * @static |
|
777 | + * @return void |
|
778 | + */ |
|
779 | + public static function set_default_settings($CFG) |
|
780 | + { |
|
781 | + // EEH_Debug_Tools::printr( $CFG, '$CFG <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
782 | + $CFG->display_description = isset($CFG->display_description) && ! empty($CFG->display_description) |
|
783 | + ? $CFG->display_description : 1; |
|
784 | + $CFG->display_address = isset($CFG->display_address) && ! empty($CFG->display_address) ? $CFG->display_address |
|
785 | + : true; |
|
786 | + $CFG->display_venue_details = isset($CFG->display_venue_details) && ! empty($CFG->display_venue_details) |
|
787 | + ? $CFG->display_venue_details : true; |
|
788 | + $CFG->display_expired_events = isset($CFG->display_expired_events) && ! empty($CFG->display_expired_events) |
|
789 | + ? $CFG->display_expired_events : false; |
|
790 | + $CFG->default_type = isset($CFG->default_type) && ! empty($CFG->default_type) ? $CFG->default_type : 'grid'; |
|
791 | + $CFG->event_list_grid_size = isset($CFG->event_list_grid_size) && ! empty($CFG->event_list_grid_size) |
|
792 | + ? $CFG->event_list_grid_size : 'medium'; |
|
793 | + $CFG->templates['full'] = isset($CFG->templates['full']) && ! empty($CFG->templates['full']) |
|
794 | + ? $CFG->templates['full'] |
|
795 | + : EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php'; |
|
796 | + $CFG->templates['part'] = isset($CFG->templates['part']) && ! empty($CFG->templates['part']) |
|
797 | + ? $CFG->templates['part'] |
|
798 | + : EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-grid-view.php'; |
|
799 | + return $CFG; |
|
800 | + } |
|
801 | + |
|
802 | + |
|
803 | + /** |
|
804 | + * filter_config |
|
805 | + * |
|
806 | + * @access public |
|
807 | + * @return void |
|
808 | + */ |
|
809 | + public function filter_config($CFG) |
|
810 | + { |
|
811 | + return $CFG; |
|
812 | + } |
|
813 | + |
|
814 | + |
|
815 | + /** |
|
816 | + * filter_config |
|
817 | + * |
|
818 | + * @access public |
|
819 | + * @return void |
|
820 | + */ |
|
821 | + public static function update_template_settings($CFG, $REQ) |
|
822 | + { |
|
823 | + // $CFG->template_settings->EED_Events_Archive_Filters = new stdClass(); |
|
824 | + $CFG->EED_Events_Archive_Filters->display_description = isset($REQ['display_description_in_event_list']) |
|
825 | + ? absint($REQ['display_description_in_event_list']) : 1; |
|
826 | + $CFG->EED_Events_Archive_Filters->display_address = isset($REQ['display_address_in_event_list']) ? absint( |
|
827 | + $REQ['display_address_in_event_list'] |
|
828 | + ) : true; |
|
829 | + $CFG->EED_Events_Archive_Filters->display_venue_details = isset($REQ['display_venue_details_in_event_list']) |
|
830 | + ? absint($REQ['display_venue_details_in_event_list']) : true; |
|
831 | + $CFG->EED_Events_Archive_Filters->display_expired_events = isset($REQ['display_expired_events']) ? absint( |
|
832 | + $REQ['display_expired_events'] |
|
833 | + ) : false; |
|
834 | + $CFG->EED_Events_Archive_Filters->default_type = isset($REQ['default_type']) ? sanitize_text_field( |
|
835 | + $REQ['default_type'] |
|
836 | + ) : 'grid'; |
|
837 | + $CFG->EED_Events_Archive_Filters->event_list_grid_size = isset($REQ['event_list_grid_size']) |
|
838 | + ? sanitize_text_field($REQ['event_list_grid_size']) : 'medium'; |
|
839 | + $CFG->EED_Events_Archive_Filters->templates = array( |
|
840 | + 'full' => EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php', |
|
841 | + ); |
|
842 | + |
|
843 | + switch ($CFG->EED_Events_Archive_Filters->default_type) { |
|
844 | + case 'dates': |
|
845 | + $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() |
|
846 | + . DS . 'archive-espresso_events-dates-view.php'; |
|
847 | + break; |
|
848 | + case 'text': |
|
849 | + $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() |
|
850 | + . DS . 'archive-espresso_events-text-view.php'; |
|
851 | + break; |
|
852 | + default: |
|
853 | + $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() |
|
854 | + . DS . 'archive-espresso_events-grid-view.php'; |
|
855 | + } |
|
856 | + |
|
857 | + $CFG->EED_Events_Archive_Filters = isset($REQ['reset_event_list_settings']) |
|
858 | + && absint($REQ['reset_event_list_settings']) == 1 |
|
859 | + ? new EE_Events_Archive_Config() |
|
860 | + : $CFG->EED_Events_Archive_Filters; |
|
861 | + return $CFG; |
|
862 | + } |
|
863 | + |
|
864 | + |
|
865 | + /** |
|
866 | + * get_template_part |
|
867 | + * |
|
868 | + * @access public |
|
869 | + * @return void |
|
870 | + */ |
|
871 | + public static function get_template_part() |
|
872 | + { |
|
873 | + switch (self::$_type) { |
|
874 | + case 'dates': |
|
875 | + return 'archive-espresso_events-dates-view.php'; |
|
876 | + break; |
|
877 | + case 'text': |
|
878 | + return 'archive-espresso_events-text-view.php'; |
|
879 | + break; |
|
880 | + default: |
|
881 | + return 'archive-espresso_events-grid-view.php'; |
|
882 | + } |
|
883 | + } |
|
884 | + |
|
885 | + |
|
886 | + /** |
|
887 | + * event_list_template_filters |
|
888 | + * |
|
889 | + * @access public |
|
890 | + * @return void |
|
891 | + */ |
|
892 | + public function event_list_template_filters() |
|
893 | + { |
|
894 | + $args = array( |
|
895 | + 'form_url' => get_post_type_archive_link('espresso_events'), |
|
896 | + // add_query_arg( array( 'post_type' => 'espresso_events' ), home_url() ), |
|
897 | + 'elf_month' => EED_Events_Archive_Filters::_display_month(), |
|
898 | + 'elf_category' => EED_Events_Archive_Filters::_event_category_slug(), |
|
899 | + 'elf_show_expired' => EED_Events_Archive_Filters::_show_expired(), |
|
900 | + 'elf_type' => self::$_type, |
|
901 | + ); |
|
902 | + EEH_Template::display_template( |
|
903 | + EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-filters.php', |
|
904 | + $args |
|
905 | + ); |
|
906 | + } |
|
907 | + |
|
908 | + |
|
909 | + /** |
|
910 | + * event_list_css |
|
911 | + * |
|
912 | + * @access public |
|
913 | + * @return void |
|
914 | + */ |
|
915 | + public static function event_list_css($extra_class = '') |
|
916 | + { |
|
917 | + $EE = EE_Registry::instance(); |
|
918 | + $event_list_css = ! empty($extra_class) ? array($extra_class) : array(); |
|
919 | + $event_list_css[] = 'espresso-event-list-event'; |
|
920 | + if (self::$_type == 'grid') { |
|
921 | + $event_list_grid_size = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size) |
|
922 | + ? $EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size : 'medium'; |
|
923 | + $event_list_css[] = $event_list_grid_size . '-event-list-grid'; |
|
924 | + } |
|
925 | + $event_list_css = apply_filters( |
|
926 | + 'EED_Events_Archive_Filters__event_list_css__event_list_css_array', |
|
927 | + $event_list_css |
|
928 | + ); |
|
929 | + return implode(' ', $event_list_css); |
|
930 | + } |
|
931 | + |
|
932 | + |
|
933 | + /** |
|
934 | + * event_categories |
|
935 | + * |
|
936 | + * @access public |
|
937 | + * @return void |
|
938 | + */ |
|
939 | + public static function event_categories() |
|
940 | + { |
|
941 | + return EE_Registry::instance()->load_model('Term')->get_all_ee_categories(); |
|
942 | + } |
|
943 | + |
|
944 | + |
|
945 | + /** |
|
946 | + * display_description |
|
947 | + * |
|
948 | + * @access public |
|
949 | + * @return void |
|
950 | + */ |
|
951 | + public static function display_description($value) |
|
952 | + { |
|
953 | + $EE = EE_Registry::instance(); |
|
954 | + $display_description = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_description) |
|
955 | + ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_description : 1; |
|
956 | + return $display_description === $value ? true : false; |
|
957 | + } |
|
958 | + |
|
959 | + |
|
960 | + /** |
|
961 | + * display_venue_details |
|
962 | + * |
|
963 | + * @access public |
|
964 | + * @return void |
|
965 | + */ |
|
966 | + public static function display_venue_details() |
|
967 | + { |
|
968 | + $EE = EE_Registry::instance(); |
|
969 | + $display_venue_details = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details) |
|
970 | + ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details : true; |
|
971 | + $venue_name = EEH_Venue_View::venue_name(); |
|
972 | + return $display_venue_details && ! empty($venue_name) ? true : false; |
|
973 | + } |
|
974 | + |
|
975 | + |
|
976 | + /** |
|
977 | + * display_address |
|
978 | + * |
|
979 | + * @access public |
|
980 | + * @return void |
|
981 | + */ |
|
982 | + public static function display_address() |
|
983 | + { |
|
984 | + $EE = EE_Registry::instance(); |
|
985 | + $display_address = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_address) |
|
986 | + ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_address : false; |
|
987 | + $venue_name = EEH_Venue_View::venue_name(); |
|
988 | + return $display_address && ! empty($venue_name) ? true : false; |
|
989 | + } |
|
990 | + |
|
991 | + |
|
992 | + /** |
|
993 | + * pagination |
|
994 | + * |
|
995 | + * @access public |
|
996 | + * @return void |
|
997 | + */ |
|
998 | + public static function pagination() |
|
999 | + { |
|
1000 | + global $wp_query; |
|
1001 | + $big = 999999999; // need an unlikely integer |
|
1002 | + $pagination = paginate_links( |
|
1003 | + array( |
|
1004 | + 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
1005 | + 'format' => '?paged=%#%', |
|
1006 | + 'current' => max(1, get_query_var('paged')), |
|
1007 | + 'total' => $wp_query->max_num_pages, |
|
1008 | + 'show_all' => true, |
|
1009 | + 'end_size' => 10, |
|
1010 | + 'mid_size' => 6, |
|
1011 | + 'prev_next' => true, |
|
1012 | + 'prev_text' => __('‹ PREV', 'event_espresso'), |
|
1013 | + 'next_text' => __('NEXT ›', 'event_espresso'), |
|
1014 | + 'type' => 'plain', |
|
1015 | + 'add_args' => false, |
|
1016 | + 'add_fragment' => '', |
|
1017 | + ) |
|
1018 | + ); |
|
1019 | + return ! empty($pagination) ? '<div class="ee-pagination-dv clear">' . $pagination . '</div>' : ''; |
|
1020 | + } |
|
1021 | + |
|
1022 | + |
|
1023 | + /** |
|
1024 | + * event_list_title |
|
1025 | + * |
|
1026 | + * @access public |
|
1027 | + * @return void |
|
1028 | + */ |
|
1029 | + public static function event_list_title() |
|
1030 | + { |
|
1031 | + return apply_filters( |
|
1032 | + 'EED_Events_Archive_Filters__event_list_title__event_list_title', |
|
1033 | + __('Upcoming Events', 'event_espresso') |
|
1034 | + ); |
|
1035 | + } |
|
1036 | 1036 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | ) : ''; |
158 | 158 | $view = ! empty($elf_type) ? $elf_type : $view; |
159 | 159 | $view = apply_filters('EED_Events_Archive_Filters__set_type__type', $view); |
160 | - if (! empty($view) && in_array($view, EED_Events_Archive_Filters::$_types)) { |
|
160 | + if ( ! empty($view) && in_array($view, EED_Events_Archive_Filters::$_types)) { |
|
161 | 161 | self::$_type = $view; |
162 | 162 | } |
163 | 163 | } |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | public static function posts_join_sql_for_terms($join_terms = null) |
253 | 253 | { |
254 | 254 | $SQL = ''; |
255 | - if (! empty($join_terms)) { |
|
255 | + if ( ! empty($join_terms)) { |
|
256 | 256 | global $wpdb; |
257 | 257 | $SQL .= " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)"; |
258 | 258 | $SQL .= " LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)"; |
@@ -279,29 +279,29 @@ discard block |
||
279 | 279 | switch ($orderby) { |
280 | 280 | case 'ticket_start': |
281 | 281 | case 'ticket_end': |
282 | - $SQL .= ' LEFT JOIN ' . EEM_Datetime_Ticket::instance()->table() . ' ON (' |
|
283 | - . EEM_Datetime::instance()->table() . '.DTT_ID = ' |
|
284 | - . EEM_Datetime_Ticket::instance()->table() . '.DTT_ID )'; |
|
285 | - $SQL .= ' LEFT JOIN ' . EEM_Ticket::instance()->table() . ' ON (' |
|
286 | - . EEM_Datetime_Ticket::instance()->table() . '.TKT_ID = ' |
|
287 | - . EEM_Ticket::instance()->table() . '.TKT_ID )'; |
|
282 | + $SQL .= ' LEFT JOIN '.EEM_Datetime_Ticket::instance()->table().' ON (' |
|
283 | + . EEM_Datetime::instance()->table().'.DTT_ID = ' |
|
284 | + . EEM_Datetime_Ticket::instance()->table().'.DTT_ID )'; |
|
285 | + $SQL .= ' LEFT JOIN '.EEM_Ticket::instance()->table().' ON (' |
|
286 | + . EEM_Datetime_Ticket::instance()->table().'.TKT_ID = ' |
|
287 | + . EEM_Ticket::instance()->table().'.TKT_ID )'; |
|
288 | 288 | break; |
289 | 289 | |
290 | 290 | case 'venue_title': |
291 | 291 | case 'city': |
292 | - $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = ' |
|
293 | - . EEM_Event_Venue::instance()->table() . '.EVT_ID )'; |
|
294 | - $SQL .= ' LEFT JOIN ' . EEM_Venue::instance()->table() . ' ON (' |
|
295 | - . EEM_Event_Venue::instance()->table() . '.VNU_ID = ' |
|
296 | - . EEM_Venue::instance()->table() . '.VNU_ID )'; |
|
292 | + $SQL .= ' LEFT JOIN '.EEM_Event_Venue::instance()->table().' ON ('.$wpdb->posts.'.ID = ' |
|
293 | + . EEM_Event_Venue::instance()->table().'.EVT_ID )'; |
|
294 | + $SQL .= ' LEFT JOIN '.EEM_Venue::instance()->table().' ON (' |
|
295 | + . EEM_Event_Venue::instance()->table().'.VNU_ID = ' |
|
296 | + . EEM_Venue::instance()->table().'.VNU_ID )'; |
|
297 | 297 | break; |
298 | 298 | |
299 | 299 | case 'state': |
300 | - $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = ' |
|
301 | - . EEM_Event_Venue::instance()->table() . '.EVT_ID )'; |
|
302 | - $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->second_table() . ' ON (' |
|
303 | - . EEM_Event_Venue::instance()->table() . '.VNU_ID = ' |
|
304 | - . EEM_Event_Venue::instance()->second_table() . '.VNU_ID )'; |
|
300 | + $SQL .= ' LEFT JOIN '.EEM_Event_Venue::instance()->table().' ON ('.$wpdb->posts.'.ID = ' |
|
301 | + . EEM_Event_Venue::instance()->table().'.EVT_ID )'; |
|
302 | + $SQL .= ' LEFT JOIN '.EEM_Event_Venue::instance()->second_table().' ON (' |
|
303 | + . EEM_Event_Venue::instance()->table().'.VNU_ID = ' |
|
304 | + . EEM_Event_Venue::instance()->second_table().'.VNU_ID )'; |
|
305 | 305 | break; |
306 | 306 | } |
307 | 307 | } |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | public static function posts_where_sql_for_show_expired($show_expired = false) |
348 | 348 | { |
349 | 349 | return ! $show_expired |
350 | - ? ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end > "' . date('Y-m-d H:s:i') . '" ' |
|
350 | + ? ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_end > "'.date('Y-m-d H:s:i').'" ' |
|
351 | 351 | : ''; |
352 | 352 | } |
353 | 353 | |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | public static function posts_where_sql_for_event_category_slug($event_category_slug = null) |
363 | 363 | { |
364 | 364 | global $wpdb; |
365 | - return ! empty($event_category_slug) ? ' AND ' . $wpdb->terms . '.slug = "' . $event_category_slug . '" ' : ''; |
|
365 | + return ! empty($event_category_slug) ? ' AND '.$wpdb->terms.'.slug = "'.$event_category_slug.'" ' : ''; |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | /** |
@@ -375,13 +375,13 @@ discard block |
||
375 | 375 | public static function posts_where_sql_for_event_list_month($month = null) |
376 | 376 | { |
377 | 377 | $SQL = ''; |
378 | - if (! empty($month)) { |
|
378 | + if ( ! empty($month)) { |
|
379 | 379 | // event start date is LESS than the end of the month ( so nothing that doesn't start until next month ) |
380 | - $SQL = ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start'; |
|
381 | - $SQL .= ' <= "' . date('Y-m-t 23:59:59', \EEH_DTT_Helper::first_of_month_timestamp($month)) . '"'; |
|
380 | + $SQL = ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_start'; |
|
381 | + $SQL .= ' <= "'.date('Y-m-t 23:59:59', \EEH_DTT_Helper::first_of_month_timestamp($month)).'"'; |
|
382 | 382 | // event end date is GREATER than the start of the month ( so nothing that ended before this month ) |
383 | - $SQL .= ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end'; |
|
384 | - $SQL .= ' >= "' . date('Y-m-d 0:0:00', \EEH_DTT_Helper::first_of_month_timestamp($month)) . '" '; |
|
383 | + $SQL .= ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_end'; |
|
384 | + $SQL .= ' >= "'.date('Y-m-d 0:0:00', \EEH_DTT_Helper::first_of_month_timestamp($month)).'" '; |
|
385 | 385 | } |
386 | 386 | return $SQL; |
387 | 387 | } |
@@ -436,43 +436,43 @@ discard block |
||
436 | 436 | switch ($orderby) { |
437 | 437 | case 'id': |
438 | 438 | case 'ID': |
439 | - $SQL .= $glue . $wpdb->posts . '.ID ' . $sort; |
|
439 | + $SQL .= $glue.$wpdb->posts.'.ID '.$sort; |
|
440 | 440 | break; |
441 | 441 | |
442 | 442 | case 'start_date': |
443 | - $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_start ' . $sort; |
|
443 | + $SQL .= $glue.EEM_Datetime::instance()->table().'.DTT_EVT_start '.$sort; |
|
444 | 444 | break; |
445 | 445 | |
446 | 446 | case 'end_date': |
447 | - $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_end ' . $sort; |
|
447 | + $SQL .= $glue.EEM_Datetime::instance()->table().'.DTT_EVT_end '.$sort; |
|
448 | 448 | break; |
449 | 449 | |
450 | 450 | case 'event_name': |
451 | - $SQL .= $glue . $wpdb->posts . '.post_title ' . $sort; |
|
451 | + $SQL .= $glue.$wpdb->posts.'.post_title '.$sort; |
|
452 | 452 | break; |
453 | 453 | |
454 | 454 | case 'category_slug': |
455 | - $SQL .= $glue . $wpdb->terms . '.slug ' . $sort; |
|
455 | + $SQL .= $glue.$wpdb->terms.'.slug '.$sort; |
|
456 | 456 | break; |
457 | 457 | |
458 | 458 | case 'ticket_start': |
459 | - $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_start_date ' . $sort; |
|
459 | + $SQL .= $glue.EEM_Ticket::instance()->table().'.TKT_start_date '.$sort; |
|
460 | 460 | break; |
461 | 461 | |
462 | 462 | case 'ticket_end': |
463 | - $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_end_date ' . $sort; |
|
463 | + $SQL .= $glue.EEM_Ticket::instance()->table().'.TKT_end_date '.$sort; |
|
464 | 464 | break; |
465 | 465 | |
466 | 466 | case 'venue_title': |
467 | - $SQL .= $glue . 'venue_title ' . $sort; |
|
467 | + $SQL .= $glue.'venue_title '.$sort; |
|
468 | 468 | break; |
469 | 469 | |
470 | 470 | case 'city': |
471 | - $SQL .= $glue . EEM_Venue::instance()->second_table() . '.VNU_city ' . $sort; |
|
471 | + $SQL .= $glue.EEM_Venue::instance()->second_table().'.VNU_city '.$sort; |
|
472 | 472 | break; |
473 | 473 | |
474 | 474 | case 'state': |
475 | - $SQL .= $glue . EEM_State::instance()->table() . '.STA_name ' . $sort; |
|
475 | + $SQL .= $glue.EEM_State::instance()->table().'.STA_name '.$sort; |
|
476 | 476 | break; |
477 | 477 | } |
478 | 478 | $cntr++; |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | */ |
527 | 527 | public function event_list_pagination() |
528 | 528 | { |
529 | - echo '<div class="ee-pagination-dv ee-clear-float">' . espresso_event_list_pagination() . '</div>'; |
|
529 | + echo '<div class="ee-pagination-dv ee-clear-float">'.espresso_event_list_pagination().'</div>'; |
|
530 | 530 | } |
531 | 531 | |
532 | 532 | |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | public function event_details($content) |
541 | 541 | { |
542 | 542 | return EEH_Template::display_template( |
543 | - EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-details.php', |
|
543 | + EE_TEMPLATES.EE_Config::get_current_theme().DS.'content-espresso_events-details.php', |
|
544 | 544 | array('the_content' => $content), |
545 | 545 | true |
546 | 546 | ); |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | { |
559 | 559 | return $content |
560 | 560 | . EEH_Template::display_template( |
561 | - EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-tickets.php', |
|
561 | + EE_TEMPLATES.EE_Config::get_current_theme().DS.'content-espresso_events-tickets.php', |
|
562 | 562 | array(), |
563 | 563 | true |
564 | 564 | ); |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | { |
576 | 576 | return $content |
577 | 577 | . EEH_Template::display_template( |
578 | - EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-datetimes.php', |
|
578 | + EE_TEMPLATES.EE_Config::get_current_theme().DS.'content-espresso_events-datetimes.php', |
|
579 | 579 | array(), |
580 | 580 | true |
581 | 581 | ); |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | { |
593 | 593 | return $content |
594 | 594 | . EEH_Template::display_template( |
595 | - EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-venues.php', |
|
595 | + EE_TEMPLATES.EE_Config::get_current_theme().DS.'content-espresso_events-venues.php', |
|
596 | 596 | array(), |
597 | 597 | true |
598 | 598 | ); |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | */ |
628 | 628 | private function _get_template($which = 'part') |
629 | 629 | { |
630 | - return EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php'; |
|
630 | + return EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events.php'; |
|
631 | 631 | } |
632 | 632 | |
633 | 633 | |
@@ -687,27 +687,27 @@ discard block |
||
687 | 687 | if (apply_filters('FHEE_enable_default_espresso_css', false)) { |
688 | 688 | // first check uploads folder |
689 | 689 | if (is_readable( |
690 | - get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css' |
|
690 | + get_stylesheet_directory().EE_Config::get_current_theme().DS.'archive-espresso_events.css' |
|
691 | 691 | )) { |
692 | 692 | wp_register_style( |
693 | 693 | 'archive-espresso_events', |
694 | - get_stylesheet_directory_uri() . EE_Config::get_current_theme( |
|
695 | - ) . DS . 'archive-espresso_events.css', |
|
694 | + get_stylesheet_directory_uri().EE_Config::get_current_theme( |
|
695 | + ).DS.'archive-espresso_events.css', |
|
696 | 696 | array('dashicons', 'espresso_default') |
697 | 697 | ); |
698 | 698 | } else { |
699 | 699 | wp_register_style( |
700 | 700 | 'archive-espresso_events', |
701 | - EE_TEMPLATES_URL . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css', |
|
701 | + EE_TEMPLATES_URL.EE_Config::get_current_theme().DS.'archive-espresso_events.css', |
|
702 | 702 | array('dashicons', 'espresso_default') |
703 | 703 | ); |
704 | 704 | } |
705 | 705 | if (is_readable( |
706 | - get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.js' |
|
706 | + get_stylesheet_directory().EE_Config::get_current_theme().DS.'archive-espresso_events.js' |
|
707 | 707 | )) { |
708 | 708 | wp_register_script( |
709 | 709 | 'archive-espresso_events', |
710 | - get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.js', |
|
710 | + get_stylesheet_directory_uri().EE_Config::get_current_theme().DS.'archive-espresso_events.js', |
|
711 | 711 | array('jquery-masonry'), |
712 | 712 | '1.0', |
713 | 713 | true |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | } else { |
716 | 716 | wp_register_script( |
717 | 717 | 'archive-espresso_events', |
718 | - EVENTS_ARCHIVE_ASSETS_URL . 'archive-espresso_events.js', |
|
718 | + EVENTS_ARCHIVE_ASSETS_URL.'archive-espresso_events.js', |
|
719 | 719 | array('jquery-masonry'), |
720 | 720 | '1.0', |
721 | 721 | true |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | $EE->CFG->template_settings->EED_Events_Archive_Filters |
764 | 764 | ); |
765 | 765 | EEH_Template::display_template( |
766 | - EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php', |
|
766 | + EVENTS_ARCHIVE_TEMPLATES_PATH.'admin-event-list-settings.template.php', |
|
767 | 767 | $EE->CFG->template_settings->EED_Events_Archive_Filters |
768 | 768 | ); |
769 | 769 | } |
@@ -792,10 +792,10 @@ discard block |
||
792 | 792 | ? $CFG->event_list_grid_size : 'medium'; |
793 | 793 | $CFG->templates['full'] = isset($CFG->templates['full']) && ! empty($CFG->templates['full']) |
794 | 794 | ? $CFG->templates['full'] |
795 | - : EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php'; |
|
795 | + : EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events.php'; |
|
796 | 796 | $CFG->templates['part'] = isset($CFG->templates['part']) && ! empty($CFG->templates['part']) |
797 | 797 | ? $CFG->templates['part'] |
798 | - : EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-grid-view.php'; |
|
798 | + : EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-grid-view.php'; |
|
799 | 799 | return $CFG; |
800 | 800 | } |
801 | 801 | |
@@ -837,21 +837,21 @@ discard block |
||
837 | 837 | $CFG->EED_Events_Archive_Filters->event_list_grid_size = isset($REQ['event_list_grid_size']) |
838 | 838 | ? sanitize_text_field($REQ['event_list_grid_size']) : 'medium'; |
839 | 839 | $CFG->EED_Events_Archive_Filters->templates = array( |
840 | - 'full' => EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php', |
|
840 | + 'full' => EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events.php', |
|
841 | 841 | ); |
842 | 842 | |
843 | 843 | switch ($CFG->EED_Events_Archive_Filters->default_type) { |
844 | 844 | case 'dates': |
845 | - $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() |
|
846 | - . DS . 'archive-espresso_events-dates-view.php'; |
|
845 | + $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme() |
|
846 | + . DS.'archive-espresso_events-dates-view.php'; |
|
847 | 847 | break; |
848 | 848 | case 'text': |
849 | - $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() |
|
850 | - . DS . 'archive-espresso_events-text-view.php'; |
|
849 | + $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme() |
|
850 | + . DS.'archive-espresso_events-text-view.php'; |
|
851 | 851 | break; |
852 | 852 | default: |
853 | - $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() |
|
854 | - . DS . 'archive-espresso_events-grid-view.php'; |
|
853 | + $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme() |
|
854 | + . DS.'archive-espresso_events-grid-view.php'; |
|
855 | 855 | } |
856 | 856 | |
857 | 857 | $CFG->EED_Events_Archive_Filters = isset($REQ['reset_event_list_settings']) |
@@ -900,7 +900,7 @@ discard block |
||
900 | 900 | 'elf_type' => self::$_type, |
901 | 901 | ); |
902 | 902 | EEH_Template::display_template( |
903 | - EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-filters.php', |
|
903 | + EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-filters.php', |
|
904 | 904 | $args |
905 | 905 | ); |
906 | 906 | } |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | if (self::$_type == 'grid') { |
921 | 921 | $event_list_grid_size = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size) |
922 | 922 | ? $EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size : 'medium'; |
923 | - $event_list_css[] = $event_list_grid_size . '-event-list-grid'; |
|
923 | + $event_list_css[] = $event_list_grid_size.'-event-list-grid'; |
|
924 | 924 | } |
925 | 925 | $event_list_css = apply_filters( |
926 | 926 | 'EED_Events_Archive_Filters__event_list_css__event_list_css_array', |
@@ -1016,7 +1016,7 @@ discard block |
||
1016 | 1016 | 'add_fragment' => '', |
1017 | 1017 | ) |
1018 | 1018 | ); |
1019 | - return ! empty($pagination) ? '<div class="ee-pagination-dv clear">' . $pagination . '</div>' : ''; |
|
1019 | + return ! empty($pagination) ? '<div class="ee-pagination-dv clear">'.$pagination.'</div>' : ''; |
|
1020 | 1020 | } |
1021 | 1021 | |
1022 | 1022 |
@@ -16,36 +16,36 @@ |
||
16 | 16 | { |
17 | 17 | |
18 | 18 | |
19 | - public function __construct() |
|
20 | - { |
|
21 | - // define some help/support page related constants |
|
22 | - define('EE_SUPPORT_PG_SLUG', 'espresso_support'); |
|
23 | - define('EE_SUPPORT_ADMIN_URL', admin_url('admin.php?page=' . EE_SUPPORT_PG_SLUG)); |
|
24 | - define('EE_SUPPORT_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES . 'support/templates/'); |
|
25 | - define('EE_SUPPORT_ADMIN', EE_ADMIN_PAGES . 'support/'); |
|
26 | - define('EE_SUPPORT_ASSETS_URL', EE_ADMIN_PAGES_URL . 'support/assets/'); |
|
27 | - parent::__construct(); |
|
28 | - } |
|
19 | + public function __construct() |
|
20 | + { |
|
21 | + // define some help/support page related constants |
|
22 | + define('EE_SUPPORT_PG_SLUG', 'espresso_support'); |
|
23 | + define('EE_SUPPORT_ADMIN_URL', admin_url('admin.php?page=' . EE_SUPPORT_PG_SLUG)); |
|
24 | + define('EE_SUPPORT_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES . 'support/templates/'); |
|
25 | + define('EE_SUPPORT_ADMIN', EE_ADMIN_PAGES . 'support/'); |
|
26 | + define('EE_SUPPORT_ASSETS_URL', EE_ADMIN_PAGES_URL . 'support/assets/'); |
|
27 | + parent::__construct(); |
|
28 | + } |
|
29 | 29 | |
30 | - protected function _set_init_properties() |
|
31 | - { |
|
32 | - $this->label = __('Help & Support', 'event_espresso'); |
|
33 | - } |
|
30 | + protected function _set_init_properties() |
|
31 | + { |
|
32 | + $this->label = __('Help & Support', 'event_espresso'); |
|
33 | + } |
|
34 | 34 | |
35 | - protected function _set_menu_map() |
|
36 | - { |
|
37 | - $this->_menu_map = new EE_Admin_Page_Sub_Menu( |
|
38 | - array( |
|
39 | - 'menu_group' => 'extras', |
|
40 | - 'menu_order' => 30, |
|
41 | - 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_AND_NETWORK_ADMIN, |
|
42 | - 'parent_slug' => 'espresso_events', |
|
43 | - 'menu_slug' => EE_SUPPORT_PG_SLUG, |
|
44 | - 'menu_label' => __('Help & Support', 'event_espresso'), |
|
45 | - 'capability' => 'ee_read_ee', |
|
46 | - 'maintenance_mode_parent' => 'espresso_maintenance_settings', |
|
47 | - 'admin_init_page' => $this, |
|
48 | - ) |
|
49 | - ); |
|
50 | - } |
|
35 | + protected function _set_menu_map() |
|
36 | + { |
|
37 | + $this->_menu_map = new EE_Admin_Page_Sub_Menu( |
|
38 | + array( |
|
39 | + 'menu_group' => 'extras', |
|
40 | + 'menu_order' => 30, |
|
41 | + 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_AND_NETWORK_ADMIN, |
|
42 | + 'parent_slug' => 'espresso_events', |
|
43 | + 'menu_slug' => EE_SUPPORT_PG_SLUG, |
|
44 | + 'menu_label' => __('Help & Support', 'event_espresso'), |
|
45 | + 'capability' => 'ee_read_ee', |
|
46 | + 'maintenance_mode_parent' => 'espresso_maintenance_settings', |
|
47 | + 'admin_init_page' => $this, |
|
48 | + ) |
|
49 | + ); |
|
50 | + } |
|
51 | 51 | } |
@@ -20,10 +20,10 @@ |
||
20 | 20 | { |
21 | 21 | // define some help/support page related constants |
22 | 22 | define('EE_SUPPORT_PG_SLUG', 'espresso_support'); |
23 | - define('EE_SUPPORT_ADMIN_URL', admin_url('admin.php?page=' . EE_SUPPORT_PG_SLUG)); |
|
24 | - define('EE_SUPPORT_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES . 'support/templates/'); |
|
25 | - define('EE_SUPPORT_ADMIN', EE_ADMIN_PAGES . 'support/'); |
|
26 | - define('EE_SUPPORT_ASSETS_URL', EE_ADMIN_PAGES_URL . 'support/assets/'); |
|
23 | + define('EE_SUPPORT_ADMIN_URL', admin_url('admin.php?page='.EE_SUPPORT_PG_SLUG)); |
|
24 | + define('EE_SUPPORT_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES.'support/templates/'); |
|
25 | + define('EE_SUPPORT_ADMIN', EE_ADMIN_PAGES.'support/'); |
|
26 | + define('EE_SUPPORT_ASSETS_URL', EE_ADMIN_PAGES_URL.'support/assets/'); |
|
27 | 27 | parent::__construct(); |
28 | 28 | } |
29 | 29 |
@@ -13,242 +13,242 @@ |
||
13 | 13 | { |
14 | 14 | |
15 | 15 | |
16 | - protected function _init_page_props() |
|
17 | - { |
|
18 | - $this->page_slug = EE_SUPPORT_PG_SLUG; |
|
19 | - $this->page_label = esc_html__('Help & Support', 'event_espresso'); |
|
20 | - $this->_admin_base_url = EE_SUPPORT_ADMIN_URL; |
|
21 | - $this->_admin_base_path = EE_SUPPORT_ADMIN; |
|
22 | - } |
|
23 | - |
|
24 | - |
|
25 | - protected function _ajax_hooks() |
|
26 | - { |
|
27 | - } |
|
28 | - |
|
29 | - |
|
30 | - protected function _define_page_props() |
|
31 | - { |
|
32 | - $this->_labels = array(); |
|
33 | - $this->_admin_page_title = $this->page_label; |
|
34 | - } |
|
35 | - |
|
36 | - |
|
37 | - protected function _set_page_routes() |
|
38 | - { |
|
39 | - $this->_page_routes = array( |
|
40 | - 'default' => array( |
|
41 | - 'func' => '_contact_support', |
|
42 | - 'capability' => 'ee_read_ee', |
|
43 | - ), |
|
44 | - 'developers' => array( |
|
45 | - 'func' => '_developers', |
|
46 | - 'capability' => 'ee_read_ee', |
|
47 | - ), |
|
48 | - 'shortcodes' => array( |
|
49 | - 'func' => '_shortcodes', |
|
50 | - 'capability' => 'ee_read_ee', |
|
51 | - ), |
|
52 | - ); |
|
53 | - } |
|
54 | - |
|
55 | - |
|
56 | - protected function _set_page_config() |
|
57 | - { |
|
58 | - $this->_page_config = array( |
|
59 | - 'default' => array( |
|
60 | - 'nav' => array( |
|
61 | - 'label' => esc_html__('Support', 'event_espresso'), |
|
62 | - 'order' => 30, |
|
63 | - ), |
|
64 | - 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_support_boxes')), |
|
65 | - 'require_nonce' => false, |
|
66 | - ), |
|
67 | - 'developers' => array( |
|
68 | - 'nav' => array( |
|
69 | - 'label' => esc_html__('Developers', 'event_espresso'), |
|
70 | - 'order' => 50, |
|
71 | - ), |
|
72 | - 'metaboxes' => $this->_default_espresso_metaboxes, |
|
73 | - 'require_nonce' => false, |
|
74 | - ), |
|
75 | - 'shortcodes' => array( |
|
76 | - 'nav' => array( |
|
77 | - 'label' => esc_html__('Shortcodes', 'event_espresso'), |
|
78 | - 'order' => 60, |
|
79 | - ), |
|
80 | - 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_shortcodes_boxes')), |
|
81 | - 'require_nonce' => false, |
|
82 | - ), |
|
83 | - ); |
|
84 | - } |
|
85 | - |
|
86 | - |
|
87 | - // none of the below group are currently used for Support pages |
|
88 | - protected function _add_screen_options() |
|
89 | - { |
|
90 | - } |
|
91 | - |
|
92 | - |
|
93 | - protected function _add_feature_pointers() |
|
94 | - { |
|
95 | - } |
|
96 | - |
|
97 | - |
|
98 | - public function admin_init() |
|
99 | - { |
|
100 | - } |
|
101 | - |
|
102 | - |
|
103 | - public function admin_notices() |
|
104 | - { |
|
105 | - } |
|
106 | - |
|
107 | - |
|
108 | - public function admin_footer_scripts() |
|
109 | - { |
|
110 | - } |
|
111 | - |
|
112 | - |
|
113 | - public function load_scripts_styles() |
|
114 | - { |
|
115 | - } |
|
116 | - |
|
117 | - |
|
118 | - protected function _installation() |
|
119 | - { |
|
120 | - $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php'; |
|
121 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
|
122 | - $template_path, |
|
123 | - '', |
|
124 | - true |
|
125 | - ); |
|
126 | - $this->display_admin_page_with_sidebar(); |
|
127 | - } |
|
128 | - |
|
129 | - |
|
130 | - protected function _resources() |
|
131 | - { |
|
132 | - $this->display_admin_page_with_sidebar(); |
|
133 | - } |
|
134 | - |
|
135 | - |
|
136 | - protected function _add_settings_metabox($box, $label, array $args) |
|
137 | - { |
|
138 | - add_meta_box( |
|
139 | - "espresso_{$box}_settings", |
|
140 | - $label, |
|
141 | - function ($post, $metabox) { |
|
142 | - echo EEH_Template::display_template( |
|
143 | - $metabox['args']['template_path'], |
|
144 | - $metabox['args']['template_args'], |
|
145 | - true |
|
146 | - ); |
|
147 | - }, |
|
148 | - $this->_current_screen->id, |
|
149 | - 'normal', |
|
150 | - 'high', |
|
151 | - apply_filters( |
|
152 | - "FHEE__Support_Admin_Page___add_settings_metabox__{$box}_args_array", |
|
153 | - $args |
|
154 | - ) |
|
155 | - ); |
|
156 | - } |
|
157 | - |
|
158 | - |
|
159 | - protected function _resources_boxes() |
|
160 | - { |
|
161 | - $boxes = apply_filters( |
|
162 | - 'FHEE__Support_Admin_Page___resources_boxes__boxes_array', |
|
163 | - array( |
|
164 | - 'favorite_theme_developers' => esc_html__('Favorite Theme Developers', 'event_espresso'), |
|
165 | - 'highly_recommended_themes' => esc_html__('Highly Recommended Themes', 'event_espresso'), |
|
166 | - 'hire_developer' => esc_html__('Hire a Developer', 'event_espresso'), |
|
167 | - 'partners' => esc_html__('Partners', 'event_espresso'), |
|
168 | - 'recommended_plugins' => esc_html__('Recommended Plugins', 'event_espresso'), |
|
169 | - 'other_resources' => esc_html__('Other Resources', 'event_espresso'), |
|
170 | - ) |
|
171 | - ); |
|
172 | - foreach ($boxes as $box => $label) { |
|
173 | - $this->_add_settings_metabox( |
|
174 | - $box, |
|
175 | - $label, |
|
176 | - array( |
|
177 | - 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
178 | - 'template_args' => $this->_template_args, |
|
179 | - ) |
|
180 | - ); |
|
181 | - } |
|
182 | - } |
|
183 | - |
|
184 | - |
|
185 | - protected function _shortcodes() |
|
186 | - { |
|
187 | - $this->display_admin_page_with_sidebar(); |
|
188 | - } |
|
189 | - |
|
190 | - |
|
191 | - protected function _shortcodes_boxes() |
|
192 | - { |
|
193 | - $boxes = apply_filters( |
|
194 | - 'FHEE__Support_Admin_Page___shortcodes_boxes__boxes_array', |
|
195 | - array( |
|
196 | - 'shortcodes_event_listings' => esc_html__('Event Listings', 'event_espresso'), |
|
197 | - 'shortcodes_ticket_selector' => esc_html__('Event Ticket Selector', 'event_espresso'), |
|
198 | - 'shortcodes_category' => esc_html__('Event Categories', 'event_espresso'), |
|
199 | - 'shortcodes_attendee' => esc_html__('Event Attendees', 'event_espresso') |
|
200 | - /*'shortcodes_single_events' => esc_html__('Single Events', 'event_espresso'),*/ |
|
201 | - /*'shortcodes_attendee_listings' => esc_html__('Attendee Listings', 'event_espresso'),*/ |
|
202 | - ) |
|
203 | - ); |
|
204 | - foreach ($boxes as $box => $label) { |
|
205 | - $this->_add_settings_metabox( |
|
206 | - $box, |
|
207 | - $label, |
|
208 | - array( |
|
209 | - 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
210 | - 'template_args' => $this->_template_args, |
|
211 | - ) |
|
212 | - ); |
|
213 | - } |
|
214 | - } |
|
215 | - |
|
216 | - |
|
217 | - protected function _contact_support() |
|
218 | - { |
|
219 | - $this->display_admin_page_with_sidebar(); |
|
220 | - } |
|
221 | - |
|
222 | - |
|
223 | - protected function _support_boxes() |
|
224 | - { |
|
225 | - $boxes = apply_filters( |
|
226 | - 'FHEE__Support_Admin_Page___support_boxes__boxes_array', |
|
227 | - array( |
|
228 | - 'contact_support' => esc_html__('Contact Support', 'event_espresso'), |
|
229 | - 'important_information' => esc_html__('Important Information', 'event_espresso'), |
|
230 | - ) |
|
231 | - ); |
|
232 | - foreach ($boxes as $box => $label) { |
|
233 | - $this->_add_settings_metabox( |
|
234 | - $box, |
|
235 | - $label, |
|
236 | - array( |
|
237 | - 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
238 | - 'template_args' => $this->_template_args, |
|
239 | - ) |
|
240 | - ); |
|
241 | - } |
|
242 | - } |
|
243 | - |
|
244 | - |
|
245 | - protected function _developers() |
|
246 | - { |
|
247 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
|
248 | - EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php', |
|
249 | - array(), |
|
250 | - true |
|
251 | - ); |
|
252 | - $this->display_admin_page_with_sidebar(); |
|
253 | - } |
|
16 | + protected function _init_page_props() |
|
17 | + { |
|
18 | + $this->page_slug = EE_SUPPORT_PG_SLUG; |
|
19 | + $this->page_label = esc_html__('Help & Support', 'event_espresso'); |
|
20 | + $this->_admin_base_url = EE_SUPPORT_ADMIN_URL; |
|
21 | + $this->_admin_base_path = EE_SUPPORT_ADMIN; |
|
22 | + } |
|
23 | + |
|
24 | + |
|
25 | + protected function _ajax_hooks() |
|
26 | + { |
|
27 | + } |
|
28 | + |
|
29 | + |
|
30 | + protected function _define_page_props() |
|
31 | + { |
|
32 | + $this->_labels = array(); |
|
33 | + $this->_admin_page_title = $this->page_label; |
|
34 | + } |
|
35 | + |
|
36 | + |
|
37 | + protected function _set_page_routes() |
|
38 | + { |
|
39 | + $this->_page_routes = array( |
|
40 | + 'default' => array( |
|
41 | + 'func' => '_contact_support', |
|
42 | + 'capability' => 'ee_read_ee', |
|
43 | + ), |
|
44 | + 'developers' => array( |
|
45 | + 'func' => '_developers', |
|
46 | + 'capability' => 'ee_read_ee', |
|
47 | + ), |
|
48 | + 'shortcodes' => array( |
|
49 | + 'func' => '_shortcodes', |
|
50 | + 'capability' => 'ee_read_ee', |
|
51 | + ), |
|
52 | + ); |
|
53 | + } |
|
54 | + |
|
55 | + |
|
56 | + protected function _set_page_config() |
|
57 | + { |
|
58 | + $this->_page_config = array( |
|
59 | + 'default' => array( |
|
60 | + 'nav' => array( |
|
61 | + 'label' => esc_html__('Support', 'event_espresso'), |
|
62 | + 'order' => 30, |
|
63 | + ), |
|
64 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_support_boxes')), |
|
65 | + 'require_nonce' => false, |
|
66 | + ), |
|
67 | + 'developers' => array( |
|
68 | + 'nav' => array( |
|
69 | + 'label' => esc_html__('Developers', 'event_espresso'), |
|
70 | + 'order' => 50, |
|
71 | + ), |
|
72 | + 'metaboxes' => $this->_default_espresso_metaboxes, |
|
73 | + 'require_nonce' => false, |
|
74 | + ), |
|
75 | + 'shortcodes' => array( |
|
76 | + 'nav' => array( |
|
77 | + 'label' => esc_html__('Shortcodes', 'event_espresso'), |
|
78 | + 'order' => 60, |
|
79 | + ), |
|
80 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_shortcodes_boxes')), |
|
81 | + 'require_nonce' => false, |
|
82 | + ), |
|
83 | + ); |
|
84 | + } |
|
85 | + |
|
86 | + |
|
87 | + // none of the below group are currently used for Support pages |
|
88 | + protected function _add_screen_options() |
|
89 | + { |
|
90 | + } |
|
91 | + |
|
92 | + |
|
93 | + protected function _add_feature_pointers() |
|
94 | + { |
|
95 | + } |
|
96 | + |
|
97 | + |
|
98 | + public function admin_init() |
|
99 | + { |
|
100 | + } |
|
101 | + |
|
102 | + |
|
103 | + public function admin_notices() |
|
104 | + { |
|
105 | + } |
|
106 | + |
|
107 | + |
|
108 | + public function admin_footer_scripts() |
|
109 | + { |
|
110 | + } |
|
111 | + |
|
112 | + |
|
113 | + public function load_scripts_styles() |
|
114 | + { |
|
115 | + } |
|
116 | + |
|
117 | + |
|
118 | + protected function _installation() |
|
119 | + { |
|
120 | + $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php'; |
|
121 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
|
122 | + $template_path, |
|
123 | + '', |
|
124 | + true |
|
125 | + ); |
|
126 | + $this->display_admin_page_with_sidebar(); |
|
127 | + } |
|
128 | + |
|
129 | + |
|
130 | + protected function _resources() |
|
131 | + { |
|
132 | + $this->display_admin_page_with_sidebar(); |
|
133 | + } |
|
134 | + |
|
135 | + |
|
136 | + protected function _add_settings_metabox($box, $label, array $args) |
|
137 | + { |
|
138 | + add_meta_box( |
|
139 | + "espresso_{$box}_settings", |
|
140 | + $label, |
|
141 | + function ($post, $metabox) { |
|
142 | + echo EEH_Template::display_template( |
|
143 | + $metabox['args']['template_path'], |
|
144 | + $metabox['args']['template_args'], |
|
145 | + true |
|
146 | + ); |
|
147 | + }, |
|
148 | + $this->_current_screen->id, |
|
149 | + 'normal', |
|
150 | + 'high', |
|
151 | + apply_filters( |
|
152 | + "FHEE__Support_Admin_Page___add_settings_metabox__{$box}_args_array", |
|
153 | + $args |
|
154 | + ) |
|
155 | + ); |
|
156 | + } |
|
157 | + |
|
158 | + |
|
159 | + protected function _resources_boxes() |
|
160 | + { |
|
161 | + $boxes = apply_filters( |
|
162 | + 'FHEE__Support_Admin_Page___resources_boxes__boxes_array', |
|
163 | + array( |
|
164 | + 'favorite_theme_developers' => esc_html__('Favorite Theme Developers', 'event_espresso'), |
|
165 | + 'highly_recommended_themes' => esc_html__('Highly Recommended Themes', 'event_espresso'), |
|
166 | + 'hire_developer' => esc_html__('Hire a Developer', 'event_espresso'), |
|
167 | + 'partners' => esc_html__('Partners', 'event_espresso'), |
|
168 | + 'recommended_plugins' => esc_html__('Recommended Plugins', 'event_espresso'), |
|
169 | + 'other_resources' => esc_html__('Other Resources', 'event_espresso'), |
|
170 | + ) |
|
171 | + ); |
|
172 | + foreach ($boxes as $box => $label) { |
|
173 | + $this->_add_settings_metabox( |
|
174 | + $box, |
|
175 | + $label, |
|
176 | + array( |
|
177 | + 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
178 | + 'template_args' => $this->_template_args, |
|
179 | + ) |
|
180 | + ); |
|
181 | + } |
|
182 | + } |
|
183 | + |
|
184 | + |
|
185 | + protected function _shortcodes() |
|
186 | + { |
|
187 | + $this->display_admin_page_with_sidebar(); |
|
188 | + } |
|
189 | + |
|
190 | + |
|
191 | + protected function _shortcodes_boxes() |
|
192 | + { |
|
193 | + $boxes = apply_filters( |
|
194 | + 'FHEE__Support_Admin_Page___shortcodes_boxes__boxes_array', |
|
195 | + array( |
|
196 | + 'shortcodes_event_listings' => esc_html__('Event Listings', 'event_espresso'), |
|
197 | + 'shortcodes_ticket_selector' => esc_html__('Event Ticket Selector', 'event_espresso'), |
|
198 | + 'shortcodes_category' => esc_html__('Event Categories', 'event_espresso'), |
|
199 | + 'shortcodes_attendee' => esc_html__('Event Attendees', 'event_espresso') |
|
200 | + /*'shortcodes_single_events' => esc_html__('Single Events', 'event_espresso'),*/ |
|
201 | + /*'shortcodes_attendee_listings' => esc_html__('Attendee Listings', 'event_espresso'),*/ |
|
202 | + ) |
|
203 | + ); |
|
204 | + foreach ($boxes as $box => $label) { |
|
205 | + $this->_add_settings_metabox( |
|
206 | + $box, |
|
207 | + $label, |
|
208 | + array( |
|
209 | + 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
210 | + 'template_args' => $this->_template_args, |
|
211 | + ) |
|
212 | + ); |
|
213 | + } |
|
214 | + } |
|
215 | + |
|
216 | + |
|
217 | + protected function _contact_support() |
|
218 | + { |
|
219 | + $this->display_admin_page_with_sidebar(); |
|
220 | + } |
|
221 | + |
|
222 | + |
|
223 | + protected function _support_boxes() |
|
224 | + { |
|
225 | + $boxes = apply_filters( |
|
226 | + 'FHEE__Support_Admin_Page___support_boxes__boxes_array', |
|
227 | + array( |
|
228 | + 'contact_support' => esc_html__('Contact Support', 'event_espresso'), |
|
229 | + 'important_information' => esc_html__('Important Information', 'event_espresso'), |
|
230 | + ) |
|
231 | + ); |
|
232 | + foreach ($boxes as $box => $label) { |
|
233 | + $this->_add_settings_metabox( |
|
234 | + $box, |
|
235 | + $label, |
|
236 | + array( |
|
237 | + 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
238 | + 'template_args' => $this->_template_args, |
|
239 | + ) |
|
240 | + ); |
|
241 | + } |
|
242 | + } |
|
243 | + |
|
244 | + |
|
245 | + protected function _developers() |
|
246 | + { |
|
247 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
|
248 | + EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php', |
|
249 | + array(), |
|
250 | + true |
|
251 | + ); |
|
252 | + $this->display_admin_page_with_sidebar(); |
|
253 | + } |
|
254 | 254 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | protected function _installation() |
119 | 119 | { |
120 | - $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php'; |
|
120 | + $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_installation.template.php'; |
|
121 | 121 | $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
122 | 122 | $template_path, |
123 | 123 | '', |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | add_meta_box( |
139 | 139 | "espresso_{$box}_settings", |
140 | 140 | $label, |
141 | - function ($post, $metabox) { |
|
141 | + function($post, $metabox) { |
|
142 | 142 | echo EEH_Template::display_template( |
143 | 143 | $metabox['args']['template_path'], |
144 | 144 | $metabox['args']['template_args'], |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $box, |
175 | 175 | $label, |
176 | 176 | array( |
177 | - 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
177 | + 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH."support_admin_details_{$box}.template.php", |
|
178 | 178 | 'template_args' => $this->_template_args, |
179 | 179 | ) |
180 | 180 | ); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $box, |
207 | 207 | $label, |
208 | 208 | array( |
209 | - 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
209 | + 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH."support_admin_details_{$box}.template.php", |
|
210 | 210 | 'template_args' => $this->_template_args, |
211 | 211 | ) |
212 | 212 | ); |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | $box, |
235 | 235 | $label, |
236 | 236 | array( |
237 | - 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
237 | + 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH."support_admin_details_{$box}.template.php", |
|
238 | 238 | 'template_args' => $this->_template_args, |
239 | 239 | ) |
240 | 240 | ); |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | protected function _developers() |
246 | 246 | { |
247 | 247 | $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
248 | - EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php', |
|
248 | + EE_SUPPORT_ADMIN_TEMPLATE_PATH.'developers_admin_details.template.php', |
|
249 | 249 | array(), |
250 | 250 | true |
251 | 251 | ); |
@@ -3,81 +3,81 @@ |
||
3 | 3 | |
4 | 4 | <h4> |
5 | 5 | <?php esc_html_e( |
6 | - 'You may be able to find an answer for your question or concern here:', |
|
7 | - 'event_espresso' |
|
8 | - ); ?> |
|
6 | + 'You may be able to find an answer for your question or concern here:', |
|
7 | + 'event_espresso' |
|
8 | + ); ?> |
|
9 | 9 | </h4> |
10 | 10 | <ol> |
11 | 11 | <li><strong><em><?php esc_html_e('A known issue.', 'event_espresso'); ?></em></strong> |
12 | 12 | <?php printf( |
13 | - esc_html__( |
|
14 | - 'Some themes and plugins have %1$sknown conflicts%2$s with Event Espresso. (You can also browse the %3$sEvent Espresso support pages%2$s or %4$sEvent Espresso support forums%2$s to see if other members have experienced and solved the problem.)', |
|
15 | - 'event_espresso' |
|
16 | - ), |
|
17 | - '<a href="https://eventespresso.com/wiki/known-third-party-plugin-theme-conflicts/" target="_blank">', |
|
18 | - '</a>', |
|
19 | - '<a href="https://eventespresso.com/support/documentation/versioned-docs/?doc_ver=ee4" target="_blank">', |
|
20 | - '<a href="https://eventespresso.com/support/forums/" target="_blank">' |
|
21 | - ); ?></li> |
|
13 | + esc_html__( |
|
14 | + 'Some themes and plugins have %1$sknown conflicts%2$s with Event Espresso. (You can also browse the %3$sEvent Espresso support pages%2$s or %4$sEvent Espresso support forums%2$s to see if other members have experienced and solved the problem.)', |
|
15 | + 'event_espresso' |
|
16 | + ), |
|
17 | + '<a href="https://eventespresso.com/wiki/known-third-party-plugin-theme-conflicts/" target="_blank">', |
|
18 | + '</a>', |
|
19 | + '<a href="https://eventespresso.com/support/documentation/versioned-docs/?doc_ver=ee4" target="_blank">', |
|
20 | + '<a href="https://eventespresso.com/support/forums/" target="_blank">' |
|
21 | + ); ?></li> |
|
22 | 22 | <li><strong><em><?php esc_html_e('A plugin conflict.', 'event_espresso'); ?></em></strong> |
23 | 23 | <?php esc_html_e( |
24 | - 'You can check to see if there is a plugin conflict by temporarily deactivating all plugins except for Event Espresso. If the problem goes away, then reactivate your plugins one by one until the issue returns. This will help you pinpoint the source of the conflict.', |
|
25 | - 'event_espresso' |
|
26 | - ); ?></li> |
|
24 | + 'You can check to see if there is a plugin conflict by temporarily deactivating all plugins except for Event Espresso. If the problem goes away, then reactivate your plugins one by one until the issue returns. This will help you pinpoint the source of the conflict.', |
|
25 | + 'event_espresso' |
|
26 | + ); ?></li> |
|
27 | 27 | <li> |
28 | 28 | <strong><em><?php esc_html_e('A theme conflict.', 'event_espresso'); ?></em></strong> |
29 | 29 | <?php |
30 | - $default_theme = wp_get_theme(WP_DEFAULT_THEME); |
|
30 | + $default_theme = wp_get_theme(WP_DEFAULT_THEME); |
|
31 | 31 | |
32 | - if ($default_theme->exists()) { |
|
33 | - printf( |
|
34 | - esc_html__( |
|
35 | - 'If your problem is not a known issue or caused by a plugin, then try activating %s (the default WordPress theme).', |
|
36 | - 'event_espresso' |
|
37 | - ), |
|
38 | - $default_theme->get('Name') |
|
39 | - ); |
|
40 | - } else { |
|
41 | - esc_html_e( |
|
42 | - 'If your problem is not a known issue or caused by a plugin, then try activating the default WordPress theme.', |
|
43 | - 'event_espresso' |
|
44 | - ); |
|
45 | - } |
|
46 | - ?> |
|
32 | + if ($default_theme->exists()) { |
|
33 | + printf( |
|
34 | + esc_html__( |
|
35 | + 'If your problem is not a known issue or caused by a plugin, then try activating %s (the default WordPress theme).', |
|
36 | + 'event_espresso' |
|
37 | + ), |
|
38 | + $default_theme->get('Name') |
|
39 | + ); |
|
40 | + } else { |
|
41 | + esc_html_e( |
|
42 | + 'If your problem is not a known issue or caused by a plugin, then try activating the default WordPress theme.', |
|
43 | + 'event_espresso' |
|
44 | + ); |
|
45 | + } |
|
46 | + ?> |
|
47 | 47 | <?php esc_html_e( |
48 | - 'If this solves the problem for you, then something in your theme is causing this issue. Check to see if an update is available for your WordPress theme or reach out to the theme author.', |
|
49 | - 'event_espresso' |
|
50 | - ); ?> |
|
48 | + 'If this solves the problem for you, then something in your theme is causing this issue. Check to see if an update is available for your WordPress theme or reach out to the theme author.', |
|
49 | + 'event_espresso' |
|
50 | + ); ?> |
|
51 | 51 | </li> |
52 | 52 | </ol> |
53 | 53 | |
54 | 54 | <p> |
55 | 55 | <?php esc_html_e( |
56 | - 'If none of the suggestions above help you find a solution, then feel free to reach out to the support team at Event Espresso.', |
|
57 | - 'event_espresso' |
|
58 | - ); ?></p> |
|
56 | + 'If none of the suggestions above help you find a solution, then feel free to reach out to the support team at Event Espresso.', |
|
57 | + 'event_espresso' |
|
58 | + ); ?></p> |
|
59 | 59 | <p> |
60 | 60 | <?php printf( |
61 | - esc_html__( |
|
62 | - 'Login to your account on EventEspresso.com and %1$screate a support post in our member support forums%2$s. Use a %3$sclear and descriptive title%4$s in your support post, %3$sdescribe the issue to the best of your knowledge%4$s, and %3$snever post any sensitive information such as login details%4$s. Be sure to also include %5$simportant information in the section below%2$s about your WordPress site.', |
|
63 | - 'event_espresso' |
|
64 | - ), |
|
65 | - '<a href="https://eventespresso.com/support/forums/" target="_blank">', |
|
66 | - '</a>', |
|
67 | - '<strong>', |
|
68 | - '</strong>', |
|
69 | - '<a href="#espresso_important_information_settings">' |
|
70 | - ); ?></p> |
|
61 | + esc_html__( |
|
62 | + 'Login to your account on EventEspresso.com and %1$screate a support post in our member support forums%2$s. Use a %3$sclear and descriptive title%4$s in your support post, %3$sdescribe the issue to the best of your knowledge%4$s, and %3$snever post any sensitive information such as login details%4$s. Be sure to also include %5$simportant information in the section below%2$s about your WordPress site.', |
|
63 | + 'event_espresso' |
|
64 | + ), |
|
65 | + '<a href="https://eventespresso.com/support/forums/" target="_blank">', |
|
66 | + '</a>', |
|
67 | + '<strong>', |
|
68 | + '</strong>', |
|
69 | + '<a href="#espresso_important_information_settings">' |
|
70 | + ); ?></p> |
|
71 | 71 | |
72 | 72 | <h4><?php esc_html_e('Have an emergency?', 'event_espresso'); ?></h4> |
73 | 73 | |
74 | 74 | <p> |
75 | 75 | <?php printf( |
76 | - esc_html__( |
|
77 | - 'We offer support tokens to members that need help with a time-sensitive issue. A support token will provide you with up to 30 minutes of one-on-one time with a team member at Event Espresso. If you have an emergency and need help quickly, then please %1$spurchase a support token%2$s.', |
|
78 | - 'event_espresso' |
|
79 | - ), |
|
80 | - '<a href="https://eventespresso.com/product/premium-support-token/?utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=help_support_tab&utm_content=support_token" target="_blank">', |
|
81 | - '</a>' |
|
82 | - ); ?></p> |
|
76 | + esc_html__( |
|
77 | + 'We offer support tokens to members that need help with a time-sensitive issue. A support token will provide you with up to 30 minutes of one-on-one time with a team member at Event Espresso. If you have an emergency and need help quickly, then please %1$spurchase a support token%2$s.', |
|
78 | + 'event_espresso' |
|
79 | + ), |
|
80 | + '<a href="https://eventespresso.com/product/premium-support-token/?utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=help_support_tab&utm_content=support_token" target="_blank">', |
|
81 | + '</a>' |
|
82 | + ); ?></p> |
|
83 | 83 | </div> |
84 | 84 | \ No newline at end of file |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | <strong>[ESPRESSO_EVENT_ATTENDEES]</strong><br> |
10 | 10 | <p class="description"> |
11 | 11 | <?php _e( |
12 | - 'With no parameters, this shows the attendees for the earliest active event, or if no active event, the earliest upcoming event. If it is used in Event Description, then it will show the attendees for that event.', |
|
13 | - 'event_espresso' |
|
14 | - ); ?> |
|
12 | + 'With no parameters, this shows the attendees for the earliest active event, or if no active event, the earliest upcoming event. If it is used in Event Description, then it will show the attendees for that event.', |
|
13 | + 'event_espresso' |
|
14 | + ); ?> |
|
15 | 15 | </p> |
16 | 16 | <br> |
17 | 17 | </li> |
@@ -40,18 +40,18 @@ discard block |
||
40 | 40 | <strong>[ESPRESSO_EVENT_ATTENDEES status=RAP]</strong><br> |
41 | 41 | <p class="description"> |
42 | 42 | <?php _e( |
43 | - 'You can list attendees that have a specific registration status (use status code) or use "all" to return all attendees regardless of status. Default when you don\'t have this parameter set is to only return attendees attached to approved contacts.', |
|
44 | - 'event_espresso' |
|
45 | - ); ?> |
|
43 | + 'You can list attendees that have a specific registration status (use status code) or use "all" to return all attendees regardless of status. Default when you don\'t have this parameter set is to only return attendees attached to approved contacts.', |
|
44 | + 'event_espresso' |
|
45 | + ); ?> |
|
46 | 46 | </p> |
47 | 47 | <p> |
48 | 48 | <?php _e('The statuses you can use are:', 'event_espresso'); ?> |
49 | 49 | <br> |
50 | 50 | <?php |
51 | - foreach (EEM_Registration::reg_status_array(array(), true) as $status_code => $status_label) { |
|
52 | - echo '<strong>' . $status_code . ':</strong>' . ' ' . $status_label . '<br>'; |
|
53 | - } |
|
54 | - ?> |
|
51 | + foreach (EEM_Registration::reg_status_array(array(), true) as $status_code => $status_label) { |
|
52 | + echo '<strong>' . $status_code . ':</strong>' . ' ' . $status_label . '<br>'; |
|
53 | + } |
|
54 | + ?> |
|
55 | 55 | |
56 | 56 | </p> |
57 | 57 | <br> |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | <strong>[ESPRESSO_EVENT_ATTENDEES display_on_archives=true]</strong><br> |
61 | 61 | <p class="description"> |
62 | 62 | <?php _e( |
63 | - 'Will display the attendees list when events are viewed on archive pages.', |
|
64 | - 'event_espresso' |
|
65 | - ); ?> |
|
63 | + 'Will display the attendees list when events are viewed on archive pages.', |
|
64 | + 'event_espresso' |
|
65 | + ); ?> |
|
66 | 66 | </p> |
67 | 67 | <br> |
68 | 68 | </li> |
@@ -49,7 +49,7 @@ |
||
49 | 49 | <br> |
50 | 50 | <?php |
51 | 51 | foreach (EEM_Registration::reg_status_array(array(), true) as $status_code => $status_label) { |
52 | - echo '<strong>' . $status_code . ':</strong>' . ' ' . $status_label . '<br>'; |
|
52 | + echo '<strong>'.$status_code.':</strong>'.' '.$status_label.'<br>'; |
|
53 | 53 | } |
54 | 54 | ?> |
55 | 55 |