@@ -1,43 +1,43 @@ |
||
1 | 1 | <?php //echo '<h1>' . __FILE__ . '</h1>'; ?> |
2 | 2 | <?php global $post; ?> |
3 | 3 | <div class="venue-content"> |
4 | -<?php if ( apply_filters( 'FHEE__content_espresso_venues_details_template__display_entry_meta', TRUE )): ?> |
|
4 | +<?php if (apply_filters('FHEE__content_espresso_venues_details_template__display_entry_meta', TRUE)): ?> |
|
5 | 5 | <div class="entry-meta"> |
6 | - <span class="tags-links"><?php espresso_venue_categories( $post->ID, TRUE, TRUE ); ?></span> |
|
6 | + <span class="tags-links"><?php espresso_venue_categories($post->ID, TRUE, TRUE); ?></span> |
|
7 | 7 | <?php |
8 | - if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : |
|
8 | + if ( ! post_password_required() && (comments_open() || get_comments_number())) : |
|
9 | 9 | ?> |
10 | - <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'event_espresso' ), __( '1 Comment', 'event_espresso' ), __( '% Comments', 'event_espresso' ) ); ?></span> |
|
10 | + <span class="comments-link"><?php comments_popup_link(__('Leave a comment', 'event_espresso'), __('1 Comment', 'event_espresso'), __('% Comments', 'event_espresso')); ?></span> |
|
11 | 11 | <?php |
12 | 12 | endif; |
13 | 13 | |
14 | - edit_post_link( __( 'Edit', 'event_espresso' ), '<span class="edit-link">', '</span>' ); |
|
14 | + edit_post_link(__('Edit', 'event_espresso'), '<span class="edit-link">', '</span>'); |
|
15 | 15 | ?> |
16 | 16 | </div> |
17 | 17 | <?php endif; ?> |
18 | 18 | |
19 | 19 | <h3 class="event-venues-h3 ee-event-h3"> |
20 | - <?php _e( 'Details', 'event_espresso' ); ?> |
|
20 | + <?php _e('Details', 'event_espresso'); ?> |
|
21 | 21 | </h3> |
22 | 22 | |
23 | - <?php if ( $venue_phone = espresso_venue_phone( $post->ID, FALSE )) : ?> |
|
23 | + <?php if ($venue_phone = espresso_venue_phone($post->ID, FALSE)) : ?> |
|
24 | 24 | <p> |
25 | - <span class="small-text"><strong><?php _e( 'Venue Phone:', 'event_espresso' ); ?> </strong></span><?php echo $venue_phone; ?> |
|
25 | + <span class="small-text"><strong><?php _e('Venue Phone:', 'event_espresso'); ?> </strong></span><?php echo $venue_phone; ?> |
|
26 | 26 | </p> |
27 | 27 | <?php endif; ?> |
28 | - <?php if ( $venue_website = espresso_venue_website( $post->ID, FALSE )) : ?> |
|
28 | + <?php if ($venue_website = espresso_venue_website($post->ID, FALSE)) : ?> |
|
29 | 29 | <p> |
30 | - <span class="small-text"><strong><?php _e( 'Venue Website:', 'event_espresso' ); ?> </strong></span><?php echo $venue_website; ?> |
|
30 | + <span class="small-text"><strong><?php _e('Venue Website:', 'event_espresso'); ?> </strong></span><?php echo $venue_website; ?> |
|
31 | 31 | </p> |
32 | 32 | <?php endif; ?> |
33 | 33 | <?php |
34 | - do_action( 'AHEE__content_espresso_venues_details_template__before_the_content', $post ); |
|
35 | - if ( is_archive() && has_excerpt( $post->ID )) { |
|
34 | + do_action('AHEE__content_espresso_venues_details_template__before_the_content', $post); |
|
35 | + if (is_archive() && has_excerpt($post->ID)) { |
|
36 | 36 | the_excerpt(); |
37 | 37 | } else { |
38 | 38 | the_content(); |
39 | 39 | } |
40 | - do_action( 'AHEE__content_espresso_venues_details_template__after_the_content', $post ); |
|
40 | + do_action('AHEE__content_espresso_venues_details_template__after_the_content', $post); |
|
41 | 41 | ?> |
42 | 42 | </div> |
43 | 43 | <!-- .venue-content --> |
@@ -944,7 +944,7 @@ |
||
944 | 944 | * @access private |
945 | 945 | * @param int $VNU_ID |
946 | 946 | * @param string $venue_status |
947 | - * @return void |
|
947 | + * @return boolean |
|
948 | 948 | */ |
949 | 949 | private function _change_venue_status( $VNU_ID = 0, $venue_status = '' ) { |
950 | 950 | // grab venue id |
@@ -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 |
@@ -893,8 +894,9 @@ discard block |
||
893 | 894 | } |
894 | 895 | $action = $venue_status == 'trash' ? 'moved to the trash' : 'restored from the trash'; |
895 | 896 | |
896 | - if ( $redirect_after ) |
|
897 | - $this->_redirect_after_action($success, 'Venue', $action, array('action' => 'default')); |
|
897 | + if ( $redirect_after ) { |
|
898 | + $this->_redirect_after_action($success, 'Venue', $action, array('action' => 'default')); |
|
899 | + } |
|
898 | 900 | |
899 | 901 | } |
900 | 902 | |
@@ -1013,8 +1015,9 @@ discard block |
||
1013 | 1015 | $msg = __('An error occurred. An venue could not be deleted because a valid venue ID was not not supplied.', 'event_espresso'); |
1014 | 1016 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
1015 | 1017 | } |
1016 | - if ( $redirect_after ) |
|
1017 | - $this->_redirect_after_action($success, 'Venue', 'deleted', array('action' => 'default')); |
|
1018 | + if ( $redirect_after ) { |
|
1019 | + $this->_redirect_after_action($success, 'Venue', 'deleted', array('action' => 'default')); |
|
1020 | + } |
|
1018 | 1021 | } |
1019 | 1022 | |
1020 | 1023 | |
@@ -1185,8 +1188,10 @@ discard block |
||
1185 | 1188 | * @return void |
1186 | 1189 | */ |
1187 | 1190 | private function _set_category_object() { |
1188 | - if ( isset( $this->_category->id ) && !empty( $this->_category->id ) ) |
|
1189 | - return; //already have the category object so get out. |
|
1191 | + if ( isset( $this->_category->id ) && !empty( $this->_category->id ) ) { |
|
1192 | + return; |
|
1193 | + } |
|
1194 | + //already have the category object so get out. |
|
1190 | 1195 | |
1191 | 1196 | //set default category object |
1192 | 1197 | $this->_set_empty_category_object(); |
@@ -1229,11 +1229,11 @@ |
||
1229 | 1229 | protected function _category_list_table() { |
1230 | 1230 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
1231 | 1231 | $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( |
1232 | - 'add_category', |
|
1233 | - 'add_category', |
|
1234 | - array(), |
|
1235 | - 'add-new-h2' |
|
1236 | - ); |
|
1232 | + 'add_category', |
|
1233 | + 'add_category', |
|
1234 | + array(), |
|
1235 | + 'add-new-h2' |
|
1236 | + ); |
|
1237 | 1237 | $this->_search_btn_label = __('Venue Categories', 'event_espresso'); |
1238 | 1238 | $this->display_admin_list_table_page_with_sidebar(); |
1239 | 1239 | } |
@@ -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 | /** |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | |
63 | 63 | |
64 | 64 | protected function _init_page_props() { |
65 | - require_once( EE_MODELS . 'EEM_Venue.model.php' ); |
|
65 | + require_once(EE_MODELS.'EEM_Venue.model.php'); |
|
66 | 66 | $this->page_slug = EE_VENUES_PG_SLUG; |
67 | 67 | $this->_admin_base_url = EE_VENUES_ADMIN_URL; |
68 | - $this->_admin_base_path = EE_ADMIN_PAGES . 'venues'; |
|
68 | + $this->_admin_base_path = EE_ADMIN_PAGES.'venues'; |
|
69 | 69 | $this->page_label = __('Event Venues', 'event_espresso'); |
70 | 70 | $this->_cpt_model_names = array( |
71 | 71 | 'create_new' => 'EEM_Venue', |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | 'edit' => __('Update Venue', 'event_espresso'), |
109 | 109 | 'add_category' => __('Save New Category', 'event_espresso'), |
110 | 110 | 'edit_category' => __('Update Category', 'event_espresso'), |
111 | - 'google_map_settings' => __( 'Update Settings', 'event_espresso' ) |
|
111 | + 'google_map_settings' => __('Update Settings', 'event_espresso') |
|
112 | 112 | ) |
113 | 113 | ); |
114 | 114 | } |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | //load field generator helper |
124 | 124 | |
125 | 125 | //is there a vnu_id in the request? |
126 | - $vnu_id = ! empty( $this->_req_data['VNU_ID'] ) && ! is_array( $this->_req_data['VNU_ID'] ) ? $this->_req_data['VNU_ID'] : 0; |
|
127 | - $vnu_id = ! empty( $this->_req_data['post'] ) ? $this->_req_data['post'] : $vnu_id; |
|
126 | + $vnu_id = ! empty($this->_req_data['VNU_ID']) && ! is_array($this->_req_data['VNU_ID']) ? $this->_req_data['VNU_ID'] : 0; |
|
127 | + $vnu_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $vnu_id; |
|
128 | 128 | |
129 | 129 | $this->_page_routes = array( |
130 | 130 | 'default' => array( |
@@ -142,27 +142,27 @@ discard block |
||
142 | 142 | ), |
143 | 143 | 'trash_venue' => array( |
144 | 144 | 'func' => '_trash_or_restore_venue', |
145 | - 'args' => array( 'venue_status' => 'trash' ), |
|
145 | + 'args' => array('venue_status' => 'trash'), |
|
146 | 146 | 'noheader' => TRUE, |
147 | 147 | 'capability' => 'ee_delete_venue', |
148 | 148 | 'obj_id' => $vnu_id |
149 | 149 | ), |
150 | 150 | 'trash_venues' => array( |
151 | 151 | 'func' => '_trash_or_restore_venues', |
152 | - 'args' => array( 'venue_status' => 'trash' ), |
|
152 | + 'args' => array('venue_status' => 'trash'), |
|
153 | 153 | 'noheader' => TRUE, |
154 | 154 | 'capability' => 'ee_delete_venues' |
155 | 155 | ), |
156 | 156 | 'restore_venue' => array( |
157 | 157 | 'func' => '_trash_or_restore_venue', |
158 | - 'args' => array( 'venue_status' => 'draft' ), |
|
158 | + 'args' => array('venue_status' => 'draft'), |
|
159 | 159 | 'noheader' => TRUE, |
160 | 160 | 'capability' => 'ee_delete_venue', |
161 | 161 | 'obj_id' => $vnu_id |
162 | 162 | ), |
163 | 163 | 'restore_venues' => array( |
164 | 164 | 'func' => '_trash_or_restore_venues', |
165 | - 'args' => array( 'venue_status' => 'draft' ), |
|
165 | + 'args' => array('venue_status' => 'draft'), |
|
166 | 166 | 'noheader' => TRUE, |
167 | 167 | 'capability' => 'ee_delete_venues' |
168 | 168 | ), |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | 'filename' => 'venues_overview_views_bulk_actions_search' |
265 | 265 | ) |
266 | 266 | ), |
267 | - 'help_tour' => array( 'Venues_Overview_Help_Tour' ), |
|
267 | + 'help_tour' => array('Venues_Overview_Help_Tour'), |
|
268 | 268 | 'metaboxes' => array('_espresso_news_post_box', '_espresso_links_post_box'), |
269 | 269 | 'require_nonce' => FALSE |
270 | 270 | ), |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | 'filename' => 'venues_editor_other' |
301 | 301 | ) |
302 | 302 | ), |
303 | - 'help_tour' => array( 'Venues_Add_Venue_Help_Tour' ), |
|
303 | + 'help_tour' => array('Venues_Add_Venue_Help_Tour'), |
|
304 | 304 | 'metaboxes' => array('_venue_editor_metaboxes'), |
305 | 305 | 'require_nonce' => FALSE |
306 | 306 | ), |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | 'label' => __('Edit Venue', 'event_espresso'), |
310 | 310 | 'order' => 5, |
311 | 311 | 'persistent' => FALSE, |
312 | - 'url' => isset($this->_req_data['post']) ? add_query_arg(array('post' => $this->_req_data['post'] ), $this->_current_page_view_url ) : $this->_admin_base_url |
|
312 | + 'url' => isset($this->_req_data['post']) ? add_query_arg(array('post' => $this->_req_data['post']), $this->_current_page_view_url) : $this->_admin_base_url |
|
313 | 313 | ), |
314 | 314 | 'help_tabs' => array( |
315 | 315 | 'venues_editor_help_tab' => array( |
@@ -343,17 +343,17 @@ discard block |
||
343 | 343 | ), |
344 | 344 | 'google_map_settings' => array( |
345 | 345 | 'nav' => array( |
346 | - 'label' => esc_html__('Google Maps', 'event_espresso' ), |
|
346 | + 'label' => esc_html__('Google Maps', 'event_espresso'), |
|
347 | 347 | 'order' => 40 |
348 | 348 | ), |
349 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ), |
|
349 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
350 | 350 | 'help_tabs' => array( |
351 | 351 | 'general_settings_google_maps_help_tab' => array( |
352 | 352 | 'title' => __('Google Maps', 'event_espresso'), |
353 | 353 | 'filename' => 'general_settings_google_maps' |
354 | 354 | ) |
355 | 355 | ), |
356 | - 'help_tour' => array( 'Google_Maps_Help_Tour' ), |
|
356 | + 'help_tour' => array('Google_Maps_Help_Tour'), |
|
357 | 357 | 'require_nonce' => FALSE |
358 | 358 | ), |
359 | 359 | //venue category stuff |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | 'filename' => 'venues_add_category' |
370 | 370 | ) |
371 | 371 | ), |
372 | - 'help_tour' => array( 'Venues_Add_Category_Help_Tour' ), |
|
372 | + 'help_tour' => array('Venues_Add_Category_Help_Tour'), |
|
373 | 373 | 'require_nonce' => FALSE |
374 | 374 | ), |
375 | 375 | 'edit_category' => array( |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | 'label' => __('Edit Category', 'event_espresso'), |
378 | 378 | 'order' => 15, |
379 | 379 | 'persistent' => FALSE, |
380 | - 'url' => isset($this->_req_data['EVT_CAT_ID']) ? add_query_arg(array('EVT_CAT_ID' => $this->_req_data['EVT_CAT_ID'] ), $this->_current_page_view_url ) : $this->_admin_base_url |
|
380 | + 'url' => isset($this->_req_data['EVT_CAT_ID']) ? add_query_arg(array('EVT_CAT_ID' => $this->_req_data['EVT_CAT_ID']), $this->_current_page_view_url) : $this->_admin_base_url |
|
381 | 381 | ), |
382 | 382 | 'metaboxes' => array('_publish_post_box'), |
383 | 383 | 'help_tabs' => array( |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | 'filename' => 'venues_categories_other' |
414 | 414 | ) |
415 | 415 | ), |
416 | - 'help_tour' => array( 'Venues_Categories_Help_Tour' ), |
|
416 | + 'help_tour' => array('Venues_Categories_Help_Tour'), |
|
417 | 417 | 'metaboxes' => $this->_default_espresso_metaboxes, |
418 | 418 | 'require_nonce' => FALSE |
419 | 419 | ) |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | |
471 | 471 | |
472 | 472 | public function load_scripts_styles() { |
473 | - wp_register_style('ee-cat-admin', EVENTS_ASSETS_URL . 'ee-cat-admin.css', array(), EVENT_ESPRESSO_VERSION ); |
|
473 | + wp_register_style('ee-cat-admin', EVENTS_ASSETS_URL.'ee-cat-admin.css', array(), EVENT_ESPRESSO_VERSION); |
|
474 | 474 | wp_enqueue_style('ee-cat-admin'); |
475 | 475 | } |
476 | 476 | |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | public function load_scripts_styles_edit() { |
494 | 494 | //styles |
495 | 495 | wp_enqueue_style('espresso-ui-theme'); |
496 | - wp_register_style( 'espresso_venues', EE_VENUES_ASSETS_URL . 'ee-venues-admin.css', array(), EVENT_ESPRESSO_VERSION ); |
|
496 | + wp_register_style('espresso_venues', EE_VENUES_ASSETS_URL.'ee-venues-admin.css', array(), EVENT_ESPRESSO_VERSION); |
|
497 | 497 | wp_enqueue_style('espresso_venues'); |
498 | 498 | } |
499 | 499 | |
@@ -512,13 +512,13 @@ discard block |
||
512 | 512 | ) |
513 | 513 | ); |
514 | 514 | |
515 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venues', 'espresso_venues_trash_venues' ) ) { |
|
515 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_venues', 'espresso_venues_trash_venues')) { |
|
516 | 516 | $this->_views['all']['bulk_action'] = array( |
517 | 517 | 'trash_venues' => __('Move to Trash', 'event_espresso') |
518 | 518 | ); |
519 | 519 | $this->_views['trash'] = array( |
520 | 520 | 'slug' => 'trash', |
521 | - 'label' => __( 'Trash', 'event_espresso' ), |
|
521 | + 'label' => __('Trash', 'event_espresso'), |
|
522 | 522 | 'count' => 0, |
523 | 523 | 'bulk_action' => array( |
524 | 524 | 'restore_venues' => __('Restore from Trash', 'event_espresso'), |
@@ -551,9 +551,9 @@ discard block |
||
551 | 551 | |
552 | 552 | |
553 | 553 | protected function _overview_list_table() { |
554 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
555 | - $this->_template_args['after_list_table'] = EEH_Template::get_button_or_link( get_post_type_archive_link('espresso_venues'), __("View Venue Archive Page", "event_espresso"), 'button' ); |
|
556 | - $this->_admin_page_title .= ' ' . $this->get_action_link_or_button('create_new', 'add', array(), 'add-new-h2'); |
|
554 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
555 | + $this->_template_args['after_list_table'] = EEH_Template::get_button_or_link(get_post_type_archive_link('espresso_venues'), __("View Venue Archive Page", "event_espresso"), 'button'); |
|
556 | + $this->_admin_page_title .= ' '.$this->get_action_link_or_button('create_new', 'add', array(), 'add-new-h2'); |
|
557 | 557 | $this->_search_btn_label = __('Venues', 'event_espresso'); |
558 | 558 | $this->display_admin_list_table_page_with_sidebar(); |
559 | 559 | } |
@@ -566,8 +566,8 @@ discard block |
||
566 | 566 | 'vnu_url' => $this->_cpt_model_obj->venue_url(), |
567 | 567 | 'vnu_phone' => $this->_cpt_model_obj->phone() |
568 | 568 | ); |
569 | - $template = EE_VENUES_TEMPLATE_PATH . 'venue_publish_box_extras.template.php'; |
|
570 | - EEH_Template::display_template( $template, $extra_rows ); |
|
569 | + $template = EE_VENUES_TEMPLATE_PATH.'venue_publish_box_extras.template.php'; |
|
570 | + EEH_Template::display_template($template, $extra_rows); |
|
571 | 571 | } |
572 | 572 | |
573 | 573 | |
@@ -583,31 +583,31 @@ discard block |
||
583 | 583 | $default_map_settings->use_google_maps = TRUE; |
584 | 584 | $default_map_settings->google_map_api_key = ''; |
585 | 585 | // for event details pages (reg page) |
586 | - $default_map_settings->event_details_map_width = 585; // ee_map_width_single |
|
587 | - $default_map_settings->event_details_map_height = 362; // ee_map_height_single |
|
588 | - $default_map_settings->event_details_map_zoom = 14; // ee_map_zoom_single |
|
589 | - $default_map_settings->event_details_display_nav = TRUE; // ee_map_nav_display_single |
|
590 | - $default_map_settings->event_details_nav_size = FALSE; // ee_map_nav_size_single |
|
591 | - $default_map_settings->event_details_control_type = 'default'; // ee_map_type_control_single |
|
592 | - $default_map_settings->event_details_map_align = 'center'; // ee_map_align_single |
|
586 | + $default_map_settings->event_details_map_width = 585; // ee_map_width_single |
|
587 | + $default_map_settings->event_details_map_height = 362; // ee_map_height_single |
|
588 | + $default_map_settings->event_details_map_zoom = 14; // ee_map_zoom_single |
|
589 | + $default_map_settings->event_details_display_nav = TRUE; // ee_map_nav_display_single |
|
590 | + $default_map_settings->event_details_nav_size = FALSE; // ee_map_nav_size_single |
|
591 | + $default_map_settings->event_details_control_type = 'default'; // ee_map_type_control_single |
|
592 | + $default_map_settings->event_details_map_align = 'center'; // ee_map_align_single |
|
593 | 593 | // for event list pages |
594 | - $default_map_settings->event_list_map_width = 300; // ee_map_width |
|
595 | - $default_map_settings->event_list_map_height = 185; // ee_map_height |
|
596 | - $default_map_settings->event_list_map_zoom = 12; // ee_map_zoom |
|
597 | - $default_map_settings->event_list_display_nav = FALSE; // ee_map_nav_display |
|
598 | - $default_map_settings->event_list_nav_size = TRUE; // ee_map_nav_size |
|
599 | - $default_map_settings->event_list_control_type = 'dropdown'; // ee_map_type_control |
|
600 | - $default_map_settings->event_list_map_align = 'center'; // ee_map_align |
|
594 | + $default_map_settings->event_list_map_width = 300; // ee_map_width |
|
595 | + $default_map_settings->event_list_map_height = 185; // ee_map_height |
|
596 | + $default_map_settings->event_list_map_zoom = 12; // ee_map_zoom |
|
597 | + $default_map_settings->event_list_display_nav = FALSE; // ee_map_nav_display |
|
598 | + $default_map_settings->event_list_nav_size = TRUE; // ee_map_nav_size |
|
599 | + $default_map_settings->event_list_control_type = 'dropdown'; // ee_map_type_control |
|
600 | + $default_map_settings->event_list_map_align = 'center'; // ee_map_align |
|
601 | 601 | |
602 | 602 | $this->_template_args['map_settings'] = |
603 | - isset( EE_Registry::instance()->CFG->map_settings ) && ! empty( EE_Registry::instance()->CFG->map_settings ) |
|
604 | - ? (object)array_merge( (array)$default_map_settings, (array)EE_Registry::instance()->CFG->map_settings ) |
|
603 | + isset(EE_Registry::instance()->CFG->map_settings) && ! empty(EE_Registry::instance()->CFG->map_settings) |
|
604 | + ? (object) array_merge((array) $default_map_settings, (array) EE_Registry::instance()->CFG->map_settings) |
|
605 | 605 | : $default_map_settings; |
606 | 606 | |
607 | - $this->_set_add_edit_form_tags( 'update_google_map_settings' ); |
|
608 | - $this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE ); |
|
607 | + $this->_set_add_edit_form_tags('update_google_map_settings'); |
|
608 | + $this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE); |
|
609 | 609 | $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
610 | - EE_VENUES_TEMPLATE_PATH . 'google_map.template.php', |
|
610 | + EE_VENUES_TEMPLATE_PATH.'google_map.template.php', |
|
611 | 611 | $this->_template_args, |
612 | 612 | true |
613 | 613 | ); |
@@ -617,83 +617,83 @@ discard block |
||
617 | 617 | protected function _update_google_map_settings() { |
618 | 618 | |
619 | 619 | EE_Registry::instance()->CFG->map_settings->use_google_maps = |
620 | - isset( $this->_req_data['use_google_maps'] ) |
|
621 | - ? absint( $this->_req_data['use_google_maps'] ) |
|
620 | + isset($this->_req_data['use_google_maps']) |
|
621 | + ? absint($this->_req_data['use_google_maps']) |
|
622 | 622 | : EE_Registry::instance()->CFG->map_settings->use_google_maps; |
623 | 623 | |
624 | 624 | EE_Registry::instance()->CFG->map_settings->google_map_api_key = |
625 | - isset( $this->_req_data['google_map_api_key'] ) |
|
626 | - ? sanitize_text_field( $this->_req_data['google_map_api_key'] ) |
|
625 | + isset($this->_req_data['google_map_api_key']) |
|
626 | + ? sanitize_text_field($this->_req_data['google_map_api_key']) |
|
627 | 627 | : EE_Registry::instance()->CFG->map_settings->google_map_api_key; |
628 | 628 | |
629 | 629 | EE_Registry::instance()->CFG->map_settings->event_details_map_width = |
630 | - isset( $this->_req_data['event_details_map_width'] ) |
|
631 | - ? absint( $this->_req_data['event_details_map_width'] ) |
|
630 | + isset($this->_req_data['event_details_map_width']) |
|
631 | + ? absint($this->_req_data['event_details_map_width']) |
|
632 | 632 | : EE_Registry::instance()->CFG->map_settings->event_details_map_width; |
633 | 633 | |
634 | 634 | EE_Registry::instance()->CFG->map_settings->event_details_map_height = |
635 | - isset( $this->_req_data['event_details_map_height'] ) |
|
636 | - ? absint( $this->_req_data['event_details_map_height'] ) |
|
635 | + isset($this->_req_data['event_details_map_height']) |
|
636 | + ? absint($this->_req_data['event_details_map_height']) |
|
637 | 637 | : EE_Registry::instance()->CFG->map_settings->event_details_map_height; |
638 | 638 | |
639 | 639 | EE_Registry::instance()->CFG->map_settings->event_details_map_zoom = |
640 | - isset( $this->_req_data['event_details_map_zoom'] ) |
|
641 | - ? absint( $this->_req_data['event_details_map_zoom'] ) |
|
640 | + isset($this->_req_data['event_details_map_zoom']) |
|
641 | + ? absint($this->_req_data['event_details_map_zoom']) |
|
642 | 642 | : EE_Registry::instance()->CFG->map_settings->event_details_map_zoom; |
643 | 643 | |
644 | 644 | EE_Registry::instance()->CFG->map_settings->event_details_display_nav = |
645 | - isset( $this->_req_data['event_details_display_nav'] ) |
|
646 | - ? absint( $this->_req_data['event_details_display_nav'] ) |
|
645 | + isset($this->_req_data['event_details_display_nav']) |
|
646 | + ? absint($this->_req_data['event_details_display_nav']) |
|
647 | 647 | : EE_Registry::instance()->CFG->map_settings->event_details_display_nav; |
648 | 648 | |
649 | 649 | EE_Registry::instance()->CFG->map_settings->event_details_nav_size = |
650 | - isset( $this->_req_data['event_details_nav_size'] ) |
|
651 | - ? absint( $this->_req_data['event_details_nav_size'] ) |
|
650 | + isset($this->_req_data['event_details_nav_size']) |
|
651 | + ? absint($this->_req_data['event_details_nav_size']) |
|
652 | 652 | : EE_Registry::instance()->CFG->map_settings->event_details_nav_size; |
653 | 653 | |
654 | 654 | EE_Registry::instance()->CFG->map_settings->event_details_control_type = |
655 | - isset( $this->_req_data['event_details_control_type'] ) |
|
656 | - ? sanitize_text_field( $this->_req_data['event_details_control_type'] ) |
|
655 | + isset($this->_req_data['event_details_control_type']) |
|
656 | + ? sanitize_text_field($this->_req_data['event_details_control_type']) |
|
657 | 657 | : EE_Registry::instance()->CFG->map_settings->event_details_control_type; |
658 | 658 | |
659 | 659 | EE_Registry::instance()->CFG->map_settings->event_details_map_align = |
660 | - isset( $this->_req_data['event_details_map_align'] ) |
|
661 | - ? sanitize_text_field( $this->_req_data['event_details_map_align'] ) |
|
660 | + isset($this->_req_data['event_details_map_align']) |
|
661 | + ? sanitize_text_field($this->_req_data['event_details_map_align']) |
|
662 | 662 | : EE_Registry::instance()->CFG->map_settings->event_details_map_align; |
663 | 663 | |
664 | 664 | EE_Registry::instance()->CFG->map_settings->event_list_map_width = |
665 | - isset( $this->_req_data['event_list_map_width'] ) |
|
666 | - ? absint( $this->_req_data['event_list_map_width'] ) |
|
665 | + isset($this->_req_data['event_list_map_width']) |
|
666 | + ? absint($this->_req_data['event_list_map_width']) |
|
667 | 667 | : EE_Registry::instance()->CFG->map_settings->event_list_map_width; |
668 | 668 | |
669 | 669 | EE_Registry::instance()->CFG->map_settings->event_list_map_height = |
670 | - isset( $this->_req_data['event_list_map_height'] ) |
|
671 | - ? absint( $this->_req_data['event_list_map_height'] ) |
|
670 | + isset($this->_req_data['event_list_map_height']) |
|
671 | + ? absint($this->_req_data['event_list_map_height']) |
|
672 | 672 | : EE_Registry::instance()->CFG->map_settings->event_list_map_height; |
673 | 673 | |
674 | 674 | EE_Registry::instance()->CFG->map_settings->event_list_map_zoom = |
675 | - isset( $this->_req_data['event_list_map_zoom'] ) |
|
676 | - ? absint( $this->_req_data['event_list_map_zoom'] ) |
|
675 | + isset($this->_req_data['event_list_map_zoom']) |
|
676 | + ? absint($this->_req_data['event_list_map_zoom']) |
|
677 | 677 | : EE_Registry::instance()->CFG->map_settings->event_list_map_zoom; |
678 | 678 | |
679 | 679 | EE_Registry::instance()->CFG->map_settings->event_list_display_nav = |
680 | - isset( $this->_req_data['event_list_display_nav'] ) |
|
681 | - ? absint( $this->_req_data['event_list_display_nav'] ) |
|
680 | + isset($this->_req_data['event_list_display_nav']) |
|
681 | + ? absint($this->_req_data['event_list_display_nav']) |
|
682 | 682 | : EE_Registry::instance()->CFG->map_settings->event_list_display_nav; |
683 | 683 | |
684 | 684 | EE_Registry::instance()->CFG->map_settings->event_list_nav_size = |
685 | - isset( $this->_req_data['event_list_nav_size'] ) |
|
686 | - ? absint( $this->_req_data['event_list_nav_size'] ) |
|
685 | + isset($this->_req_data['event_list_nav_size']) |
|
686 | + ? absint($this->_req_data['event_list_nav_size']) |
|
687 | 687 | : EE_Registry::instance()->CFG->map_settings->event_list_nav_size; |
688 | 688 | |
689 | 689 | EE_Registry::instance()->CFG->map_settings->event_list_control_type = |
690 | - isset( $this->_req_data['event_list_control_type'] ) |
|
691 | - ? sanitize_text_field( $this->_req_data['event_list_control_type'] ) |
|
690 | + isset($this->_req_data['event_list_control_type']) |
|
691 | + ? sanitize_text_field($this->_req_data['event_list_control_type']) |
|
692 | 692 | : EE_Registry::instance()->CFG->map_settings->event_list_control_type; |
693 | 693 | |
694 | 694 | EE_Registry::instance()->CFG->map_settings->event_list_map_align = |
695 | - isset( $this->_req_data['event_list_map_align'] ) |
|
696 | - ? sanitize_text_field( $this->_req_data['event_list_map_align'] ) |
|
695 | + isset($this->_req_data['event_list_map_align']) |
|
696 | + ? sanitize_text_field($this->_req_data['event_list_map_align']) |
|
697 | 697 | : EE_Registry::instance()->CFG->map_settings->event_list_map_align; |
698 | 698 | |
699 | 699 | EE_Registry::instance()->CFG->map_settings = apply_filters( |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | EE_Registry::instance()->CFG->map_settings, |
708 | 708 | __FILE__, __FUNCTION__, __LINE__ |
709 | 709 | ); |
710 | - $this->_redirect_after_action( $success, $what, 'updated', array( 'action' => 'google_map_settings' ) ); |
|
710 | + $this->_redirect_after_action($success, $what, 'updated', array('action' => 'google_map_settings')); |
|
711 | 711 | |
712 | 712 | } |
713 | 713 | |
@@ -716,9 +716,9 @@ discard block |
||
716 | 716 | protected function _venue_editor_metaboxes() { |
717 | 717 | $this->verify_cpt_object(); |
718 | 718 | |
719 | - add_meta_box( 'espresso_venue_address_options', __('Physical Location', 'event_espresso'), array( $this, 'venue_address_metabox'), $this->page_slug, 'side', 'default' ); |
|
720 | - add_meta_box( 'espresso_venue_gmap_options', __('Google Map', 'event_espresso'), array( $this, 'venue_gmap_metabox'), $this->page_slug, 'side', 'default' ); |
|
721 | - add_meta_box( 'espresso_venue_virtual_loc_options', __('Virtual Location', 'event_espresso'), array( $this, 'venue_virtual_loc_metabox'), $this->page_slug, 'side', 'default' ); |
|
719 | + add_meta_box('espresso_venue_address_options', __('Physical Location', 'event_espresso'), array($this, 'venue_address_metabox'), $this->page_slug, 'side', 'default'); |
|
720 | + add_meta_box('espresso_venue_gmap_options', __('Google Map', 'event_espresso'), array($this, 'venue_gmap_metabox'), $this->page_slug, 'side', 'default'); |
|
721 | + add_meta_box('espresso_venue_virtual_loc_options', __('Virtual Location', 'event_espresso'), array($this, 'venue_virtual_loc_metabox'), $this->page_slug, 'side', 'default'); |
|
722 | 722 | |
723 | 723 | } |
724 | 724 | |
@@ -726,23 +726,23 @@ discard block |
||
726 | 726 | |
727 | 727 | public function venue_gmap_metabox() { |
728 | 728 | $template_args = array( |
729 | - 'vnu_enable_for_gmap' => EEH_Form_Fields::select_input('vnu_enable_for_gmap', $this->get_yes_no_values(), $this->_cpt_model_obj->enable_for_gmap() ), |
|
729 | + 'vnu_enable_for_gmap' => EEH_Form_Fields::select_input('vnu_enable_for_gmap', $this->get_yes_no_values(), $this->_cpt_model_obj->enable_for_gmap()), |
|
730 | 730 | 'vnu_google_map_link' => $this->_cpt_model_obj->google_map_link(), |
731 | 731 | ); |
732 | - $template = EE_VENUES_TEMPLATE_PATH . 'venue_gmap_metabox_content.template.php'; |
|
733 | - EEH_Template::display_template( $template, $template_args ); |
|
732 | + $template = EE_VENUES_TEMPLATE_PATH.'venue_gmap_metabox_content.template.php'; |
|
733 | + EEH_Template::display_template($template, $template_args); |
|
734 | 734 | } |
735 | 735 | |
736 | 736 | |
737 | 737 | |
738 | 738 | public function venue_address_metabox() { |
739 | 739 | |
740 | - $template_args['_venue'] =$this->_cpt_model_obj; |
|
740 | + $template_args['_venue'] = $this->_cpt_model_obj; |
|
741 | 741 | |
742 | 742 | $template_args['states_dropdown'] = EEH_Form_Fields::generate_form_input( |
743 | 743 | $QFI = new EE_Question_Form_Input( |
744 | - EE_Question::new_instance( array( 'QST_display_text' => esc_html__( 'State', 'event_espresso' ), 'QST_system' => 'state' )), |
|
745 | - EE_Answer::new_instance( array( 'ANS_value'=> $this->_cpt_model_obj->state_ID() )), |
|
744 | + EE_Question::new_instance(array('QST_display_text' => esc_html__('State', 'event_espresso'), 'QST_system' => 'state')), |
|
745 | + EE_Answer::new_instance(array('ANS_value'=> $this->_cpt_model_obj->state_ID())), |
|
746 | 746 | array( |
747 | 747 | 'input_name' => 'sta_id', |
748 | 748 | 'input_id' => 'sta_id', |
@@ -754,8 +754,8 @@ discard block |
||
754 | 754 | ); |
755 | 755 | $template_args['countries_dropdown'] = EEH_Form_Fields::generate_form_input( |
756 | 756 | $QFI = new EE_Question_Form_Input( |
757 | - EE_Question::new_instance( array( 'QST_display_text' => esc_html__( 'Country', 'event_espresso' ), 'QST_system' => 'country' )), |
|
758 | - EE_Answer::new_instance( array( 'ANS_value'=> $this->_cpt_model_obj->country_ID() )), |
|
757 | + EE_Question::new_instance(array('QST_display_text' => esc_html__('Country', 'event_espresso'), 'QST_system' => 'country')), |
|
758 | + EE_Answer::new_instance(array('ANS_value'=> $this->_cpt_model_obj->country_ID())), |
|
759 | 759 | array( |
760 | 760 | 'input_name' => 'cnt_iso', |
761 | 761 | 'input_id' => 'cnt_iso', |
@@ -766,8 +766,8 @@ discard block |
||
766 | 766 | ) |
767 | 767 | ); |
768 | 768 | |
769 | - $template = EE_VENUES_TEMPLATE_PATH . 'venue_address_metabox_content.template.php'; |
|
770 | - EEH_Template::display_template( $template, $template_args ); |
|
769 | + $template = EE_VENUES_TEMPLATE_PATH.'venue_address_metabox_content.template.php'; |
|
770 | + EEH_Template::display_template($template, $template_args); |
|
771 | 771 | } |
772 | 772 | |
773 | 773 | |
@@ -779,8 +779,8 @@ discard block |
||
779 | 779 | $template_args = array( |
780 | 780 | '_venue' => $this->_cpt_model_obj |
781 | 781 | ); |
782 | - $template = EE_VENUES_TEMPLATE_PATH . 'venue_virtual_location_metabox_content.template.php'; |
|
783 | - EEH_Template::display_template( $template, $template_args ); |
|
782 | + $template = EE_VENUES_TEMPLATE_PATH.'venue_virtual_location_metabox_content.template.php'; |
|
783 | + EEH_Template::display_template($template, $template_args); |
|
784 | 784 | } |
785 | 785 | |
786 | 786 | |
@@ -803,52 +803,52 @@ discard block |
||
803 | 803 | * @param object $post Post object (with "blessed" WP properties) |
804 | 804 | * @return void |
805 | 805 | */ |
806 | - protected function _insert_update_cpt_item( $post_id, $post ) { |
|
806 | + protected function _insert_update_cpt_item($post_id, $post) { |
|
807 | 807 | |
808 | - if ( $post instanceof WP_Post && $post->post_type !== 'espresso_venues' ) { |
|
809 | - return;// get out we're not processing the saving of venues. |
|
808 | + if ($post instanceof WP_Post && $post->post_type !== 'espresso_venues') { |
|
809 | + return; // get out we're not processing the saving of venues. |
|
810 | 810 | } |
811 | 811 | |
812 | - $wheres = array( $this->_venue_model->primary_key_name() => $post_id ); |
|
812 | + $wheres = array($this->_venue_model->primary_key_name() => $post_id); |
|
813 | 813 | |
814 | 814 | $venue_values = array( |
815 | - 'VNU_address' => !empty( $this->_req_data['vnu_address'] ) ? $this->_req_data['vnu_address'] : NULL, |
|
816 | - 'VNU_address2' => !empty( $this->_req_data['vnu_address2'] ) ? $this->_req_data['vnu_address2'] : NULL, |
|
817 | - 'VNU_city' => !empty( $this->_req_data['vnu_city'] ) ? $this->_req_data['vnu_city'] : NULL, |
|
818 | - 'STA_ID' => !empty( $this->_req_data['sta_id'] ) ? $this->_req_data['sta_id'] : NULL, |
|
819 | - 'CNT_ISO' => !empty( $this->_req_data['cnt_iso'] ) ? $this->_req_data['cnt_iso'] : NULL, |
|
820 | - 'VNU_zip' => !empty( $this->_req_data['vnu_zip'] ) ? $this->_req_data['vnu_zip'] : NULL, |
|
821 | - 'VNU_phone' => !empty( $this->_req_data['vnu_phone'] ) ? $this->_req_data['vnu_phone'] : NULL, |
|
822 | - 'VNU_capacity' => !empty( $this->_req_data['vnu_capacity'] ) ? str_replace( ',', '', $this->_req_data['vnu_capacity'] ) : EE_INF, |
|
823 | - 'VNU_url' => !empty( $this->_req_data['vnu_url'] ) ? $this->_req_data['vnu_url'] : NULL, |
|
824 | - 'VNU_virtual_phone' => !empty( $this->_req_data['vnu_virtual_phone'] ) ? $this->_req_data['vnu_virtual_phone'] : NULL, |
|
825 | - 'VNU_virtual_url' => !empty( $this->_req_data['vnu_virtual_url'] ) ? $this->_req_data['vnu_virtual_url'] : NULL, |
|
826 | - 'VNU_enable_for_gmap' => !empty( $this->_req_data['vnu_enable_for_gmap'] ) ? TRUE : FALSE, |
|
827 | - 'VNU_google_map_link' => !empty( $this->_req_data['vnu_google_map_link'] ) ? $this->_req_data['vnu_google_map_link'] : NULL |
|
815 | + 'VNU_address' => ! empty($this->_req_data['vnu_address']) ? $this->_req_data['vnu_address'] : NULL, |
|
816 | + 'VNU_address2' => ! empty($this->_req_data['vnu_address2']) ? $this->_req_data['vnu_address2'] : NULL, |
|
817 | + 'VNU_city' => ! empty($this->_req_data['vnu_city']) ? $this->_req_data['vnu_city'] : NULL, |
|
818 | + 'STA_ID' => ! empty($this->_req_data['sta_id']) ? $this->_req_data['sta_id'] : NULL, |
|
819 | + 'CNT_ISO' => ! empty($this->_req_data['cnt_iso']) ? $this->_req_data['cnt_iso'] : NULL, |
|
820 | + 'VNU_zip' => ! empty($this->_req_data['vnu_zip']) ? $this->_req_data['vnu_zip'] : NULL, |
|
821 | + 'VNU_phone' => ! empty($this->_req_data['vnu_phone']) ? $this->_req_data['vnu_phone'] : NULL, |
|
822 | + 'VNU_capacity' => ! empty($this->_req_data['vnu_capacity']) ? str_replace(',', '', $this->_req_data['vnu_capacity']) : EE_INF, |
|
823 | + 'VNU_url' => ! empty($this->_req_data['vnu_url']) ? $this->_req_data['vnu_url'] : NULL, |
|
824 | + 'VNU_virtual_phone' => ! empty($this->_req_data['vnu_virtual_phone']) ? $this->_req_data['vnu_virtual_phone'] : NULL, |
|
825 | + 'VNU_virtual_url' => ! empty($this->_req_data['vnu_virtual_url']) ? $this->_req_data['vnu_virtual_url'] : NULL, |
|
826 | + 'VNU_enable_for_gmap' => ! empty($this->_req_data['vnu_enable_for_gmap']) ? TRUE : FALSE, |
|
827 | + 'VNU_google_map_link' => ! empty($this->_req_data['vnu_google_map_link']) ? $this->_req_data['vnu_google_map_link'] : NULL |
|
828 | 828 | ); |
829 | 829 | |
830 | 830 | //update venue |
831 | - $success = $this->_venue_model->update( $venue_values, array( $wheres ) ); |
|
831 | + $success = $this->_venue_model->update($venue_values, array($wheres)); |
|
832 | 832 | |
833 | 833 | //get venue_object for other metaboxes that might be added via the filter... though it would seem to make sense to just use $this->_venue_model->get_one_by_ID( $post_id ).. i have to setup where conditions to override the filters in the model that filter out autodraft and inherit statuses so we GET the inherit id! |
834 | - $get_one_where = array( $this->_venue_model->primary_key_name() => $post_id, 'status' => $post->post_status ); |
|
835 | - $venue = $this->_venue_model->get_one( array( $get_one_where ) ); |
|
834 | + $get_one_where = array($this->_venue_model->primary_key_name() => $post_id, 'status' => $post->post_status); |
|
835 | + $venue = $this->_venue_model->get_one(array($get_one_where)); |
|
836 | 836 | |
837 | 837 | //notice we've applied a filter for venue metabox callbacks but we don't actually have any default venue metaboxes in use. So this is just here for addons to more easily hook into venue saves. |
838 | - $venue_update_callbacks = apply_filters( 'FHEE__Venues_Admin_Page___insert_update_cpt_item__venue_update_callbacks', array() ); |
|
838 | + $venue_update_callbacks = apply_filters('FHEE__Venues_Admin_Page___insert_update_cpt_item__venue_update_callbacks', array()); |
|
839 | 839 | |
840 | 840 | $att_success = TRUE; |
841 | 841 | |
842 | - foreach ( $venue_update_callbacks as $v_callback ) { |
|
843 | - $_succ = call_user_func_array( $v_callback, array( $venue, $this->_req_data ) ); |
|
844 | - $att_success = !$att_success ? $att_success : $_succ; //if ANY of these updates fail then we want the appropriate global error message |
|
842 | + foreach ($venue_update_callbacks as $v_callback) { |
|
843 | + $_succ = call_user_func_array($v_callback, array($venue, $this->_req_data)); |
|
844 | + $att_success = ! $att_success ? $att_success : $_succ; //if ANY of these updates fail then we want the appropriate global error message |
|
845 | 845 | } |
846 | 846 | |
847 | 847 | //any errors? |
848 | - if ( $success && !$att_success ) { |
|
849 | - EE_Error::add_error( __('Venue Details saved successfully but something went wrong with saving attachments.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
850 | - } else if ( $success === FALSE ) { |
|
851 | - EE_Error::add_error( __('Venue Details did not save successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
848 | + if ($success && ! $att_success) { |
|
849 | + EE_Error::add_error(__('Venue Details saved successfully but something went wrong with saving attachments.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
850 | + } else if ($success === FALSE) { |
|
851 | + EE_Error::add_error(__('Venue Details did not save successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
852 | 852 | } |
853 | 853 | } |
854 | 854 | |
@@ -856,9 +856,9 @@ discard block |
||
856 | 856 | |
857 | 857 | |
858 | 858 | |
859 | - public function trash_cpt_item( $post_id ) { |
|
859 | + public function trash_cpt_item($post_id) { |
|
860 | 860 | $this->_req_data['VNU_ID'] = $post_id; |
861 | - $this->_trash_or_restore_venue( 'trash', FALSE ); |
|
861 | + $this->_trash_or_restore_venue('trash', FALSE); |
|
862 | 862 | } |
863 | 863 | |
864 | 864 | |
@@ -866,18 +866,18 @@ discard block |
||
866 | 866 | |
867 | 867 | |
868 | 868 | |
869 | - public function restore_cpt_item( $post_id ) { |
|
869 | + public function restore_cpt_item($post_id) { |
|
870 | 870 | $this->_req_data['VNU_ID'] = $post_id; |
871 | - $this->_trash_or_restore_venue( 'draft', FALSE ); |
|
871 | + $this->_trash_or_restore_venue('draft', FALSE); |
|
872 | 872 | } |
873 | 873 | |
874 | 874 | |
875 | 875 | |
876 | 876 | |
877 | 877 | |
878 | - public function delete_cpt_item( $post_id ) { |
|
878 | + public function delete_cpt_item($post_id) { |
|
879 | 879 | $this->_req_data['VNU_ID'] = $post_id; |
880 | - $this->_delete_venue( FALSE ); |
|
880 | + $this->_delete_venue(FALSE); |
|
881 | 881 | } |
882 | 882 | |
883 | 883 | |
@@ -892,15 +892,15 @@ discard block |
||
892 | 892 | |
893 | 893 | |
894 | 894 | |
895 | - protected function _trash_or_restore_venue( $venue_status = 'trash', $redirect_after = TRUE ) { |
|
896 | - $VNU_ID = isset( $this->_req_data['VNU_ID'] ) ? absint( $this->_req_data['VNU_ID'] ) : FALSE; |
|
895 | + protected function _trash_or_restore_venue($venue_status = 'trash', $redirect_after = TRUE) { |
|
896 | + $VNU_ID = isset($this->_req_data['VNU_ID']) ? absint($this->_req_data['VNU_ID']) : FALSE; |
|
897 | 897 | |
898 | 898 | //loop thru venues |
899 | - if ( $VNU_ID ) { |
|
899 | + if ($VNU_ID) { |
|
900 | 900 | //clean status |
901 | - $venue_status = sanitize_key( $venue_status ); |
|
901 | + $venue_status = sanitize_key($venue_status); |
|
902 | 902 | // grab status |
903 | - if (!empty($venue_status)) { |
|
903 | + if ( ! empty($venue_status)) { |
|
904 | 904 | $success = $this->_change_venue_status($VNU_ID, $venue_status); |
905 | 905 | } else { |
906 | 906 | $success = FALSE; |
@@ -914,7 +914,7 @@ discard block |
||
914 | 914 | } |
915 | 915 | $action = $venue_status == 'trash' ? 'moved to the trash' : 'restored from the trash'; |
916 | 916 | |
917 | - if ( $redirect_after ) |
|
917 | + if ($redirect_after) |
|
918 | 918 | $this->_redirect_after_action($success, 'Venue', $action, array('action' => 'default')); |
919 | 919 | |
920 | 920 | } |
@@ -923,11 +923,11 @@ discard block |
||
923 | 923 | |
924 | 924 | |
925 | 925 | |
926 | - protected function _trash_or_restore_venues( $venue_status = 'trash' ) { |
|
926 | + protected function _trash_or_restore_venues($venue_status = 'trash') { |
|
927 | 927 | // clean status |
928 | 928 | $venue_status = sanitize_key($venue_status); |
929 | 929 | // grab status |
930 | - if (!empty($venue_status)) { |
|
930 | + if ( ! empty($venue_status)) { |
|
931 | 931 | $success = TRUE; |
932 | 932 | //determine the event id and set to array. |
933 | 933 | $VNU_IDs = isset($this->_req_data['venue_id']) ? (array) $this->_req_data['venue_id'] : array(); |
@@ -967,20 +967,20 @@ discard block |
||
967 | 967 | * @param string $venue_status |
968 | 968 | * @return void |
969 | 969 | */ |
970 | - private function _change_venue_status( $VNU_ID = 0, $venue_status = '' ) { |
|
970 | + private function _change_venue_status($VNU_ID = 0, $venue_status = '') { |
|
971 | 971 | // grab venue id |
972 | - if (! $VNU_ID) { |
|
972 | + if ( ! $VNU_ID) { |
|
973 | 973 | $msg = __('An error occurred. No Venue ID or an invalid Venue ID was received.', 'event_espresso'); |
974 | 974 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
975 | 975 | return FALSE; |
976 | 976 | } |
977 | 977 | |
978 | - $this->_cpt_model_obj = EEM_Venue::instance()->get_one_by_ID( $VNU_ID ); |
|
978 | + $this->_cpt_model_obj = EEM_Venue::instance()->get_one_by_ID($VNU_ID); |
|
979 | 979 | |
980 | 980 | // clean status |
981 | 981 | $venue_status = sanitize_key($venue_status); |
982 | 982 | // grab status |
983 | - if ( ! $venue_status ) { |
|
983 | + if ( ! $venue_status) { |
|
984 | 984 | $msg = __('An error occurred. No Venue Status or an invalid Venue Status was received.', 'event_espresso'); |
985 | 985 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
986 | 986 | return FALSE; |
@@ -1001,7 +1001,7 @@ discard block |
||
1001 | 1001 | $hook = FALSE; |
1002 | 1002 | } |
1003 | 1003 | //use class to change status |
1004 | - $this->_cpt_model_obj->set_status( $venue_status ); |
|
1004 | + $this->_cpt_model_obj->set_status($venue_status); |
|
1005 | 1005 | $success = $this->_cpt_model_obj->save(); |
1006 | 1006 | |
1007 | 1007 | if ($success === FALSE) { |
@@ -1020,21 +1020,21 @@ discard block |
||
1020 | 1020 | * @param bool $redirect_after |
1021 | 1021 | * @return void |
1022 | 1022 | */ |
1023 | - protected function _delete_venue( $redirect_after = true ) { |
|
1023 | + protected function _delete_venue($redirect_after = true) { |
|
1024 | 1024 | //determine the venue id and set to array. |
1025 | 1025 | $VNU_ID = isset($this->_req_data['VNU_ID']) ? absint($this->_req_data['VNU_ID']) : NULL; |
1026 | - $VNU_ID = isset( $this->_req_data['post'] ) ? absint( $this->_req_data['post'] ) : $VNU_ID; |
|
1026 | + $VNU_ID = isset($this->_req_data['post']) ? absint($this->_req_data['post']) : $VNU_ID; |
|
1027 | 1027 | |
1028 | 1028 | |
1029 | 1029 | // loop thru venues |
1030 | 1030 | if ($VNU_ID) { |
1031 | - $success = $this->_delete_or_trash_venue( $VNU_ID ); |
|
1031 | + $success = $this->_delete_or_trash_venue($VNU_ID); |
|
1032 | 1032 | } else { |
1033 | 1033 | $success = FALSE; |
1034 | 1034 | $msg = __('An error occurred. An venue could not be deleted because a valid venue ID was not not supplied.', 'event_espresso'); |
1035 | 1035 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
1036 | 1036 | } |
1037 | - if ( $redirect_after ) |
|
1037 | + if ($redirect_after) |
|
1038 | 1038 | $this->_redirect_after_action($success, 'Venue', 'deleted', array('action' => 'default')); |
1039 | 1039 | } |
1040 | 1040 | |
@@ -1066,7 +1066,7 @@ discard block |
||
1066 | 1066 | //todo: put in parent |
1067 | 1067 | private function _delete_or_trash_venue($VNU_ID = FALSE) { |
1068 | 1068 | // grab event id |
1069 | - if (!$VNU_ID = absint($VNU_ID)) { |
|
1069 | + if ( ! $VNU_ID = absint($VNU_ID)) { |
|
1070 | 1070 | $msg = __('An error occurred. No Venue ID or an invalid Venue ID was received.', 'event_espresso'); |
1071 | 1071 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
1072 | 1072 | return FALSE; |
@@ -1086,7 +1086,7 @@ discard block |
||
1086 | 1086 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
1087 | 1087 | return FALSE; |
1088 | 1088 | } |
1089 | - do_action( 'AHEE__Venues_Admin_Page___delete_or_trash_venue__after_venue_deleted' ); |
|
1089 | + do_action('AHEE__Venues_Admin_Page___delete_or_trash_venue__after_venue_deleted'); |
|
1090 | 1090 | return TRUE; |
1091 | 1091 | } |
1092 | 1092 | |
@@ -1097,11 +1097,11 @@ discard block |
||
1097 | 1097 | /* QUERIES */ |
1098 | 1098 | |
1099 | 1099 | |
1100 | - public function get_venues( $per_page = 10, $count = FALSE ) { |
|
1100 | + public function get_venues($per_page = 10, $count = FALSE) { |
|
1101 | 1101 | |
1102 | - $_orderby = !empty( $this->_req_data['orderby'] ) ? $this->_req_data['orderby'] : ''; |
|
1102 | + $_orderby = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : ''; |
|
1103 | 1103 | |
1104 | - switch ( $_orderby ) { |
|
1104 | + switch ($_orderby) { |
|
1105 | 1105 | case 'id': |
1106 | 1106 | $orderby = 'VNU_ID'; |
1107 | 1107 | break; |
@@ -1119,43 +1119,43 @@ discard block |
||
1119 | 1119 | } |
1120 | 1120 | |
1121 | 1121 | |
1122 | - $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC'; |
|
1122 | + $sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC'; |
|
1123 | 1123 | |
1124 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
1125 | - $per_page = isset( $per_page ) && !empty( $per_page ) ? $per_page : 10; |
|
1126 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
1124 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
1125 | + $per_page = isset($per_page) && ! empty($per_page) ? $per_page : 10; |
|
1126 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
1127 | 1127 | |
1128 | 1128 | |
1129 | - $offset = ($current_page-1)*$per_page; |
|
1129 | + $offset = ($current_page - 1) * $per_page; |
|
1130 | 1130 | $limit = array($offset, $per_page); |
1131 | 1131 | |
1132 | - $category = isset( $this->_req_data['category'] ) && $this->_req_data['category'] > 0 ? $this->_req_data['category'] : NULL; |
|
1132 | + $category = isset($this->_req_data['category']) && $this->_req_data['category'] > 0 ? $this->_req_data['category'] : NULL; |
|
1133 | 1133 | $where = array(); |
1134 | 1134 | |
1135 | 1135 | //only set initial status if it is in the incoming request. Otherwise the "all" view display's all statuses. |
1136 | - if ( isset( $this->_req_data['status'] ) && $this->_req_data['status'] != 'all' ) { |
|
1136 | + if (isset($this->_req_data['status']) && $this->_req_data['status'] != 'all') { |
|
1137 | 1137 | $where['status'] = $this->_req_data['status']; |
1138 | 1138 | } |
1139 | 1139 | |
1140 | - if ( isset( $this->_req_data['venue_status'] ) ) { |
|
1140 | + if (isset($this->_req_data['venue_status'])) { |
|
1141 | 1141 | $where['status'] = $this->_req_data['venue_status']; |
1142 | 1142 | } |
1143 | 1143 | |
1144 | 1144 | |
1145 | - if ( $category ) { |
|
1145 | + if ($category) { |
|
1146 | 1146 | $where['Term_Taxonomy.taxonomy'] = 'espresso_venue_categories'; |
1147 | 1147 | $where['Term_Taxonomy.term_id'] = $category; |
1148 | 1148 | } |
1149 | 1149 | |
1150 | 1150 | |
1151 | - if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_venues', 'get_venues' ) ) { |
|
1152 | - $where['VNU_wp_user'] = get_current_user_id(); |
|
1151 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_venues', 'get_venues')) { |
|
1152 | + $where['VNU_wp_user'] = get_current_user_id(); |
|
1153 | 1153 | } else { |
1154 | - if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_venues', 'get_venues' ) ) { |
|
1154 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_venues', 'get_venues')) { |
|
1155 | 1155 | $where['OR'] = array( |
1156 | - 'status*restrict_private' => array( '!=', 'private' ), |
|
1156 | + 'status*restrict_private' => array('!=', 'private'), |
|
1157 | 1157 | 'AND' => array( |
1158 | - 'status*inclusive' => array( '=', 'private' ), |
|
1158 | + 'status*inclusive' => array('=', 'private'), |
|
1159 | 1159 | 'VNU_wp_user' => get_current_user_id() |
1160 | 1160 | ) |
1161 | 1161 | ); |
@@ -1165,30 +1165,30 @@ discard block |
||
1165 | 1165 | |
1166 | 1166 | |
1167 | 1167 | |
1168 | - if ( isset( $this->_req_data['s'] ) ) { |
|
1169 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
1168 | + if (isset($this->_req_data['s'])) { |
|
1169 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
1170 | 1170 | $where['OR'] = array( |
1171 | - 'VNU_name' => array('LIKE',$sstr ), |
|
1172 | - 'VNU_desc' => array('LIKE',$sstr ), |
|
1173 | - 'VNU_short_desc' => array( 'LIKE',$sstr ), |
|
1174 | - 'VNU_address' => array( 'LIKE', $sstr ), |
|
1175 | - 'VNU_address2' => array( 'LIKE', $sstr ), |
|
1176 | - 'VNU_city' => array( 'LIKE', $sstr ), |
|
1177 | - 'VNU_zip' => array( 'LIKE', $sstr ), |
|
1178 | - 'VNU_phone' => array( 'LIKE', $sstr ), |
|
1179 | - 'VNU_url' => array( 'LIKE', $sstr ), |
|
1180 | - 'VNU_virtual_phone' => array( 'LIKE', $sstr ), |
|
1181 | - 'VNU_virtual_url' => array( 'LIKE', $sstr ), |
|
1182 | - 'VNU_google_map_link' => array( 'LIKE', $sstr ), |
|
1183 | - 'Event.EVT_name' => array('LIKE', $sstr ), |
|
1184 | - 'Event.EVT_desc' => array('LIKE', $sstr ), |
|
1185 | - 'Event.EVT_phone' => array('LIKE', $sstr ), |
|
1186 | - 'Event.EVT_external_URL' => array('LIKE', $sstr ), |
|
1171 | + 'VNU_name' => array('LIKE', $sstr), |
|
1172 | + 'VNU_desc' => array('LIKE', $sstr), |
|
1173 | + 'VNU_short_desc' => array('LIKE', $sstr), |
|
1174 | + 'VNU_address' => array('LIKE', $sstr), |
|
1175 | + 'VNU_address2' => array('LIKE', $sstr), |
|
1176 | + 'VNU_city' => array('LIKE', $sstr), |
|
1177 | + 'VNU_zip' => array('LIKE', $sstr), |
|
1178 | + 'VNU_phone' => array('LIKE', $sstr), |
|
1179 | + 'VNU_url' => array('LIKE', $sstr), |
|
1180 | + 'VNU_virtual_phone' => array('LIKE', $sstr), |
|
1181 | + 'VNU_virtual_url' => array('LIKE', $sstr), |
|
1182 | + 'VNU_google_map_link' => array('LIKE', $sstr), |
|
1183 | + 'Event.EVT_name' => array('LIKE', $sstr), |
|
1184 | + 'Event.EVT_desc' => array('LIKE', $sstr), |
|
1185 | + 'Event.EVT_phone' => array('LIKE', $sstr), |
|
1186 | + 'Event.EVT_external_URL' => array('LIKE', $sstr), |
|
1187 | 1187 | ); |
1188 | 1188 | } |
1189 | 1189 | |
1190 | 1190 | |
1191 | - $venues = $count ? $this->_venue_model->count( array($where), 'VNU_ID' ) : $this->_venue_model->get_all( array( $where, 'limit' => $limit, 'order_by' => $orderby, 'order' => $sort ) ); |
|
1191 | + $venues = $count ? $this->_venue_model->count(array($where), 'VNU_ID') : $this->_venue_model->get_all(array($where, 'limit' => $limit, 'order_by' => $orderby, 'order' => $sort)); |
|
1192 | 1192 | |
1193 | 1193 | return $venues; |
1194 | 1194 | |
@@ -1206,22 +1206,22 @@ discard block |
||
1206 | 1206 | * @return void |
1207 | 1207 | */ |
1208 | 1208 | private function _set_category_object() { |
1209 | - if ( isset( $this->_category->id ) && !empty( $this->_category->id ) ) |
|
1209 | + if (isset($this->_category->id) && ! empty($this->_category->id)) |
|
1210 | 1210 | return; //already have the category object so get out. |
1211 | 1211 | |
1212 | 1212 | //set default category object |
1213 | 1213 | $this->_set_empty_category_object(); |
1214 | 1214 | |
1215 | 1215 | //only set if we've got an id |
1216 | - if ( !isset($this->_req_data['VEN_CAT_ID'] ) ) { |
|
1216 | + if ( ! isset($this->_req_data['VEN_CAT_ID'])) { |
|
1217 | 1217 | return; |
1218 | 1218 | } |
1219 | 1219 | |
1220 | 1220 | $category_id = absint($this->_req_data['VEN_CAT_ID']); |
1221 | - $term = get_term( $category_id, 'espresso_venue_categories' ); |
|
1221 | + $term = get_term($category_id, 'espresso_venue_categories'); |
|
1222 | 1222 | |
1223 | 1223 | |
1224 | - if ( !empty( $term ) ) { |
|
1224 | + if ( ! empty($term)) { |
|
1225 | 1225 | $this->_category->category_name = $term->name; |
1226 | 1226 | $this->_category->category_identifier = $term->slug; |
1227 | 1227 | $this->_category->category_desc = $term->description; |
@@ -1235,15 +1235,15 @@ discard block |
||
1235 | 1235 | |
1236 | 1236 | private function _set_empty_category_object() { |
1237 | 1237 | $this->_category = new stdClass(); |
1238 | - $this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = ''; |
|
1238 | + $this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = ''; |
|
1239 | 1239 | $this->_category->id = $this->_category->parent = 0; |
1240 | 1240 | } |
1241 | 1241 | |
1242 | 1242 | |
1243 | 1243 | |
1244 | 1244 | protected function _category_list_table() { |
1245 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
1246 | - $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( |
|
1245 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
1246 | + $this->_admin_page_title .= ' '.$this->get_action_link_or_button( |
|
1247 | 1247 | 'add_category', |
1248 | 1248 | 'add_category', |
1249 | 1249 | array(), |
@@ -1263,13 +1263,13 @@ discard block |
||
1263 | 1263 | $this->_set_add_edit_form_tags($route); |
1264 | 1264 | |
1265 | 1265 | $this->_set_category_object(); |
1266 | - $id = !empty($this->_category->id) ? $this->_category->id : ''; |
|
1266 | + $id = ! empty($this->_category->id) ? $this->_category->id : ''; |
|
1267 | 1267 | |
1268 | 1268 | $delete_action = 'delete_category'; |
1269 | 1269 | |
1270 | - $redirect = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'category_list' ), $this->_admin_base_url ); |
|
1270 | + $redirect = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'category_list'), $this->_admin_base_url); |
|
1271 | 1271 | |
1272 | - $this->_set_publish_post_box_vars( 'VEN_CAT_ID', $id, $delete_action, $redirect ); |
|
1272 | + $this->_set_publish_post_box_vars('VEN_CAT_ID', $id, $delete_action, $redirect); |
|
1273 | 1273 | |
1274 | 1274 | //take care of contents |
1275 | 1275 | $this->_template_args['admin_page_content'] = $this->_category_details_content(); |
@@ -1283,25 +1283,25 @@ discard block |
||
1283 | 1283 | 'type' => 'wp_editor', |
1284 | 1284 | 'value' => EEH_Formatter::admin_format_content($this->_category->category_desc), |
1285 | 1285 | 'class' => 'my_editor_custom', |
1286 | - 'wpeditor_args' => array( 'media_buttons' => FALSE ) |
|
1286 | + 'wpeditor_args' => array('media_buttons' => FALSE) |
|
1287 | 1287 | ); |
1288 | - $_wp_editor = $this->_generate_admin_form_fields( $editor_args, 'array' ); |
|
1288 | + $_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array'); |
|
1289 | 1289 | |
1290 | - $all_terms = get_terms( array('espresso_venue_categories' ), array( 'hide_empty' => 0, 'exclude' => array( $this->_category->id ) ) ); |
|
1290 | + $all_terms = get_terms(array('espresso_venue_categories'), array('hide_empty' => 0, 'exclude' => array($this->_category->id))); |
|
1291 | 1291 | |
1292 | 1292 | //setup category select for term parents. |
1293 | 1293 | $category_select_values[] = array( |
1294 | 1294 | 'text' => __('No Parent', 'event_espresso'), |
1295 | 1295 | 'id' => 0 |
1296 | 1296 | ); |
1297 | - foreach ( $all_terms as $term ) { |
|
1297 | + foreach ($all_terms as $term) { |
|
1298 | 1298 | $category_select_values[] = array( |
1299 | 1299 | 'text' => $term->name, |
1300 | 1300 | 'id' => $term->term_id |
1301 | 1301 | ); |
1302 | 1302 | } |
1303 | 1303 | |
1304 | - $category_select = EEH_Form_Fields::select_input( 'category_parent', $category_select_values, $this->_category->parent ); |
|
1304 | + $category_select = EEH_Form_Fields::select_input('category_parent', $category_select_values, $this->_category->parent); |
|
1305 | 1305 | $template_args = array( |
1306 | 1306 | 'category' => $this->_category, |
1307 | 1307 | 'category_select' => $category_select, |
@@ -1310,15 +1310,15 @@ discard block |
||
1310 | 1310 | 'disable' => '', |
1311 | 1311 | 'disabled_message' =>FALSE |
1312 | 1312 | ); |
1313 | - $template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php'; |
|
1314 | - return EEH_Template::display_template($template, $template_args, TRUE ); |
|
1313 | + $template = EVENTS_TEMPLATE_PATH.'event_category_details.template.php'; |
|
1314 | + return EEH_Template::display_template($template, $template_args, TRUE); |
|
1315 | 1315 | } |
1316 | 1316 | |
1317 | 1317 | |
1318 | 1318 | protected function _delete_categories() { |
1319 | - $cat_ids = isset( $this->_req_data['VEN_CAT_ID'] ) ? (array) $this->_req_data['VEN_CAT_ID'] : (array) $this->_req_data['category_id']; |
|
1319 | + $cat_ids = isset($this->_req_data['VEN_CAT_ID']) ? (array) $this->_req_data['VEN_CAT_ID'] : (array) $this->_req_data['category_id']; |
|
1320 | 1320 | |
1321 | - foreach ( $cat_ids as $cat_id ) { |
|
1321 | + foreach ($cat_ids as $cat_id) { |
|
1322 | 1322 | $this->_delete_category($cat_id); |
1323 | 1323 | } |
1324 | 1324 | |
@@ -1326,7 +1326,7 @@ discard block |
||
1326 | 1326 | $query_args = array( |
1327 | 1327 | 'action' => 'category_list' |
1328 | 1328 | ); |
1329 | - $this->_redirect_after_action(0,'','',$query_args); |
|
1329 | + $this->_redirect_after_action(0, '', '', $query_args); |
|
1330 | 1330 | |
1331 | 1331 | } |
1332 | 1332 | |
@@ -1335,58 +1335,58 @@ discard block |
||
1335 | 1335 | |
1336 | 1336 | |
1337 | 1337 | protected function _delete_category($cat_id) { |
1338 | - $cat_id = absint( $cat_id ); |
|
1339 | - wp_delete_term( $cat_id, 'espresso_venue_categories' ); |
|
1338 | + $cat_id = absint($cat_id); |
|
1339 | + wp_delete_term($cat_id, 'espresso_venue_categories'); |
|
1340 | 1340 | } |
1341 | 1341 | |
1342 | 1342 | |
1343 | 1343 | |
1344 | 1344 | protected function _insert_or_update_category($new_category) { |
1345 | 1345 | |
1346 | - $cat_id = $new_category ? $this->_insert_category() : $this->_insert_category( TRUE ); |
|
1346 | + $cat_id = $new_category ? $this->_insert_category() : $this->_insert_category(TRUE); |
|
1347 | 1347 | $success = 0; //we already have a success message so lets not send another. |
1348 | - if ( $cat_id ) { |
|
1348 | + if ($cat_id) { |
|
1349 | 1349 | $query_args = array( |
1350 | 1350 | 'action' => 'edit_category', |
1351 | 1351 | 'VEN_CAT_ID' => $cat_id |
1352 | 1352 | ); |
1353 | 1353 | } else { |
1354 | - $query_args = array( 'action' => 'add_category' ); |
|
1354 | + $query_args = array('action' => 'add_category'); |
|
1355 | 1355 | } |
1356 | - $this->_redirect_after_action( $success, '','', $query_args, TRUE ); |
|
1356 | + $this->_redirect_after_action($success, '', '', $query_args, TRUE); |
|
1357 | 1357 | |
1358 | 1358 | } |
1359 | 1359 | |
1360 | 1360 | |
1361 | 1361 | |
1362 | - private function _insert_category( $update = FALSE ) { |
|
1362 | + private function _insert_category($update = FALSE) { |
|
1363 | 1363 | $cat_id = $update ? $this->_req_data['VEN_CAT_ID'] : ''; |
1364 | - $category_name= isset( $this->_req_data['category_name'] ) ? $this->_req_data['category_name'] : ''; |
|
1365 | - $category_desc= isset( $this->_req_data['category_desc'] ) ? $this->_req_data['category_desc'] : ''; |
|
1366 | - $category_parent = isset( $this->_req_data['category_parent'] ) ? $this->_req_data['category_parent'] : 0; |
|
1364 | + $category_name = isset($this->_req_data['category_name']) ? $this->_req_data['category_name'] : ''; |
|
1365 | + $category_desc = isset($this->_req_data['category_desc']) ? $this->_req_data['category_desc'] : ''; |
|
1366 | + $category_parent = isset($this->_req_data['category_parent']) ? $this->_req_data['category_parent'] : 0; |
|
1367 | 1367 | |
1368 | - if ( empty( $category_name ) ) { |
|
1369 | - $msg = __( 'You must add a name for the category.', 'event_espresso' ); |
|
1370 | - EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
1368 | + if (empty($category_name)) { |
|
1369 | + $msg = __('You must add a name for the category.', 'event_espresso'); |
|
1370 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
1371 | 1371 | return false; |
1372 | 1372 | } |
1373 | 1373 | |
1374 | 1374 | |
1375 | - $term_args=array( |
|
1375 | + $term_args = array( |
|
1376 | 1376 | 'name'=>$category_name, |
1377 | 1377 | 'description'=>$category_desc, |
1378 | 1378 | 'parent'=>$category_parent |
1379 | 1379 | ); |
1380 | 1380 | |
1381 | - $insert_ids = $update ? wp_update_term( $cat_id, 'espresso_venue_categories', $term_args ) :wp_insert_term( $category_name, 'espresso_venue_categories', $term_args ); |
|
1381 | + $insert_ids = $update ? wp_update_term($cat_id, 'espresso_venue_categories', $term_args) : wp_insert_term($category_name, 'espresso_venue_categories', $term_args); |
|
1382 | 1382 | |
1383 | - if ( !is_array( $insert_ids ) ) { |
|
1384 | - $msg = __( 'An error occurred and the category has not been saved to the database.', 'event_espresso' ); |
|
1385 | - EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
1383 | + if ( ! is_array($insert_ids)) { |
|
1384 | + $msg = __('An error occurred and the category has not been saved to the database.', 'event_espresso'); |
|
1385 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
1386 | 1386 | } else { |
1387 | 1387 | $cat_id = $insert_ids['term_id']; |
1388 | - $msg = sprintf ( __('The category %s was successfully created', 'event_espresso'), $category_name ); |
|
1389 | - EE_Error::add_success( $msg ); |
|
1388 | + $msg = sprintf(__('The category %s was successfully created', 'event_espresso'), $category_name); |
|
1389 | + EE_Error::add_success($msg); |
|
1390 | 1390 | } |
1391 | 1391 | |
1392 | 1392 | return $cat_id; |
@@ -1406,11 +1406,11 @@ discard block |
||
1406 | 1406 | 'category_ids' => $this->_req_data['VEN_CAT_ID'] |
1407 | 1407 | ); |
1408 | 1408 | |
1409 | - $this->_req_data = array_merge( $this->_req_data, $new_request_args ); |
|
1409 | + $this->_req_data = array_merge($this->_req_data, $new_request_args); |
|
1410 | 1410 | |
1411 | - if ( is_readable( EE_CLASSES . 'EE_Export.class.php') ) { |
|
1412 | - require_once( EE_CLASSES . 'EE_Export.class.php'); |
|
1413 | - $EE_Export = EE_Export::instance( $this->_req_data ); |
|
1411 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
1412 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
1413 | + $EE_Export = EE_Export::instance($this->_req_data); |
|
1414 | 1414 | $EE_Export->export(); |
1415 | 1415 | } |
1416 | 1416 | |
@@ -1422,7 +1422,7 @@ discard block |
||
1422 | 1422 | |
1423 | 1423 | protected function _import_categories() { |
1424 | 1424 | |
1425 | - require_once(EE_CLASSES . 'EE_Import.class.php'); |
|
1425 | + require_once(EE_CLASSES.'EE_Import.class.php'); |
|
1426 | 1426 | EE_Import::instance()->import(); |
1427 | 1427 | |
1428 | 1428 | } |
@@ -1430,29 +1430,29 @@ discard block |
||
1430 | 1430 | |
1431 | 1431 | |
1432 | 1432 | |
1433 | - public function get_categories( $per_page = 10, $current_page = 1, $count = FALSE ) { |
|
1433 | + public function get_categories($per_page = 10, $current_page = 1, $count = FALSE) { |
|
1434 | 1434 | |
1435 | 1435 | //testing term stuff |
1436 | - $orderby = isset( $this->_req_data['orderby'] ) ? $this->_req_data['orderby'] : 'Term.term_id'; |
|
1437 | - $order = isset( $this->_req_data['order'] ) ? $this->_req_data['order'] : 'DESC'; |
|
1438 | - $limit = ($current_page-1)*$per_page; |
|
1439 | - $where = array( 'taxonomy' => 'espresso_venue_categories' ); |
|
1440 | - if ( isset( $this->_req_data['s'] ) ) { |
|
1441 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
1436 | + $orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'Term.term_id'; |
|
1437 | + $order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC'; |
|
1438 | + $limit = ($current_page - 1) * $per_page; |
|
1439 | + $where = array('taxonomy' => 'espresso_venue_categories'); |
|
1440 | + if (isset($this->_req_data['s'])) { |
|
1441 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
1442 | 1442 | $where['OR'] = array( |
1443 | - 'Term.name' => array( 'LIKE', $sstr), |
|
1444 | - 'description' => array( 'LIKE', $sstr ) |
|
1443 | + 'Term.name' => array('LIKE', $sstr), |
|
1444 | + 'description' => array('LIKE', $sstr) |
|
1445 | 1445 | ); |
1446 | 1446 | } |
1447 | 1447 | |
1448 | 1448 | $query_params = array( |
1449 | 1449 | $where, |
1450 | - 'order_by' => array( $orderby => $order ), |
|
1451 | - 'limit' => $limit . ',' . $per_page, |
|
1450 | + 'order_by' => array($orderby => $order), |
|
1451 | + 'limit' => $limit.','.$per_page, |
|
1452 | 1452 | 'force_join' => array('Term') |
1453 | 1453 | ); |
1454 | 1454 | |
1455 | - $categories = $count ? EEM_Term_Taxonomy::instance()->count( $query_params, 'term_id' ) :EEM_Term_Taxonomy::instance()->get_all( $query_params ); |
|
1455 | + $categories = $count ? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id') : EEM_Term_Taxonomy::instance()->get_all($query_params); |
|
1456 | 1456 | |
1457 | 1457 | return $categories; |
1458 | 1458 | } |
@@ -3,5 +3,5 @@ |
||
3 | 3 | <?php _e('A venue is the place or location that is hosting your event. This setting is optional which means that you are not required to select a venue for your event.', 'event_espresso'); ?> |
4 | 4 | </p> |
5 | 5 | <p> |
6 | -<?php echo sprintf(__('Venues can be managed through the %sVenues page%s.', 'event_espresso'),'<a href="admin.php?page=espresso_venues">','</a>'); ?> |
|
6 | +<?php echo sprintf(__('Venues can be managed through the %sVenues page%s.', 'event_espresso'), '<a href="admin.php?page=espresso_venues">', '</a>'); ?> |
|
7 | 7 | </p> |
8 | 8 | \ No newline at end of file |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php do_action( 'AHEE__event_tickets_metabox_main__before_content' ); ?> |
|
1 | +<?php do_action('AHEE__event_tickets_metabox_main__before_content'); ?> |
|
2 | 2 | <div id="event-and-ticket-form-content"> |
3 | 3 | <h4 class="event-tickets-datetimes-title"><?php _e('Event Datetime', 'event_espresso'); ?></h4><?php echo $event_datetime_help_link; ?> |
4 | 4 | <div class="event-datetimes-container"> |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | </td> |
30 | 30 | <td class="event-datetime-column reg-limit-column"> |
31 | 31 | <?php |
32 | - $reg_limit = $time->get_pretty('DTT_reg_limit','input'); |
|
32 | + $reg_limit = $time->get_pretty('DTT_reg_limit', 'input'); |
|
33 | 33 | ?> |
34 | 34 | <input type="text" name="edit_event_datetimes[1][DTT_reg_limit]" id="event-datetime-DTT_reg_limit-1" class="ee-small-text-inp ee-inp-right event-datetime-DTT_reg_limit" value="<?php echo $reg_limit; ?>"> |
35 | 35 | </td> |
36 | - <td class="datetime-tickets-sold"><?php printf( __('Tickets Sold: %s', 'event_espresso'), $time->get('DTT_sold') ); ?></td> |
|
36 | + <td class="datetime-tickets-sold"><?php printf(__('Tickets Sold: %s', 'event_espresso'), $time->get('DTT_sold')); ?></td> |
|
37 | 37 | </tr> |
38 | 38 | </tbody> |
39 | 39 | </table> |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | <div style="clear:both"></div> |
72 | 72 | </div> <!-- end #event-and-ticket-form-content --> |
73 | 73 | |
74 | -<?php do_action( 'AHEE__event_tickets_metabox_main__after_content' ); ?> |
|
74 | +<?php do_action('AHEE__event_tickets_metabox_main__after_content'); ?> |
|
75 | 75 | |
76 | 76 | <table id="new-ticket-row-form" class="hidden"> |
77 | 77 | <tbody><?php echo $ticket_js_structure; ?></tbody> |
@@ -6,41 +6,41 @@ |
||
6 | 6 | <ul> |
7 | 7 | <li> |
8 | 8 | <strong><?php _e('Registration Checkout Page', 'event_espresso'); ?></strong><br /> |
9 | -<?php printf( __('This page displays all your events and is required. It is important that this page always contain the %s shortcode. It is not required to be in your navigation menu.', 'event_espresso'), '<strong>[ESPRESSO_CHECKOUT]</strong>' ); ?> |
|
9 | +<?php printf(__('This page displays all your events and is required. It is important that this page always contain the %s shortcode. It is not required to be in your navigation menu.', 'event_espresso'), '<strong>[ESPRESSO_CHECKOUT]</strong>'); ?> |
|
10 | 10 | </li> |
11 | 11 | <li> |
12 | 12 | <strong><?php _e('Transactions Page', 'event_espresso'); ?></strong><br /> |
13 | -<?php printf( __('This page processes the payments and is required. It should only contain the %s shortcode. No other content should be added and it should be hidden from your navigation menu.', 'event_espresso'), '<strong>[ESPRESSO_TXN_PAGE]</strong>' ); ?> |
|
13 | +<?php printf(__('This page processes the payments and is required. It should only contain the %s shortcode. No other content should be added and it should be hidden from your navigation menu.', 'event_espresso'), '<strong>[ESPRESSO_TXN_PAGE]</strong>'); ?> |
|
14 | 14 | </li> |
15 | 15 | <li> |
16 | 16 | <strong><?php _e('Thank You Page', 'event_espresso'); ?></strong><br /> |
17 | -<?php printf( __('This page is displayed after a successful transaction and is required. It should contain the %s shortcode. Additionally, you may customize this page by adding extra content to the page. It should be hidden from your navigation menu.', 'event_espresso'), '<strong>[ESPRESSO_THANK_YOU]</strong>' ); ?> |
|
17 | +<?php printf(__('This page is displayed after a successful transaction and is required. It should contain the %s shortcode. Additionally, you may customize this page by adding extra content to the page. It should be hidden from your navigation menu.', 'event_espresso'), '<strong>[ESPRESSO_THANK_YOU]</strong>'); ?> |
|
18 | 18 | </li> |
19 | 19 | <li> |
20 | 20 | <strong><?php _e('Cancel / Return Page', 'event_espresso'); ?></strong><br /> |
21 | -<?php printf( __('This page is displayed after an unsuccessful transaction and is required. It should contain the %s shortcode. Additionally, you may customize this page by adding extra content to the page. It should be hidden from your navigation menu.', 'event_espresso'), '<strong>[ESPRESSO_CANCELLED]</strong>' ); ?> |
|
21 | +<?php printf(__('This page is displayed after an unsuccessful transaction and is required. It should contain the %s shortcode. Additionally, you may customize this page by adding extra content to the page. It should be hidden from your navigation menu.', 'event_espresso'), '<strong>[ESPRESSO_CANCELLED]</strong>'); ?> |
|
22 | 22 | </li> |
23 | 23 | <li> |
24 | 24 | <strong><?php _e('Event List', 'event_espresso'); ?></strong><br /> |
25 | -<?php printf(__('If you would like to style the look of your events archive page, then follow the WordPress instructions for %1$screating a custom template for archive pages%2$s.', 'event_espresso'), '<a href="http://codex.wordpress.org/Post_Type_Templates">','</a>'); ?> |
|
25 | +<?php printf(__('If you would like to style the look of your events archive page, then follow the WordPress instructions for %1$screating a custom template for archive pages%2$s.', 'event_espresso'), '<a href="http://codex.wordpress.org/Post_Type_Templates">', '</a>'); ?> |
|
26 | 26 | <ul> |
27 | 27 | <li style="list-style-type: circle;"> |
28 | -<?php printf( __('Build a template for your events - create a theme template named %1$s Then place it in your theme\'s root directory. For the default WordPress Twenty Thirteen theme, this location will be %2$s.', 'event_espresso'), '<strong>archive-espresso_events.php</strong>','wp-content/themes/twenty-fourteen' ); ?> |
|
28 | +<?php printf(__('Build a template for your events - create a theme template named %1$s Then place it in your theme\'s root directory. For the default WordPress Twenty Thirteen theme, this location will be %2$s.', 'event_espresso'), '<strong>archive-espresso_events.php</strong>', 'wp-content/themes/twenty-fourteen'); ?> |
|
29 | 29 | </li> |
30 | 30 | <li style="list-style-type: circle;"> |
31 | -<?php printf( __('Build a template for a single event - create a theme template named %1$s Then place it in your theme\'s root directory. For the default WordPress Twenty Thirteen theme, this location will be %2$s.', 'event_espresso'), '<strong>single-espresso_events.php</strong>','wp-content/themes/twenty-fourteen' ); ?> |
|
31 | +<?php printf(__('Build a template for a single event - create a theme template named %1$s Then place it in your theme\'s root directory. For the default WordPress Twenty Thirteen theme, this location will be %2$s.', 'event_espresso'), '<strong>single-espresso_events.php</strong>', 'wp-content/themes/twenty-fourteen'); ?> |
|
32 | 32 | </li> |
33 | 33 | </ul> |
34 | 34 | </li> |
35 | 35 | <li> |
36 | 36 | <strong><?php _e('Venue List', 'event_espresso'); ?></strong><br /> |
37 | -<?php printf(__('If you would like to style the look of your venues archive page, then follow the WordPress instructions for %1$screating a custom template for archive pages%2$s.', 'event_espresso'), '<a href="http://codex.wordpress.org/Post_Type_Templates">','</a>'); ?> |
|
37 | +<?php printf(__('If you would like to style the look of your venues archive page, then follow the WordPress instructions for %1$screating a custom template for archive pages%2$s.', 'event_espresso'), '<a href="http://codex.wordpress.org/Post_Type_Templates">', '</a>'); ?> |
|
38 | 38 | <ul> |
39 | 39 | <li style="list-style-type: circle;"> |
40 | -<?php printf( __('Build a template for your events - create a theme template named %1$s Then place it in your theme\'s root directory. For the default WordPress Twenty Thirteen theme, this location will be %2$s.', 'event_espresso'), '<strong>archive-espresso_venues.php</strong>','wp-content/themes/twenty-fourteen' ); ?> |
|
40 | +<?php printf(__('Build a template for your events - create a theme template named %1$s Then place it in your theme\'s root directory. For the default WordPress Twenty Thirteen theme, this location will be %2$s.', 'event_espresso'), '<strong>archive-espresso_venues.php</strong>', 'wp-content/themes/twenty-fourteen'); ?> |
|
41 | 41 | </li> |
42 | 42 | <li style="list-style-type: circle;"> |
43 | -<?php printf( __('Build a template for a single event - create a theme template named %1$s Then place it in your theme\'s root directory. For the default WordPress Twenty Thirteen theme, this location will be %2$s.', 'event_espresso'), '<strong>single-espresso_venues.php</strong>','wp-content/themes/twenty-fourteen' ); ?> |
|
43 | +<?php printf(__('Build a template for a single event - create a theme template named %1$s Then place it in your theme\'s root directory. For the default WordPress Twenty Thirteen theme, this location will be %2$s.', 'event_espresso'), '<strong>single-espresso_venues.php</strong>', 'wp-content/themes/twenty-fourteen'); ?> |
|
44 | 44 | </li> |
45 | 45 | </ul> |
46 | 46 | </li> |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | </strong> |
25 | 25 | <?php echo EEH_Template::get_help_tab_link('registration_page_info'); ?> |
26 | 26 | <br /> |
27 | - <?php echo General_Settings_Admin_Page::edit_view_links( $reg_page_id );?> |
|
27 | + <?php echo General_Settings_Admin_Page::edit_view_links($reg_page_id); ?> |
|
28 | 28 | </label> |
29 | 29 | </th> |
30 | 30 | <td> |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | <option value="0"> |
33 | 33 | <?php _e('Main Page', 'event_espresso'); ?> |
34 | 34 | </option> |
35 | - <?php General_Settings_Admin_Page::page_settings_dropdown( $reg_page_id ); ?> |
|
35 | + <?php General_Settings_Admin_Page::page_settings_dropdown($reg_page_id); ?> |
|
36 | 36 | </select> |
37 | 37 | <span> |
38 | - <?php echo General_Settings_Admin_Page::page_and_shortcode_status( $reg_page_obj, '[ESPRESSO_CHECKOUT]' ); ?> |
|
38 | + <?php echo General_Settings_Admin_Page::page_and_shortcode_status($reg_page_obj, '[ESPRESSO_CHECKOUT]'); ?> |
|
39 | 39 | </span> |
40 | 40 | <br /> |
41 | 41 | <p class="description"> |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | <?php echo EEH_Template::get_help_tab_link('notify_url_info'); ?> |
60 | 60 | <br /> |
61 | 61 | <span class="lt-grey-text"><?php _e('Notify URL (processes payments)', 'event_espresso'); ?></span><br/> |
62 | - <?php echo General_Settings_Admin_Page::edit_view_links( $txn_page_id );?> |
|
62 | + <?php echo General_Settings_Admin_Page::edit_view_links($txn_page_id); ?> |
|
63 | 63 | </label> |
64 | 64 | </th> |
65 | 65 | <td> |
@@ -67,16 +67,16 @@ discard block |
||
67 | 67 | <option value="0"> |
68 | 68 | <?php _e('Main Page', 'event_espresso'); ?> |
69 | 69 | </option> |
70 | - <?php General_Settings_Admin_Page::page_settings_dropdown( $txn_page_id ); ?> |
|
70 | + <?php General_Settings_Admin_Page::page_settings_dropdown($txn_page_id); ?> |
|
71 | 71 | </select> |
72 | 72 | <span> |
73 | - <?php echo General_Settings_Admin_Page::page_and_shortcode_status( $txn_page_obj, '[ESPRESSO_TXN_PAGE]' ); ?> |
|
73 | + <?php echo General_Settings_Admin_Page::page_and_shortcode_status($txn_page_obj, '[ESPRESSO_TXN_PAGE]'); ?> |
|
74 | 74 | </span> |
75 | 75 | <br /> |
76 | 76 | <p class="description"> |
77 | 77 | <?php |
78 | 78 | echo sprintf( |
79 | - __( 'This page should be hidden from your navigation, but still viewable to the public (not password protected), and should always contain the %s shortcode.', 'event_espresso' ), |
|
79 | + __('This page should be hidden from your navigation, but still viewable to the public (not password protected), and should always contain the %s shortcode.', 'event_espresso'), |
|
80 | 80 | '<span class="highlight" style="padding:3px;margin:0;">[ESPRESSO_TXN_PAGE]</span>' |
81 | 81 | ); |
82 | 82 | ?> |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | </strong> |
94 | 94 | <?php echo EEH_Template::get_help_tab_link('return_url_info'); ?> |
95 | 95 | <br /> |
96 | - <?php echo General_Settings_Admin_Page::edit_view_links( $thank_you_page_id );?> |
|
96 | + <?php echo General_Settings_Admin_Page::edit_view_links($thank_you_page_id); ?> |
|
97 | 97 | </label> |
98 | 98 | </th> |
99 | 99 | <td> |
@@ -101,16 +101,16 @@ discard block |
||
101 | 101 | <option value="0"> |
102 | 102 | <?php _e('Main Page', 'event_espresso'); ?> |
103 | 103 | </option> |
104 | - <?php General_Settings_Admin_Page::page_settings_dropdown( $thank_you_page_id ); ?> |
|
104 | + <?php General_Settings_Admin_Page::page_settings_dropdown($thank_you_page_id); ?> |
|
105 | 105 | </select> |
106 | 106 | <span> |
107 | - <?php echo General_Settings_Admin_Page::page_and_shortcode_status( $thank_you_page_obj, '[ESPRESSO_THANK_YOU]' ); ?> |
|
107 | + <?php echo General_Settings_Admin_Page::page_and_shortcode_status($thank_you_page_obj, '[ESPRESSO_THANK_YOU]'); ?> |
|
108 | 108 | </span> |
109 | 109 | <br /> |
110 | 110 | <p class="description"> |
111 | 111 | <?php |
112 | 112 | echo sprintf( |
113 | - __( 'This page should be hidden from your navigation, but still viewable to the public (not password protected), and should always contain the %s shortcode.', 'event_espresso' ), |
|
113 | + __('This page should be hidden from your navigation, but still viewable to the public (not password protected), and should always contain the %s shortcode.', 'event_espresso'), |
|
114 | 114 | '<span class="highlight" style="padding:3px;margin:0;">[ESPRESSO_THANK_YOU]</span>' |
115 | 115 | ); |
116 | 116 | ?> |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | </strong> |
128 | 128 | <?php echo EEH_Template::get_help_tab_link('cancel_return_info'); ?> |
129 | 129 | <br /> |
130 | - <?php echo General_Settings_Admin_Page::edit_view_links( $cancel_page_id );?> |
|
130 | + <?php echo General_Settings_Admin_Page::edit_view_links($cancel_page_id); ?> |
|
131 | 131 | </label> |
132 | 132 | </th> |
133 | 133 | <td> |
@@ -135,16 +135,16 @@ discard block |
||
135 | 135 | <option value="0"> |
136 | 136 | <?php _e('Main Page', 'event_espresso'); ?> |
137 | 137 | </option> |
138 | - <?php General_Settings_Admin_Page::page_settings_dropdown( $cancel_page_id ); ?> |
|
138 | + <?php General_Settings_Admin_Page::page_settings_dropdown($cancel_page_id); ?> |
|
139 | 139 | </select> |
140 | 140 | <span> |
141 | - <?php echo General_Settings_Admin_Page::page_and_shortcode_status( $cancel_page_obj, '[ESPRESSO_CANCELLED]' ); ?> |
|
141 | + <?php echo General_Settings_Admin_Page::page_and_shortcode_status($cancel_page_obj, '[ESPRESSO_CANCELLED]'); ?> |
|
142 | 142 | </span> |
143 | 143 | <br /> |
144 | 144 | <p class="description"> |
145 | 145 | <?php |
146 | 146 | echo sprintf( |
147 | - __( 'This page should be hidden from your navigation, but still viewable to the public (not password protected), and should always contain a "cancelled transaction" message and the %s shortcode.', 'event_espresso' ), |
|
147 | + __('This page should be hidden from your navigation, but still viewable to the public (not password protected), and should always contain a "cancelled transaction" message and the %s shortcode.', 'event_espresso'), |
|
148 | 148 | '<span class="highlight" style="padding:3px;margin:0;">[ESPRESSO_CANCELLED]</span>' |
149 | 149 | ); |
150 | 150 | ?> |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | </strong> |
162 | 162 | <?php echo EEH_Template::get_help_tab_link('event_list_cpt_info'); ?> |
163 | 163 | <br /> |
164 | - <a href='<?php echo get_post_type_archive_link('espresso_events') ?>'><?php _e('View', 'event_espresso');?></a> |
|
164 | + <a href='<?php echo get_post_type_archive_link('espresso_events') ?>'><?php _e('View', 'event_espresso'); ?></a> |
|
165 | 165 | </label> |
166 | 166 | </th> |
167 | 167 | <td> |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | <?php echo __('Events are custom post types and use WordPress\' normal archive pages for displaying events.', 'event_espresso') ?> |
170 | 170 | </p> |
171 | 171 | <p class="description"> |
172 | - <?php printf(__('If you would still like your events on a page like in Event Espresso 3.1 or earlier, simply create a page and place a shortcode to display them on the page, as described %s here %s', 'event_espresso'),'<a href="admin.php?page=espresso_support">','</a>') ?> |
|
172 | + <?php printf(__('If you would still like your events on a page like in Event Espresso 3.1 or earlier, simply create a page and place a shortcode to display them on the page, as described %s here %s', 'event_espresso'), '<a href="admin.php?page=espresso_support">', '</a>') ?> |
|
173 | 173 | </p> |
174 | 174 | <br/><br/> |
175 | 175 | </td> |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | </strong> |
184 | 184 | <?php echo EEH_Template::get_help_tab_link('venue_list_cpt_info'); ?> |
185 | 185 | <br /> |
186 | - <a href='<?php echo get_post_type_archive_link('espresso_venues') ?>'><?php _e('View', 'event_espresso');?></a> |
|
186 | + <a href='<?php echo get_post_type_archive_link('espresso_venues') ?>'><?php _e('View', 'event_espresso'); ?></a> |
|
187 | 187 | </label> |
188 | 188 | </th> |
189 | 189 | <td> |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | <?php echo __('Venues are custom post types and use WordPress\' normal archive pages for displaying events.', 'event_espresso') ?> |
192 | 192 | </p> |
193 | 193 | <p class="description"> |
194 | - <?php printf(__('If you would still like your venues on a page like in Event Espresso 3.1 or earlier, simply create a page and place a shortcode to display them on the page, as described %s here %s', 'event_espresso'),'<a href="admin.php?page=espresso_support">','</a>') ?> |
|
194 | + <?php printf(__('If you would still like your venues on a page like in Event Espresso 3.1 or earlier, simply create a page and place a shortcode to display them on the page, as described %s here %s', 'event_espresso'), '<a href="admin.php?page=espresso_support">', '</a>') ?> |
|
195 | 195 | </p> |
196 | 196 | </td> |
197 | 197 | </tr> |
@@ -7,14 +7,14 @@ |
||
7 | 7 | * @type string $fieldname The name of the field the chooser is associated with. |
8 | 8 | * @type string $linked_input_id The name of the input that the shortcode gets inserted to. |
9 | 9 | */ |
10 | -if ( ! empty( $shortcodes ) ) : ?> |
|
10 | +if ( ! empty($shortcodes)) : ?> |
|
11 | 11 | <span class="ee-messages-shortcodes-chooser js-open-list-trigger dashicons dashicons-menu"> |
12 | 12 | <ul id="ee_shortcode_chooser_<?php echo $fieldname; ?>" class="ee_shortcode_chooser_container hidden"> |
13 | - <?php foreach( $shortcodes as $shortcode => $label ) : ?> |
|
13 | + <?php foreach ($shortcodes as $shortcode => $label) : ?> |
|
14 | 14 | <li> |
15 | - <span class="js-shortcode-selection" data-value="<?php echo esc_attr( $shortcode ); ?>" data-linked-input-id="<?php echo esc_attr( $linked_input_id ); ?>"><?php echo $shortcode; ?></span> |
|
15 | + <span class="js-shortcode-selection" data-value="<?php echo esc_attr($shortcode); ?>" data-linked-input-id="<?php echo esc_attr($linked_input_id); ?>"><?php echo $shortcode; ?></span> |
|
16 | 16 | </li> |
17 | 17 | <?php endforeach; ?> |
18 | 18 | </ul> |
19 | 19 | </span> |
20 | -<?php endif ; ?> |
|
21 | 20 | \ No newline at end of file |
21 | +<?php endif; ?> |
|
22 | 22 | \ No newline at end of file |
@@ -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 | /** |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | |
36 | 36 | |
37 | 37 | protected function _setup_data() { |
38 | - $this->_data = $this->_admin_page->get_categories( $this->_per_page, $this->_current_page); |
|
39 | - $this->_all_data_count = $this->_admin_page->get_categories( $this->_per_page, $this->_current_page, TRUE ); |
|
38 | + $this->_data = $this->_admin_page->get_categories($this->_per_page, $this->_current_page); |
|
39 | + $this->_all_data_count = $this->_admin_page->get_categories($this->_per_page, $this->_current_page, TRUE); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | |
46 | 46 | protected function _set_properties() { |
47 | 47 | $this->_wp_list_args = array( |
48 | - 'singular' => __('venue category', 'event_espresso' ), |
|
49 | - 'plural' => __('venue categories', 'event_espresso' ), |
|
48 | + 'singular' => __('venue category', 'event_espresso'), |
|
49 | + 'plural' => __('venue categories', 'event_espresso'), |
|
50 | 50 | 'ajax' => TRUE, //for now, |
51 | 51 | 'screen' => $this->_admin_page->get_current_screen()->id |
52 | 52 | ); |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | ); |
61 | 61 | |
62 | 62 | $this->_sortable_columns = array( |
63 | - 'id' => array( 'Term.term_id' => true ), |
|
64 | - 'name' => array( 'Term.slug' => false ), |
|
65 | - 'count' => array( 'term_count' => false ) |
|
63 | + 'id' => array('Term.term_id' => true), |
|
64 | + 'name' => array('Term.slug' => false), |
|
65 | + 'count' => array('term_count' => false) |
|
66 | 66 | ); |
67 | 67 | |
68 | 68 | $this->_hidden_columns = array(); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | |
94 | 94 | public function column_cb($item) { |
95 | - return sprintf( '<input type="checkbox" name="VEN_CAT_ID[]" value="%s" />', $item->get('term_id') ); |
|
95 | + return sprintf('<input type="checkbox" name="VEN_CAT_ID[]" value="%s" />', $item->get('term_id')); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | public function column_id($item) { |
104 | 104 | $content = $item->get('term_id'); |
105 | - $content .= ' <span class="show-on-mobile-view-only">' . $item->get_first_related('Term')->get('name') . '</span>'; |
|
105 | + $content .= ' <span class="show-on-mobile-view-only">'.$item->get_first_related('Term')->get('name').'</span>'; |
|
106 | 106 | return $content; |
107 | 107 | } |
108 | 108 | |
@@ -122,17 +122,17 @@ discard block |
||
122 | 122 | 'VEN_CAT_ID' => $item->get('term_id') |
123 | 123 | ); |
124 | 124 | |
125 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_VENUES_ADMIN_URL ); |
|
126 | - $delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EE_VENUES_ADMIN_URL ); |
|
125 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_VENUES_ADMIN_URL); |
|
126 | + $delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_VENUES_ADMIN_URL); |
|
127 | 127 | |
128 | 128 | $actions = array( |
129 | - 'edit' => '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Category', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>' |
|
129 | + 'edit' => '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Category', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>' |
|
130 | 130 | ); |
131 | 131 | |
132 | 132 | |
133 | - $actions['delete'] = '<a href="' . $delete_link . '" title="' . esc_attr__('Delete Category', 'event_espresso') . '">' . __('Delete', 'event_espresso') . '</a>'; |
|
133 | + $actions['delete'] = '<a href="'.$delete_link.'" title="'.esc_attr__('Delete Category', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>'; |
|
134 | 134 | |
135 | - $content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->get_first_related('Term')->get('name') . '</a></strong>'; |
|
135 | + $content = '<strong><a class="row-title" href="'.$edit_link.'">'.$item->get_first_related('Term')->get('name').'</a></strong>'; |
|
136 | 136 | $content .= $this->row_actions($actions); |
137 | 137 | return $content; |
138 | 138 | } |
@@ -141,20 +141,20 @@ discard block |
||
141 | 141 | |
142 | 142 | |
143 | 143 | public function column_shortcode($item) { |
144 | - $content = '[EVENT_ESPRESSO_CATEGORY category_id="' . $item->get_first_related('Term')->get('slug') . '"]'; |
|
144 | + $content = '[EVENT_ESPRESSO_CATEGORY category_id="'.$item->get_first_related('Term')->get('slug').'"]'; |
|
145 | 145 | return $content; |
146 | 146 | } |
147 | 147 | |
148 | 148 | |
149 | 149 | |
150 | 150 | |
151 | - public function column_count( $item ) { |
|
151 | + public function column_count($item) { |
|
152 | 152 | $e_args = array( |
153 | 153 | 'action' => 'default', |
154 | 154 | 'category' => $item->get_first_related('Term')->ID() |
155 | 155 | ); |
156 | - $e_link = EE_Admin_Page::add_query_args_and_nonce( $e_args, EE_VENUES_ADMIN_URL ); |
|
157 | - $content = '<a href="' . $e_link . '">' . $item->get('term_count') . '</a>'; |
|
156 | + $e_link = EE_Admin_Page::add_query_args_and_nonce($e_args, EE_VENUES_ADMIN_URL); |
|
157 | + $content = '<a href="'.$e_link.'">'.$item->get('term_count').'</a>'; |
|
158 | 158 | return $content; |
159 | 159 | } |
160 | 160 | } |
@@ -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 |
@@ -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 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | class Venues_Admin_List_Table extends EE_Admin_List_Table { |
33 | 33 | |
34 | - public function __construct( $admin_page ) { |
|
34 | + public function __construct($admin_page) { |
|
35 | 35 | parent::__construct($admin_page); |
36 | 36 | } |
37 | 37 | |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | |
40 | 40 | |
41 | 41 | protected function _setup_data() { |
42 | - $this->_data = $this->_admin_page->get_venues( $this->_per_page); |
|
43 | - $this->_all_data_count = $this->_admin_page->get_venues( $this->_per_page, TRUE ); |
|
42 | + $this->_data = $this->_admin_page->get_venues($this->_per_page); |
|
43 | + $this->_all_data_count = $this->_admin_page->get_venues($this->_per_page, TRUE); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | |
50 | 50 | protected function _set_properties() { |
51 | 51 | $this->_wp_list_args = array( |
52 | - 'singular' => __('Event Venue', 'event_espresso' ), |
|
53 | - 'plural' => __('Event Venues', 'event_espresso' ), |
|
52 | + 'singular' => __('Event Venue', 'event_espresso'), |
|
53 | + 'plural' => __('Event Venues', 'event_espresso'), |
|
54 | 54 | 'ajax' => TRUE, //for now, |
55 | 55 | 'screen' => $this->_admin_page->get_current_screen()->id |
56 | 56 | ); |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | ); |
67 | 67 | |
68 | 68 | $this->_sortable_columns = array( |
69 | - 'id' => array( 'id' => true ), |
|
70 | - 'name' => array( 'name' => false ), |
|
71 | - 'city' => array( 'city' => false ), |
|
72 | - 'capacity' => array( 'capacity' => false ) |
|
69 | + 'id' => array('id' => true), |
|
70 | + 'name' => array('name' => false), |
|
71 | + 'city' => array('city' => false), |
|
72 | + 'capacity' => array('capacity' => false) |
|
73 | 73 | ); |
74 | 74 | |
75 | 75 | $this->_hidden_columns = array(); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | protected function _add_view_counts() { |
93 | 93 | $this->_views['all']['count'] = EEM_Venue::instance()->count(); |
94 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venues', 'espresso_venues_trash_venues' ) ) { |
|
94 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_venues', 'espresso_venues_trash_venues')) { |
|
95 | 95 | $this->_views['trash']['count'] = EEM_Venue::instance()->count_deleted(); |
96 | 96 | } |
97 | 97 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | public function column_cb($item) { |
105 | 105 | |
106 | - return $item->count_related('Event') > 0 && $item->get( 'status' ) === 'trash' ? '<span class="ee-lock-icon"></span>' : sprintf( '<input type="checkbox" name="venue_id[]" value="%s" />', $item->ID()); |
|
106 | + return $item->count_related('Event') > 0 && $item->get('status') === 'trash' ? '<span class="ee-lock-icon"></span>' : sprintf('<input type="checkbox" name="venue_id[]" value="%s" />', $item->ID()); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | public function column_id($item) { |
113 | 113 | $content = $item->ID(); |
114 | - $content .= ' <span class="show-on-mobile-view-only">' . $item->name() . '</span>'; |
|
114 | + $content .= ' <span class="show-on-mobile-view-only">'.$item->name().'</span>'; |
|
115 | 115 | return $content; |
116 | 116 | } |
117 | 117 | |
@@ -122,12 +122,12 @@ discard block |
||
122 | 122 | 'post' => $item->ID() |
123 | 123 | ); |
124 | 124 | |
125 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_VENUES_ADMIN_URL ); |
|
125 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_VENUES_ADMIN_URL); |
|
126 | 126 | |
127 | 127 | $statuses = EEM_Venue::instance()->get_status_array(); |
128 | - $actions = $this->_column_name_action_setup( $item ); |
|
129 | - $content = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_venue', 'espresso_venues_edit', $item->ID() ) ? '<strong><a class="row-title" href="' . $edit_link . '">' . stripslashes_deep($item->name()) . '</a></strong>' : $item->name(); |
|
130 | - $content .= $item->status() == 'draft' ? ' - <span class="post-state">' . $statuses['draft'] . '</span>' : ''; |
|
128 | + $actions = $this->_column_name_action_setup($item); |
|
129 | + $content = EE_Registry::instance()->CAP->current_user_can('ee_edit_venue', 'espresso_venues_edit', $item->ID()) ? '<strong><a class="row-title" href="'.$edit_link.'">'.stripslashes_deep($item->name()).'</a></strong>' : $item->name(); |
|
130 | + $content .= $item->status() == 'draft' ? ' - <span class="post-state">'.$statuses['draft'].'</span>' : ''; |
|
131 | 131 | $content .= $this->row_actions($actions); |
132 | 132 | return $content; |
133 | 133 | } |
@@ -138,59 +138,59 @@ discard block |
||
138 | 138 | * @param EE_Venue $item |
139 | 139 | * @return array() |
140 | 140 | */ |
141 | - protected function _column_name_action_setup( EE_Venue $item ) { |
|
141 | + protected function _column_name_action_setup(EE_Venue $item) { |
|
142 | 142 | $actions = array(); |
143 | 143 | |
144 | - if ( EE_Registry::instance()->CAP->current_user_can('ee_edit_venue', 'espresso_venues_edit', $item->ID() ) ) { |
|
144 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_venue', 'espresso_venues_edit', $item->ID())) { |
|
145 | 145 | $edit_query_args = array( |
146 | 146 | 'action' => 'edit', |
147 | 147 | 'post' => $item->ID() |
148 | 148 | ); |
149 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_VENUES_ADMIN_URL ); |
|
150 | - $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Venue', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>'; |
|
149 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_VENUES_ADMIN_URL); |
|
150 | + $actions['edit'] = '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Venue', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'; |
|
151 | 151 | |
152 | 152 | } |
153 | 153 | |
154 | 154 | |
155 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venue', 'espresso_venues_trash_venue', $item->ID() ) ) { |
|
155 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_venue', 'espresso_venues_trash_venue', $item->ID())) { |
|
156 | 156 | $trash_event_query_arg = array( |
157 | 157 | 'action' => 'trash_venue', |
158 | 158 | 'VNU_ID' => $item->ID() |
159 | 159 | ); |
160 | - $trash_venue_link = EE_Admin_Page::add_query_args_and_nonce( $trash_event_query_arg, EE_VENUES_ADMIN_URL ); |
|
160 | + $trash_venue_link = EE_Admin_Page::add_query_args_and_nonce($trash_event_query_arg, EE_VENUES_ADMIN_URL); |
|
161 | 161 | } |
162 | 162 | |
163 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venue', 'espresso_venues_restore_venue', $item->ID() ) ) { |
|
163 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_venue', 'espresso_venues_restore_venue', $item->ID())) { |
|
164 | 164 | $restore_venue_query_args = array( |
165 | 165 | 'action' => 'restore_venue', |
166 | 166 | 'VNU_ID' => $item->ID() |
167 | 167 | ); |
168 | - $restore_venue_link = EE_Admin_Page::add_query_args_and_nonce( $restore_venue_query_args, EE_VENUES_ADMIN_URL ); |
|
168 | + $restore_venue_link = EE_Admin_Page::add_query_args_and_nonce($restore_venue_query_args, EE_VENUES_ADMIN_URL); |
|
169 | 169 | } |
170 | 170 | |
171 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venue', 'espresso_venues_delete_venue', $item->ID() ) ) { |
|
171 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_venue', 'espresso_venues_delete_venue', $item->ID())) { |
|
172 | 172 | $delete_venue_query_args = array( |
173 | 173 | 'action' => 'delete_venue', |
174 | 174 | 'VNU_ID' => $item->ID() |
175 | 175 | ); |
176 | - $delete_venue_link = EE_Admin_Page::add_query_args_and_nonce( $delete_venue_query_args, EE_VENUES_ADMIN_URL ); |
|
176 | + $delete_venue_link = EE_Admin_Page::add_query_args_and_nonce($delete_venue_query_args, EE_VENUES_ADMIN_URL); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | $view_link = get_permalink($item->ID()); |
180 | 180 | |
181 | - switch ( $item->get( 'status' ) ) { |
|
181 | + switch ($item->get('status')) { |
|
182 | 182 | case 'trash' : |
183 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venue', 'espresso_venues_restore_venue', $item->ID() ) ) { |
|
184 | - $actions['restore_from_trash'] = '<a href="' . $restore_venue_link . '" title="' . esc_attr__('Restore from Trash', 'event_espresso') . '">' . __('Restore from Trash', 'event_espresso') . '</a>'; |
|
183 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_venue', 'espresso_venues_restore_venue', $item->ID())) { |
|
184 | + $actions['restore_from_trash'] = '<a href="'.$restore_venue_link.'" title="'.esc_attr__('Restore from Trash', 'event_espresso').'">'.__('Restore from Trash', 'event_espresso').'</a>'; |
|
185 | 185 | } |
186 | - if ( $item->count_related('Event') === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venue', 'espresso_venues_delete_venue', $item->ID() ) ) { |
|
187 | - $actions['delete permanently'] = '<a href="' . $delete_venue_link . '" title="' . esc_attr__('Delete Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>'; |
|
186 | + if ($item->count_related('Event') === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_venue', 'espresso_venues_delete_venue', $item->ID())) { |
|
187 | + $actions['delete permanently'] = '<a href="'.$delete_venue_link.'" title="'.esc_attr__('Delete Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>'; |
|
188 | 188 | } |
189 | 189 | break; |
190 | 190 | default : |
191 | - $actions['view'] = '<a href="' . $view_link . '" title="' . esc_attr__('View Venue', 'event_espresso') . '">' . __('View', 'event_espresso') . '</a>'; |
|
192 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venue', 'espresso_venues_trash_venue', $item->ID() ) ) { |
|
193 | - $actions['move to trash'] = '<a href="' . $trash_venue_link . '" title="' . esc_attr__('Trash Event', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>'; |
|
191 | + $actions['view'] = '<a href="'.$view_link.'" title="'.esc_attr__('View Venue', 'event_espresso').'">'.__('View', 'event_espresso').'</a>'; |
|
192 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_venue', 'espresso_venues_trash_venue', $item->ID())) { |
|
193 | + $actions['move to trash'] = '<a href="'.$trash_venue_link.'" title="'.esc_attr__('Trash Event', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>'; |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | return $actions; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | |
218 | 218 | |
219 | 219 | public function column_shortcode($item) { |
220 | - $content = '[ESPRESSO_VENUE id=' . $item->ID() . ']'; |
|
220 | + $content = '[ESPRESSO_VENUE id='.$item->ID().']'; |
|
221 | 221 | return $content; |
222 | 222 | } |
223 | 223 |
@@ -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 |