@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | 'TKT_taxable' => __('Taxable', 'event_espresso') |
| 60 | 60 | ); |
| 61 | 61 | |
| 62 | - $this->_sortable_columns = array( |
|
| 62 | + $this->_sortable_columns = array( |
|
| 63 | 63 | // TRUE means its already sorted |
| 64 | 64 | 'TKT_name' => array( 'TKT_name', TRUE ), |
| 65 | 65 | 'TKT_description' => array( 'TKT_description', FALSE ), |
@@ -68,9 +68,9 @@ discard block |
||
| 68 | 68 | 'TKT_min' => array( 'TKT_min', FALSE ), |
| 69 | 69 | 'TKT_max' => array( 'TKT_max', FALSE ), |
| 70 | 70 | 'TKT_price' => array( 'TKT_price', FALSE ) |
| 71 | - ); |
|
| 71 | + ); |
|
| 72 | 72 | |
| 73 | - $this->_hidden_columns = array( |
|
| 73 | + $this->_hidden_columns = array( |
|
| 74 | 74 | ); |
| 75 | 75 | |
| 76 | 76 | } |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | protected function _setup_data() { |
| 33 | 33 | $trashed = $this->_admin_page->get_view() == 'trashed' ? TRUE : FALSE; |
| 34 | - $this->_data = $this->_admin_page->get_default_tickets( $this->_per_page, FALSE, $trashed ); |
|
| 35 | - $this->_all_data_count = $this->_admin_page->get_default_tickets( $this->_per_page, TRUE, FALSE ); |
|
| 36 | - $this->_trashed_count = $this->_admin_page->get_default_tickets( $this->_per_page, TRUE, TRUE ); |
|
| 34 | + $this->_data = $this->_admin_page->get_default_tickets($this->_per_page, FALSE, $trashed); |
|
| 35 | + $this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, TRUE, FALSE); |
|
| 36 | + $this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, TRUE, TRUE); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
@@ -61,13 +61,13 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | $this->_sortable_columns = array( |
| 63 | 63 | // TRUE means its already sorted |
| 64 | - 'TKT_name' => array( 'TKT_name', TRUE ), |
|
| 65 | - 'TKT_description' => array( 'TKT_description', FALSE ), |
|
| 66 | - 'TKT_qty' => array( 'TKT_qty', FALSE ), |
|
| 67 | - 'TKT_uses' => array( 'TKT_uses', FALSE ), |
|
| 68 | - 'TKT_min' => array( 'TKT_min', FALSE ), |
|
| 69 | - 'TKT_max' => array( 'TKT_max', FALSE ), |
|
| 70 | - 'TKT_price' => array( 'TKT_price', FALSE ) |
|
| 64 | + 'TKT_name' => array('TKT_name', TRUE), |
|
| 65 | + 'TKT_description' => array('TKT_description', FALSE), |
|
| 66 | + 'TKT_qty' => array('TKT_qty', FALSE), |
|
| 67 | + 'TKT_uses' => array('TKT_uses', FALSE), |
|
| 68 | + 'TKT_min' => array('TKT_min', FALSE), |
|
| 69 | + 'TKT_max' => array('TKT_max', FALSE), |
|
| 70 | + 'TKT_price' => array('TKT_price', FALSE) |
|
| 71 | 71 | ); |
| 72 | 72 | |
| 73 | 73 | $this->_hidden_columns = array( |
@@ -87,14 +87,14 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | protected function _add_view_counts() { |
| 89 | 89 | $this->_views['all']['count'] = $this->_all_data_count; |
| 90 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_tickets', 'trash_ticket')) |
|
| 90 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_tickets', 'trash_ticket')) |
|
| 91 | 91 | $this->_views['trashed']['count'] = $this->_trashed_count; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
| 95 | 95 | |
| 96 | 96 | function column_cb($item) { |
| 97 | - return $item->ID() === 1 ? '<span class="ee-lock-icon"></span>' : sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() ); |
|
| 97 | + return $item->ID() === 1 ? '<span class="ee-lock-icon"></span>' : sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID()); |
|
| 98 | 98 | |
| 99 | 99 | } |
| 100 | 100 | |
@@ -105,21 +105,21 @@ discard block |
||
| 105 | 105 | $actions = array(); |
| 106 | 106 | |
| 107 | 107 | //trash links |
| 108 | - if ( $item->ID() !== 1 ) { |
|
| 109 | - if ( $this->_view == 'all' ) { |
|
| 110 | - $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'trash_ticket', 'TKT_ID' => $item->ID() ), TICKETS_ADMIN_URL ); |
|
| 111 | - $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' . esc_attr__('Move Ticket to trash', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>'; |
|
| 108 | + if ($item->ID() !== 1) { |
|
| 109 | + if ($this->_view == 'all') { |
|
| 110 | + $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'trash_ticket', 'TKT_ID' => $item->ID()), TICKETS_ADMIN_URL); |
|
| 111 | + $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Ticket to trash', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>'; |
|
| 112 | 112 | } else { |
| 113 | 113 | // restore price link |
| 114 | - $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_ticket', 'TKT_ID'=>$item->ID() ), TICKETS_ADMIN_URL ); |
|
| 115 | - $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Ticket', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>'; |
|
| 114 | + $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_ticket', 'TKT_ID'=>$item->ID()), TICKETS_ADMIN_URL); |
|
| 115 | + $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Ticket', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>'; |
|
| 116 | 116 | // delete price link |
| 117 | - $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_ticket', 'TKT_ID'=>$item->ID() ), TICKETS_ADMIN_URL ); |
|
| 118 | - $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Ticket Permanently', 'event_espresso' ) . '">' . __( 'Delete Permanently', 'event_espresso' ) . '</a>'; |
|
| 117 | + $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_ticket', 'TKT_ID'=>$item->ID()), TICKETS_ADMIN_URL); |
|
| 118 | + $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Ticket Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>'; |
|
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - return $item->get('TKT_name') . $this->row_actions( $actions ); |
|
| 122 | + return $item->get('TKT_name').$this->row_actions($actions); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | |
@@ -132,13 +132,13 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | |
| 134 | 134 | function column_TKT_qty($item) { |
| 135 | - return $item->get_pretty('TKT_qty','text'); |
|
| 135 | + return $item->get_pretty('TKT_qty', 'text'); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| 139 | 139 | |
| 140 | 140 | function column_TKT_uses($item) { |
| 141 | - return $item->get_pretty('TKT_uses','text'); |
|
| 141 | + return $item->get_pretty('TKT_uses', 'text'); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | |
| 151 | 151 | function column_TKT_max($item) { |
| 152 | - return $item->get_pretty('TKT_max','text'); |
|
| 152 | + return $item->get_pretty('TKT_max', 'text'); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
@@ -1,4 +1,6 @@ discard block |
||
| 1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | |
| 3 | 5 | /** |
| 4 | 6 | * Event Espresso |
@@ -87,8 +89,9 @@ discard block |
||
| 87 | 89 | |
| 88 | 90 | protected function _add_view_counts() { |
| 89 | 91 | $this->_views['all']['count'] = $this->_all_data_count; |
| 90 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_tickets', 'trash_ticket')) |
|
| 91 | - $this->_views['trashed']['count'] = $this->_trashed_count; |
|
| 92 | + if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_tickets', 'trash_ticket')) { |
|
| 93 | + $this->_views['trashed']['count'] = $this->_trashed_count; |
|
| 94 | + } |
|
| 92 | 95 | } |
| 93 | 96 | |
| 94 | 97 | |
@@ -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 | |
@@ -120,17 +120,17 @@ discard block |
||
| 120 | 120 | 'VEN_CAT_ID' => $item->get('term_id') |
| 121 | 121 | ); |
| 122 | 122 | |
| 123 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_VENUES_ADMIN_URL ); |
|
| 124 | - $delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EE_VENUES_ADMIN_URL ); |
|
| 123 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_VENUES_ADMIN_URL); |
|
| 124 | + $delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_VENUES_ADMIN_URL); |
|
| 125 | 125 | |
| 126 | 126 | $actions = array( |
| 127 | - 'edit' => '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Category', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>' |
|
| 127 | + 'edit' => '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Category', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>' |
|
| 128 | 128 | ); |
| 129 | 129 | |
| 130 | 130 | |
| 131 | - $actions['delete'] = '<a href="' . $delete_link . '" title="' . esc_attr__('Delete Category', 'event_espresso') . '">' . __('Delete', 'event_espresso') . '</a>'; |
|
| 131 | + $actions['delete'] = '<a href="'.$delete_link.'" title="'.esc_attr__('Delete Category', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>'; |
|
| 132 | 132 | |
| 133 | - $content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->get_first_related('Term')->get('name') . '</a></strong>'; |
|
| 133 | + $content = '<strong><a class="row-title" href="'.$edit_link.'">'.$item->get_first_related('Term')->get('name').'</a></strong>'; |
|
| 134 | 134 | $content .= $this->row_actions($actions); |
| 135 | 135 | return $content; |
| 136 | 136 | } |
@@ -139,20 +139,20 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | |
| 141 | 141 | public function column_shortcode($item) { |
| 142 | - $content = '[EVENT_ESPRESSO_CATEGORY category_id="' . $item->get_first_related('Term')->get('slug') . '"]'; |
|
| 142 | + $content = '[EVENT_ESPRESSO_CATEGORY category_id="'.$item->get_first_related('Term')->get('slug').'"]'; |
|
| 143 | 143 | return $content; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | |
| 147 | 147 | |
| 148 | 148 | |
| 149 | - public function column_count( $item ) { |
|
| 149 | + public function column_count($item) { |
|
| 150 | 150 | $e_args = array( |
| 151 | 151 | 'action' => 'default', |
| 152 | 152 | 'category' => $item->get_first_related('Term')->ID() |
| 153 | 153 | ); |
| 154 | - $e_link = EE_Admin_Page::add_query_args_and_nonce( $e_args, EE_VENUES_ADMIN_URL ); |
|
| 155 | - $content = '<a href="' . $e_link . '">' . $item->get('term_count') . '</a>'; |
|
| 154 | + $e_link = EE_Admin_Page::add_query_args_and_nonce($e_args, EE_VENUES_ADMIN_URL); |
|
| 155 | + $content = '<a href="'.$e_link.'">'.$item->get('term_count').'</a>'; |
|
| 156 | 156 | return $content; |
| 157 | 157 | } |
| 158 | 158 | } |
@@ -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,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(); |
@@ -781,9 +781,8 @@ |
||
| 781 | 781 | * //todo this is pretty much the same as the corresponding change_event_status method in Events_Admin_Page. We should probably abstract this up to the EE_Admin_Page_CPT (or even EE_Admin_Page) and make this a common method accepting a certain number of params. |
| 782 | 782 | * |
| 783 | 783 | * @access private |
| 784 | - * @param int $event_id |
|
| 785 | - * @param string $event_status |
|
| 786 | - * @return void |
|
| 784 | + * @param string $venue_status |
|
| 785 | + * @return boolean |
|
| 787 | 786 | */ |
| 788 | 787 | private function _change_venue_status( $VNU_ID = FALSE, $venue_status = FALSE ) { |
| 789 | 788 | // grab venue id |
@@ -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_CORE_CAF_ADMIN . 'new/venues'; |
|
| 68 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN.'new/venues'; |
|
| 69 | 69 | $this->page_label = __('Event Venues', 'event_espresso'); |
| 70 | 70 | $this->_cpt_model_names = array( |
| 71 | 71 | 'create_new' => 'EEM_Venue', |
@@ -119,13 +119,13 @@ discard block |
||
| 119 | 119 | protected function _set_page_routes() { |
| 120 | 120 | |
| 121 | 121 | //load formatter helper |
| 122 | - EE_Registry::instance()->load_helper( 'Formatter' ); |
|
| 122 | + EE_Registry::instance()->load_helper('Formatter'); |
|
| 123 | 123 | //load field generator helper |
| 124 | - EE_Registry::instance()->load_helper( 'Form_Fields' ); |
|
| 124 | + EE_Registry::instance()->load_helper('Form_Fields'); |
|
| 125 | 125 | |
| 126 | 126 | //is there a vnu_id in the request? |
| 127 | - $vnu_id = ! empty( $this->_req_data['VNU_ID'] ) && ! is_array( $this->_req_data['VNU_ID'] ) ? $this->_req_data['VNU_ID'] : 0; |
|
| 128 | - $vnu_id = ! empty( $this->_req_data['post'] ) ? $this->_req_data['post'] : $vnu_id; |
|
| 127 | + $vnu_id = ! empty($this->_req_data['VNU_ID']) && ! is_array($this->_req_data['VNU_ID']) ? $this->_req_data['VNU_ID'] : 0; |
|
| 128 | + $vnu_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $vnu_id; |
|
| 129 | 129 | |
| 130 | 130 | $this->_page_routes = array( |
| 131 | 131 | 'default' => array( |
@@ -143,27 +143,27 @@ discard block |
||
| 143 | 143 | ), |
| 144 | 144 | 'trash_venue' => array( |
| 145 | 145 | 'func' => '_trash_or_restore_venue', |
| 146 | - 'args' => array( 'venue_status' => 'trash' ), |
|
| 146 | + 'args' => array('venue_status' => 'trash'), |
|
| 147 | 147 | 'noheader' => TRUE, |
| 148 | 148 | 'capability' => 'ee_delete_venue', |
| 149 | 149 | 'obj_id' => $vnu_id |
| 150 | 150 | ), |
| 151 | 151 | 'trash_venues' => array( |
| 152 | 152 | 'func' => '_trash_or_restore_venues', |
| 153 | - 'args' => array( 'venue_status' => 'trash' ), |
|
| 153 | + 'args' => array('venue_status' => 'trash'), |
|
| 154 | 154 | 'noheader' => TRUE, |
| 155 | 155 | 'capability' => 'ee_delete_venues' |
| 156 | 156 | ), |
| 157 | 157 | 'restore_venue' => array( |
| 158 | 158 | 'func' => '_trash_or_restore_venue', |
| 159 | - 'args' => array( 'venue_status' => 'draft' ), |
|
| 159 | + 'args' => array('venue_status' => 'draft'), |
|
| 160 | 160 | 'noheader' => TRUE, |
| 161 | 161 | 'capability' => 'ee_delete_venue', |
| 162 | 162 | 'obj_id' => $vnu_id |
| 163 | 163 | ), |
| 164 | 164 | 'restore_venues' => array( |
| 165 | 165 | 'func' => '_trash_or_restore_venues', |
| 166 | - 'args' => array( 'venue_status' => 'draft' ), |
|
| 166 | + 'args' => array('venue_status' => 'draft'), |
|
| 167 | 167 | 'noheader' => TRUE, |
| 168 | 168 | 'capability' => 'ee_delete_venues' |
| 169 | 169 | ), |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | 'filename' => 'venues_overview_views_bulk_actions_search' |
| 256 | 256 | ) |
| 257 | 257 | ), |
| 258 | - 'help_tour' => array( 'Venues_Overview_Help_Tour' ), |
|
| 258 | + 'help_tour' => array('Venues_Overview_Help_Tour'), |
|
| 259 | 259 | 'metaboxes' => array('_espresso_news_post_box', '_espresso_links_post_box'), |
| 260 | 260 | 'require_nonce' => FALSE |
| 261 | 261 | ), |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | 'filename' => 'venues_editor_other' |
| 292 | 292 | ) |
| 293 | 293 | ), |
| 294 | - 'help_tour' => array( 'Venues_Add_Venue_Help_Tour' ), |
|
| 294 | + 'help_tour' => array('Venues_Add_Venue_Help_Tour'), |
|
| 295 | 295 | 'metaboxes' => array('_venue_editor_metaboxes'), |
| 296 | 296 | 'require_nonce' => FALSE |
| 297 | 297 | ), |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | 'label' => __('Edit Venue', 'event_espresso'), |
| 301 | 301 | 'order' => 5, |
| 302 | 302 | 'persistent' => FALSE, |
| 303 | - 'url' => isset($this->_req_data['post']) ? add_query_arg(array('post' => $this->_req_data['post'] ), $this->_current_page_view_url ) : $this->_admin_base_url |
|
| 303 | + 'url' => isset($this->_req_data['post']) ? add_query_arg(array('post' => $this->_req_data['post']), $this->_current_page_view_url) : $this->_admin_base_url |
|
| 304 | 304 | ), |
| 305 | 305 | 'help_tabs' => array( |
| 306 | 306 | 'venues_editor_help_tab' => array( |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | 'filename' => 'venues_editor_other' |
| 329 | 329 | ) |
| 330 | 330 | ), |
| 331 | - 'help_tour' => array( 'Venues_Edit_Venue_Help_Tour' ), |
|
| 331 | + 'help_tour' => array('Venues_Edit_Venue_Help_Tour'), |
|
| 332 | 332 | 'metaboxes' => array('_venue_editor_metaboxes'), |
| 333 | 333 | 'require_nonce' => FALSE |
| 334 | 334 | ), |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | 'filename' => 'venues_add_category' |
| 346 | 346 | ) |
| 347 | 347 | ), |
| 348 | - 'help_tour' => array( 'Venues_Add_Category_Help_Tour' ), |
|
| 348 | + 'help_tour' => array('Venues_Add_Category_Help_Tour'), |
|
| 349 | 349 | 'require_nonce' => FALSE |
| 350 | 350 | ), |
| 351 | 351 | 'edit_category' => array( |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | 'label' => __('Edit Category', 'event_espresso'), |
| 354 | 354 | 'order' => 15, |
| 355 | 355 | 'persistent' => FALSE, |
| 356 | - '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 |
|
| 356 | + '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 |
|
| 357 | 357 | ), |
| 358 | 358 | 'metaboxes' => array('_publish_post_box'), |
| 359 | 359 | 'help_tabs' => array( |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | 'filename' => 'venues_edit_category' |
| 363 | 363 | ) |
| 364 | 364 | ), |
| 365 | - 'help_tour' => array( 'Venues_Edit_Category_Help_Tour' ), |
|
| 365 | + 'help_tour' => array('Venues_Edit_Category_Help_Tour'), |
|
| 366 | 366 | 'require_nonce' => FALSE |
| 367 | 367 | ), |
| 368 | 368 | 'category_list' => array( |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | 'filename' => 'venues_categories_other' |
| 390 | 390 | ) |
| 391 | 391 | ), |
| 392 | - 'help_tour' => array( 'Venues_Categories_Help_Tour' ), |
|
| 392 | + 'help_tour' => array('Venues_Categories_Help_Tour'), |
|
| 393 | 393 | 'metaboxes' => $this->_default_espresso_metaboxes, |
| 394 | 394 | 'require_nonce' => FALSE |
| 395 | 395 | ) |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | |
| 447 | 447 | |
| 448 | 448 | public function load_scripts_styles() { |
| 449 | - wp_register_style('ee-cat-admin', EVENTS_ASSETS_URL . 'ee-cat-admin.css', array(), EVENT_ESPRESSO_VERSION ); |
|
| 449 | + wp_register_style('ee-cat-admin', EVENTS_ASSETS_URL.'ee-cat-admin.css', array(), EVENT_ESPRESSO_VERSION); |
|
| 450 | 450 | wp_enqueue_style('ee-cat-admin'); |
| 451 | 451 | } |
| 452 | 452 | |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | public function load_scripts_styles_edit() { |
| 470 | 470 | //styles |
| 471 | 471 | wp_enqueue_style('espresso-ui-theme'); |
| 472 | - wp_register_style( 'espresso_venues', EE_VENUES_ASSETS_URL . 'ee-venues-admin.css', array(), EVENT_ESPRESSO_VERSION ); |
|
| 472 | + wp_register_style('espresso_venues', EE_VENUES_ASSETS_URL.'ee-venues-admin.css', array(), EVENT_ESPRESSO_VERSION); |
|
| 473 | 473 | wp_enqueue_style('espresso_venues'); |
| 474 | 474 | } |
| 475 | 475 | |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | |
| 517 | 517 | |
| 518 | 518 | protected function _overview_list_table() { |
| 519 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
| 519 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
| 520 | 520 | $this->_admin_page_title .= $this->get_action_link_or_button('create_new', 'add', array(), 'add-new-h2'); |
| 521 | 521 | $this->_search_btn_label = __('Venues', 'event_espresso'); |
| 522 | 522 | $this->display_admin_list_table_page_with_sidebar(); |
@@ -530,8 +530,8 @@ discard block |
||
| 530 | 530 | 'vnu_url' => $this->_cpt_model_obj->venue_url(), |
| 531 | 531 | 'vnu_phone' => $this->_cpt_model_obj->phone() |
| 532 | 532 | ); |
| 533 | - $template = EE_VENUES_TEMPLATE_PATH . 'venue_publish_box_extras.template.php'; |
|
| 534 | - EEH_Template::display_template( $template, $extra_rows ); |
|
| 533 | + $template = EE_VENUES_TEMPLATE_PATH.'venue_publish_box_extras.template.php'; |
|
| 534 | + EEH_Template::display_template($template, $extra_rows); |
|
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | |
@@ -539,9 +539,9 @@ discard block |
||
| 539 | 539 | protected function _venue_editor_metaboxes() { |
| 540 | 540 | $this->verify_cpt_object(); |
| 541 | 541 | |
| 542 | - add_meta_box( 'espresso_venue_address_options', __('Physical Location', 'event_espresso'), array( $this, 'venue_address_metabox'), $this->page_slug, 'side', 'default' ); |
|
| 543 | - add_meta_box( 'espresso_venue_gmap_options', __('Google Map', 'event_espresso'), array( $this, 'venue_gmap_metabox'), $this->page_slug, 'side', 'default' ); |
|
| 544 | - add_meta_box( 'espresso_venue_virtual_loc_options', __('Virtual Location', 'event_espresso'), array( $this, 'venue_virtual_loc_metabox'), $this->page_slug, 'side', 'default' ); |
|
| 542 | + add_meta_box('espresso_venue_address_options', __('Physical Location', 'event_espresso'), array($this, 'venue_address_metabox'), $this->page_slug, 'side', 'default'); |
|
| 543 | + add_meta_box('espresso_venue_gmap_options', __('Google Map', 'event_espresso'), array($this, 'venue_gmap_metabox'), $this->page_slug, 'side', 'default'); |
|
| 544 | + add_meta_box('espresso_venue_virtual_loc_options', __('Virtual Location', 'event_espresso'), array($this, 'venue_virtual_loc_metabox'), $this->page_slug, 'side', 'default'); |
|
| 545 | 545 | |
| 546 | 546 | } |
| 547 | 547 | |
@@ -549,23 +549,23 @@ discard block |
||
| 549 | 549 | |
| 550 | 550 | public function venue_gmap_metabox() { |
| 551 | 551 | $template_args = array( |
| 552 | - '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() ), |
|
| 552 | + '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()), |
|
| 553 | 553 | 'vnu_google_map_link' => $this->_cpt_model_obj->google_map_link(), |
| 554 | 554 | ); |
| 555 | - $template = EE_VENUES_TEMPLATE_PATH . 'venue_gmap_metabox_content.template.php'; |
|
| 556 | - EEH_Template::display_template( $template, $template_args ); |
|
| 555 | + $template = EE_VENUES_TEMPLATE_PATH.'venue_gmap_metabox_content.template.php'; |
|
| 556 | + EEH_Template::display_template($template, $template_args); |
|
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | |
| 560 | 560 | |
| 561 | 561 | public function venue_address_metabox() { |
| 562 | 562 | |
| 563 | - $template_args['_venue'] =$this->_cpt_model_obj; |
|
| 563 | + $template_args['_venue'] = $this->_cpt_model_obj; |
|
| 564 | 564 | |
| 565 | 565 | $template_args['states_dropdown'] = EEH_Form_Fields::generate_form_input( |
| 566 | 566 | $QFI = new EE_Question_Form_Input( |
| 567 | - EE_Question::new_instance( array( 'QST_display_text' => 'State', 'QST_system' => 'state' )), |
|
| 568 | - EE_Answer::new_instance( array( 'ANS_value'=> $this->_cpt_model_obj->state_ID() )), |
|
| 567 | + EE_Question::new_instance(array('QST_display_text' => 'State', 'QST_system' => 'state')), |
|
| 568 | + EE_Answer::new_instance(array('ANS_value'=> $this->_cpt_model_obj->state_ID())), |
|
| 569 | 569 | array( |
| 570 | 570 | 'input_name' => 'sta_id', |
| 571 | 571 | 'input_id' => 'sta_id', |
@@ -577,8 +577,8 @@ discard block |
||
| 577 | 577 | ); |
| 578 | 578 | $template_args['countries_dropdown'] = EEH_Form_Fields::generate_form_input( |
| 579 | 579 | $QFI = new EE_Question_Form_Input( |
| 580 | - EE_Question::new_instance( array( 'QST_display_text' => 'Country', 'QST_system' => 'country' )), |
|
| 581 | - EE_Answer::new_instance( array( 'ANS_value'=> $this->_cpt_model_obj->country_ID() )), |
|
| 580 | + EE_Question::new_instance(array('QST_display_text' => 'Country', 'QST_system' => 'country')), |
|
| 581 | + EE_Answer::new_instance(array('ANS_value'=> $this->_cpt_model_obj->country_ID())), |
|
| 582 | 582 | array( |
| 583 | 583 | 'input_name' => 'cnt_iso', |
| 584 | 584 | 'input_id' => 'cnt_iso', |
@@ -589,8 +589,8 @@ discard block |
||
| 589 | 589 | ) |
| 590 | 590 | ); |
| 591 | 591 | |
| 592 | - $template = EE_VENUES_TEMPLATE_PATH . 'venue_address_metabox_content.template.php'; |
|
| 593 | - EEH_Template::display_template( $template, $template_args ); |
|
| 592 | + $template = EE_VENUES_TEMPLATE_PATH.'venue_address_metabox_content.template.php'; |
|
| 593 | + EEH_Template::display_template($template, $template_args); |
|
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | |
@@ -602,8 +602,8 @@ discard block |
||
| 602 | 602 | $template_args = array( |
| 603 | 603 | '_venue' => $this->_cpt_model_obj |
| 604 | 604 | ); |
| 605 | - $template = EE_VENUES_TEMPLATE_PATH . 'venue_virtual_location_metabox_content.template.php'; |
|
| 606 | - EEH_Template::display_template( $template, $template_args ); |
|
| 605 | + $template = EE_VENUES_TEMPLATE_PATH.'venue_virtual_location_metabox_content.template.php'; |
|
| 606 | + EEH_Template::display_template($template, $template_args); |
|
| 607 | 607 | } |
| 608 | 608 | |
| 609 | 609 | |
@@ -626,47 +626,47 @@ discard block |
||
| 626 | 626 | * @param object $post Post object (with "blessed" WP properties) |
| 627 | 627 | * @return void |
| 628 | 628 | */ |
| 629 | - protected function _insert_update_cpt_item( $post_id, $post ) { |
|
| 630 | - $wheres = array( $this->_venue_model->primary_key_name() => $post_id ); |
|
| 629 | + protected function _insert_update_cpt_item($post_id, $post) { |
|
| 630 | + $wheres = array($this->_venue_model->primary_key_name() => $post_id); |
|
| 631 | 631 | |
| 632 | 632 | $venue_values = array( |
| 633 | - 'VNU_address' => !empty( $this->_req_data['vnu_address'] ) ? $this->_req_data['vnu_address'] : NULL, |
|
| 634 | - 'VNU_address2' => !empty( $this->_req_data['vnu_address2'] ) ? $this->_req_data['vnu_address2'] : NULL, |
|
| 635 | - 'VNU_city' => !empty( $this->_req_data['vnu_city'] ) ? $this->_req_data['vnu_city'] : NULL, |
|
| 636 | - 'STA_ID' => !empty( $this->_req_data['sta_id'] ) ? $this->_req_data['sta_id'] : NULL, |
|
| 637 | - 'CNT_ISO' => !empty( $this->_req_data['cnt_iso'] ) ? $this->_req_data['cnt_iso'] : NULL, |
|
| 638 | - 'VNU_zip' => !empty( $this->_req_data['vnu_zip'] ) ? $this->_req_data['vnu_zip'] : NULL, |
|
| 639 | - 'VNU_phone' => !empty( $this->_req_data['vnu_phone'] ) ? $this->_req_data['vnu_phone'] : NULL, |
|
| 640 | - 'VNU_capacity' => !empty( $this->_req_data['vnu_capacity'] ) ? str_replace( ',', '', $this->_req_data['vnu_capacity'] ) : INF, |
|
| 641 | - 'VNU_url' => !empty( $this->_req_data['vnu_url'] ) ? $this->_req_data['vnu_url'] : NULL, |
|
| 642 | - 'VNU_virtual_phone' => !empty( $this->_req_data['vnu_virtual_phone'] ) ? $this->_req_data['vnu_virtual_phone'] : NULL, |
|
| 643 | - 'VNU_virtual_url' => !empty( $this->_req_data['vnu_virtual_url'] ) ? $this->_req_data['vnu_virtual_url'] : NULL, |
|
| 644 | - 'VNU_enable_for_gmap' => !empty( $this->_req_data['vnu_enable_for_gmap'] ) ? TRUE : FALSE, |
|
| 645 | - 'VNU_google_map_link' => !empty( $this->_req_data['vnu_google_map_link'] ) ? $this->_req_data['vnu_google_map_link'] : NULL |
|
| 633 | + 'VNU_address' => ! empty($this->_req_data['vnu_address']) ? $this->_req_data['vnu_address'] : NULL, |
|
| 634 | + 'VNU_address2' => ! empty($this->_req_data['vnu_address2']) ? $this->_req_data['vnu_address2'] : NULL, |
|
| 635 | + 'VNU_city' => ! empty($this->_req_data['vnu_city']) ? $this->_req_data['vnu_city'] : NULL, |
|
| 636 | + 'STA_ID' => ! empty($this->_req_data['sta_id']) ? $this->_req_data['sta_id'] : NULL, |
|
| 637 | + 'CNT_ISO' => ! empty($this->_req_data['cnt_iso']) ? $this->_req_data['cnt_iso'] : NULL, |
|
| 638 | + 'VNU_zip' => ! empty($this->_req_data['vnu_zip']) ? $this->_req_data['vnu_zip'] : NULL, |
|
| 639 | + 'VNU_phone' => ! empty($this->_req_data['vnu_phone']) ? $this->_req_data['vnu_phone'] : NULL, |
|
| 640 | + 'VNU_capacity' => ! empty($this->_req_data['vnu_capacity']) ? str_replace(',', '', $this->_req_data['vnu_capacity']) : INF, |
|
| 641 | + 'VNU_url' => ! empty($this->_req_data['vnu_url']) ? $this->_req_data['vnu_url'] : NULL, |
|
| 642 | + 'VNU_virtual_phone' => ! empty($this->_req_data['vnu_virtual_phone']) ? $this->_req_data['vnu_virtual_phone'] : NULL, |
|
| 643 | + 'VNU_virtual_url' => ! empty($this->_req_data['vnu_virtual_url']) ? $this->_req_data['vnu_virtual_url'] : NULL, |
|
| 644 | + 'VNU_enable_for_gmap' => ! empty($this->_req_data['vnu_enable_for_gmap']) ? TRUE : FALSE, |
|
| 645 | + 'VNU_google_map_link' => ! empty($this->_req_data['vnu_google_map_link']) ? $this->_req_data['vnu_google_map_link'] : NULL |
|
| 646 | 646 | ); |
| 647 | 647 | |
| 648 | 648 | //update venue |
| 649 | - $success = $this->_venue_model->update( $venue_values, array( $wheres ) ); |
|
| 649 | + $success = $this->_venue_model->update($venue_values, array($wheres)); |
|
| 650 | 650 | |
| 651 | 651 | //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! |
| 652 | - $get_one_where = array( $this->_venue_model->primary_key_name() => $post_id, 'status' => $post->post_status ); |
|
| 653 | - $venue = $this->_venue_model->get_one( array( $get_one_where ) ); |
|
| 652 | + $get_one_where = array($this->_venue_model->primary_key_name() => $post_id, 'status' => $post->post_status); |
|
| 653 | + $venue = $this->_venue_model->get_one(array($get_one_where)); |
|
| 654 | 654 | |
| 655 | 655 | //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. |
| 656 | - $venue_update_callbacks = apply_filters( 'FHEE__Venues_Admin_Page___insert_update_cpt_item__venue_update_callbacks', array() ); |
|
| 656 | + $venue_update_callbacks = apply_filters('FHEE__Venues_Admin_Page___insert_update_cpt_item__venue_update_callbacks', array()); |
|
| 657 | 657 | |
| 658 | 658 | $att_success = TRUE; |
| 659 | 659 | |
| 660 | - foreach ( $venue_update_callbacks as $v_callback ) { |
|
| 661 | - $_succ = call_user_func_array( $v_callback, array( $venue, $this->_req_data ) ); |
|
| 662 | - $att_success = !$att_success ? $att_success : $_succ; //if ANY of these updates fail then we want the appropriate global error message |
|
| 660 | + foreach ($venue_update_callbacks as $v_callback) { |
|
| 661 | + $_succ = call_user_func_array($v_callback, array($venue, $this->_req_data)); |
|
| 662 | + $att_success = ! $att_success ? $att_success : $_succ; //if ANY of these updates fail then we want the appropriate global error message |
|
| 663 | 663 | } |
| 664 | 664 | |
| 665 | 665 | //any errors? |
| 666 | - if ( $success && !$att_success ) { |
|
| 667 | - EE_Error::add_error( __('Venue Details saved successfully but something went wrong with saving attachments.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 668 | - } else if ( $success === FALSE ) { |
|
| 669 | - EE_Error::add_error( __('Venue Details did not save successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 666 | + if ($success && ! $att_success) { |
|
| 667 | + EE_Error::add_error(__('Venue Details saved successfully but something went wrong with saving attachments.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
| 668 | + } else if ($success === FALSE) { |
|
| 669 | + EE_Error::add_error(__('Venue Details did not save successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
| 670 | 670 | } |
| 671 | 671 | } |
| 672 | 672 | |
@@ -674,9 +674,9 @@ discard block |
||
| 674 | 674 | |
| 675 | 675 | |
| 676 | 676 | |
| 677 | - public function trash_cpt_item( $post_id ) { |
|
| 677 | + public function trash_cpt_item($post_id) { |
|
| 678 | 678 | $this->_req_data['VNU_ID'] = $post_id; |
| 679 | - $this->_trash_or_restore_venue( 'trash', FALSE ); |
|
| 679 | + $this->_trash_or_restore_venue('trash', FALSE); |
|
| 680 | 680 | } |
| 681 | 681 | |
| 682 | 682 | |
@@ -684,18 +684,18 @@ discard block |
||
| 684 | 684 | |
| 685 | 685 | |
| 686 | 686 | |
| 687 | - public function restore_cpt_item( $post_id ) { |
|
| 687 | + public function restore_cpt_item($post_id) { |
|
| 688 | 688 | $this->_req_data['VNU_ID'] = $post_id; |
| 689 | - $this->_trash_or_restore_venue( 'draft', FALSE ); |
|
| 689 | + $this->_trash_or_restore_venue('draft', FALSE); |
|
| 690 | 690 | } |
| 691 | 691 | |
| 692 | 692 | |
| 693 | 693 | |
| 694 | 694 | |
| 695 | 695 | |
| 696 | - public function delete_cpt_item( $post_id ) { |
|
| 696 | + public function delete_cpt_item($post_id) { |
|
| 697 | 697 | $this->_req_data['VNU_ID'] = $post_id; |
| 698 | - $this->_delete_venue( FALSE ); |
|
| 698 | + $this->_delete_venue(FALSE); |
|
| 699 | 699 | } |
| 700 | 700 | |
| 701 | 701 | |
@@ -710,15 +710,15 @@ discard block |
||
| 710 | 710 | |
| 711 | 711 | |
| 712 | 712 | |
| 713 | - protected function _trash_or_restore_venue( $venue_stats = 'trash', $redirect_after = TRUE ) { |
|
| 714 | - $VNU_ID = isset( $this->_req_data['VNU_ID'] ) ? absint( $this->_req_data['VNU_ID'] ) : FALSE; |
|
| 713 | + protected function _trash_or_restore_venue($venue_stats = 'trash', $redirect_after = TRUE) { |
|
| 714 | + $VNU_ID = isset($this->_req_data['VNU_ID']) ? absint($this->_req_data['VNU_ID']) : FALSE; |
|
| 715 | 715 | |
| 716 | 716 | //loop thru venues |
| 717 | - if ( $VNU_ID ) { |
|
| 717 | + if ($VNU_ID) { |
|
| 718 | 718 | //clean status |
| 719 | - $venue_status = strtoupper( sanitize_key( $venue_status ) ); |
|
| 719 | + $venue_status = strtoupper(sanitize_key($venue_status)); |
|
| 720 | 720 | // grab status |
| 721 | - if (!empty($venue_status)) { |
|
| 721 | + if ( ! empty($venue_status)) { |
|
| 722 | 722 | $success = $this->_change_venue_status($VNU_ID, $venue_status); |
| 723 | 723 | } else { |
| 724 | 724 | $success = FALSE; |
@@ -732,7 +732,7 @@ discard block |
||
| 732 | 732 | } |
| 733 | 733 | $action = $venue_status == 'trash' ? 'moved to the trash' : 'restored from the trash'; |
| 734 | 734 | |
| 735 | - if ( $redirect_after ) |
|
| 735 | + if ($redirect_after) |
|
| 736 | 736 | $this->_redirect_after_action($success, 'Venue', $action, array('action' => 'default')); |
| 737 | 737 | |
| 738 | 738 | } |
@@ -741,11 +741,11 @@ discard block |
||
| 741 | 741 | |
| 742 | 742 | |
| 743 | 743 | |
| 744 | - protected function _trash_or_restore_venues( $venue_status = 'trash' ) { |
|
| 744 | + protected function _trash_or_restore_venues($venue_status = 'trash') { |
|
| 745 | 745 | // clean status |
| 746 | 746 | $venue_status = strtoupper(sanitize_key($venue_status)); |
| 747 | 747 | // grab status |
| 748 | - if (!empty($venue_status)) { |
|
| 748 | + if ( ! empty($venue_status)) { |
|
| 749 | 749 | $success = TRUE; |
| 750 | 750 | //determine the event id and set to array. |
| 751 | 751 | $VNU_IDs = isset($this->_req_data['VNU_IDs']) ? (array) $this->_req_data['VNU_IDs'] : array(); |
@@ -785,15 +785,15 @@ discard block |
||
| 785 | 785 | * @param string $event_status |
| 786 | 786 | * @return void |
| 787 | 787 | */ |
| 788 | - private function _change_venue_status( $VNU_ID = FALSE, $venue_status = FALSE ) { |
|
| 788 | + private function _change_venue_status($VNU_ID = FALSE, $venue_status = FALSE) { |
|
| 789 | 789 | // grab venue id |
| 790 | - if (!$VNU_ID) { |
|
| 790 | + if ( ! $VNU_ID) { |
|
| 791 | 791 | $msg = __('An error occurred. No Venue ID or an invalid Venue ID was received.', 'event_espresso'); |
| 792 | 792 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
| 793 | 793 | return FALSE; |
| 794 | 794 | } |
| 795 | 795 | |
| 796 | - $this->_set_model_object( $VNU_ID ); |
|
| 796 | + $this->_set_model_object($VNU_ID); |
|
| 797 | 797 | |
| 798 | 798 | // clean status |
| 799 | 799 | $venue_status = strtoupper(sanitize_key($venue_status)); |
@@ -819,7 +819,7 @@ discard block |
||
| 819 | 819 | $hook = FALSE; |
| 820 | 820 | } |
| 821 | 821 | //use class to change status |
| 822 | - $this->_cpt_model_obj->set_status( $venue_status ); |
|
| 822 | + $this->_cpt_model_obj->set_status($venue_status); |
|
| 823 | 823 | $success = $this->_cpt_model_obj->save(); |
| 824 | 824 | |
| 825 | 825 | if ($success === FALSE) { |
@@ -838,21 +838,21 @@ discard block |
||
| 838 | 838 | * @param boolean $redirect_after [description] |
| 839 | 839 | * @return [type] [description] |
| 840 | 840 | */ |
| 841 | - protected function _delete_venue( $redirect_after = TRUE ) { |
|
| 841 | + protected function _delete_venue($redirect_after = TRUE) { |
|
| 842 | 842 | //determine the venue id and set to array. |
| 843 | 843 | $VNU_ID = isset($this->_req_data['VNU_ID']) ? absint($this->_req_data['VNU_ID']) : NULL; |
| 844 | - $VNU_ID = isset( $this->_req_data['post'] ) ? absint( $this->_req_data['post'] ) : NULL; |
|
| 844 | + $VNU_ID = isset($this->_req_data['post']) ? absint($this->_req_data['post']) : NULL; |
|
| 845 | 845 | |
| 846 | 846 | |
| 847 | 847 | // loop thru venues |
| 848 | 848 | if ($VNU_ID) { |
| 849 | - $success = $this->_delete_or_trash_venue( $VNU_ID ); |
|
| 849 | + $success = $this->_delete_or_trash_venue($VNU_ID); |
|
| 850 | 850 | } else { |
| 851 | 851 | $success = FALSE; |
| 852 | 852 | $msg = __('An error occurred. An venue could not be deleted because a valid venue ID was not not supplied.', 'event_espresso'); |
| 853 | 853 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
| 854 | 854 | } |
| 855 | - if ( $redirect_after ) |
|
| 855 | + if ($redirect_after) |
|
| 856 | 856 | $this->_redirect_after_action($success, 'Venue', 'deleted', array('action' => 'default')); |
| 857 | 857 | } |
| 858 | 858 | |
@@ -884,7 +884,7 @@ discard block |
||
| 884 | 884 | //todo: put in parent |
| 885 | 885 | private function _delete_or_trash_venue($VNU_ID = FALSE) { |
| 886 | 886 | // grab event id |
| 887 | - if (!$VNU_ID = absint($VNU_ID)) { |
|
| 887 | + if ( ! $VNU_ID = absint($VNU_ID)) { |
|
| 888 | 888 | $msg = __('An error occurred. No Venue ID or an invalid Venue ID was received.', 'event_espresso'); |
| 889 | 889 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
| 890 | 890 | return FALSE; |
@@ -904,7 +904,7 @@ discard block |
||
| 904 | 904 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
| 905 | 905 | return FALSE; |
| 906 | 906 | } |
| 907 | - do_action( 'AHEE__Venues_Admin_Page___delete_or_trash_venue__after_venue_deleted' ); |
|
| 907 | + do_action('AHEE__Venues_Admin_Page___delete_or_trash_venue__after_venue_deleted'); |
|
| 908 | 908 | return TRUE; |
| 909 | 909 | } |
| 910 | 910 | |
@@ -915,11 +915,11 @@ discard block |
||
| 915 | 915 | /* QUERIES */ |
| 916 | 916 | |
| 917 | 917 | |
| 918 | - public function get_venues( $per_page = 10, $count = FALSE ) { |
|
| 918 | + public function get_venues($per_page = 10, $count = FALSE) { |
|
| 919 | 919 | |
| 920 | - $_orderby = !empty( $this->_req_data['orderby'] ) ? $this->_req_data['orderby'] : ''; |
|
| 920 | + $_orderby = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : ''; |
|
| 921 | 921 | |
| 922 | - switch ( $_orderby ) { |
|
| 922 | + switch ($_orderby) { |
|
| 923 | 923 | case 'id': |
| 924 | 924 | $orderby = 'VNU_ID'; |
| 925 | 925 | break; |
@@ -937,64 +937,64 @@ discard block |
||
| 937 | 937 | } |
| 938 | 938 | |
| 939 | 939 | |
| 940 | - $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC'; |
|
| 940 | + $sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC'; |
|
| 941 | 941 | |
| 942 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
| 943 | - $per_page = isset( $per_page ) && !empty( $per_page ) ? $per_page : 10; |
|
| 944 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
| 942 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
| 943 | + $per_page = isset($per_page) && ! empty($per_page) ? $per_page : 10; |
|
| 944 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
| 945 | 945 | |
| 946 | 946 | |
| 947 | - $offset = ($current_page-1)*$per_page; |
|
| 947 | + $offset = ($current_page - 1) * $per_page; |
|
| 948 | 948 | $limit = array($offset, $per_page); |
| 949 | 949 | |
| 950 | - $category = isset( $this->_req_data['category'] ) && $this->_req_data['category'] > 0 ? $this->_req_data['category'] : NULL; |
|
| 950 | + $category = isset($this->_req_data['category']) && $this->_req_data['category'] > 0 ? $this->_req_data['category'] : NULL; |
|
| 951 | 951 | |
| 952 | 952 | $where = array( |
| 953 | - 'status' => isset( $this->_req_data['venue_status'] ) && $this->_req_data['venue_status'] != '' ? $this->_req_data['venue_status'] : array('IN', array('publish', 'draft') ) |
|
| 953 | + 'status' => isset($this->_req_data['venue_status']) && $this->_req_data['venue_status'] != '' ? $this->_req_data['venue_status'] : array('IN', array('publish', 'draft')) |
|
| 954 | 954 | //todo add filter by category |
| 955 | 955 | ); |
| 956 | 956 | |
| 957 | - if ( $category ) { |
|
| 957 | + if ($category) { |
|
| 958 | 958 | $where['Term_Taxonomy.taxonomy'] = 'espresso_venue_categories'; |
| 959 | 959 | $where['Term_Taxonomy.term_id'] = $category; |
| 960 | 960 | } |
| 961 | 961 | |
| 962 | 962 | //cap checks |
| 963 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_private_venues', 'get_venue' ) ) { |
|
| 964 | - if ( ! empty( $where['status'][0] ) && $where['status'][0] == 'IN' ) { |
|
| 963 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_private_venues', 'get_venue')) { |
|
| 964 | + if ( ! empty($where['status'][0]) && $where['status'][0] == 'IN') { |
|
| 965 | 965 | $where['status'][1][] = 'private'; |
| 966 | 966 | } |
| 967 | 967 | } |
| 968 | 968 | |
| 969 | - if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_venues', 'get_venues' ) ) { |
|
| 970 | - $where['VNU_wp_user'] = get_current_user_id(); |
|
| 969 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_venues', 'get_venues')) { |
|
| 970 | + $where['VNU_wp_user'] = get_current_user_id(); |
|
| 971 | 971 | } |
| 972 | 972 | |
| 973 | 973 | |
| 974 | - if ( isset( $this->_req_data['s'] ) ) { |
|
| 975 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
| 974 | + if (isset($this->_req_data['s'])) { |
|
| 975 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
| 976 | 976 | $where['OR'] = array( |
| 977 | - 'VNU_name' => array('LIKE',$sstr ), |
|
| 978 | - 'VNU_desc' => array('LIKE',$sstr ), |
|
| 979 | - 'VNU_short_desc' => array( 'LIKE',$sstr ), |
|
| 980 | - 'VNU_address' => array( 'LIKE', $sstr ), |
|
| 981 | - 'VNU_address2' => array( 'LIKE', $sstr ), |
|
| 982 | - 'VNU_city' => array( 'LIKE', $sstr ), |
|
| 983 | - 'VNU_zip' => array( 'LIKE', $sstr ), |
|
| 984 | - 'VNU_phone' => array( 'LIKE', $sstr ), |
|
| 985 | - 'VNU_url' => array( 'LIKE', $sstr ), |
|
| 986 | - 'VNU_virtual_phone' => array( 'LIKE', $sstr ), |
|
| 987 | - 'VNU_virtual_url' => array( 'LIKE', $sstr ), |
|
| 988 | - 'VNU_google_map_link' => array( 'LIKE', $sstr ), |
|
| 989 | - 'Event.EVT_name' => array('LIKE', $sstr ), |
|
| 990 | - 'Event.EVT_desc' => array('LIKE', $sstr ), |
|
| 991 | - 'Event.EVT_phone' => array('LIKE', $sstr ), |
|
| 992 | - 'Event.EVT_external_URL' => array('LIKE', $sstr ), |
|
| 977 | + 'VNU_name' => array('LIKE', $sstr), |
|
| 978 | + 'VNU_desc' => array('LIKE', $sstr), |
|
| 979 | + 'VNU_short_desc' => array('LIKE', $sstr), |
|
| 980 | + 'VNU_address' => array('LIKE', $sstr), |
|
| 981 | + 'VNU_address2' => array('LIKE', $sstr), |
|
| 982 | + 'VNU_city' => array('LIKE', $sstr), |
|
| 983 | + 'VNU_zip' => array('LIKE', $sstr), |
|
| 984 | + 'VNU_phone' => array('LIKE', $sstr), |
|
| 985 | + 'VNU_url' => array('LIKE', $sstr), |
|
| 986 | + 'VNU_virtual_phone' => array('LIKE', $sstr), |
|
| 987 | + 'VNU_virtual_url' => array('LIKE', $sstr), |
|
| 988 | + 'VNU_google_map_link' => array('LIKE', $sstr), |
|
| 989 | + 'Event.EVT_name' => array('LIKE', $sstr), |
|
| 990 | + 'Event.EVT_desc' => array('LIKE', $sstr), |
|
| 991 | + 'Event.EVT_phone' => array('LIKE', $sstr), |
|
| 992 | + 'Event.EVT_external_URL' => array('LIKE', $sstr), |
|
| 993 | 993 | ); |
| 994 | 994 | } |
| 995 | 995 | |
| 996 | 996 | |
| 997 | - $venues = $count ? $this->_venue_model->count( array($where), 'VNU_ID' ) : $this->_venue_model->get_all( array( $where, 'limit' => $limit, 'order_by' => $orderby, 'order' => $sort ) ); |
|
| 997 | + $venues = $count ? $this->_venue_model->count(array($where), 'VNU_ID') : $this->_venue_model->get_all(array($where, 'limit' => $limit, 'order_by' => $orderby, 'order' => $sort)); |
|
| 998 | 998 | |
| 999 | 999 | return $venues; |
| 1000 | 1000 | |
@@ -1012,22 +1012,22 @@ discard block |
||
| 1012 | 1012 | * @return void |
| 1013 | 1013 | */ |
| 1014 | 1014 | private function _set_category_object() { |
| 1015 | - if ( isset( $this->_category->id ) && !empty( $this->_category->id ) ) |
|
| 1015 | + if (isset($this->_category->id) && ! empty($this->_category->id)) |
|
| 1016 | 1016 | return; //already have the category object so get out. |
| 1017 | 1017 | |
| 1018 | 1018 | //set default category object |
| 1019 | 1019 | $this->_set_empty_category_object(); |
| 1020 | 1020 | |
| 1021 | 1021 | //only set if we've got an id |
| 1022 | - if ( !isset($this->_req_data['VEN_CAT_ID'] ) ) { |
|
| 1022 | + if ( ! isset($this->_req_data['VEN_CAT_ID'])) { |
|
| 1023 | 1023 | return; |
| 1024 | 1024 | } |
| 1025 | 1025 | |
| 1026 | 1026 | $category_id = absint($this->_req_data['VEN_CAT_ID']); |
| 1027 | - $term = get_term( $category_id, 'espresso_venue_categories' ); |
|
| 1027 | + $term = get_term($category_id, 'espresso_venue_categories'); |
|
| 1028 | 1028 | |
| 1029 | 1029 | |
| 1030 | - if ( !empty( $term ) ) { |
|
| 1030 | + if ( ! empty($term)) { |
|
| 1031 | 1031 | $this->_category->category_name = $term->name; |
| 1032 | 1032 | $this->_category->category_identifier = $term->slug; |
| 1033 | 1033 | $this->_category->category_desc = $term->description; |
@@ -1041,14 +1041,14 @@ discard block |
||
| 1041 | 1041 | |
| 1042 | 1042 | private function _set_empty_category_object() { |
| 1043 | 1043 | $this->_category = new stdClass(); |
| 1044 | - $this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = ''; |
|
| 1044 | + $this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = ''; |
|
| 1045 | 1045 | $this->_category->id = $this->_category->parent = 0; |
| 1046 | 1046 | } |
| 1047 | 1047 | |
| 1048 | 1048 | |
| 1049 | 1049 | |
| 1050 | 1050 | protected function _category_list_table() { |
| 1051 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
| 1051 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
| 1052 | 1052 | $this->_admin_page_title .= $this->get_action_link_or_button('add_category', 'add_category', array(), 'add-new-h2'); |
| 1053 | 1053 | $this->_search_btn_label = __('Venue Categories', 'event_espresso'); |
| 1054 | 1054 | $this->display_admin_list_table_page_with_sidebar(); |
@@ -1058,21 +1058,21 @@ discard block |
||
| 1058 | 1058 | protected function _category_details($view) { |
| 1059 | 1059 | |
| 1060 | 1060 | //load formatter helper |
| 1061 | - EE_Registry::instance()->load_helper( 'Formatter' ); |
|
| 1061 | + EE_Registry::instance()->load_helper('Formatter'); |
|
| 1062 | 1062 | //load field generator helper |
| 1063 | - EE_Registry::instance()->load_helper( 'Form_Fields' ); |
|
| 1063 | + EE_Registry::instance()->load_helper('Form_Fields'); |
|
| 1064 | 1064 | |
| 1065 | 1065 | $route = $view == 'edit' ? 'update_category' : 'insert_category'; |
| 1066 | 1066 | $this->_set_add_edit_form_tags($route); |
| 1067 | 1067 | |
| 1068 | 1068 | $this->_set_category_object(); |
| 1069 | - $id = !empty($this->_category->id) ? $this->_category->id : ''; |
|
| 1069 | + $id = ! empty($this->_category->id) ? $this->_category->id : ''; |
|
| 1070 | 1070 | |
| 1071 | 1071 | $delete_action = 'delete_category'; |
| 1072 | 1072 | |
| 1073 | - $redirect = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'category_list' ), $this->_admin_base_url ); |
|
| 1073 | + $redirect = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'category_list'), $this->_admin_base_url); |
|
| 1074 | 1074 | |
| 1075 | - $this->_set_publish_post_box_vars( 'VEN_CAT_ID', $id, $delete_action, $redirect ); |
|
| 1075 | + $this->_set_publish_post_box_vars('VEN_CAT_ID', $id, $delete_action, $redirect); |
|
| 1076 | 1076 | |
| 1077 | 1077 | //take care of contents |
| 1078 | 1078 | $this->_template_args['admin_page_content'] = $this->_category_details_content(); |
@@ -1086,25 +1086,25 @@ discard block |
||
| 1086 | 1086 | 'type' => 'wp_editor', |
| 1087 | 1087 | 'value' => EEH_Formatter::admin_format_content($this->_category->category_desc), |
| 1088 | 1088 | 'class' => 'my_editor_custom', |
| 1089 | - 'wpeditor_args' => array( 'media_buttons' => FALSE ) |
|
| 1089 | + 'wpeditor_args' => array('media_buttons' => FALSE) |
|
| 1090 | 1090 | ); |
| 1091 | - $_wp_editor = $this->_generate_admin_form_fields( $editor_args, 'array' ); |
|
| 1091 | + $_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array'); |
|
| 1092 | 1092 | |
| 1093 | - $all_terms = get_terms( array('espresso_venue_categories' ), array( 'hide_empty' => 0, 'exclude' => array( $this->_category->id ) ) ); |
|
| 1093 | + $all_terms = get_terms(array('espresso_venue_categories'), array('hide_empty' => 0, 'exclude' => array($this->_category->id))); |
|
| 1094 | 1094 | |
| 1095 | 1095 | //setup category select for term parents. |
| 1096 | 1096 | $category_select_values[] = array( |
| 1097 | 1097 | 'text' => __('No Parent', 'event_espresso'), |
| 1098 | 1098 | 'id' => 0 |
| 1099 | 1099 | ); |
| 1100 | - foreach ( $all_terms as $term ) { |
|
| 1100 | + foreach ($all_terms as $term) { |
|
| 1101 | 1101 | $category_select_values[] = array( |
| 1102 | 1102 | 'text' => $term->name, |
| 1103 | 1103 | 'id' => $term->term_id |
| 1104 | 1104 | ); |
| 1105 | 1105 | } |
| 1106 | 1106 | |
| 1107 | - $category_select = EEH_Form_Fields::select_input( 'category_parent', $category_select_values, $this->_category->parent ); |
|
| 1107 | + $category_select = EEH_Form_Fields::select_input('category_parent', $category_select_values, $this->_category->parent); |
|
| 1108 | 1108 | $template_args = array( |
| 1109 | 1109 | 'category' => $this->_category, |
| 1110 | 1110 | 'category_select' => $category_select, |
@@ -1113,15 +1113,15 @@ discard block |
||
| 1113 | 1113 | 'disable' => '', |
| 1114 | 1114 | 'disabled_message' =>FALSE |
| 1115 | 1115 | ); |
| 1116 | - $template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php'; |
|
| 1117 | - return EEH_Template::display_template($template, $template_args, TRUE ); |
|
| 1116 | + $template = EVENTS_TEMPLATE_PATH.'event_category_details.template.php'; |
|
| 1117 | + return EEH_Template::display_template($template, $template_args, TRUE); |
|
| 1118 | 1118 | } |
| 1119 | 1119 | |
| 1120 | 1120 | |
| 1121 | 1121 | protected function _delete_categories() { |
| 1122 | - $cat_ids = isset( $this->_req_data['VEN_CAT_ID'] ) ? (array) $this->_req_data['VEN_CAT_ID'] : (array) $this->_req_data['category_id']; |
|
| 1122 | + $cat_ids = isset($this->_req_data['VEN_CAT_ID']) ? (array) $this->_req_data['VEN_CAT_ID'] : (array) $this->_req_data['category_id']; |
|
| 1123 | 1123 | |
| 1124 | - foreach ( $cat_ids as $cat_id ) { |
|
| 1124 | + foreach ($cat_ids as $cat_id) { |
|
| 1125 | 1125 | $this->_delete_category($cat_id); |
| 1126 | 1126 | } |
| 1127 | 1127 | |
@@ -1129,7 +1129,7 @@ discard block |
||
| 1129 | 1129 | $query_args = array( |
| 1130 | 1130 | 'action' => 'category_list' |
| 1131 | 1131 | ); |
| 1132 | - $this->_redirect_after_action(0,'','',$query_args); |
|
| 1132 | + $this->_redirect_after_action(0, '', '', $query_args); |
|
| 1133 | 1133 | |
| 1134 | 1134 | } |
| 1135 | 1135 | |
@@ -1138,47 +1138,47 @@ discard block |
||
| 1138 | 1138 | |
| 1139 | 1139 | |
| 1140 | 1140 | protected function _delete_category($cat_id) { |
| 1141 | - $cat_id = absint( $cat_id ); |
|
| 1142 | - wp_delete_term( $cat_id, 'espresso_venue_categories' ); |
|
| 1141 | + $cat_id = absint($cat_id); |
|
| 1142 | + wp_delete_term($cat_id, 'espresso_venue_categories'); |
|
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | 1145 | |
| 1146 | 1146 | |
| 1147 | 1147 | protected function _insert_or_update_category($new_category) { |
| 1148 | 1148 | |
| 1149 | - $cat_id = $new_category ? $this->_insert_category() : $this->_insert_category( TRUE ); |
|
| 1149 | + $cat_id = $new_category ? $this->_insert_category() : $this->_insert_category(TRUE); |
|
| 1150 | 1150 | $success = 0; //we already have a success message so lets not send another. |
| 1151 | 1151 | $query_args = array( |
| 1152 | 1152 | 'action' => 'edit_category', |
| 1153 | 1153 | 'VEN_CAT_ID' => $cat_id |
| 1154 | 1154 | ); |
| 1155 | - $this->_redirect_after_action( $success, '','', $query_args, TRUE ); |
|
| 1155 | + $this->_redirect_after_action($success, '', '', $query_args, TRUE); |
|
| 1156 | 1156 | |
| 1157 | 1157 | } |
| 1158 | 1158 | |
| 1159 | 1159 | |
| 1160 | 1160 | |
| 1161 | - private function _insert_category( $update = FALSE ) { |
|
| 1161 | + private function _insert_category($update = FALSE) { |
|
| 1162 | 1162 | $cat_id = $update ? $this->_req_data['VEN_CAT_ID'] : ''; |
| 1163 | - $category_name= isset( $this->_req_data['category_name'] ) ? $this->_req_data['category_name'] : ''; |
|
| 1164 | - $category_desc= isset( $this->_req_data['category_desc'] ) ? $this->_req_data['category_desc'] : ''; |
|
| 1165 | - $category_parent = isset( $this->_req_data['category_parent'] ) ? $this->_req_data['category_parent'] : 0; |
|
| 1163 | + $category_name = isset($this->_req_data['category_name']) ? $this->_req_data['category_name'] : ''; |
|
| 1164 | + $category_desc = isset($this->_req_data['category_desc']) ? $this->_req_data['category_desc'] : ''; |
|
| 1165 | + $category_parent = isset($this->_req_data['category_parent']) ? $this->_req_data['category_parent'] : 0; |
|
| 1166 | 1166 | |
| 1167 | - $term_args=array( |
|
| 1167 | + $term_args = array( |
|
| 1168 | 1168 | 'name'=>$category_name, |
| 1169 | 1169 | 'description'=>$category_desc, |
| 1170 | 1170 | 'parent'=>$category_parent |
| 1171 | 1171 | ); |
| 1172 | 1172 | |
| 1173 | - $insert_ids = $update ? wp_update_term( $cat_id, 'espresso_venue_categories', $term_args ) :wp_insert_term( $category_name, 'espresso_venue_categories', $term_args ); |
|
| 1173 | + $insert_ids = $update ? wp_update_term($cat_id, 'espresso_venue_categories', $term_args) : wp_insert_term($category_name, 'espresso_venue_categories', $term_args); |
|
| 1174 | 1174 | |
| 1175 | - if ( !is_array( $insert_ids ) ) { |
|
| 1176 | - $msg = __( 'An error occurred and the category has not been saved to the database.', 'event_espresso', 'event_espresso' ); |
|
| 1177 | - EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 1175 | + if ( ! is_array($insert_ids)) { |
|
| 1176 | + $msg = __('An error occurred and the category has not been saved to the database.', 'event_espresso', 'event_espresso'); |
|
| 1177 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
| 1178 | 1178 | } else { |
| 1179 | 1179 | $cat_id = $insert_ids['term_id']; |
| 1180 | - $msg = sprintf ( __('The category %s was successfuly created', 'event_espresso'), $category_name ); |
|
| 1181 | - EE_Error::add_success( $msg ); |
|
| 1180 | + $msg = sprintf(__('The category %s was successfuly created', 'event_espresso'), $category_name); |
|
| 1181 | + EE_Error::add_success($msg); |
|
| 1182 | 1182 | } |
| 1183 | 1183 | |
| 1184 | 1184 | return $cat_id; |
@@ -1198,12 +1198,12 @@ discard block |
||
| 1198 | 1198 | 'category_ids' => $this->_req_data['VEN_CAT_ID'] |
| 1199 | 1199 | ); |
| 1200 | 1200 | |
| 1201 | - $this->_req_data = array_merge( $this->_req_data, $new_request_args ); |
|
| 1201 | + $this->_req_data = array_merge($this->_req_data, $new_request_args); |
|
| 1202 | 1202 | |
| 1203 | - EE_Registry::instance()->load_helper( 'File' ); |
|
| 1204 | - if ( is_readable( EE_CLASSES . 'EE_Export.class.php') ) { |
|
| 1205 | - require_once( EE_CLASSES . 'EE_Export.class.php'); |
|
| 1206 | - $EE_Export = EE_Export::instance( $this->_req_data ); |
|
| 1203 | + EE_Registry::instance()->load_helper('File'); |
|
| 1204 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
| 1205 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
| 1206 | + $EE_Export = EE_Export::instance($this->_req_data); |
|
| 1207 | 1207 | $EE_Export->export(); |
| 1208 | 1208 | } |
| 1209 | 1209 | |
@@ -1215,7 +1215,7 @@ discard block |
||
| 1215 | 1215 | |
| 1216 | 1216 | protected function _import_categories() { |
| 1217 | 1217 | |
| 1218 | - require_once(EE_CLASSES . 'EE_Import.class.php'); |
|
| 1218 | + require_once(EE_CLASSES.'EE_Import.class.php'); |
|
| 1219 | 1219 | EE_Import::instance()->import(); |
| 1220 | 1220 | |
| 1221 | 1221 | } |
@@ -1223,29 +1223,29 @@ discard block |
||
| 1223 | 1223 | |
| 1224 | 1224 | |
| 1225 | 1225 | |
| 1226 | - public function get_categories( $per_page = 10, $current_page = 1, $count = FALSE ) { |
|
| 1226 | + public function get_categories($per_page = 10, $current_page = 1, $count = FALSE) { |
|
| 1227 | 1227 | |
| 1228 | 1228 | //testing term stuff |
| 1229 | - $orderby = isset( $this->_req_data['orderby'] ) ? $this->_req_data['orderby'] : 'Term.term_id'; |
|
| 1230 | - $order = isset( $this->_req_data['order'] ) ? $this->_req_data['order'] : 'DESC'; |
|
| 1231 | - $limit = ($current_page-1)*$per_page; |
|
| 1232 | - $where = array( 'taxonomy' => 'espresso_venue_categories' ); |
|
| 1233 | - if ( isset( $this->_req_data['s'] ) ) { |
|
| 1234 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
| 1229 | + $orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'Term.term_id'; |
|
| 1230 | + $order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC'; |
|
| 1231 | + $limit = ($current_page - 1) * $per_page; |
|
| 1232 | + $where = array('taxonomy' => 'espresso_venue_categories'); |
|
| 1233 | + if (isset($this->_req_data['s'])) { |
|
| 1234 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
| 1235 | 1235 | $where['OR'] = array( |
| 1236 | - 'Term.name' => array( 'LIKE', $sstr), |
|
| 1237 | - 'description' => array( 'LIKE', $sstr ) |
|
| 1236 | + 'Term.name' => array('LIKE', $sstr), |
|
| 1237 | + 'description' => array('LIKE', $sstr) |
|
| 1238 | 1238 | ); |
| 1239 | 1239 | } |
| 1240 | 1240 | |
| 1241 | 1241 | $query_params = array( |
| 1242 | 1242 | $where, |
| 1243 | - 'order_by' => array( $orderby => $order ), |
|
| 1244 | - 'limit' => $limit . ',' . $per_page, |
|
| 1243 | + 'order_by' => array($orderby => $order), |
|
| 1244 | + 'limit' => $limit.','.$per_page, |
|
| 1245 | 1245 | 'force_join' => array('Term') |
| 1246 | 1246 | ); |
| 1247 | 1247 | |
| 1248 | - $categories = $count ? EEM_Term_Taxonomy::instance()->count( $query_params, 'term_id' ) :EEM_Term_Taxonomy::instance()->get_all( $query_params ); |
|
| 1248 | + $categories = $count ? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id') : EEM_Term_Taxonomy::instance()->get_all($query_params); |
|
| 1249 | 1249 | |
| 1250 | 1250 | return $categories; |
| 1251 | 1251 | } |
@@ -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 | /** |
@@ -32,13 +32,13 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | public function __construct() { |
| 34 | 34 | //define some event categories related constants |
| 35 | - define( 'EE_VENUES_PG_SLUG', 'espresso_venues' ); |
|
| 36 | - define( 'EE_VENUES_ADMIN_URL', admin_url('admin.php?page=' . EE_VENUES_PG_SLUG )); |
|
| 37 | - define( 'EE_VENUES_ASSETS_URL', EE_CORE_CAF_ADMIN_URL . 'new/venues/assets/'); |
|
| 38 | - define( 'EE_VENUES_TEMPLATE_PATH', EE_CORE_CAF_ADMIN . 'new/venues/templates/' ); |
|
| 35 | + define('EE_VENUES_PG_SLUG', 'espresso_venues'); |
|
| 36 | + define('EE_VENUES_ADMIN_URL', admin_url('admin.php?page='.EE_VENUES_PG_SLUG)); |
|
| 37 | + define('EE_VENUES_ASSETS_URL', EE_CORE_CAF_ADMIN_URL.'new/venues/assets/'); |
|
| 38 | + define('EE_VENUES_TEMPLATE_PATH', EE_CORE_CAF_ADMIN.'new/venues/templates/'); |
|
| 39 | 39 | |
| 40 | 40 | parent::__construct(); |
| 41 | - $this->_folder_path = EE_CORE_CAF_ADMIN . 'new/' . $this->_folder_name . DS; |
|
| 41 | + $this->_folder_path = EE_CORE_CAF_ADMIN.'new/'.$this->_folder_name.DS; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | protected function _set_init_properties() { |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | protected function _set_menu_map() { |
| 52 | - $this->_menu_map = new EE_Admin_Page_Sub_Menu( array( |
|
| 52 | + $this->_menu_map = new EE_Admin_Page_Sub_Menu(array( |
|
| 53 | 53 | 'menu_group' => 'management', |
| 54 | 54 | 'menu_order' => 40, |
| 55 | 55 | 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |
@@ -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,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 |
@@ -163,11 +164,14 @@ discard block |
||
| 163 | 164 | $evt_venue = $evtobj->venues(); |
| 164 | 165 | $evt_venue = !empty( $evt_venue ) ? array_shift( $evt_venue ) : NULL; |
| 165 | 166 | |
| 166 | - if ( !empty( $evt_venue ) && $evt_venue->ID() != $venue_id ) |
|
| 167 | - $evtobj->_remove_relation_to( $evt_venue->ID(), 'Venue' ); |
|
| 167 | + if ( !empty( $evt_venue ) && $evt_venue->ID() != $venue_id ) { |
|
| 168 | + $evtobj->_remove_relation_to( $evt_venue->ID(), 'Venue' ); |
|
| 169 | + } |
|
| 168 | 170 | |
| 169 | - if ( empty( $venue_id ) ) |
|
| 170 | - return TRUE; //no venue to attach |
|
| 171 | + if ( empty( $venue_id ) ) { |
|
| 172 | + return TRUE; |
|
| 173 | + } |
|
| 174 | + //no venue to attach |
|
| 171 | 175 | |
| 172 | 176 | // this should take care of adding to revisions as well as main post object |
| 173 | 177 | $success = $evtobj->_add_relation_to( $venue_id, 'Venue' ); |
@@ -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 | /** |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | protected $_event; |
| 34 | 34 | |
| 35 | 35 | |
| 36 | - public function __construct( EE_Admin_Page $admin_page ) { |
|
| 37 | - parent::__construct( $admin_page ); |
|
| 36 | + public function __construct(EE_Admin_Page $admin_page) { |
|
| 37 | + parent::__construct($admin_page); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | $this->_name = 'venues'; |
| 43 | 43 | $this->_remove_metaboxes = array( |
| 44 | 44 | 0 => array( |
| 45 | - 'page_route' => array( 'create_new', 'edit' ), |
|
| 45 | + 'page_route' => array('create_new', 'edit'), |
|
| 46 | 46 | 'id' => 'espresso_event_editor_venue', |
| 47 | 47 | 'context' => 'normal' |
| 48 | 48 | ) |
| 49 | - );/**/ |
|
| 49 | + ); /**/ |
|
| 50 | 50 | $this->_metaboxes = array( |
| 51 | 51 | 0 => array( |
| 52 | 52 | 'page_route' => array('edit', 'create_new'), |
@@ -55,18 +55,18 @@ discard block |
||
| 55 | 55 | 'priority' => 'high', |
| 56 | 56 | 'context' => 'normal' |
| 57 | 57 | ) |
| 58 | - );/**/ |
|
| 58 | + ); /**/ |
|
| 59 | 59 | |
| 60 | 60 | $this->_scripts_styles = array( |
| 61 | 61 | 'registers' => array( |
| 62 | 62 | 'ee_event_venues' => array( |
| 63 | 63 | 'type' => 'js', |
| 64 | - 'url' => EE_VENUES_ASSETS_URL . 'ee-event-venues-admin.js', |
|
| 64 | + 'url' => EE_VENUES_ASSETS_URL.'ee-event-venues-admin.js', |
|
| 65 | 65 | 'depends' => array('jquery') |
| 66 | 66 | ), |
| 67 | 67 | 'ee_event_venues_css' => array( |
| 68 | 68 | 'type' => 'css', |
| 69 | - 'url' => EE_VENUES_ASSETS_URL . 'ee-event-venues-admin.css', |
|
| 69 | + 'url' => EE_VENUES_ASSETS_URL.'ee-event-venues-admin.css', |
|
| 70 | 70 | ) |
| 71 | 71 | ), |
| 72 | 72 | 'enqueues' => array( |
@@ -76,24 +76,24 @@ discard block |
||
| 76 | 76 | ); |
| 77 | 77 | |
| 78 | 78 | //hook into the handler for saving venue |
| 79 | - add_filter( 'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', array( $this, 'modify_callbacks' ), 10 ); |
|
| 79 | + add_filter('FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', array($this, 'modify_callbacks'), 10); |
|
| 80 | 80 | |
| 81 | 81 | //remove default ee_autosave returns for DECAF venues (not needed for CAF venues cause we have a dropdown selector) |
| 82 | - add_filter( 'FHEE__Events_Admin_Page__ee_autosave_edit_do_decaf_venue_save', '__return_false' ); |
|
| 82 | + add_filter('FHEE__Events_Admin_Page__ee_autosave_edit_do_decaf_venue_save', '__return_false'); |
|
| 83 | 83 | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
| 87 | - public function modify_callbacks( $callbacks ) { |
|
| 87 | + public function modify_callbacks($callbacks) { |
|
| 88 | 88 | // first remove default venue callback |
| 89 | - foreach ( $callbacks as $key => $callback ) { |
|
| 90 | - if ( $callback[1] == '_default_venue_update' ) { |
|
| 91 | - unset( $callbacks[$key] ); |
|
| 89 | + foreach ($callbacks as $key => $callback) { |
|
| 90 | + if ($callback[1] == '_default_venue_update') { |
|
| 91 | + unset($callbacks[$key]); |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | //now let's add the caf version |
| 96 | - $callbacks[] = array( $this, 'caf_venue_update' ); |
|
| 96 | + $callbacks[] = array($this, 'caf_venue_update'); |
|
| 97 | 97 | return $callbacks; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -109,61 +109,61 @@ discard block |
||
| 109 | 109 | $evt_id = $evt_obj->ID(); |
| 110 | 110 | |
| 111 | 111 | //first let's see if we have a venue already |
| 112 | - $evt_venues = !empty( $evt_id ) ? $evt_obj->venues() : array(); |
|
| 113 | - $evt_venue = !empty( $evt_venues ) ? array_shift( $evt_venues ) : NULL; |
|
| 114 | - $evt_venue_id = !empty( $evt_venue ) ? $evt_venue->ID() : NULL; |
|
| 112 | + $evt_venues = ! empty($evt_id) ? $evt_obj->venues() : array(); |
|
| 113 | + $evt_venue = ! empty($evt_venues) ? array_shift($evt_venues) : NULL; |
|
| 114 | + $evt_venue_id = ! empty($evt_venue) ? $evt_venue->ID() : NULL; |
|
| 115 | 115 | |
| 116 | 116 | //possibly private venues. |
| 117 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_venues', 'get_venues' ) ) { |
|
| 118 | - $vnu_where['status']= array( 'IN' , array( 'publish', 'private' ) ); |
|
| 117 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_private_venues', 'get_venues')) { |
|
| 118 | + $vnu_where['status'] = array('IN', array('publish', 'private')); |
|
| 119 | 119 | } else { |
| 120 | 120 | $vnu_where['status'] = 'publish'; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | //cap checks |
| 124 | - if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_venues', 'get_venues' ) ) { |
|
| 124 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_venues', 'get_venues')) { |
|
| 125 | 125 | $vnu_where['VNU_wp_user'] = get_current_user_id(); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - $vnumdl = EE_Registry::instance()->load_model( 'Venue' ); |
|
| 129 | - $venues = $vnumdl->get_all( array( $vnu_where ) ); |
|
| 128 | + $vnumdl = EE_Registry::instance()->load_model('Venue'); |
|
| 129 | + $venues = $vnumdl->get_all(array($vnu_where)); |
|
| 130 | 130 | |
| 131 | 131 | $ven_select = array(); |
| 132 | 132 | $ven_select[0] = __('Select a Venue', 'event_espresso'); |
| 133 | 133 | //setup venues for selector |
| 134 | - foreach ( $venues as $venue ) { |
|
| 134 | + foreach ($venues as $venue) { |
|
| 135 | 135 | $ven_select[$venue->ID()] = $venue->name(); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | $template_args['venues'] = $venues; |
| 139 | 139 | $template_args['evt_venue_id'] = $evt_venue_id; |
| 140 | - $template_args['venue_selector'] = EEH_Form_Fields::select_input('venue_id', $ven_select, $evt_venue_id, 'id="venue_id"' ); |
|
| 141 | - $template_args['enable_for_gmap'] = EEH_Form_Fields::select_input('enable_for_gmap', $values, is_object( $evt_venue ) ? $evt_venue->enable_for_gmap() : NULL, 'id="enable_for_gmap"'); |
|
| 142 | - $template_path = empty( $venues ) ? EE_VENUES_TEMPLATE_PATH . 'event_venues_metabox_content.template.php' : EE_VENUES_TEMPLATE_PATH . 'event_venues_metabox_content_from_manager.template.php'; |
|
| 143 | - EEH_Template::display_template( $template_path, $template_args ); |
|
| 140 | + $template_args['venue_selector'] = EEH_Form_Fields::select_input('venue_id', $ven_select, $evt_venue_id, 'id="venue_id"'); |
|
| 141 | + $template_args['enable_for_gmap'] = EEH_Form_Fields::select_input('enable_for_gmap', $values, is_object($evt_venue) ? $evt_venue->enable_for_gmap() : NULL, 'id="enable_for_gmap"'); |
|
| 142 | + $template_path = empty($venues) ? EE_VENUES_TEMPLATE_PATH.'event_venues_metabox_content.template.php' : EE_VENUES_TEMPLATE_PATH.'event_venues_metabox_content_from_manager.template.php'; |
|
| 143 | + EEH_Template::display_template($template_path, $template_args); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | |
| 147 | 147 | |
| 148 | 148 | |
| 149 | - public function caf_venue_update( $evtobj, $data ) { |
|
| 149 | + public function caf_venue_update($evtobj, $data) { |
|
| 150 | 150 | EE_Registry::instance()->load_model('Venue'); |
| 151 | - $venue_id = !empty( $data['venue_id'] ) ? $data['venue_id'] : NULL; |
|
| 151 | + $venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : NULL; |
|
| 152 | 152 | |
| 153 | 153 | |
| 154 | 154 | //first let's check if the selected venue matches any existing venue attached to the event |
| 155 | 155 | $evt_venue = $evtobj->venues(); |
| 156 | - $evt_venue = !empty( $evt_venue ) ? array_shift( $evt_venue ) : NULL; |
|
| 156 | + $evt_venue = ! empty($evt_venue) ? array_shift($evt_venue) : NULL; |
|
| 157 | 157 | |
| 158 | - if ( !empty( $evt_venue ) && $evt_venue->ID() != $venue_id ) |
|
| 159 | - $evtobj->_remove_relation_to( $evt_venue->ID(), 'Venue' ); |
|
| 158 | + if ( ! empty($evt_venue) && $evt_venue->ID() != $venue_id) |
|
| 159 | + $evtobj->_remove_relation_to($evt_venue->ID(), 'Venue'); |
|
| 160 | 160 | |
| 161 | - if ( empty( $venue_id ) ) |
|
| 161 | + if (empty($venue_id)) |
|
| 162 | 162 | return TRUE; //no venue to attach |
| 163 | 163 | |
| 164 | 164 | // this should take care of adding to revisions as well as main post object |
| 165 | - $success = $evtobj->_add_relation_to( $venue_id, 'Venue' ); |
|
| 166 | - return !empty($success) ? TRUE : FALSE; |
|
| 165 | + $success = $evtobj->_add_relation_to($venue_id, 'Venue'); |
|
| 166 | + return ! empty($success) ? TRUE : FALSE; |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <h3><?php _e('Physical Location', 'event_espresso'); ?></h3> |
| 2 | 2 | <p> |
| 3 | 3 | <?php _e('Enter the physical address for this venue. This field is optional.', 'event_espresso'); ?><br /> |
| 4 | -<?php echo sprintf(__('The countries that are shown in the dropdown are controlled through the "Country Appears in Dropdown Select Lists" setting which is in the %sCountries tab%s on the General Settings page. Once on this page, you can specify whether to show a country in this dropdown by selecting yes or no and saving changes.', 'event_espresso'),'<a href="admin.php?page=espresso_general_settings&action=country_settings">','</a>'); ?> |
|
| 4 | +<?php echo sprintf(__('The countries that are shown in the dropdown are controlled through the "Country Appears in Dropdown Select Lists" setting which is in the %sCountries tab%s on the General Settings page. Once on this page, you can specify whether to show a country in this dropdown by selecting yes or no and saving changes.', 'event_espresso'), '<a href="admin.php?page=espresso_general_settings&action=country_settings">', '</a>'); ?> |
|
| 5 | 5 | </p> |
| 6 | 6 | </p> |
| 7 | 7 | <h3><?php _e('Google Map', 'event_espresso'); ?></h3> |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $this->_slug = 'venue-add-category-joyride'; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - protected function _set_tour_stops() { |
|
| 37 | + protected function _set_tour_stops() { |
|
| 38 | 38 | $this->_stops = array( |
| 39 | 39 | 10 => array( |
| 40 | 40 | 'content' => $this->_stop_one(), |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | 'options' => array( |
| 55 | 55 | 'tipLocation' => 'right', |
| 56 | 56 | 'tipAdjustmentY' => -55, |
| 57 | - 'tipAdjustmentX' => 5 |
|
| 57 | + 'tipAdjustmentX' => 5 |
|
| 58 | 58 | ) |
| 59 | 59 | ), |
| 60 | 60 | 40 => array( |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | 'options' => array( |
| 64 | 64 | 'tipLocation' => 'top', |
| 65 | 65 | 'tipAdjustmentY' => -75, |
| 66 | - 'tipAdjustmentX' => 250 |
|
| 66 | + 'tipAdjustmentX' => 250 |
|
| 67 | 67 | ) |
| 68 | 68 | ) |
| 69 | 69 | ); |
@@ -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 | /** |
@@ -71,21 +71,21 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | protected function _stop_one() { |
| 74 | - $content = '<h3>' . __('Add New Venue Category', 'event_espresso') . '</h3>'; |
|
| 75 | - $content .= '<p>' . __('This tour of the Add New Venue Category page will provide an overview of the different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
| 74 | + $content = '<h3>'.__('Add New Venue Category', 'event_espresso').'</h3>'; |
|
| 75 | + $content .= '<p>'.__('This tour of the Add New Venue Category page will provide an overview of the different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
| 76 | 76 | return $content; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | protected function _category_name_stop() { |
| 80 | - return '<p>' . __('Enter a name for your new venue category.', 'event_espresso') . '</p>'; |
|
| 80 | + return '<p>'.__('Enter a name for your new venue category.', 'event_espresso').'</p>'; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | protected function _category_id_stop() { |
| 84 | - return '<p>' . __('Enter a unique ID for your new venue category.', 'event_espresso') . '</p>'; |
|
| 84 | + return '<p>'.__('Enter a unique ID for your new venue category.', 'event_espresso').'</p>'; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | protected function _category_editor_stop() { |
| 88 | - return '<p>' . __('The rich text editor can be used to add information about your venue category. Images and links can also be added along with your text.', 'event_espresso') . '</p>'; |
|
| 88 | + return '<p>'.__('The rich text editor can be used to add information about your venue category. Images and links can also be added along with your text.', 'event_espresso').'</p>'; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | } |
| 92 | 92 | \ No newline at end of file |
@@ -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 | /** |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | |
| 111 | 111 | protected function _stop_one() { |
| 112 | - $content = '<h3>' . __('Add Venue', 'event_espresso') . '</h3>'; |
|
| 113 | - $content .= '<p>' . __('This tour of the Venue Editor page will provide an overview of the different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
| 112 | + $content = '<h3>'.__('Add Venue', 'event_espresso').'</h3>'; |
|
| 113 | + $content .= '<p>'.__('This tour of the Venue Editor page will provide an overview of the different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
| 114 | 114 | return $content; |
| 115 | 115 | } |
| 116 | 116 | |
@@ -119,35 +119,35 @@ discard block |
||
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | protected function _venue_editor_stop() { |
| 122 | - return '<p>' . __('The rich text editor can be used to add information about your venue. Images and links can also be added along with your text.', 'event_espresso') . '</p>'; |
|
| 122 | + return '<p>'.__('The rich text editor can be used to add information about your venue. Images and links can also be added along with your text.', 'event_espresso').'</p>'; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | protected function _venue_tags_stop() { |
| 126 | - return '<p>' . __('Quickly add tags to your venue.', 'event_espresso') . '</p>'; |
|
| 126 | + return '<p>'.__('Quickly add tags to your venue.', 'event_espresso').'</p>'; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | protected function _venue_categories_stop() { |
| 130 | - return '<p>' . __('Venues can also be categorized if you wish.', 'event_espresso') . '</p>'; |
|
| 130 | + return '<p>'.__('Venues can also be categorized if you wish.', 'event_espresso').'</p>'; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | protected function _venue_physical_location_stop() { |
| 134 | - return '<p>' . __('Add a physical address for your venue.', 'event_espresso') . '</p>'; |
|
| 134 | + return '<p>'.__('Add a physical address for your venue.', 'event_espresso').'</p>'; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | protected function _venue_gmap_stop() { |
| 138 | - return '<p>' . __('Enable or disable a Google Map for your venue.', 'event_espresso') . '</p>'; |
|
| 138 | + return '<p>'.__('Enable or disable a Google Map for your venue.', 'event_espresso').'</p>'; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | protected function _venue_virtual_location_stop() { |
| 142 | - return '<p>' . __('Setup a virtual location for your venue.', 'event_espresso') . '</p>'; |
|
| 142 | + return '<p>'.__('Setup a virtual location for your venue.', 'event_espresso').'</p>'; |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | protected function _stop_featured_image() { |
| 146 | - return '<p>' . __('Set a feature image for your venue here.', 'event_espresso') . '</p>'; |
|
| 146 | + return '<p>'.__('Set a feature image for your venue here.', 'event_espresso').'</p>'; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | protected function _stop_publish_box() { |
| 150 | - return '<p>' . __('Easily control the status of your venue. The main options are Published, Pending Review, and Draft.', 'event_espresso') . '</p>'; |
|
| 150 | + return '<p>'.__('Easily control the status of your venue. The main options are Published, Pending Review, and Draft.', 'event_espresso').'</p>'; |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | } |
| 154 | 154 | \ No newline at end of file |
@@ -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 | /** |
@@ -107,36 +107,36 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | |
| 109 | 109 | protected function _start() { |
| 110 | - $content = '<h3>' . __('Venue Overview', 'event_espresso') . '</h3>'; |
|
| 111 | - $content .= '<p>' . __('This tour of the Venues Overview page will provide an overview of the different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
| 110 | + $content = '<h3>'.__('Venue Overview', 'event_espresso').'</h3>'; |
|
| 111 | + $content .= '<p>'.__('This tour of the Venues Overview page will provide an overview of the different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
| 112 | 112 | return $content; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | protected function _id_stop() { |
| 116 | - return '<p>' . __('View the venue category ID. Can be sorted by ascending or descending order.', 'event_espresso') . '</p>'; |
|
| 116 | + return '<p>'.__('View the venue category ID. Can be sorted by ascending or descending order.', 'event_espresso').'</p>'; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | protected function _name_stop() { |
| 120 | - return '<p>' . __('View the name of each venue category. Can be sorted by ascending or descending order.', 'event_espresso') . '</p>'; |
|
| 120 | + return '<p>'.__('View the name of each venue category. Can be sorted by ascending or descending order.', 'event_espresso').'</p>'; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | protected function _shortcode_stop() { |
| 124 | - return '<p>' . __('View the shortcode for a venue category. This shortcode can be added to an event, WordPress post, or WordPress page. ', 'event_espresso') . '</p>'; |
|
| 124 | + return '<p>'.__('View the shortcode for a venue category. This shortcode can be added to an event, WordPress post, or WordPress page. ', 'event_espresso').'</p>'; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | protected function _count_stop() { |
| 128 | - return '<p>' . __('View the number of venues that are associated with a category.', 'event_espresso') . '</p>'; |
|
| 128 | + return '<p>'.__('View the number of venues that are associated with a category.', 'event_espresso').'</p>'; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | protected function _bulk_actions_stop() { |
| 132 | - return '<p>' . __('Perform bulk actions to multiple venue categories.', 'event_espresso') . '</p>'; |
|
| 132 | + return '<p>'.__('Perform bulk actions to multiple venue categories.', 'event_espresso').'</p>'; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | protected function _search_stop() { |
| 136 | - return '<p>' . __('Search through venues categories. The following sources will be searched: Venue Category ID, Venue Category Name, Venue Shortcode, and Venue Count.', 'event_espresso') . '</p>'; |
|
| 136 | + return '<p>'.__('Search through venues categories. The following sources will be searched: Venue Category ID, Venue Category Name, Venue Shortcode, and Venue Count.', 'event_espresso').'</p>'; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | protected function _new_category_stop() { |
| 140 | - return '<p>' . __('Click here to add a new venue category.', 'event_espresso') . '</p>'; |
|
| 140 | + return '<p>'.__('Click here to add a new venue category.', 'event_espresso').'</p>'; |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | \ No newline at end of file |
@@ -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 |