@@ -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 | /** |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | class Custom_Messages_Template_List_Table extends EE_Admin_List_Table { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $admin_page ) { |
|
33 | + public function __construct($admin_page) { |
|
34 | 34 | //Set parent defaults |
35 | 35 | parent::__construct($admin_page); |
36 | 36 | } |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | |
50 | 50 | |
51 | 51 | protected function _setup_data() { |
52 | - $this->_data = $this->get_admin_page()->get_message_templates( $this->_per_page, $this->_view, FALSE, FALSE, FALSE ); |
|
53 | - $this->_all_data_count = $this->get_admin_page()->get_message_templates( $this->_per_page, $this->_view, TRUE, TRUE, FALSE ); |
|
52 | + $this->_data = $this->get_admin_page()->get_message_templates($this->_per_page, $this->_view, FALSE, FALSE, FALSE); |
|
53 | + $this->_all_data_count = $this->get_admin_page()->get_message_templates($this->_per_page, $this->_view, TRUE, TRUE, FALSE); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | |
60 | 60 | protected function _set_properties() { |
61 | 61 | $this->_wp_list_args = array( |
62 | - 'singular' => __('Message Template Group', 'event_espresso' ), |
|
63 | - 'plural' => __('Message Template', 'event_espresso' ), |
|
62 | + 'singular' => __('Message Template Group', 'event_espresso'), |
|
63 | + 'plural' => __('Message Template', 'event_espresso'), |
|
64 | 64 | 'ajax' => TRUE, //for now, |
65 | 65 | 'screen' => $this->get_admin_page()->get_current_screen()->id |
66 | 66 | ); |
@@ -69,15 +69,15 @@ discard block |
||
69 | 69 | 'cb' => '<input type="checkbox" />', |
70 | 70 | 'name' => __('Template Name', 'event_espresso'), |
71 | 71 | 'message_type' => __('Message Type', 'event_espresso'), |
72 | - 'messenger' => __( 'Messenger', 'event_espresso'), |
|
73 | - 'description' => __( 'Description', 'event_espresso' ), |
|
74 | - 'events' => __( 'Events', 'event_espresso'), //count of events using this template. |
|
72 | + 'messenger' => __('Messenger', 'event_espresso'), |
|
73 | + 'description' => __('Description', 'event_espresso'), |
|
74 | + 'events' => __('Events', 'event_espresso'), //count of events using this template. |
|
75 | 75 | 'actions' => '' |
76 | 76 | //'messages_sent' => __( 'Total Sent', 'event_espresso' ) //todo this will come later when we've got message tracking in place. |
77 | 77 | ); |
78 | 78 | |
79 | 79 | $this->_sortable_columns = array( |
80 | - 'messenger' => array( 'MTP_messenger' => TRUE ), |
|
80 | + 'messenger' => array('MTP_messenger' => TRUE), |
|
81 | 81 | //'message_type' => array( 'MTP_message_type' => FALSE ) |
82 | 82 | ); |
83 | 83 | |
@@ -96,16 +96,16 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @return string |
98 | 98 | */ |
99 | - public function single_row( $item ) { |
|
99 | + public function single_row($item) { |
|
100 | 100 | $message_type = $item->message_type_obj(); |
101 | 101 | $messenger = $item->messenger_obj(); |
102 | 102 | |
103 | - if ( ! $message_type instanceof EE_message_type || ! $messenger instanceof EE_messenger ) { |
|
103 | + if ( ! $message_type instanceof EE_message_type || ! $messenger instanceof EE_messenger) { |
|
104 | 104 | echo ''; |
105 | 105 | return; |
106 | 106 | } |
107 | 107 | |
108 | - parent::single_row( $item ); |
|
108 | + parent::single_row($item); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | ); |
124 | 124 | |
125 | 125 | //set filters to select inputs if they aren't empty |
126 | - foreach ( $select_inputs as $select_input ) { |
|
127 | - if ( $select_input ) { |
|
126 | + foreach ($select_inputs as $select_input) { |
|
127 | + if ($select_input) { |
|
128 | 128 | $filters[] = $select_input; |
129 | 129 | } |
130 | 130 | } |
@@ -135,14 +135,14 @@ discard block |
||
135 | 135 | * we're just removing the search box for message templates, not needed. |
136 | 136 | * @return string (empty); |
137 | 137 | */ |
138 | - function search_box( $text, $input_id ) { |
|
138 | + function search_box($text, $input_id) { |
|
139 | 139 | return ''; |
140 | 140 | } |
141 | 141 | |
142 | 142 | |
143 | 143 | protected function _add_view_counts() { |
144 | - foreach ( $this->_views as $view => $args ) { |
|
145 | - $this->_views[$view]['count'] = $this->get_admin_page()->get_message_templates( $this->_per_page, $view, TRUE, TRUE, FALSE ); |
|
144 | + foreach ($this->_views as $view => $args) { |
|
145 | + $this->_views[$view]['count'] = $this->get_admin_page()->get_message_templates($this->_per_page, $view, TRUE, TRUE, FALSE); |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | |
@@ -156,16 +156,16 @@ discard block |
||
156 | 156 | * @return string |
157 | 157 | */ |
158 | 158 | public function no_items() { |
159 | - if ( $this->_view !== 'trashed' ) |
|
160 | - printf( __('%sNo Custom Templates found.%s To create your first custom message template, go to the "Default Message Templates" tab and click the "Create Custom" button next to the template you want to use as a base for the new one.', 'event_espresso'), '<strong>', '</strong>' ); |
|
159 | + if ($this->_view !== 'trashed') |
|
160 | + printf(__('%sNo Custom Templates found.%s To create your first custom message template, go to the "Default Message Templates" tab and click the "Create Custom" button next to the template you want to use as a base for the new one.', 'event_espresso'), '<strong>', '</strong>'); |
|
161 | 161 | else |
162 | 162 | parent::no_items(); |
163 | 163 | } |
164 | 164 | |
165 | 165 | |
166 | 166 | |
167 | - public function column_cb( $item ) { |
|
168 | - return sprintf( '<input type="checkbox" name="checkbox[%s] value="1" />', $item->GRP_ID() ); |
|
167 | + public function column_cb($item) { |
|
168 | + return sprintf('<input type="checkbox" name="checkbox[%s] value="1" />', $item->GRP_ID()); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | |
@@ -173,29 +173,29 @@ discard block |
||
173 | 173 | |
174 | 174 | |
175 | 175 | |
176 | - function column_name( $item ) { |
|
177 | - return '<p>' . $item->name() . '</p>'; |
|
176 | + function column_name($item) { |
|
177 | + return '<p>'.$item->name().'</p>'; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | |
181 | 181 | |
182 | 182 | |
183 | - function column_description( $item ) { |
|
184 | - return '<p>' . $item->description() . '</p>'; |
|
183 | + function column_description($item) { |
|
184 | + return '<p>'.$item->description().'</p>'; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | |
188 | 188 | |
189 | - function column_actions( $item ) { |
|
190 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_messages', 'espresso_messages_add_new_message_template' ) ) { |
|
189 | + function column_actions($item) { |
|
190 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'espresso_messages_add_new_message_template')) { |
|
191 | 191 | $create_args = array( |
192 | 192 | 'GRP_ID' => $item->ID(), |
193 | 193 | 'messenger' => $item->messenger(), |
194 | 194 | 'message_type' => $item->message_type(), |
195 | 195 | 'action' => 'add_new_message_template' |
196 | 196 | ); |
197 | - $create_link = EE_Admin_Page::add_query_args_and_nonce( $create_args, EE_MSG_ADMIN_URL ); |
|
198 | - return sprintf( '<p><a href="%s" class="button button-small">%s</a></p>', $create_link, __('Create Custom', 'event_espresso') ); |
|
197 | + $create_link = EE_Admin_Page::add_query_args_and_nonce($create_args, EE_MSG_ADMIN_URL); |
|
198 | + return sprintf('<p><a href="%s" class="button button-small">%s</a></p>', $create_link, __('Create Custom', 'event_espresso')); |
|
199 | 199 | } |
200 | 200 | return ''; |
201 | 201 | } |
@@ -212,27 +212,27 @@ discard block |
||
212 | 212 | $actions = array(); |
213 | 213 | |
214 | 214 | // edit link but only if item isn't trashed. |
215 | - if ( !$item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() ) ) { |
|
216 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_message_template', 'id'=>$item->GRP_ID() ), EE_MSG_ADMIN_URL ); |
|
217 | - $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Template', 'event_espresso' ) . '">' . __( 'Edit', 'event_espresso' ) . '</a>'; |
|
215 | + if ( ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID())) { |
|
216 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_message_template', 'id'=>$item->GRP_ID()), EE_MSG_ADMIN_URL); |
|
217 | + $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Template', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'; |
|
218 | 218 | } |
219 | 219 | |
220 | - $name_link = ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() )? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Template', 'event_espresso' ) . '">' . ucwords( $item->messenger_obj()->label['singular'] ) . '</a>' : ucwords( $item->messenger_obj()->label['singular'] ); |
|
221 | - $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE ), EE_MSG_ADMIN_URL ); |
|
220 | + $name_link = ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID()) ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Template', 'event_espresso').'">'.ucwords($item->messenger_obj()->label['singular']).'</a>' : ucwords($item->messenger_obj()->label['singular']); |
|
221 | + $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE), EE_MSG_ADMIN_URL); |
|
222 | 222 | // restore link |
223 | - $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE ), EE_MSG_ADMIN_URL ); |
|
223 | + $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE), EE_MSG_ADMIN_URL); |
|
224 | 224 | // delete price link |
225 | - $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE ), EE_MSG_ADMIN_URL ); |
|
225 | + $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE), EE_MSG_ADMIN_URL); |
|
226 | 226 | |
227 | - if ( !$item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_message', 'espresso_messages_trash_message_template', $item->ID() ) ) { |
|
228 | - $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Move Template Group to Trash', 'event_espresso' ) . '">' . __( 'Move to Trash', 'event_espresso' ) . '</a>'; |
|
227 | + if ( ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_delete_message', 'espresso_messages_trash_message_template', $item->ID())) { |
|
228 | + $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Template Group to Trash', 'event_espresso').'">'.__('Move to Trash', 'event_espresso').'</a>'; |
|
229 | 229 | } else { |
230 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_message', 'espresso_messages_restore_message_template', $item->ID() ) ) { |
|
231 | - $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Message Template', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>'; |
|
230 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_message', 'espresso_messages_restore_message_template', $item->ID())) { |
|
231 | + $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Message Template', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>'; |
|
232 | 232 | } |
233 | 233 | |
234 | - if ( $this->_view == 'trashed' && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_message', 'espresso_messages_delete_message_template', $item->ID() ) ) { |
|
235 | - $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Template Group Permanently', 'event_espresso' ) . '">' . __( 'Delete Permanently', 'event_espresso' ) . '</a>'; |
|
234 | + if ($this->_view == 'trashed' && EE_Registry::instance()->CAP->current_user_can('ee_delete_message', 'espresso_messages_delete_message_template', $item->ID())) { |
|
235 | + $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Template Group Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>'; |
|
236 | 236 | } |
237 | 237 | } |
238 | 238 | |
@@ -241,15 +241,15 @@ discard block |
||
241 | 241 | $c_configs = $item->contexts_config(); |
242 | 242 | $ctxt = array(); |
243 | 243 | $context_templates = $item->context_templates(); |
244 | - foreach ( $context_templates as $context => $template_fields ) { |
|
245 | - $mtp_to = !empty( $context_templates[$context]['to'] ) && $context_templates[$context]['to'] instanceof EE_Message_Template ? $context_templates[$context]['to']->get('MTP_content') : NULL; |
|
246 | - $inactive = empty( $mtp_to ) && !empty( $context_templates[$context]['to'] ) ? ' class="mtp-inactive"' : ''; |
|
244 | + foreach ($context_templates as $context => $template_fields) { |
|
245 | + $mtp_to = ! empty($context_templates[$context]['to']) && $context_templates[$context]['to'] instanceof EE_Message_Template ? $context_templates[$context]['to']->get('MTP_content') : NULL; |
|
246 | + $inactive = empty($mtp_to) && ! empty($context_templates[$context]['to']) ? ' class="mtp-inactive"' : ''; |
|
247 | 247 | $context_title = ucwords($c_configs[$context]['label']); |
248 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( array('action'=>'edit_message_template', 'id'=>$item->GRP_ID(), 'context' => $context), EE_MSG_ADMIN_URL ); |
|
249 | - $ctxt[] = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() ) ? '<a' . $inactive . ' href="'. $edit_link . '" title="' . esc_attr__('Edit Context', 'event_espresso') . '">' . $context_title . '</a>' : $context_title; |
|
248 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_message_template', 'id'=>$item->GRP_ID(), 'context' => $context), EE_MSG_ADMIN_URL); |
|
249 | + $ctxt[] = EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID()) ? '<a'.$inactive.' href="'.$edit_link.'" title="'.esc_attr__('Edit Context', 'event_espresso').'">'.$context_title.'</a>' : $context_title; |
|
250 | 250 | } |
251 | 251 | |
252 | - $ctx_content = !$item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() ) ? sprintf( __('<strong>%s:</strong> ', 'event_espresso'), ucwords($c_label['plural']) ) . implode(' | ', $ctxt) : ''; |
|
252 | + $ctx_content = ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID()) ? sprintf(__('<strong>%s:</strong> ', 'event_espresso'), ucwords($c_label['plural'])).implode(' | ', $ctxt) : ''; |
|
253 | 253 | |
254 | 254 | |
255 | 255 | //Return the name contents |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | /* $1%s */ $name_link, |
258 | 258 | /* $2%s */ $item->GRP_ID(), |
259 | 259 | /* %4$s */ $ctx_content, |
260 | - /* $3%s */ $this->row_actions( $actions ) |
|
260 | + /* $3%s */ $this->row_actions($actions) |
|
261 | 261 | ); |
262 | 262 | } |
263 | 263 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | * @return string message_type name |
279 | 279 | */ |
280 | 280 | function column_message_type($item) { |
281 | - return ucwords($item->message_type_obj()->label['singular'] ); |
|
281 | + return ucwords($item->message_type_obj()->label['singular']); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | |
@@ -305,16 +305,16 @@ discard block |
||
305 | 305 | ) |
306 | 306 | ); |
307 | 307 | |
308 | - foreach ( $active_message_template_groups_grouped_by_messenger as $active_message_template_group ) { |
|
309 | - if ( $active_message_template_group instanceof EE_Message_Template_Group ) { |
|
308 | + foreach ($active_message_template_groups_grouped_by_messenger as $active_message_template_group) { |
|
309 | + if ($active_message_template_group instanceof EE_Message_Template_Group) { |
|
310 | 310 | $messenger = $active_message_template_group->messenger_obj(); |
311 | 311 | $messenger_label = $messenger instanceof EE_messenger |
312 | 312 | ? $messenger->label['singular'] |
313 | 313 | : $active_message_template_group->messenger(); |
314 | - $messenger_options[ $active_message_template_group->messenger() ] = ucwords( $messenger_label ); |
|
314 | + $messenger_options[$active_message_template_group->messenger()] = ucwords($messenger_label); |
|
315 | 315 | } |
316 | 316 | } |
317 | - return $this->get_admin_page()->get_messengers_select_input( $messenger_options ); |
|
317 | + return $this->get_admin_page()->get_messengers_select_input($messenger_options); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | |
@@ -334,16 +334,16 @@ discard block |
||
334 | 334 | ) |
335 | 335 | ); |
336 | 336 | |
337 | - foreach ( $active_message_template_groups_grouped_by_message_type as $active_message_template_group ) { |
|
338 | - if ( $active_message_template_group instanceof EE_Message_Template_Group ) { |
|
337 | + foreach ($active_message_template_groups_grouped_by_message_type as $active_message_template_group) { |
|
338 | + if ($active_message_template_group instanceof EE_Message_Template_Group) { |
|
339 | 339 | $message_type = $active_message_template_group->message_type_obj(); |
340 | 340 | $message_type_label = $message_type instanceof EE_message_type |
341 | 341 | ? $message_type->label['singular'] |
342 | 342 | : $active_message_template_group->message_type(); |
343 | - $message_type_options[ $active_message_template_group->message_type() ] = ucwords( $message_type_label ); |
|
343 | + $message_type_options[$active_message_template_group->message_type()] = ucwords($message_type_label); |
|
344 | 344 | } |
345 | 345 | } |
346 | - return $this->get_admin_page()->get_message_types_select_input( $message_type_options ); |
|
346 | + return $this->get_admin_page()->get_message_types_select_input($message_type_options); |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | } |
@@ -1,6 +1,7 @@ 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 | 6 | /** |
6 | 7 | * Event Espresso |
@@ -156,10 +157,11 @@ discard block |
||
156 | 157 | * @return string |
157 | 158 | */ |
158 | 159 | public function no_items() { |
159 | - if ( $this->_view !== 'trashed' ) |
|
160 | - printf( __('%sNo Custom Templates found.%s To create your first custom message template, go to the "Default Message Templates" tab and click the "Create Custom" button next to the template you want to use as a base for the new one.', 'event_espresso'), '<strong>', '</strong>' ); |
|
161 | - else |
|
162 | - parent::no_items(); |
|
160 | + if ( $this->_view !== 'trashed' ) { |
|
161 | + printf( __('%sNo Custom Templates found.%s To create your first custom message template, go to the "Default Message Templates" tab and click the "Create Custom" button next to the template you want to use as a base for the new one.', 'event_espresso'), '<strong>', '</strong>' ); |
|
162 | + } else { |
|
163 | + parent::no_items(); |
|
164 | + } |
|
163 | 165 | } |
164 | 166 | |
165 | 167 |
@@ -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 | /** |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | |
42 | 42 | |
43 | 43 | protected function _setup_data() { |
44 | - $this->_data = $this->get_admin_page()->get_message_templates( $this->_per_page, $this->_view, FALSE); |
|
45 | - $this->_all_data_count = $this->get_admin_page()->get_message_templates( $this->_per_page, $this->_view, TRUE, TRUE ); |
|
44 | + $this->_data = $this->get_admin_page()->get_message_templates($this->_per_page, $this->_view, FALSE); |
|
45 | + $this->_all_data_count = $this->get_admin_page()->get_message_templates($this->_per_page, $this->_view, TRUE, TRUE); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
@@ -51,21 +51,21 @@ discard block |
||
51 | 51 | |
52 | 52 | protected function _set_properties() { |
53 | 53 | $this->_wp_list_args = array( |
54 | - 'singular' => __('Message Template Group', 'event_espresso' ), |
|
55 | - 'plural' => __('Message Template', 'event_espresso' ), |
|
54 | + 'singular' => __('Message Template Group', 'event_espresso'), |
|
55 | + 'plural' => __('Message Template', 'event_espresso'), |
|
56 | 56 | 'ajax' => TRUE, //for now, |
57 | 57 | 'screen' => $this->get_admin_page()->get_current_screen()->id |
58 | 58 | ); |
59 | 59 | $this->_columns = array( |
60 | 60 | //'cb' => '<input type="checkbox" />', //no deleting default (global) templates! |
61 | 61 | 'message_type' => __('Message Type', 'event_espresso'), |
62 | - 'messenger' => __( 'Messenger', 'event_espresso'), |
|
63 | - 'description' => __( 'Description', 'event_espresso' ), |
|
62 | + 'messenger' => __('Messenger', 'event_espresso'), |
|
63 | + 'description' => __('Description', 'event_espresso'), |
|
64 | 64 | //'messages_sent' => __( 'Total Sent', 'event_espresso' ) //todo this will come later when we've got message tracking in place. |
65 | 65 | ); |
66 | 66 | |
67 | 67 | $this->_sortable_columns = array( |
68 | - 'messenger' => array( 'MTP_messenger' => TRUE ), |
|
68 | + 'messenger' => array('MTP_messenger' => TRUE), |
|
69 | 69 | //'message_type' => array( 'MTP_message_type' => FALSE ) |
70 | 70 | ); |
71 | 71 | |
@@ -84,16 +84,16 @@ discard block |
||
84 | 84 | * |
85 | 85 | * @return string |
86 | 86 | */ |
87 | - public function single_row( $item ) { |
|
87 | + public function single_row($item) { |
|
88 | 88 | $message_type = $item->message_type_obj(); |
89 | 89 | $messenger = $item->messenger_obj(); |
90 | 90 | |
91 | - if ( ! $message_type instanceof EE_message_type || ! $messenger instanceof EE_messenger ) { |
|
91 | + if ( ! $message_type instanceof EE_message_type || ! $messenger instanceof EE_messenger) { |
|
92 | 92 | echo ''; |
93 | 93 | return; |
94 | 94 | } |
95 | 95 | |
96 | - parent::single_row( $item ); |
|
96 | + parent::single_row($item); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | ); |
112 | 112 | |
113 | 113 | //set filters to select inputs if they aren't empty |
114 | - foreach ( $select_inputs as $select_input ) { |
|
115 | - if ( $select_input ) { |
|
114 | + foreach ($select_inputs as $select_input) { |
|
115 | + if ($select_input) { |
|
116 | 116 | $filters[] = $select_input; |
117 | 117 | } |
118 | 118 | } |
@@ -123,20 +123,20 @@ discard block |
||
123 | 123 | * we're just removing the search box for message templates, not needed. |
124 | 124 | * @return string (empty); |
125 | 125 | */ |
126 | - function search_box( $text, $input_id ) { |
|
126 | + function search_box($text, $input_id) { |
|
127 | 127 | return ''; |
128 | 128 | } |
129 | 129 | |
130 | 130 | |
131 | 131 | protected function _add_view_counts() { |
132 | - foreach ( $this->_views as $view => $args ) { |
|
133 | - $this->_views[$view]['count'] = $this->get_admin_page()->get_message_templates( $this->_per_page, $view, TRUE, TRUE ); |
|
132 | + foreach ($this->_views as $view => $args) { |
|
133 | + $this->_views[$view]['count'] = $this->get_admin_page()->get_message_templates($this->_per_page, $view, TRUE, TRUE); |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
137 | 137 | |
138 | 138 | |
139 | - public function column_cb( $item ) { |
|
139 | + public function column_cb($item) { |
|
140 | 140 | return ''; |
141 | 141 | } |
142 | 142 | |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | |
145 | 145 | |
146 | 146 | |
147 | - function column_description( $item ) { |
|
148 | - return '<p>' . $item->message_type_obj()->description . '</p>'; |
|
147 | + function column_description($item) { |
|
148 | + return '<p>'.$item->message_type_obj()->description.'</p>'; |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | |
@@ -160,27 +160,27 @@ discard block |
||
160 | 160 | $actions = array(); |
161 | 161 | |
162 | 162 | // edit link but only if item isn't trashed. |
163 | - if ( !$item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() ) ) { |
|
164 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_message_template', 'id'=>$item->GRP_ID() ), EE_MSG_ADMIN_URL ); |
|
165 | - $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Template Group', 'event_espresso' ) . '">' . __( 'Edit', 'event_espresso' ) . '</a>'; |
|
163 | + if ( ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID())) { |
|
164 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_message_template', 'id'=>$item->GRP_ID()), EE_MSG_ADMIN_URL); |
|
165 | + $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Template Group', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'; |
|
166 | 166 | } |
167 | 167 | |
168 | - $name_link = ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Template Group', 'event_espresso' ) . '">' . ucwords( $item->messenger_obj()->label['singular'] ) . '</a>' : ucwords( $item->messenger_obj()->label['singular'] ); |
|
168 | + $name_link = ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID()) ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Template Group', 'event_espresso').'">'.ucwords($item->messenger_obj()->label['singular']).'</a>' : ucwords($item->messenger_obj()->label['singular']); |
|
169 | 169 | |
170 | 170 | //we want to display the contexts in here so we need to set them up |
171 | 171 | $c_label = $item->context_label(); |
172 | 172 | $c_configs = $item->contexts_config(); |
173 | 173 | $ctxt = array(); |
174 | 174 | $context_templates = $item->context_templates(); |
175 | - foreach ( $context_templates as $context => $template_fields ) { |
|
176 | - $mtp_to = !empty( $context_templates[$context]['to'] ) && $context_templates[$context]['to'] instanceof EE_Message_Template ? $context_templates[$context]['to']->get('MTP_content') : NULL; |
|
177 | - $inactive = empty( $mtp_to ) && !empty( $context_templates[$context]['to'] ) ? ' class="mtp-inactive"' : ''; |
|
175 | + foreach ($context_templates as $context => $template_fields) { |
|
176 | + $mtp_to = ! empty($context_templates[$context]['to']) && $context_templates[$context]['to'] instanceof EE_Message_Template ? $context_templates[$context]['to']->get('MTP_content') : NULL; |
|
177 | + $inactive = empty($mtp_to) && ! empty($context_templates[$context]['to']) ? ' class="mtp-inactive"' : ''; |
|
178 | 178 | $context_title = ucwords($c_configs[$context]['label']); |
179 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( array('action'=>'edit_message_template', 'id'=>$item->GRP_ID(), 'context' => $context), EE_MSG_ADMIN_URL ); |
|
180 | - $ctxt[] = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() ) ? '<a' . $inactive . ' href="'. $edit_link . '" title="' . esc_attr__('Edit Context', 'event_espresso') . '">' . $context_title . '</a>' : $context_title; |
|
179 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_message_template', 'id'=>$item->GRP_ID(), 'context' => $context), EE_MSG_ADMIN_URL); |
|
180 | + $ctxt[] = EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID()) ? '<a'.$inactive.' href="'.$edit_link.'" title="'.esc_attr__('Edit Context', 'event_espresso').'">'.$context_title.'</a>' : $context_title; |
|
181 | 181 | } |
182 | 182 | |
183 | - $ctx_content = !$item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() ) ? sprintf( __('<strong>%s:</strong> ', 'event_espresso'), ucwords($c_label['plural']) ) . implode(' | ', $ctxt) : ''; |
|
183 | + $ctx_content = ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID()) ? sprintf(__('<strong>%s:</strong> ', 'event_espresso'), ucwords($c_label['plural'])).implode(' | ', $ctxt) : ''; |
|
184 | 184 | |
185 | 185 | |
186 | 186 | //Return the name contents |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | /* $1%s */ $name_link, |
189 | 189 | /* $2%s */ $item->GRP_ID(), |
190 | 190 | /* %4$s */ $ctx_content, |
191 | - /* $3%s */ $this->row_actions( $actions ) |
|
191 | + /* $3%s */ $this->row_actions($actions) |
|
192 | 192 | ); |
193 | 193 | } |
194 | 194 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * @return string message_type name |
199 | 199 | */ |
200 | 200 | function column_message_type($item) { |
201 | - return ucwords($item->message_type_obj()->label['singular'] ); |
|
201 | + return ucwords($item->message_type_obj()->label['singular']); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | |
@@ -225,16 +225,16 @@ discard block |
||
225 | 225 | ) |
226 | 226 | ); |
227 | 227 | |
228 | - foreach ( $active_message_template_groups_grouped_by_messenger as $active_message_template_group ) { |
|
229 | - if ( $active_message_template_group instanceof EE_Message_Template_Group ) { |
|
228 | + foreach ($active_message_template_groups_grouped_by_messenger as $active_message_template_group) { |
|
229 | + if ($active_message_template_group instanceof EE_Message_Template_Group) { |
|
230 | 230 | $messenger = $active_message_template_group->messenger_obj(); |
231 | 231 | $messenger_label = $messenger instanceof EE_messenger |
232 | 232 | ? $messenger->label['singular'] |
233 | 233 | : $active_message_template_group->messenger(); |
234 | - $messenger_options[ $active_message_template_group->messenger() ] = ucwords( $messenger_label ); |
|
234 | + $messenger_options[$active_message_template_group->messenger()] = ucwords($messenger_label); |
|
235 | 235 | } |
236 | 236 | } |
237 | - return $this->get_admin_page()->get_messengers_select_input( $messenger_options ); |
|
237 | + return $this->get_admin_page()->get_messengers_select_input($messenger_options); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | |
@@ -254,16 +254,16 @@ discard block |
||
254 | 254 | ) |
255 | 255 | ); |
256 | 256 | |
257 | - foreach ( $active_message_template_groups_grouped_by_message_type as $active_message_template_group ) { |
|
258 | - if ( $active_message_template_group instanceof EE_Message_Template_Group ) { |
|
257 | + foreach ($active_message_template_groups_grouped_by_message_type as $active_message_template_group) { |
|
258 | + if ($active_message_template_group instanceof EE_Message_Template_Group) { |
|
259 | 259 | $message_type = $active_message_template_group->message_type_obj(); |
260 | 260 | $message_type_label = $message_type instanceof EE_message_type |
261 | 261 | ? $message_type->label['singular'] |
262 | 262 | : $active_message_template_group->message_type(); |
263 | - $message_type_options[ $active_message_template_group->message_type() ] = ucwords( $message_type_label ); |
|
263 | + $message_type_options[$active_message_template_group->message_type()] = ucwords($message_type_label); |
|
264 | 264 | } |
265 | 265 | } |
266 | - return $this->get_admin_page()->get_message_types_select_input( $message_type_options ); |
|
266 | + return $this->get_admin_page()->get_message_types_select_input($message_type_options); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | } |
@@ -1,6 +1,7 @@ |
||
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 | 6 | /** |
6 | 7 | * Event Espresso |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * |
24 | 24 | * ------------------------------------------------------------------------ |
25 | 25 | */ |
26 | -require_once ( EE_MODELS . 'EEM_Base.model.php' ); |
|
27 | -require_once ( EE_CLASSES . 'EE_Checkin.class.php' ); |
|
26 | +require_once (EE_MODELS.'EEM_Base.model.php'); |
|
27 | +require_once (EE_CLASSES.'EE_Checkin.class.php'); |
|
28 | 28 | |
29 | 29 | class EEM_Checkin extends EEM_Base { |
30 | 30 | |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | * @param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved). Note this just sends the timezone info to the date time model field objects. Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option) |
41 | 41 | * @return void |
42 | 42 | */ |
43 | - protected function __construct( $timezone = NULL ) { |
|
44 | - $this->singular_item = __('Check-In','event_espresso'); |
|
45 | - $this->plural_item = __('Check-Ins','event_espresso'); |
|
43 | + protected function __construct($timezone = NULL) { |
|
44 | + $this->singular_item = __('Check-In', 'event_espresso'); |
|
45 | + $this->plural_item = __('Check-Ins', 'event_espresso'); |
|
46 | 46 | |
47 | 47 | $this->_tables = array( |
48 | - 'Checkin'=>new EE_Primary_Table('esp_checkin','CHK_ID') |
|
48 | + 'Checkin'=>new EE_Primary_Table('esp_checkin', 'CHK_ID') |
|
49 | 49 | ); |
50 | 50 | $this->_fields = array( |
51 | 51 | 'Checkin'=> array( |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | 'REG_ID'=>new EE_Foreign_Key_Int_Field('REG_ID', 'Registration Id', false, 0, 'Registration'), |
54 | 54 | 'DTT_ID'=>new EE_Foreign_Key_Int_Field('DTT_ID', 'Datetime Id', false, 0, 'Datetime'), |
55 | 55 | 'CHK_in'=>new EE_Boolean_Field('CHK_in', 'Whether a person has checked in or checked out', false, true), |
56 | - 'CHK_timestamp'=>new EE_Datetime_Field('CHK_timestamp', __('When the row was modified','event_espresso'), false, EE_Datetime_Field::now, $timezone ) |
|
56 | + 'CHK_timestamp'=>new EE_Datetime_Field('CHK_timestamp', __('When the row was modified', 'event_espresso'), false, EE_Datetime_Field::now, $timezone) |
|
57 | 57 | ) |
58 | 58 | ); |
59 | 59 | $this->_model_relations = array( |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | 'Datetime'=>new EE_Belongs_To_Relation() |
62 | 62 | ); |
63 | 63 | $this->_model_chain_to_wp_user = 'Registration.Event'; |
64 | - parent::__construct( $timezone ); |
|
64 | + parent::__construct($timezone); |
|
65 | 65 | |
66 | 66 | } |
67 | 67 |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @since $VID:$ |
13 | 13 | * |
14 | 14 | */ |
15 | -class EE_Select2_Display_Strategy extends EE_Select_Display_Strategy{ |
|
15 | +class EE_Select2_Display_Strategy extends EE_Select_Display_Strategy { |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Arguments that will be passed into the select2 javascript constructor |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @param array $select2_js_args pass in the EXACT array of JS arguments you want |
26 | 26 | * to pass into the select2 js/html input. See https://select2.github.io |
27 | 27 | */ |
28 | - public function __construct( $select2_js_args = array() ) { |
|
28 | + public function __construct($select2_js_args = array()) { |
|
29 | 29 | $this->_select2_js_args = $select2_js_args; |
30 | 30 | parent::__construct(); |
31 | 31 | } |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | public function enqueue_js() { |
38 | 38 | // need to first deregister the select2 script in case some other plugin **cough cough Toolset Types cough** |
39 | 39 | // is carelessly registering an older version of Select2 on admin pages that don't even belong to them |
40 | - wp_deregister_script( 'select2' ); |
|
41 | - wp_deregister_style( 'select2' ); |
|
42 | - wp_register_script( 'select2', EE_GLOBAL_ASSETS_URL . 'scripts/select2.min.js', array(), '4.0.2', true ); |
|
43 | - wp_register_style( 'select2', EE_GLOBAL_ASSETS_URL . 'css/select2.min.css', array(), '4.0.2', 'all' ); |
|
44 | - wp_enqueue_script( 'form_section_select2_init', EE_GLOBAL_ASSETS_URL . 'scripts/form_section_select2_init.js', array( 'select2' ), '1.0.0', true ); |
|
45 | - wp_enqueue_style( 'select2', EE_GLOBAL_ASSETS_URL . 'css/select2.min.css', array(), '4.0.2', 'all' ); |
|
40 | + wp_deregister_script('select2'); |
|
41 | + wp_deregister_style('select2'); |
|
42 | + wp_register_script('select2', EE_GLOBAL_ASSETS_URL.'scripts/select2.min.js', array(), '4.0.2', true); |
|
43 | + wp_register_style('select2', EE_GLOBAL_ASSETS_URL.'css/select2.min.css', array(), '4.0.2', 'all'); |
|
44 | + wp_enqueue_script('form_section_select2_init', EE_GLOBAL_ASSETS_URL.'scripts/form_section_select2_init.js', array('select2'), '1.0.0', true); |
|
45 | + wp_enqueue_style('select2', EE_GLOBAL_ASSETS_URL.'css/select2.min.css', array(), '4.0.2', 'all'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * Sets the exact js args which will be passed into the select2 js/html input |
58 | 58 | * @param array $js_args |
59 | 59 | */ |
60 | - public function set_js_args( $js_args ) { |
|
60 | + public function set_js_args($js_args) { |
|
61 | 61 | $this->_select2_js_args = $js_args; |
62 | 62 | } |
63 | 63 | |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | * @param array $other_js_data |
67 | 67 | * @return array |
68 | 68 | */ |
69 | - public function get_other_js_data( $other_js_data = array() ) { |
|
70 | - $other_js_data = parent::get_other_js_data( $other_js_data ); |
|
71 | - if( ! isset( $other_js_data[ 'select2s' ] ) ) { |
|
69 | + public function get_other_js_data($other_js_data = array()) { |
|
70 | + $other_js_data = parent::get_other_js_data($other_js_data); |
|
71 | + if ( ! isset($other_js_data['select2s'])) { |
|
72 | 72 | $other_js_data['select2s'] = array(); |
73 | 73 | } |
74 | - $other_js_data[ 'select2s' ][ $this->_input->html_id() ] = $this->get_js_args(); |
|
74 | + $other_js_data['select2s'][$this->_input->html_id()] = $this->get_js_args(); |
|
75 | 75 | return $other_js_data; |
76 | 76 | } |
77 | 77 | } |
78 | 78 | \ No newline at end of file |
@@ -2,7 +2,7 @@ |
||
2 | 2 | namespace EventEspresso\core\services\commands; |
3 | 3 | |
4 | 4 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
5 | - exit('No direct script access allowed'); |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' )) { exit( 'No direct script access allowed' ); } |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
|
2 | 2 | /** |
3 | 3 | * Class EE_Country_Select_Input |
4 | 4 | * |
@@ -11,23 +11,23 @@ discard block |
||
11 | 11 | * @since $VID:$ |
12 | 12 | * |
13 | 13 | */ |
14 | -class EE_Country_Select_Input extends EE_Select_Input{ |
|
14 | +class EE_Country_Select_Input extends EE_Select_Input { |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * @param array $country_options |
18 | 18 | * @param array $input_settings |
19 | 19 | * @return EE_Country_Select_Input |
20 | 20 | */ |
21 | - public function __construct( $country_options = NULL, $input_settings = array() ){ |
|
21 | + public function __construct($country_options = NULL, $input_settings = array()) { |
|
22 | 22 | $country_options = apply_filters( |
23 | 23 | 'FHEE__EE_Country_Select_Input____construct__country_options', |
24 | - $this->get_country_answer_options( $country_options ), |
|
24 | + $this->get_country_answer_options($country_options), |
|
25 | 25 | $this |
26 | 26 | ); |
27 | - $input_settings['html_class'] = isset( $input_settings['html_class'] ) |
|
28 | - ? $input_settings['html_class'] . ' ee-country-select-js' |
|
27 | + $input_settings['html_class'] = isset($input_settings['html_class']) |
|
28 | + ? $input_settings['html_class'].' ee-country-select-js' |
|
29 | 29 | : 'ee-country-select-js'; |
30 | - parent::__construct( $country_options, $input_settings ); |
|
30 | + parent::__construct($country_options, $input_settings); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -38,16 +38,16 @@ discard block |
||
38 | 38 | * @param array $country_options |
39 | 39 | * @return array |
40 | 40 | */ |
41 | - public function get_country_answer_options( $country_options = NULL ){ |
|
41 | + public function get_country_answer_options($country_options = NULL) { |
|
42 | 42 | // if passed something that is NOT an array |
43 | - if ( ! is_array( $country_options )) { |
|
43 | + if ( ! is_array($country_options)) { |
|
44 | 44 | // get possibly cached list of countries |
45 | 45 | $countries = EEM_Country::instance()->get_all_active_countries(); |
46 | - if ( ! empty( $countries )) { |
|
47 | - $country_options[ '' ] = ''; |
|
48 | - foreach( $countries as $country ){ |
|
49 | - if ( $country instanceof EE_Country ) { |
|
50 | - $country_options[ $country->ID() ] = $country->name(); |
|
46 | + if ( ! empty($countries)) { |
|
47 | + $country_options[''] = ''; |
|
48 | + foreach ($countries as $country) { |
|
49 | + if ($country instanceof EE_Country) { |
|
50 | + $country_options[$country->ID()] = $country->name(); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | } else { |
@@ -6,22 +6,22 @@ discard block |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_State_Select_Input extends EE_Select_Input{ |
|
9 | +class EE_State_Select_Input extends EE_Select_Input { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @param array $state_options |
13 | 13 | * @param array $input_settings |
14 | 14 | */ |
15 | - function __construct( $state_options, $input_settings = array() ){ |
|
15 | + function __construct($state_options, $input_settings = array()) { |
|
16 | 16 | $state_options = apply_filters( |
17 | 17 | 'FHEE__EE_State_Select_Input____construct__state_options', |
18 | - $this->get_state_answer_options( $state_options ), |
|
18 | + $this->get_state_answer_options($state_options), |
|
19 | 19 | $this |
20 | 20 | ); |
21 | - $input_settings['html_class'] = isset( $input_settings['html_class'] ) |
|
22 | - ? $input_settings['html_class'] . ' ee-state-select-js' |
|
21 | + $input_settings['html_class'] = isset($input_settings['html_class']) |
|
22 | + ? $input_settings['html_class'].' ee-state-select-js' |
|
23 | 23 | : 'ee-state-select-js'; |
24 | - parent::__construct( $state_options, $input_settings ); |
|
24 | + parent::__construct($state_options, $input_settings); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -32,17 +32,17 @@ discard block |
||
32 | 32 | * @param array $state_options |
33 | 33 | * @return array |
34 | 34 | */ |
35 | - public function get_state_answer_options( $state_options = NULL ){ |
|
35 | + public function get_state_answer_options($state_options = NULL) { |
|
36 | 36 | // if passed something that is NOT an array |
37 | - if ( ! is_array( $state_options )) { |
|
37 | + if ( ! is_array($state_options)) { |
|
38 | 38 | // get possibly cached list of states |
39 | 39 | $states = EEM_State::instance()->get_all_active_states(); |
40 | - if ( ! empty( $states )) { |
|
40 | + if ( ! empty($states)) { |
|
41 | 41 | //set the default |
42 | 42 | $state_options[''][''] = ''; |
43 | - foreach( $states as $state ){ |
|
44 | - if ( $state instanceof EE_State ) { |
|
45 | - $state_options[ $state->country()->name() ][ $state->ID() ] = $state->name(); |
|
43 | + foreach ($states as $state) { |
|
44 | + if ($state instanceof EE_State) { |
|
45 | + $state_options[$state->country()->name()][$state->ID()] = $state->name(); |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | } else { |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_Many_Valued_Normalization extends EE_Normalization_Strategy_Base{ |
|
9 | +class EE_Many_Valued_Normalization extends EE_Normalization_Strategy_Base { |
|
10 | 10 | protected $_individual_item_normalization_strategy = array(); |
11 | 11 | /** |
12 | 12 | * |
@@ -23,16 +23,16 @@ discard block |
||
23 | 23 | * @return array |
24 | 24 | */ |
25 | 25 | public function normalize($value_to_normalize) { |
26 | - if ( is_array( $value_to_normalize )){ |
|
26 | + if (is_array($value_to_normalize)) { |
|
27 | 27 | $items_to_normalize = $value_to_normalize; |
28 | - } else if( $value_to_normalize !== NULL ){ |
|
29 | - $items_to_normalize = array( $value_to_normalize ); |
|
28 | + } else if ($value_to_normalize !== NULL) { |
|
29 | + $items_to_normalize = array($value_to_normalize); |
|
30 | 30 | } else { |
31 | 31 | $items_to_normalize = array(); |
32 | 32 | } |
33 | 33 | $normalized_array_value = array(); |
34 | - foreach( $items_to_normalize as $key => $individual_item ){ |
|
35 | - $normalized_array_value[ $key ] = $this->normalize_one( $individual_item ); |
|
34 | + foreach ($items_to_normalize as $key => $individual_item) { |
|
35 | + $normalized_array_value[$key] = $this->normalize_one($individual_item); |
|
36 | 36 | } |
37 | 37 | return $normalized_array_value; |
38 | 38 | } |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | * @param string $individual_value_to_normalize but definitely NOT an array |
43 | 43 | * @return mixed |
44 | 44 | */ |
45 | - public function normalize_one( $individual_value_to_normalize ) { |
|
46 | - return $this->_individual_item_normalization_strategy->normalize( $individual_value_to_normalize ); |
|
45 | + public function normalize_one($individual_value_to_normalize) { |
|
46 | + return $this->_individual_item_normalization_strategy->normalize($individual_value_to_normalize); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -51,16 +51,16 @@ discard block |
||
51 | 51 | * @param array $normalized_values |
52 | 52 | * @return string[] |
53 | 53 | */ |
54 | - public function unnormalize( $normalized_values ) { |
|
55 | - if( $normalized_values === null ) { |
|
54 | + public function unnormalize($normalized_values) { |
|
55 | + if ($normalized_values === null) { |
|
56 | 56 | $normalized_values = array(); |
57 | 57 | } |
58 | - if( ! is_array( $normalized_values ) ){ |
|
59 | - $normalized_values = array( $normalized_values ); |
|
58 | + if ( ! is_array($normalized_values)) { |
|
59 | + $normalized_values = array($normalized_values); |
|
60 | 60 | } |
61 | 61 | $non_normal_values = array(); |
62 | - foreach( $normalized_values as $key => $value ) { |
|
63 | - $non_normal_values[ $key ] = $this->unnormalize_one( $value ); |
|
62 | + foreach ($normalized_values as $key => $value) { |
|
63 | + $non_normal_values[$key] = $this->unnormalize_one($value); |
|
64 | 64 | } |
65 | 65 | return $non_normal_values; |
66 | 66 | } |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | * @param mixed $individual_value_to_unnormalize but certainly NOT an array |
71 | 71 | * @return string |
72 | 72 | */ |
73 | - public function unnormalize_one( $individual_value_to_unnormalize ) { |
|
74 | - return $this->_individual_item_normalization_strategy->unnormalize( $individual_value_to_unnormalize ); |
|
73 | + public function unnormalize_one($individual_value_to_unnormalize) { |
|
74 | + return $this->_individual_item_normalization_strategy->unnormalize($individual_value_to_unnormalize); |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <div class="padding"> |
2 | - <p><?php _e( 'We need your help to continue maintaining and providing this plugin for free. You can help by leaving a positive review in the WordPress plugin directory. 5 star ratings bring Event Espresso Decaf to the attention of more users which increases our support and features for this version of Event Espresso.', 'event_espresso' ); ?></p> |
|
3 | - <p><?php _e( 'Rate it five stars today!', 'event_espresso' ); ?></p><span class="ee-wp-blue dashicons dashicons-star-filled"></span><span class="ee-wp-blue dashicons dashicons-star-filled"></span><span class="ee-wp-blue dashicons dashicons-star-filled"></span><span class="ee-wp-blue dashicons dashicons-star-filled"></span><span class="ee-wp-blue dashicons dashicons-star-filled"></span> |
|
4 | - <p><a class="button button-primary" href="https://events.codebasehq.com/redirect?https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Fview%2Fplugin-reviews%2Fevent-espresso-decaf%3Frate%3D5%23postform"><?php _e( 'Rate It!', 'event_espresso' ); ?></a></p> |
|
2 | + <p><?php _e('We need your help to continue maintaining and providing this plugin for free. You can help by leaving a positive review in the WordPress plugin directory. 5 star ratings bring Event Espresso Decaf to the attention of more users which increases our support and features for this version of Event Espresso.', 'event_espresso'); ?></p> |
|
3 | + <p><?php _e('Rate it five stars today!', 'event_espresso'); ?></p><span class="ee-wp-blue dashicons dashicons-star-filled"></span><span class="ee-wp-blue dashicons dashicons-star-filled"></span><span class="ee-wp-blue dashicons dashicons-star-filled"></span><span class="ee-wp-blue dashicons dashicons-star-filled"></span><span class="ee-wp-blue dashicons dashicons-star-filled"></span> |
|
4 | + <p><a class="button button-primary" href="https://events.codebasehq.com/redirect?https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Fview%2Fplugin-reviews%2Fevent-espresso-decaf%3Frate%3D5%23postform"><?php _e('Rate It!', 'event_espresso'); ?></a></p> |
|
5 | 5 | </div> |
6 | 6 | \ No newline at end of file |