@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | class EE_Messages_Email_Cancelled_Registration_Validator extends EE_Messages_Validator { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $fields, $context ) { |
|
33 | + public function __construct($fields, $context) { |
|
34 | 34 | $this->_m_name = 'email'; |
35 | 35 | $this->_mt_name = 'cancelled_registration'; |
36 | 36 | |
37 | - parent::__construct( $fields, $context ); |
|
37 | + parent::__construct($fields, $context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
47 | 47 | 'required' => array('[EVENT_LIST]') |
48 | 48 | ); |
49 | - $this->_messenger->set_validator_config( $new_config ); |
|
49 | + $this->_messenger->set_validator_config($new_config); |
|
50 | 50 | |
51 | - if ( $this->_context != 'admin' ) |
|
51 | + if ($this->_context != 'admin') |
|
52 | 52 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
53 | 53 | |
54 | 54 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | class EE_Messages_Email_Payment_Reminder_Validator extends EE_Messages_Validator { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $fields, $context ) { |
|
33 | + public function __construct($fields, $context) { |
|
34 | 34 | $this->_m_name = 'email'; |
35 | 35 | $this->_mt_name = 'payment_reminder'; |
36 | 36 | |
37 | - parent::__construct( $fields, $context ); |
|
37 | + parent::__construct($fields, $context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -45,17 +45,17 @@ discard block |
||
45 | 45 | |
46 | 46 | //modify just event_list |
47 | 47 | $new_config['event_list'] = array( |
48 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
48 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
49 | 49 | ); |
50 | 50 | $new_config['ticket_list'] = array( |
51 | 51 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
52 | 52 | ); |
53 | 53 | $new_config['content'] = array( |
54 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
54 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
55 | 55 | ); |
56 | - $this->_messenger->set_validator_config( $new_config ); |
|
56 | + $this->_messenger->set_validator_config($new_config); |
|
57 | 57 | |
58 | - if ( $this->_context != 'admin' ) |
|
58 | + if ($this->_context != 'admin') |
|
59 | 59 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
60 | 60 | |
61 | 61 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | class EE_Messages_Email_Payment_Reminder_Validator extends EE_Messages_Validator { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $fields, $context ) { |
|
33 | + public function __construct($fields, $context) { |
|
34 | 34 | $this->_m_name = 'email'; |
35 | 35 | $this->_mt_name = 'payment_reminder'; |
36 | 36 | |
37 | - parent::__construct( $fields, $context ); |
|
37 | + parent::__construct($fields, $context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -45,17 +45,17 @@ discard block |
||
45 | 45 | |
46 | 46 | //modify just event_list |
47 | 47 | $new_config['event_list'] = array( |
48 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
48 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
49 | 49 | ); |
50 | 50 | $new_config['ticket_list'] = array( |
51 | 51 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
52 | 52 | ); |
53 | 53 | $new_config['content'] = array( |
54 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
54 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
55 | 55 | ); |
56 | - $this->_messenger->set_validator_config( $new_config ); |
|
56 | + $this->_messenger->set_validator_config($new_config); |
|
57 | 57 | |
58 | - if ( $this->_context != 'admin' ) |
|
58 | + if ($this->_context != 'admin') |
|
59 | 59 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
60 | 60 | |
61 | 61 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | class EE_Messages_Email_Payment_Reminder_Validator extends EE_Messages_Validator { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $fields, $context ) { |
|
33 | + public function __construct($fields, $context) { |
|
34 | 34 | $this->_m_name = 'email'; |
35 | 35 | $this->_mt_name = 'payment_reminder'; |
36 | 36 | |
37 | - parent::__construct( $fields, $context ); |
|
37 | + parent::__construct($fields, $context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -45,17 +45,17 @@ discard block |
||
45 | 45 | |
46 | 46 | //modify just event_list |
47 | 47 | $new_config['event_list'] = array( |
48 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
48 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
49 | 49 | ); |
50 | 50 | $new_config['ticket_list'] = array( |
51 | 51 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
52 | 52 | ); |
53 | 53 | $new_config['content'] = array( |
54 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
54 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
55 | 55 | ); |
56 | - $this->_messenger->set_validator_config( $new_config ); |
|
56 | + $this->_messenger->set_validator_config($new_config); |
|
57 | 57 | |
58 | - if ( $this->_context != 'admin' ) |
|
58 | + if ($this->_context != 'admin') |
|
59 | 59 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
60 | 60 | |
61 | 61 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | * |
44 | 44 | * @param EE_Admin_Page $admin_page |
45 | 45 | */ |
46 | - public function __construct( $admin_page ) { |
|
46 | + public function __construct($admin_page) { |
|
47 | 47 | parent::__construct($admin_page); |
48 | - require_once( EE_HELPERS . 'EEH_DTT_Helper.helper.php' ); |
|
48 | + require_once(EE_HELPERS.'EEH_DTT_Helper.helper.php'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | protected function _setup_data() { |
56 | 56 | $this->_data = $this->_admin_page->get_events($this->_per_page, $this->_current_page); |
57 | - $this->_all_data_count = $this->_admin_page->get_events(0,0, TRUE); |
|
57 | + $this->_all_data_count = $this->_admin_page->get_events(0, 0, TRUE); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -85,17 +85,17 @@ discard block |
||
85 | 85 | |
86 | 86 | |
87 | 87 | $this->_sortable_columns = array( |
88 | - 'id' => array( 'EVT_ID' => true ), |
|
89 | - 'name' => array( 'EVT_name' => false ), |
|
90 | - 'author' => array( 'EVT_wp_user' => false ), |
|
91 | - 'venue' => array( 'Venue.VNU_name' => false ), |
|
88 | + 'id' => array('EVT_ID' => true), |
|
89 | + 'name' => array('EVT_name' => false), |
|
90 | + 'author' => array('EVT_wp_user' => false), |
|
91 | + 'venue' => array('Venue.VNU_name' => false), |
|
92 | 92 | 'start_date_time' => array('Datetime.DTT_EVT_start' => false), |
93 | 93 | 'reg_begins' => array('Datetime.Ticket.TKT_start_date' => false), |
94 | 94 | ); |
95 | 95 | |
96 | 96 | $this->_primary_column = 'id'; |
97 | 97 | |
98 | - $this->_hidden_columns = array( 'author' ); |
|
98 | + $this->_hidden_columns = array('author'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | protected function _add_view_counts() { |
114 | 114 | $this->_views['all']['count'] = $this->_admin_page->total_events(); |
115 | 115 | $this->_views['draft']['count'] = $this->_admin_page->total_events_draft(); |
116 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_events', 'espresso_events_trash_events' ) ) { |
|
116 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) { |
|
117 | 117 | $this->_views['trash']['count'] = $this->_admin_page->total_trashed_events(); |
118 | 118 | } |
119 | 119 | } |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | * |
125 | 125 | * @return string |
126 | 126 | */ |
127 | - protected function _get_row_class( $item ) { |
|
128 | - $class = parent::_get_row_class( $item ); |
|
127 | + protected function _get_row_class($item) { |
|
128 | + $class = parent::_get_row_class($item); |
|
129 | 129 | //add status class |
130 | - $class .= $item instanceof EE_Event ? ' ee-status-strip event-status-' . $item->get_active_status() : ''; |
|
131 | - if ( $this->_has_checkbox_column ) { |
|
130 | + $class .= $item instanceof EE_Event ? ' ee-status-strip event-status-'.$item->get_active_status() : ''; |
|
131 | + if ($this->_has_checkbox_column) { |
|
132 | 132 | $class .= ' has-checkbox-column'; |
133 | 133 | } |
134 | 134 | return $class; |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | * |
141 | 141 | * @return string |
142 | 142 | */ |
143 | - public function column_status( EE_Event $item ) { |
|
144 | - return '<span class="ee-status-strip ee-status-strip-td event-status-' . $item->get_active_status() . '"></span>'; |
|
143 | + public function column_status(EE_Event $item) { |
|
144 | + return '<span class="ee-status-strip ee-status-strip-td event-status-'.$item->get_active_status().'"></span>'; |
|
145 | 145 | }/**/ |
146 | 146 | |
147 | 147 | |
@@ -150,14 +150,14 @@ discard block |
||
150 | 150 | * |
151 | 151 | * @return string |
152 | 152 | */ |
153 | - public function column_cb( $item ) { |
|
154 | - if ( ! $item instanceof EE_Event ) { |
|
153 | + public function column_cb($item) { |
|
154 | + if ( ! $item instanceof EE_Event) { |
|
155 | 155 | return ''; |
156 | 156 | } |
157 | 157 | $this->_dtt = $item->primary_datetime(); //set this for use in other columns |
158 | 158 | |
159 | 159 | //does event have any attached registrations? |
160 | - $regs = $item->count_related( 'Registration' ); |
|
160 | + $regs = $item->count_related('Registration'); |
|
161 | 161 | return $regs > 0 && $this->_view == 'trash' ? '<span class="ee-lock-icon"></span>' : sprintf( |
162 | 162 | '<input type="checkbox" name="EVT_IDs[]" value="%s" />', $item->ID() |
163 | 163 | ); |
@@ -169,9 +169,9 @@ discard block |
||
169 | 169 | * |
170 | 170 | * @return mixed|string |
171 | 171 | */ |
172 | - public function column_id( EE_Event $item ) { |
|
172 | + public function column_id(EE_Event $item) { |
|
173 | 173 | $content = $item->ID(); |
174 | - $content .= ' <span class="show-on-mobile-view-only">' . $item->name() . '</span>'; |
|
174 | + $content .= ' <span class="show-on-mobile-view-only">'.$item->name().'</span>'; |
|
175 | 175 | return $content; |
176 | 176 | } |
177 | 177 | |
@@ -181,16 +181,16 @@ discard block |
||
181 | 181 | * |
182 | 182 | * @return string |
183 | 183 | */ |
184 | - public function column_name( EE_Event $item ) { |
|
184 | + public function column_name(EE_Event $item) { |
|
185 | 185 | $edit_query_args = array( |
186 | 186 | 'action' => 'edit', |
187 | 187 | 'post' => $item->ID() |
188 | 188 | ); |
189 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL ); |
|
190 | - $actions = $this->_column_name_action_setup( $item ); |
|
189 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL); |
|
190 | + $actions = $this->_column_name_action_setup($item); |
|
191 | 191 | $status = ''; //$item->status() !== 'publish' ? ' (' . $item->status() . ')' : ''; |
192 | - $content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>' . $status; |
|
193 | - $content .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $item->get_active_status(), false, 'sentence' ) . '</span>'; |
|
192 | + $content = '<strong><a class="row-title" href="'.$edit_link.'">'.$item->name().'</a></strong>'.$status; |
|
193 | + $content .= '<br><span class="ee-status-text-small">'.EEH_Template::pretty_status($item->get_active_status(), false, 'sentence').'</span>'; |
|
194 | 194 | $content .= $this->row_actions($actions); |
195 | 195 | return $content; |
196 | 196 | |
@@ -207,72 +207,72 @@ discard block |
||
207 | 207 | * |
208 | 208 | * @return array array of actions |
209 | 209 | */ |
210 | - protected function _column_name_action_setup( EE_Event $item ) { |
|
210 | + protected function _column_name_action_setup(EE_Event $item) { |
|
211 | 211 | //todo: remove when attendees is active |
212 | - if ( !defined('REG_ADMIN_URL') ) |
|
212 | + if ( ! defined('REG_ADMIN_URL')) |
|
213 | 213 | define('REG_ADMIN_URL', EVENTS_ADMIN_URL); |
214 | 214 | |
215 | 215 | $actions = array(); |
216 | 216 | |
217 | - if ( EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID() ) ) { |
|
217 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID())) { |
|
218 | 218 | $edit_query_args = array( |
219 | 219 | 'action' => 'edit', |
220 | 220 | 'post' => $item->ID() |
221 | 221 | ); |
222 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL ); |
|
223 | - $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Event', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>'; |
|
222 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL); |
|
223 | + $actions['edit'] = '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Event', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'; |
|
224 | 224 | |
225 | 225 | } |
226 | 226 | |
227 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ) { |
|
227 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID())) { |
|
228 | 228 | $attendees_query_args = array( |
229 | 229 | 'action' => 'default', |
230 | 230 | 'event_id' => $item->ID() |
231 | 231 | ); |
232 | - $attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL ); |
|
233 | - $actions['attendees'] = '<a href="' . $attendees_link . '" title="' . esc_attr__('View Registrations', 'event_espresso') . '">' . __('Registrations', 'event_espresso') . '</a>'; |
|
232 | + $attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL); |
|
233 | + $actions['attendees'] = '<a href="'.$attendees_link.'" title="'.esc_attr__('View Registrations', 'event_espresso').'">'.__('Registrations', 'event_espresso').'</a>'; |
|
234 | 234 | } |
235 | 235 | |
236 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_trash_event', $item->ID() ) ) { |
|
236 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_trash_event', $item->ID())) { |
|
237 | 237 | $trash_event_query_args = array( |
238 | 238 | 'action' => 'trash_event', |
239 | 239 | 'EVT_ID' => $item->ID() |
240 | 240 | ); |
241 | - $trash_event_link = EE_Admin_Page::add_query_args_and_nonce( $trash_event_query_args, EVENTS_ADMIN_URL ); |
|
241 | + $trash_event_link = EE_Admin_Page::add_query_args_and_nonce($trash_event_query_args, EVENTS_ADMIN_URL); |
|
242 | 242 | } |
243 | 243 | |
244 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_restore_event', $item->ID() ) ) { |
|
244 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_restore_event', $item->ID())) { |
|
245 | 245 | $restore_event_query_args = array( |
246 | 246 | 'action' => 'restore_event', |
247 | 247 | 'EVT_ID' => $item->ID() |
248 | 248 | ); |
249 | - $restore_event_link = EE_Admin_Page::add_query_args_and_nonce( $restore_event_query_args, EVENTS_ADMIN_URL ); |
|
249 | + $restore_event_link = EE_Admin_Page::add_query_args_and_nonce($restore_event_query_args, EVENTS_ADMIN_URL); |
|
250 | 250 | } |
251 | 251 | |
252 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_delete_event', $item->ID() ) ) { |
|
252 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_delete_event', $item->ID())) { |
|
253 | 253 | $delete_event_query_args = array( |
254 | 254 | 'action' => 'delete_event', |
255 | 255 | 'EVT_ID' => $item->ID() |
256 | 256 | ); |
257 | - $delete_event_link = EE_Admin_Page::add_query_args_and_nonce( $delete_event_query_args, EVENTS_ADMIN_URL ); |
|
257 | + $delete_event_link = EE_Admin_Page::add_query_args_and_nonce($delete_event_query_args, EVENTS_ADMIN_URL); |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | $view_link = get_permalink($item->ID()); |
261 | 261 | |
262 | - $actions['view'] = '<a href="' . $view_link . '" title="' . esc_attr__('View Event', 'event_espresso') . '">' . __('View', 'event_espresso') . '</a>'; |
|
262 | + $actions['view'] = '<a href="'.$view_link.'" title="'.esc_attr__('View Event', 'event_espresso').'">'.__('View', 'event_espresso').'</a>'; |
|
263 | 263 | |
264 | - switch ( $item->get( 'status' ) ) { |
|
264 | + switch ($item->get('status')) { |
|
265 | 265 | case 'trash' : |
266 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_restore_event', $item->ID() ) ) { |
|
267 | - $actions['restore_from_trash'] = '<a href="' . $restore_event_link . '" title="' . esc_attr__('Restore from Trash', 'event_espresso') . '">' . __('Restore from Trash', 'event_espresso') . '</a>'; |
|
266 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_restore_event', $item->ID())) { |
|
267 | + $actions['restore_from_trash'] = '<a href="'.$restore_event_link.'" title="'.esc_attr__('Restore from Trash', 'event_espresso').'">'.__('Restore from Trash', 'event_espresso').'</a>'; |
|
268 | 268 | } |
269 | - if ( $item->count_related('Registration') === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_delete_event', $item->ID() ) ) { |
|
270 | - $actions['delete'] = '<a href="' . $delete_event_link . '" title="' . esc_attr__('Delete Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>'; |
|
269 | + if ($item->count_related('Registration') === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_delete_event', $item->ID())) { |
|
270 | + $actions['delete'] = '<a href="'.$delete_event_link.'" title="'.esc_attr__('Delete Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>'; |
|
271 | 271 | } |
272 | 272 | break; |
273 | 273 | default : |
274 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_trash_event', $item->ID() ) ) { |
|
275 | - $actions['move to trash'] = '<a href="' . $trash_event_link . '" title="' . esc_attr__('Trash Event', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>'; |
|
274 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_trash_event', $item->ID())) { |
|
275 | + $actions['move to trash'] = '<a href="'.$trash_event_link.'" title="'.esc_attr__('Trash Event', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>'; |
|
276 | 276 | } |
277 | 277 | } |
278 | 278 | return $actions; |
@@ -284,17 +284,17 @@ discard block |
||
284 | 284 | * |
285 | 285 | * @return string |
286 | 286 | */ |
287 | - public function column_author( EE_Event $item ) { |
|
287 | + public function column_author(EE_Event $item) { |
|
288 | 288 | //user author info |
289 | - $event_author = get_userdata( $item->wp_user() ); |
|
290 | - $gravatar = get_avatar( $item->wp_user(), '15' ); |
|
289 | + $event_author = get_userdata($item->wp_user()); |
|
290 | + $gravatar = get_avatar($item->wp_user(), '15'); |
|
291 | 291 | //filter link |
292 | 292 | $query_args = array( |
293 | 293 | 'action' => 'default', |
294 | 294 | 'EVT_wp_user' => $item->wp_user() |
295 | 295 | ); |
296 | - $filter_url = EE_Admin_Page::add_query_args_and_nonce( $query_args, EVENTS_ADMIN_URL ); |
|
297 | - return $gravatar . ' <a href="' . $filter_url . '" title="' . esc_attr__('Click to filter events by this author.', 'event_espresso') . '">' . $event_author->display_name . '</a>'; |
|
296 | + $filter_url = EE_Admin_Page::add_query_args_and_nonce($query_args, EVENTS_ADMIN_URL); |
|
297 | + return $gravatar.' <a href="'.$filter_url.'" title="'.esc_attr__('Click to filter events by this author.', 'event_espresso').'">'.$event_author->display_name.'</a>'; |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | |
@@ -303,9 +303,9 @@ discard block |
||
303 | 303 | * |
304 | 304 | * @return string |
305 | 305 | */ |
306 | - public function column_venue( EE_Event $item ) { |
|
307 | - $venue = $item->get_first_related( 'Venue' ); |
|
308 | - return !empty( $venue ) ? $venue->name() : ''; |
|
306 | + public function column_venue(EE_Event $item) { |
|
307 | + $venue = $item->get_first_related('Venue'); |
|
308 | + return ! empty($venue) ? $venue->name() : ''; |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | |
@@ -314,10 +314,10 @@ discard block |
||
314 | 314 | * |
315 | 315 | * @throws EE_Error |
316 | 316 | */ |
317 | - public function column_start_date_time( EE_Event $item ) { |
|
318 | - echo !empty( $this->_dtt ) ? $this->_dtt->get_i18n_datetime('DTT_EVT_start') : __('No Date was saved for this Event', 'event_espresso'); |
|
317 | + public function column_start_date_time(EE_Event $item) { |
|
318 | + echo ! empty($this->_dtt) ? $this->_dtt->get_i18n_datetime('DTT_EVT_start') : __('No Date was saved for this Event', 'event_espresso'); |
|
319 | 319 | //display in user's timezone? |
320 | - echo !empty( $this->_dtt ) ? $this->_dtt->display_in_my_timezone('DTT_EVT_start', 'get_i18n_datetime', '', 'My Timezone: ' ) : ''; |
|
320 | + echo ! empty($this->_dtt) ? $this->_dtt->display_in_my_timezone('DTT_EVT_start', 'get_i18n_datetime', '', 'My Timezone: ') : ''; |
|
321 | 321 | |
322 | 322 | } |
323 | 323 | |
@@ -327,11 +327,11 @@ discard block |
||
327 | 327 | * |
328 | 328 | * @throws EE_Error |
329 | 329 | */ |
330 | - public function column_reg_begins( EE_Event $item ) { |
|
330 | + public function column_reg_begins(EE_Event $item) { |
|
331 | 331 | $reg_start = $item->get_ticket_with_earliest_start_time(); |
332 | - echo !empty( $reg_start ) ? $reg_start->get_i18n_datetime('TKT_start_date') : __('No Tickets have been setup for this Event', 'event_espresso'); |
|
332 | + echo ! empty($reg_start) ? $reg_start->get_i18n_datetime('TKT_start_date') : __('No Tickets have been setup for this Event', 'event_espresso'); |
|
333 | 333 | //display in user's timezone? |
334 | - echo !empty( $reg_start ) ? $reg_start->display_in_my_timezone('TKT_start_date', 'get_i18n_datetime', '', 'My Timezone: ' ) : '';/**/ |
|
334 | + echo ! empty($reg_start) ? $reg_start->display_in_my_timezone('TKT_start_date', 'get_i18n_datetime', '', 'My Timezone: ') : ''; /**/ |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | |
@@ -340,14 +340,14 @@ discard block |
||
340 | 340 | * |
341 | 341 | * @return int|string |
342 | 342 | */ |
343 | - public function column_attendees( EE_Event $item ) { |
|
343 | + public function column_attendees(EE_Event $item) { |
|
344 | 344 | $attendees_query_args = array( |
345 | 345 | 'action' => 'default', |
346 | 346 | 'event_id' => $item->ID() |
347 | 347 | ); |
348 | - $attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL ); |
|
349 | - $registered_attendees = EEM_Registration::instance()->get_event_registration_count( $item->ID() ); |
|
350 | - return EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ? '<a href="' . $attendees_link . '">' . $registered_attendees . '</a>' : $registered_attendees; |
|
348 | + $attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL); |
|
349 | + $registered_attendees = EEM_Registration::instance()->get_event_registration_count($item->ID()); |
|
350 | + return EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? '<a href="'.$attendees_link.'">'.$registered_attendees.'</a>' : $registered_attendees; |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | |
@@ -356,8 +356,8 @@ discard block |
||
356 | 356 | * |
357 | 357 | * @return float |
358 | 358 | */ |
359 | - public function column_tkts_sold( EE_Event $item ) { |
|
360 | - return EEM_Ticket::instance()->sum(array( array('Datetime.EVT_ID' => $item->ID() )), 'TKT_sold' ); |
|
359 | + public function column_tkts_sold(EE_Event $item) { |
|
360 | + return EEM_Ticket::instance()->sum(array(array('Datetime.EVT_ID' => $item->ID())), 'TKT_sold'); |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | |
@@ -366,38 +366,38 @@ discard block |
||
366 | 366 | * |
367 | 367 | * @return string |
368 | 368 | */ |
369 | - public function column_actions( EE_Event $item ) { |
|
369 | + public function column_actions(EE_Event $item) { |
|
370 | 370 | //todo: remove when attendees is active |
371 | - if ( !defined('REG_ADMIN_URL') ) |
|
371 | + if ( ! defined('REG_ADMIN_URL')) |
|
372 | 372 | define('REG_ADMIN_URL', EVENTS_ADMIN_URL); |
373 | 373 | $actionlinks = array(); |
374 | 374 | |
375 | 375 | $view_link = get_permalink($item->ID()); |
376 | 376 | |
377 | - $actionlinks[] = '<a href="' . $view_link . '" title="' . esc_attr__('View Event', 'event_espresso') . '" target="_blank">'; |
|
377 | + $actionlinks[] = '<a href="'.$view_link.'" title="'.esc_attr__('View Event', 'event_espresso').'" target="_blank">'; |
|
378 | 378 | $actionlinks[] = '<div class="dashicons dashicons-search"></div></a>'; |
379 | 379 | |
380 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'espresso_events_edit', $item->ID() ) ) { |
|
380 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID())) { |
|
381 | 381 | $edit_query_args = array( |
382 | 382 | 'action' => 'edit', |
383 | 383 | 'post' => $item->ID() |
384 | 384 | ); |
385 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL ); |
|
386 | - $actionlinks[] = '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Event', 'event_espresso') . '"><div class="ee-icon ee-icon-calendar-edit"></div></a>'; |
|
385 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL); |
|
386 | + $actionlinks[] = '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Event', 'event_espresso').'"><div class="ee-icon ee-icon-calendar-edit"></div></a>'; |
|
387 | 387 | } |
388 | 388 | |
389 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ) { |
|
389 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID())) { |
|
390 | 390 | $attendees_query_args = array( |
391 | 391 | 'action' => 'default', |
392 | 392 | 'event_id' => $item->ID() |
393 | 393 | ); |
394 | - $attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL ); |
|
395 | - $actionlinks[] = '<a href="' . $attendees_link . '" title="' . esc_attr__('View Registrants', 'event_espresso') . '"><div class="dashicons dashicons-groups"></div></a>'; |
|
394 | + $attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL); |
|
395 | + $actionlinks[] = '<a href="'.$attendees_link.'" title="'.esc_attr__('View Registrants', 'event_espresso').'"><div class="dashicons dashicons-groups"></div></a>'; |
|
396 | 396 | } |
397 | 397 | |
398 | - $actionlinks = apply_filters( 'FHEE__Events_Admin_List_Table__column_actions__action_links', $actionlinks, $item ); |
|
398 | + $actionlinks = apply_filters('FHEE__Events_Admin_List_Table__column_actions__action_links', $actionlinks, $item); |
|
399 | 399 | |
400 | - return $this->_action_string( implode( "\n\t", $actionlinks ), $item, 'div' ); |
|
400 | + return $this->_action_string(implode("\n\t", $actionlinks), $item, 'div'); |
|
401 | 401 | } |
402 | 402 | |
403 | 403 |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
2 | 2 | exit('NO direct script access allowed'); |
3 | 3 | /** |
4 | 4 | * Event Espresso |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * ------------------------------------------------------------------------ |
26 | 26 | */ |
27 | -class Messages_Admin_Page_Init extends EE_Admin_Page_Init { |
|
27 | +class Messages_Admin_Page_Init extends EE_Admin_Page_Init { |
|
28 | 28 | /** |
29 | 29 | *constructor |
30 | 30 | *@Constructor |
@@ -33,18 +33,18 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function __construct() { |
35 | 35 | |
36 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
36 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
37 | 37 | |
38 | - if ( ! defined( 'EE_MSG_PG_SLUG' ) ) { |
|
38 | + if ( ! defined('EE_MSG_PG_SLUG')) { |
|
39 | 39 | |
40 | - define( 'EE_MSG_PG_SLUG', 'espresso_messages' ); |
|
41 | - define( 'EE_MSG_PG_NAME', ucwords( str_replace( '_', '', EE_MSG_PG_SLUG ) ) ); |
|
42 | - define( 'EE_MSG_ADMIN', EE_ADMIN_PAGES . 'messages' . DS ); |
|
43 | - define( 'EE_MSG_ADMIN_URL', admin_url( 'admin.php?page=' . EE_MSG_PG_SLUG ) ); |
|
44 | - define( 'EE_MSG_ASSETS_PATH', EE_MSG_ADMIN . 'assets' . DS ); |
|
45 | - define( 'EE_MSG_ASSETS_URL', EE_ADMIN_PAGES_URL . 'messages/assets/' ); |
|
46 | - define( 'EE_MSG_TEMPLATE_PATH', EE_MSG_ADMIN . 'templates' . DS ); |
|
47 | - define( 'EE_MSG_TEMPLATE_URL', EE_ADMIN_PAGES_URL . 'messages/templates/' ); |
|
40 | + define('EE_MSG_PG_SLUG', 'espresso_messages'); |
|
41 | + define('EE_MSG_PG_NAME', ucwords(str_replace('_', '', EE_MSG_PG_SLUG))); |
|
42 | + define('EE_MSG_ADMIN', EE_ADMIN_PAGES.'messages'.DS); |
|
43 | + define('EE_MSG_ADMIN_URL', admin_url('admin.php?page='.EE_MSG_PG_SLUG)); |
|
44 | + define('EE_MSG_ASSETS_PATH', EE_MSG_ADMIN.'assets'.DS); |
|
45 | + define('EE_MSG_ASSETS_URL', EE_ADMIN_PAGES_URL.'messages/assets/'); |
|
46 | + define('EE_MSG_TEMPLATE_PATH', EE_MSG_ADMIN.'templates'.DS); |
|
47 | + define('EE_MSG_TEMPLATE_URL', EE_ADMIN_PAGES_URL.'messages/templates/'); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | parent::__construct(); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | |
62 | 62 | protected function _set_menu_map() { |
63 | - $this->_menu_map = new EE_Admin_Page_Sub_Menu( array( |
|
63 | + $this->_menu_map = new EE_Admin_Page_Sub_Menu(array( |
|
64 | 64 | 'menu_group' => 'management', |
65 | 65 | 'menu_order' => 10, |
66 | 66 | 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | |
50 | - protected function _parser( $shortcode ) { |
|
50 | + protected function _parser($shortcode) { |
|
51 | 51 | |
52 | 52 | |
53 | - switch ( $shortcode ) { |
|
53 | + switch ($shortcode) { |
|
54 | 54 | case '[QUESTION_LIST]' : |
55 | 55 | return $this->_get_question_list(); |
56 | 56 | break; |
@@ -64,12 +64,12 @@ discard block |
||
64 | 64 | $this->_validate_list_requirements(); |
65 | 65 | |
66 | 66 | //for when [QUESTION_LIST] is used in the [attendee_list] field. |
67 | - if ( $this->_data['data'] instanceof EE_Registration ) { |
|
67 | + if ($this->_data['data'] instanceof EE_Registration) { |
|
68 | 68 | return $this->_get_question_answer_list_for_attendee(); |
69 | 69 | } |
70 | 70 | //for when [QUESTION_LIST] is used in the main content field. |
71 | - else if ( $this->_data['data'] instanceof EE_Messages_Addressee && $this->_data['data']->reg_obj instanceof EE_Registration ) { |
|
72 | - return $this->_get_question_answer_list_for_attendee( $this->_data['data']->reg_obj ); |
|
71 | + else if ($this->_data['data'] instanceof EE_Messages_Addressee && $this->_data['data']->reg_obj instanceof EE_Registration) { |
|
72 | + return $this->_get_question_answer_list_for_attendee($this->_data['data']->reg_obj); |
|
73 | 73 | } else { |
74 | 74 | return ''; |
75 | 75 | } |
@@ -81,19 +81,19 @@ discard block |
||
81 | 81 | * Note when we parse the "[question_list]" shortcode for attendees we're actually going to retrieve the list of answers for that attendee since that is what we really need (we can derive the questions from the answers); |
82 | 82 | * @return string parsed template. |
83 | 83 | */ |
84 | - private function _get_question_answer_list_for_attendee( $reg_obj = null ) { |
|
84 | + private function _get_question_answer_list_for_attendee($reg_obj = null) { |
|
85 | 85 | $valid_shortcodes = array('question'); |
86 | 86 | $reg_obj = $reg_obj instanceof EE_Registration ? $reg_obj : $this->_data['data']; |
87 | - $template = is_array( $this->_data['template'] ) && isset( $this->_data['template']['question_list'] ) ? $this->_data['template']['question_list'] : ''; |
|
88 | - $template = empty( $template ) && isset( $this->_extra_data['template']['question_list'] ) ? $this->_extra_data['template']['question_list'] : $template; |
|
87 | + $template = is_array($this->_data['template']) && isset($this->_data['template']['question_list']) ? $this->_data['template']['question_list'] : ''; |
|
88 | + $template = empty($template) && isset($this->_extra_data['template']['question_list']) ? $this->_extra_data['template']['question_list'] : $template; |
|
89 | 89 | $ans_result = ''; |
90 | 90 | $answers = ! empty($this->_extra_data['data']->registrations[$reg_obj->ID()]['ans_objs']) ? $this->_extra_data['data']->registrations[$reg_obj->ID()]['ans_objs'] : array(); |
91 | - foreach ( $answers as $answer ) { |
|
91 | + foreach ($answers as $answer) { |
|
92 | 92 | $question = $answer->question(); |
93 | - if ( $question instanceof EE_Question and $question->admin_only() ) { |
|
93 | + if ($question instanceof EE_Question and $question->admin_only()) { |
|
94 | 94 | continue; |
95 | 95 | } |
96 | - $ans_result .= $this->_shortcode_helper->parse_question_list_template( $template, $answer, $valid_shortcodes, $this->_extra_data); |
|
96 | + $ans_result .= $this->_shortcode_helper->parse_question_list_template($template, $answer, $valid_shortcodes, $this->_extra_data); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | return $ans_result; |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * EE_Message class |
@@ -48,14 +48,14 @@ discard block |
||
48 | 48 | * @param array $date_formats incoming date formats in an array. First value is the date_format, second is time format. |
49 | 49 | * @return EE_Message |
50 | 50 | */ |
51 | - public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
|
52 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
51 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) { |
|
52 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
53 | 53 | //if object doesn't exist, let's generate a unique token on instantiation so that its available even before saving to db. |
54 | - if ( ! $has_object ) { |
|
55 | - EE_Registry::instance()->load_helper( 'URL' ); |
|
54 | + if ( ! $has_object) { |
|
55 | + EE_Registry::instance()->load_helper('URL'); |
|
56 | 56 | $props_n_values['MSG_token'] = EEH_URL::generate_unique_token(); |
57 | 57 | } |
58 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
58 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | * @param string $timezone |
67 | 67 | * @return EE_Message |
68 | 68 | */ |
69 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
|
70 | - return new self( $props_n_values, true, $timezone ); |
|
69 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) { |
|
70 | + return new self($props_n_values, true, $timezone); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @return int |
79 | 79 | */ |
80 | 80 | public function MSG_token() { |
81 | - return $this->get( 'MSG_token' ); |
|
81 | + return $this->get('MSG_token'); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | * |
89 | 89 | * @param int $MSG_token |
90 | 90 | */ |
91 | - public function set_MSG_token( $MSG_token) { |
|
92 | - $this->set( 'MSG_token', $MSG_token ); |
|
91 | + public function set_MSG_token($MSG_token) { |
|
92 | + $this->set('MSG_token', $MSG_token); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @return int |
102 | 102 | */ |
103 | 103 | public function GRP_ID() { |
104 | - return $this->get( 'GRP_ID' ); |
|
104 | + return $this->get('GRP_ID'); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | * |
112 | 112 | * @param int $GRP_ID |
113 | 113 | */ |
114 | - public function set_GRP_ID( $GRP_ID ) { |
|
115 | - $this->set( 'GRP_ID', $GRP_ID ); |
|
114 | + public function set_GRP_ID($GRP_ID) { |
|
115 | + $this->set('GRP_ID', $GRP_ID); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @return int |
125 | 125 | */ |
126 | 126 | public function TXN_ID() { |
127 | - return $this->get( 'TXN_ID' ); |
|
127 | + return $this->get('TXN_ID'); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | * |
135 | 135 | * @param int $TXN_ID |
136 | 136 | */ |
137 | - public function set_TXN_ID( $TXN_ID) { |
|
138 | - $this->set( 'TXN_ID', $TXN_ID ); |
|
137 | + public function set_TXN_ID($TXN_ID) { |
|
138 | + $this->set('TXN_ID', $TXN_ID); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * @return string |
148 | 148 | */ |
149 | 149 | public function messenger() { |
150 | - return $this->get( 'MSG_messenger' ); |
|
150 | + return $this->get('MSG_messenger'); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | * |
158 | 158 | * @param string $messenger |
159 | 159 | */ |
160 | - public function set_messenger( $messenger ) { |
|
161 | - $this->set( 'MSG_messenger', $messenger ); |
|
160 | + public function set_messenger($messenger) { |
|
161 | + $this->set('MSG_messenger', $messenger); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * |
180 | 180 | * @param EE_messenger $messenger |
181 | 181 | */ |
182 | - public function set_messenger_object( EE_messenger $messenger ) { |
|
182 | + public function set_messenger_object(EE_messenger $messenger) { |
|
183 | 183 | $this->_messenger = $messenger; |
184 | 184 | } |
185 | 185 | |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | * @return bool |
193 | 193 | * @throws \EE_Error |
194 | 194 | */ |
195 | - public function valid_messenger( $throw_exceptions = false ) { |
|
196 | - if ( $this->_messenger instanceof EE_messenger ) { |
|
195 | + public function valid_messenger($throw_exceptions = false) { |
|
196 | + if ($this->_messenger instanceof EE_messenger) { |
|
197 | 197 | return true; |
198 | 198 | } |
199 | - if ( $throw_exceptions ) { |
|
199 | + if ($throw_exceptions) { |
|
200 | 200 | throw new EE_Error( |
201 | 201 | sprintf( |
202 | 202 | __( |
@@ -220,10 +220,10 @@ discard block |
||
220 | 220 | * @param bool $plural whether to return the plural label or not. |
221 | 221 | * @return string |
222 | 222 | */ |
223 | - public function messenger_label( $plural = false ) { |
|
223 | + public function messenger_label($plural = false) { |
|
224 | 224 | $label_type = $plural ? 'plural' : 'singular'; |
225 | 225 | $messenger = $this->messenger_object(); |
226 | - return $messenger instanceof EE_messenger ? $messenger->label[ $label_type ] : $this->messenger(); |
|
226 | + return $messenger instanceof EE_messenger ? $messenger->label[$label_type] : $this->messenger(); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | * @return string |
235 | 235 | */ |
236 | 236 | public function message_type() { |
237 | - return $this->get( 'MSG_message_type' ); |
|
237 | + return $this->get('MSG_message_type'); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | |
@@ -244,8 +244,8 @@ discard block |
||
244 | 244 | * |
245 | 245 | * @param string $message_type |
246 | 246 | */ |
247 | - public function set_message_type( $message_type ) { |
|
248 | - $this->set( 'MSG_message_type', $message_type ); |
|
247 | + public function set_message_type($message_type) { |
|
248 | + $this->set('MSG_message_type', $message_type); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | |
@@ -268,10 +268,10 @@ discard block |
||
268 | 268 | * @param bool $set_priority This indicates whether to set the priority to whatever the priority is on |
269 | 269 | * the message type or not. |
270 | 270 | */ |
271 | - public function set_message_type_object( EE_message_type $message_type, $set_priority = false ) { |
|
271 | + public function set_message_type_object(EE_message_type $message_type, $set_priority = false) { |
|
272 | 272 | $this->_message_type = $message_type; |
273 | - if ( $set_priority ) { |
|
274 | - $this->set_priority( $this->_message_type->get_priority() ); |
|
273 | + if ($set_priority) { |
|
274 | + $this->set_priority($this->_message_type->get_priority()); |
|
275 | 275 | } |
276 | 276 | } |
277 | 277 | |
@@ -284,11 +284,11 @@ discard block |
||
284 | 284 | * @return bool |
285 | 285 | * @throws \EE_Error |
286 | 286 | */ |
287 | - public function valid_message_type( $throw_exceptions = false ) { |
|
288 | - if ( $this->_message_type instanceof EE_message_type ) { |
|
287 | + public function valid_message_type($throw_exceptions = false) { |
|
288 | + if ($this->_message_type instanceof EE_message_type) { |
|
289 | 289 | return true; |
290 | 290 | } |
291 | - if ( $throw_exceptions ) { |
|
291 | + if ($throw_exceptions) { |
|
292 | 292 | throw new EE_Error( |
293 | 293 | sprintf( |
294 | 294 | __( |
@@ -311,8 +311,8 @@ discard block |
||
311 | 311 | * @return bool |
312 | 312 | * @throws \EE_Error |
313 | 313 | */ |
314 | - public function is_valid( $throw_exceptions = false ) { |
|
315 | - if ( $this->valid_messenger( $throw_exceptions ) && $this->valid_message_type( $throw_exceptions ) ) { |
|
314 | + public function is_valid($throw_exceptions = false) { |
|
315 | + if ($this->valid_messenger($throw_exceptions) && $this->valid_message_type($throw_exceptions)) { |
|
316 | 316 | return true; |
317 | 317 | } |
318 | 318 | return false; |
@@ -333,16 +333,16 @@ discard block |
||
333 | 333 | * @param bool $throw_exceptions |
334 | 334 | * @return bool |
335 | 335 | */ |
336 | - public function is_valid_for_sending_or_generation( $throw_exceptions = false ) { |
|
336 | + public function is_valid_for_sending_or_generation($throw_exceptions = false) { |
|
337 | 337 | $valid = false; |
338 | - if ( $this->is_valid( $throw_exceptions ) ) { |
|
338 | + if ($this->is_valid($throw_exceptions)) { |
|
339 | 339 | /** @var EE_Message_Resource_Manager $message_resource_manager */ |
340 | - $message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
341 | - $valid = $message_resource_manager->is_message_type_active_for_messenger( $this->messenger(), $this->message_type() ); |
|
342 | - if ( ! $valid && $throw_exceptions ) { |
|
340 | + $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
341 | + $valid = $message_resource_manager->is_message_type_active_for_messenger($this->messenger(), $this->message_type()); |
|
342 | + if ( ! $valid && $throw_exceptions) { |
|
343 | 343 | throw new EE_Error( |
344 | 344 | sprintf( |
345 | - __( 'The %1$s message type is not a valid message type for the %2$s messenger so it will not be sent.', 'event_espresso' ), |
|
345 | + __('The %1$s message type is not a valid message type for the %2$s messenger so it will not be sent.', 'event_espresso'), |
|
346 | 346 | $this->message_type(), |
347 | 347 | $this->messenger() |
348 | 348 | ) |
@@ -362,10 +362,10 @@ discard block |
||
362 | 362 | * @param bool $plural whether to return the plural label or not. |
363 | 363 | * @return string |
364 | 364 | */ |
365 | - public function message_type_label( $plural = false ) { |
|
365 | + public function message_type_label($plural = false) { |
|
366 | 366 | $label_type = $plural ? 'plural' : 'singular'; |
367 | 367 | $message_type = $this->message_type_object(); |
368 | - return $message_type instanceof EE_message_type ? $message_type->label[ $label_type ] : $this->message_type(); |
|
368 | + return $message_type instanceof EE_message_type ? $message_type->label[$label_type] : $this->message_type(); |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | * @return string |
377 | 377 | */ |
378 | 378 | public function context() { |
379 | - return $this->get( 'MSG_context' ); |
|
379 | + return $this->get('MSG_context'); |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | |
@@ -390,9 +390,9 @@ discard block |
||
390 | 390 | */ |
391 | 391 | public function context_label() { |
392 | 392 | /** @type EE_Message_Resource_Manager $message_resource_manager */ |
393 | - $message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
393 | + $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
394 | 394 | $contexts = $message_resource_manager->get_all_contexts(); |
395 | - return isset( $contexts[ $this->context() ] ) ? $contexts[ $this->context() ] : $this->context(); |
|
395 | + return isset($contexts[$this->context()]) ? $contexts[$this->context()] : $this->context(); |
|
396 | 396 | } |
397 | 397 | |
398 | 398 | |
@@ -402,8 +402,8 @@ discard block |
||
402 | 402 | * |
403 | 403 | * @param string $context |
404 | 404 | */ |
405 | - public function set_context( $context ) { |
|
406 | - $this->set( 'MSG_context', $context ); |
|
405 | + public function set_context($context) { |
|
406 | + $this->set('MSG_context', $context); |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | * @return int |
415 | 415 | */ |
416 | 416 | public function recipient_ID() { |
417 | - return $this->get( 'MSG_recipient_ID' ); |
|
417 | + return $this->get('MSG_recipient_ID'); |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | |
@@ -424,8 +424,8 @@ discard block |
||
424 | 424 | * |
425 | 425 | * @param string $recipient_ID |
426 | 426 | */ |
427 | - public function set_recipient_ID( $recipient_ID ) { |
|
428 | - $this->set( 'MSG_recipient_ID', $recipient_ID ); |
|
427 | + public function set_recipient_ID($recipient_ID) { |
|
428 | + $this->set('MSG_recipient_ID', $recipient_ID); |
|
429 | 429 | } |
430 | 430 | |
431 | 431 | |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | * @return string |
437 | 437 | */ |
438 | 438 | public function recipient_type() { |
439 | - return $this->get( 'MSG_recipient_type' ); |
|
439 | + return $this->get('MSG_recipient_type'); |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | |
@@ -448,11 +448,11 @@ discard block |
||
448 | 448 | * @return EE_Base_Class | null |
449 | 449 | */ |
450 | 450 | public function recipient_object() { |
451 | - if ( ! $this->recipient_type() || ! $this->recipient_ID() ) { |
|
451 | + if ( ! $this->recipient_type() || ! $this->recipient_ID()) { |
|
452 | 452 | return null; |
453 | 453 | } |
454 | 454 | |
455 | - return $this->get_first_related( $this->recipient_type() ); |
|
455 | + return $this->get_first_related($this->recipient_type()); |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | |
@@ -462,8 +462,8 @@ discard block |
||
462 | 462 | * |
463 | 463 | * @param string $recipient_type |
464 | 464 | */ |
465 | - public function set_recipient_type( $recipient_type ) { |
|
466 | - $this->set( 'MSG_recipient_type', $recipient_type ); |
|
465 | + public function set_recipient_type($recipient_type) { |
|
466 | + $this->set('MSG_recipient_type', $recipient_type); |
|
467 | 467 | } |
468 | 468 | |
469 | 469 | |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | * @return string |
475 | 475 | */ |
476 | 476 | public function content() { |
477 | - return $this->get( 'MSG_content' ); |
|
477 | + return $this->get('MSG_content'); |
|
478 | 478 | } |
479 | 479 | |
480 | 480 | |
@@ -484,8 +484,8 @@ discard block |
||
484 | 484 | * |
485 | 485 | * @param string $content |
486 | 486 | */ |
487 | - public function set_content( $content ) { |
|
488 | - $this->set( 'MSG_content', $content ); |
|
487 | + public function set_content($content) { |
|
488 | + $this->set('MSG_content', $content); |
|
489 | 489 | } |
490 | 490 | |
491 | 491 | |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | * @return string |
497 | 497 | */ |
498 | 498 | public function subject() { |
499 | - return $this->get( 'MSG_subject' ); |
|
499 | + return $this->get('MSG_subject'); |
|
500 | 500 | } |
501 | 501 | |
502 | 502 | |
@@ -506,8 +506,8 @@ discard block |
||
506 | 506 | * |
507 | 507 | * @param string $subject |
508 | 508 | */ |
509 | - public function set_subject( $subject ) { |
|
510 | - $this->set( 'MSG_subject', $subject ); |
|
509 | + public function set_subject($subject) { |
|
510 | + $this->set('MSG_subject', $subject); |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | |
@@ -518,8 +518,8 @@ discard block |
||
518 | 518 | * @return string |
519 | 519 | */ |
520 | 520 | public function to() { |
521 | - $to = $this->get( 'MSG_to' ); |
|
522 | - return empty( $to ) ? __( 'No recipient', 'event_espresso' ) : $to; |
|
521 | + $to = $this->get('MSG_to'); |
|
522 | + return empty($to) ? __('No recipient', 'event_espresso') : $to; |
|
523 | 523 | } |
524 | 524 | |
525 | 525 | |
@@ -529,8 +529,8 @@ discard block |
||
529 | 529 | * |
530 | 530 | * @param string $to |
531 | 531 | */ |
532 | - public function set_to( $to ) { |
|
533 | - $this->set( 'MSG_to', $to ); |
|
532 | + public function set_to($to) { |
|
533 | + $this->set('MSG_to', $to); |
|
534 | 534 | } |
535 | 535 | |
536 | 536 | |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | * @return string |
542 | 542 | */ |
543 | 543 | public function from() { |
544 | - return $this->get( 'MSG_from' ); |
|
544 | + return $this->get('MSG_from'); |
|
545 | 545 | } |
546 | 546 | |
547 | 547 | |
@@ -551,8 +551,8 @@ discard block |
||
551 | 551 | * |
552 | 552 | * @param string $from |
553 | 553 | */ |
554 | - public function set_from( $from ) { |
|
555 | - $this->set( 'MSG_from', $from ); |
|
554 | + public function set_from($from) { |
|
555 | + $this->set('MSG_from', $from); |
|
556 | 556 | } |
557 | 557 | |
558 | 558 | |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | * @return int |
566 | 566 | */ |
567 | 567 | public function priority() { |
568 | - return $this->get( 'MSG_priority' ); |
|
568 | + return $this->get('MSG_priority'); |
|
569 | 569 | } |
570 | 570 | |
571 | 571 | |
@@ -578,9 +578,9 @@ discard block |
||
578 | 578 | * |
579 | 579 | * @param int $priority |
580 | 580 | */ |
581 | - public function set_priority( $priority ) { |
|
581 | + public function set_priority($priority) { |
|
582 | 582 | $priority = $this->send_now() ? EEM_Message::priority_high : $priority; |
583 | - parent::set( 'MSG_priority', $priority ); |
|
583 | + parent::set('MSG_priority', $priority); |
|
584 | 584 | } |
585 | 585 | |
586 | 586 | |
@@ -592,11 +592,11 @@ discard block |
||
592 | 592 | * @param bool $use_default |
593 | 593 | * @throws EE_Error |
594 | 594 | */ |
595 | - public function set( $field_name, $field_value, $use_default = false ) { |
|
596 | - if ( $field_name === 'MSG_priority' ) { |
|
597 | - $this->set_priority( $field_value ); |
|
595 | + public function set($field_name, $field_value, $use_default = false) { |
|
596 | + if ($field_name === 'MSG_priority') { |
|
597 | + $this->set_priority($field_value); |
|
598 | 598 | } |
599 | - parent::set( $field_name, $field_value, $use_default ); |
|
599 | + parent::set($field_name, $field_value, $use_default); |
|
600 | 600 | } |
601 | 601 | |
602 | 602 | |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | * @return string |
619 | 619 | */ |
620 | 620 | public function STS_ID() { |
621 | - return $this->get( 'STS_ID' ); |
|
621 | + return $this->get('STS_ID'); |
|
622 | 622 | } |
623 | 623 | |
624 | 624 | |
@@ -628,8 +628,8 @@ discard block |
||
628 | 628 | * |
629 | 629 | * @param string $STS_ID |
630 | 630 | */ |
631 | - public function set_STS_ID( $STS_ID ) { |
|
632 | - $this->set( 'STS_ID', $STS_ID ); |
|
631 | + public function set_STS_ID($STS_ID) { |
|
632 | + $this->set('STS_ID', $STS_ID); |
|
633 | 633 | } |
634 | 634 | |
635 | 635 | |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | * @return string |
641 | 641 | */ |
642 | 642 | public function created() { |
643 | - return $this->get( 'MSG_created' ); |
|
643 | + return $this->get('MSG_created'); |
|
644 | 644 | } |
645 | 645 | |
646 | 646 | |
@@ -650,8 +650,8 @@ discard block |
||
650 | 650 | * |
651 | 651 | * @param string $created |
652 | 652 | */ |
653 | - public function set_created( $created ) { |
|
654 | - $this->set( 'MSG_created', $created ); |
|
653 | + public function set_created($created) { |
|
654 | + $this->set('MSG_created', $created); |
|
655 | 655 | } |
656 | 656 | |
657 | 657 | |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | * @return string |
663 | 663 | */ |
664 | 664 | public function modified() { |
665 | - return $this->get( 'MSG_modified' ); |
|
665 | + return $this->get('MSG_modified'); |
|
666 | 666 | } |
667 | 667 | |
668 | 668 | |
@@ -672,8 +672,8 @@ discard block |
||
672 | 672 | * |
673 | 673 | * @param string $modified |
674 | 674 | */ |
675 | - public function set_modified( $modified ) { |
|
676 | - $this->set( 'MSG_modified', $modified ); |
|
675 | + public function set_modified($modified) { |
|
676 | + $this->set('MSG_modified', $modified); |
|
677 | 677 | } |
678 | 678 | |
679 | 679 | |
@@ -683,8 +683,8 @@ discard block |
||
683 | 683 | * Sets generation data for this message. |
684 | 684 | * @param mixed $data |
685 | 685 | */ |
686 | - public function set_generation_data( $data ) { |
|
687 | - $this->set_field_or_extra_meta( 'MSG_generation_data', $data ); |
|
686 | + public function set_generation_data($data) { |
|
687 | + $this->set_field_or_extra_meta('MSG_generation_data', $data); |
|
688 | 688 | } |
689 | 689 | |
690 | 690 | |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | * @return mixed|null |
697 | 697 | */ |
698 | 698 | public function get_generation_data() { |
699 | - return $this->get_field_or_extra_meta( 'MSG_generation_data' ); |
|
699 | + return $this->get_field_or_extra_meta('MSG_generation_data'); |
|
700 | 700 | } |
701 | 701 | |
702 | 702 | |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | * @return mixed|null |
708 | 708 | */ |
709 | 709 | public function error_message() { |
710 | - return $this->get_field_or_extra_meta( 'MSG_error' ); |
|
710 | + return $this->get_field_or_extra_meta('MSG_error'); |
|
711 | 711 | } |
712 | 712 | |
713 | 713 | |
@@ -716,8 +716,8 @@ discard block |
||
716 | 716 | * @param $message |
717 | 717 | * @return bool|int |
718 | 718 | */ |
719 | - public function set_error_message( $message ) { |
|
720 | - return $this->set_field_or_extra_meta( 'MSG_error', $message ); |
|
719 | + public function set_error_message($message) { |
|
720 | + return $this->set_field_or_extra_meta('MSG_error', $message); |
|
721 | 721 | } |
722 | 722 | |
723 | 723 | |
@@ -731,13 +731,13 @@ discard block |
||
731 | 731 | /** |
732 | 732 | * This is deprecated functionality that will be removed eventually but included here now for backward compat. |
733 | 733 | */ |
734 | - if ( ! empty( $this->template_pack ) ) { |
|
734 | + if ( ! empty($this->template_pack)) { |
|
735 | 735 | return $this->template_pack; |
736 | 736 | } |
737 | 737 | /** @type EE_Message_Template_Group $grp */ |
738 | - $grp = $this->get_first_related( 'Message_Template_Group' ); |
|
738 | + $grp = $this->get_first_related('Message_Template_Group'); |
|
739 | 739 | //if no group then let's try to get the first related group by internal messenger and message type (will use global grp). |
740 | - if ( ! $grp instanceof EE_Message_Template_Group ) { |
|
740 | + if ( ! $grp instanceof EE_Message_Template_Group) { |
|
741 | 741 | $grp = EEM_Message_Template_Group::instance()->get_one( |
742 | 742 | array( |
743 | 743 | array( |
@@ -763,15 +763,15 @@ discard block |
||
763 | 763 | /** |
764 | 764 | * This is deprecated functionality that will be removed eventually but included here now for backward compat. |
765 | 765 | */ |
766 | - if ( ! empty( $this->template_variation ) ) { |
|
766 | + if ( ! empty($this->template_variation)) { |
|
767 | 767 | return $this->template_variation; |
768 | 768 | } |
769 | 769 | |
770 | 770 | /** @type EE_Message_Template_Group $grp */ |
771 | - $grp = $this->get_first_related( 'Message_Template_Group' ); |
|
771 | + $grp = $this->get_first_related('Message_Template_Group'); |
|
772 | 772 | |
773 | 773 | //if no group then let's try to get the first related group by internal messenger and message type (will use global grp). |
774 | - if ( ! $grp instanceof EE_Message_Template_Group ) { |
|
774 | + if ( ! $grp instanceof EE_Message_Template_Group) { |
|
775 | 775 | $grp = EEM_Message_Template_Group::instance()->get_one( |
776 | 776 | array( |
777 | 777 | array( |
@@ -791,15 +791,15 @@ discard block |
||
791 | 791 | * @return string |
792 | 792 | */ |
793 | 793 | public function get_admin_details_link() { |
794 | - EE_Registry::instance()->load_helper( 'URL' ); |
|
795 | - EE_Registry::instance()->load_helper( 'MSG_Template' ); |
|
796 | - switch ( $this->STS_ID() ) { |
|
794 | + EE_Registry::instance()->load_helper('URL'); |
|
795 | + EE_Registry::instance()->load_helper('MSG_Template'); |
|
796 | + switch ($this->STS_ID()) { |
|
797 | 797 | case EEM_Message::status_failed : |
798 | - return EEH_MSG_Template::generate_error_display_trigger( $this ); |
|
798 | + return EEH_MSG_Template::generate_error_display_trigger($this); |
|
799 | 799 | break; |
800 | 800 | |
801 | 801 | case EEM_Message::status_sent : |
802 | - return EEH_MSG_Template::generate_browser_trigger( $this ); |
|
802 | + return EEH_MSG_Template::generate_browser_trigger($this); |
|
803 | 803 | break; |
804 | 804 | |
805 | 805 | default : |
@@ -820,13 +820,13 @@ discard block |
||
820 | 820 | * @return string |
821 | 821 | */ |
822 | 822 | public function get_admin_settings_link() { |
823 | - EE_Registry::instance()->load_helper( 'URL' ); |
|
823 | + EE_Registry::instance()->load_helper('URL'); |
|
824 | 824 | return EEH_URL::add_query_args_and_nonce( |
825 | 825 | array( |
826 | 826 | 'page' => 'espresso_messages', |
827 | 827 | 'action' => 'settings', |
828 | 828 | ), |
829 | - admin_url( 'admin.php' ) |
|
829 | + admin_url('admin.php') |
|
830 | 830 | ); |
831 | 831 | } |
832 | 832 | |
@@ -835,13 +835,13 @@ discard block |
||
835 | 835 | * @return string |
836 | 836 | */ |
837 | 837 | public function get_admin_overview_link() { |
838 | - EE_Registry::instance()->load_helper( 'URL' ); |
|
838 | + EE_Registry::instance()->load_helper('URL'); |
|
839 | 839 | return EEH_URL::add_query_args_and_nonce( |
840 | 840 | array( |
841 | 841 | 'page' => 'espresso_messages', |
842 | 842 | 'action' => 'default', |
843 | 843 | ), |
844 | - admin_url( 'admin.php' ) |
|
844 | + admin_url('admin.php') |
|
845 | 845 | ); |
846 | 846 | } |
847 | 847 |
@@ -704,7 +704,7 @@ |
||
704 | 704 | |
705 | 705 | /** |
706 | 706 | * Gets any error message. |
707 | - * @return mixed|null |
|
707 | + * @return string |
|
708 | 708 | */ |
709 | 709 | public function error_message() { |
710 | 710 | return $this->get_field_or_extra_meta( 'MSG_error' ); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | /** |
6 | 6 | * |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @since 4.6.0 |
16 | 16 | * |
17 | 17 | */ |
18 | -class EE_Default_Where_Conditions{ |
|
18 | +class EE_Default_Where_Conditions { |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * This const can be used in EE_Default_Where_Conditions values, and at the time of querying it will be |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * onto any field names |
49 | 49 | * @param array $custom_where_conditions |
50 | 50 | */ |
51 | - public function __construct( $custom_where_conditions = array() ) { |
|
51 | + public function __construct($custom_where_conditions = array()) { |
|
52 | 52 | $this->_where_conditions_provided = $custom_where_conditions; |
53 | 53 | } |
54 | 54 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * for querying of the model. |
60 | 60 | * @param EEM_Base $model |
61 | 61 | */ |
62 | - function _finalize_construct(EEM_Base $model){ |
|
62 | + function _finalize_construct(EEM_Base $model) { |
|
63 | 63 | $this->_model = $model; |
64 | 64 | } |
65 | 65 | |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | * @param string $model_relation_chain |
81 | 81 | * @return array like what's expected in EEM_Base::get_all()'s $query_params[0] |
82 | 82 | */ |
83 | - function get_default_where_conditions( $model_relation_chain = '' ){ |
|
84 | - return $this->prepare_where_conditions_for_querying( array_merge( $this->_get_default_where_conditions(), $this->get_where_conditions_provided() ), $model_relation_chain ); |
|
83 | + function get_default_where_conditions($model_relation_chain = '') { |
|
84 | + return $this->prepare_where_conditions_for_querying(array_merge($this->_get_default_where_conditions(), $this->get_where_conditions_provided()), $model_relation_chain); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * Adding model relation chains is handled by the public method get_default_where_conditions |
92 | 92 | * @return array |
93 | 93 | */ |
94 | - protected function _get_default_where_conditions(){ |
|
94 | + protected function _get_default_where_conditions() { |
|
95 | 95 | return array(); |
96 | 96 | } |
97 | 97 | |
@@ -105,36 +105,36 @@ discard block |
||
105 | 105 | * @return array |
106 | 106 | * @throws \EE_Error |
107 | 107 | */ |
108 | - public function prepare_where_conditions_for_querying( $where_conditions, $model_relation_chain ) { |
|
108 | + public function prepare_where_conditions_for_querying($where_conditions, $model_relation_chain) { |
|
109 | 109 | $where_conditions_with_model_relation_chain_prefixes = array(); |
110 | - if ( ! is_array( $where_conditions ) ) { |
|
110 | + if ( ! is_array($where_conditions)) { |
|
111 | 111 | $where_conditions = array(); |
112 | 112 | } |
113 | - foreach ( $where_conditions as $key => $value ) { |
|
113 | + foreach ($where_conditions as $key => $value) { |
|
114 | 114 | if ( |
115 | - in_array( $key, array( 'OR', 'AND', 'NOT' ) ) |
|
116 | - || strpos( $key, 'OR*' ) !== false |
|
117 | - || strpos( $key, 'AND*' ) !== false |
|
118 | - || strpos( $key, 'NOT*' ) !== false |
|
115 | + in_array($key, array('OR', 'AND', 'NOT')) |
|
116 | + || strpos($key, 'OR*') !== false |
|
117 | + || strpos($key, 'AND*') !== false |
|
118 | + || strpos($key, 'NOT*') !== false |
|
119 | 119 | ) { |
120 | - $where_conditions_with_model_relation_chain_prefixes[ $key ] = $this->prepare_where_conditions_for_querying( |
|
120 | + $where_conditions_with_model_relation_chain_prefixes[$key] = $this->prepare_where_conditions_for_querying( |
|
121 | 121 | $value, |
122 | 122 | $model_relation_chain |
123 | 123 | ); |
124 | 124 | } else { |
125 | 125 | if ( |
126 | 126 | $model_relation_chain != '' |
127 | - && $model_relation_chain[ strlen( $model_relation_chain ) - 1 ] != '.' |
|
127 | + && $model_relation_chain[strlen($model_relation_chain) - 1] != '.' |
|
128 | 128 | ) { |
129 | - $model_relation_chain = $model_relation_chain . "."; |
|
129 | + $model_relation_chain = $model_relation_chain."."; |
|
130 | 130 | } |
131 | 131 | //check for the current user id place holder, and if present change it |
132 | - if ( $value === self::current_user_placeholder ) { |
|
132 | + if ($value === self::current_user_placeholder) { |
|
133 | 133 | $value = get_current_user_id(); |
134 | 134 | } |
135 | 135 | //check for user field placeholder |
136 | - if ( $key == self::user_field_name_placeholder ) { |
|
137 | - if ( ! $this->_model->wp_user_field_name() ) { |
|
136 | + if ($key == self::user_field_name_placeholder) { |
|
137 | + if ( ! $this->_model->wp_user_field_name()) { |
|
138 | 138 | throw new EE_Error( |
139 | 139 | sprintf( |
140 | 140 | __( |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | $key = $this->_model->wp_user_field_name(); |
149 | 149 | } |
150 | - $where_conditions_with_model_relation_chain_prefixes[ $model_relation_chain . $key ] = $value; |
|
150 | + $where_conditions_with_model_relation_chain_prefixes[$model_relation_chain.$key] = $value; |
|
151 | 151 | } |
152 | 152 | } |
153 | 153 | return $where_conditions_with_model_relation_chain_prefixes; |
@@ -5,7 +5,7 @@ |
||
5 | 5 | /** |
6 | 6 | * |
7 | 7 | * Class EE_Default_Where_Conditions |
8 | - * |
|
8 | + * |
|
9 | 9 | * Strategy to be used for getting default where conditions for EEM_Base children. |
10 | 10 | * Should be initialized and set on construction of model |
11 | 11 | * |