@@ -229,7 +229,7 @@ |
||
229 | 229 | * |
230 | 230 | * @access public |
231 | 231 | * @param string $event_list_css |
232 | - * @return array |
|
232 | + * @return string |
|
233 | 233 | */ |
234 | 234 | public function event_list_css( $event_list_css = '' ) { |
235 | 235 | $event_list_css .= ! empty( $event_list_css ) ? ' ' : ''; |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public static function add_query_filters() { |
87 | 87 | //add query filters |
88 | - add_action( 'pre_get_posts', array( 'EEH_Event_Query', 'filter_query_parts' ), 10, 1 ); |
|
88 | + add_action('pre_get_posts', array('EEH_Event_Query', 'filter_query_parts'), 10, 1); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | * @param \WP_Query $WP_Query |
98 | 98 | * @return bool |
99 | 99 | */ |
100 | - public static function apply_query_filters( WP_Query $WP_Query ) { |
|
101 | - return ( isset( $WP_Query->query, $WP_Query->query['post_type'] ) && $WP_Query->query['post_type'] == 'espresso_events' ) || apply_filters( 'FHEE__EEH_Event_Query__apply_query_filters', false ) ? true : false; |
|
100 | + public static function apply_query_filters(WP_Query $WP_Query) { |
|
101 | + return (isset($WP_Query->query, $WP_Query->query['post_type']) && $WP_Query->query['post_type'] == 'espresso_events') || apply_filters('FHEE__EEH_Event_Query__apply_query_filters', false) ? true : false; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -108,15 +108,15 @@ discard block |
||
108 | 108 | * @access public |
109 | 109 | * @param \WP_Query $WP_Query |
110 | 110 | */ |
111 | - public static function filter_query_parts( WP_Query $WP_Query ) { |
|
111 | + public static function filter_query_parts(WP_Query $WP_Query) { |
|
112 | 112 | //ONLY add our filters if this isn't the main wp_query, because if this is the main wp_query we already have our cpt strategies take care of adding things in. |
113 | - if ( $WP_Query instanceof WP_Query && ! $WP_Query->is_main_query() ) { |
|
113 | + if ($WP_Query instanceof WP_Query && ! $WP_Query->is_main_query()) { |
|
114 | 114 | // build event list query |
115 | - add_filter( 'posts_fields', array( 'EEH_Event_Query', 'posts_fields' ), 10, 2 ); |
|
116 | - add_filter( 'posts_join', array( 'EEH_Event_Query', 'posts_join' ), 10, 2 ); |
|
117 | - add_filter( 'posts_where', array( 'EEH_Event_Query', 'posts_where' ), 10, 2 ); |
|
118 | - add_filter( 'posts_orderby', array( 'EEH_Event_Query', 'posts_orderby' ), 10, 2 ); |
|
119 | - add_filter( 'posts_clauses_request', array( 'EEH_Event_Query', 'posts_clauses' ), 10, 2 ); |
|
115 | + add_filter('posts_fields', array('EEH_Event_Query', 'posts_fields'), 10, 2); |
|
116 | + add_filter('posts_join', array('EEH_Event_Query', 'posts_join'), 10, 2); |
|
117 | + add_filter('posts_where', array('EEH_Event_Query', 'posts_where'), 10, 2); |
|
118 | + add_filter('posts_orderby', array('EEH_Event_Query', 'posts_orderby'), 10, 2); |
|
119 | + add_filter('posts_clauses_request', array('EEH_Event_Query', 'posts_clauses'), 10, 2); |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | * @param string $orderby |
132 | 132 | * @param string $sort |
133 | 133 | */ |
134 | - public static function set_query_params( $month = '', $category = '', $show_expired = FALSE, $orderby = 'start_date', $sort = 'ASC' ) { |
|
134 | + public static function set_query_params($month = '', $category = '', $show_expired = FALSE, $orderby = 'start_date', $sort = 'ASC') { |
|
135 | 135 | self::$_query_params = array(); |
136 | - EEH_Event_Query::$_event_query_month = EEH_Event_Query::_display_month( $month ); |
|
137 | - EEH_Event_Query::$_event_query_category = EEH_Event_Query::_event_category_slug( $category ); |
|
138 | - EEH_Event_Query::$_event_query_show_expired = EEH_Event_Query::_show_expired( $show_expired ); |
|
139 | - EEH_Event_Query::$_event_query_orderby = EEH_Event_Query::_orderby( $orderby ); |
|
140 | - EEH_Event_Query::$_event_query_sort = EEH_Event_Query::_sort( $sort ); |
|
136 | + EEH_Event_Query::$_event_query_month = EEH_Event_Query::_display_month($month); |
|
137 | + EEH_Event_Query::$_event_query_category = EEH_Event_Query::_event_category_slug($category); |
|
138 | + EEH_Event_Query::$_event_query_show_expired = EEH_Event_Query::_show_expired($show_expired); |
|
139 | + EEH_Event_Query::$_event_query_orderby = EEH_Event_Query::_orderby($orderby); |
|
140 | + EEH_Event_Query::$_event_query_sort = EEH_Event_Query::_sort($sort); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | * @param string $month |
150 | 150 | * @return string |
151 | 151 | */ |
152 | - private static function _display_month( $month = '' ) { |
|
153 | - return EE_Registry::instance()->REQ->is_set( 'event_query_month' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'event_query_month' ) ) : $month; |
|
152 | + private static function _display_month($month = '') { |
|
153 | + return EE_Registry::instance()->REQ->is_set('event_query_month') ? sanitize_text_field(EE_Registry::instance()->REQ->get('event_query_month')) : $month; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | * @param string $category |
163 | 163 | * @return string |
164 | 164 | */ |
165 | - private static function _event_category_slug( $category = '' ) { |
|
166 | - return EE_Registry::instance()->REQ->is_set( 'event_query_category' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'event_query_category' ) ) : $category; |
|
165 | + private static function _event_category_slug($category = '') { |
|
166 | + return EE_Registry::instance()->REQ->is_set('event_query_category') ? sanitize_text_field(EE_Registry::instance()->REQ->get('event_query_category')) : $category; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | |
@@ -175,10 +175,10 @@ discard block |
||
175 | 175 | * @param bool $show_expired |
176 | 176 | * @return boolean |
177 | 177 | */ |
178 | - private static function _show_expired( $show_expired = FALSE ) { |
|
178 | + private static function _show_expired($show_expired = FALSE) { |
|
179 | 179 | // override default expired option if set via filter |
180 | - $_event_query_show_expired =EE_Registry::instance()->REQ->is_set( 'event_query_show_expired' ) ? EE_Registry::instance()->REQ->get( 'event_query_show_expired' ) : $show_expired; |
|
181 | - return filter_var( $_event_query_show_expired, FILTER_VALIDATE_BOOLEAN ); |
|
180 | + $_event_query_show_expired = EE_Registry::instance()->REQ->is_set('event_query_show_expired') ? EE_Registry::instance()->REQ->get('event_query_show_expired') : $show_expired; |
|
181 | + return filter_var($_event_query_show_expired, FILTER_VALIDATE_BOOLEAN); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | |
@@ -190,10 +190,10 @@ discard block |
||
190 | 190 | * @param string $orderby |
191 | 191 | * @return array |
192 | 192 | */ |
193 | - private static function _orderby( $orderby = 'start_date' ) { |
|
194 | - $event_query_orderby = EE_Registry::instance()->REQ->is_set( 'event_query_orderby' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'event_query_orderby' ) ) : $orderby; |
|
195 | - $event_query_orderby = is_array( $event_query_orderby ) ? $event_query_orderby : explode( ',', $event_query_orderby ); |
|
196 | - $event_query_orderby = array_map( 'trim', $event_query_orderby ); |
|
193 | + private static function _orderby($orderby = 'start_date') { |
|
194 | + $event_query_orderby = EE_Registry::instance()->REQ->is_set('event_query_orderby') ? sanitize_text_field(EE_Registry::instance()->REQ->get('event_query_orderby')) : $orderby; |
|
195 | + $event_query_orderby = is_array($event_query_orderby) ? $event_query_orderby : explode(',', $event_query_orderby); |
|
196 | + $event_query_orderby = array_map('trim', $event_query_orderby); |
|
197 | 197 | return $event_query_orderby; |
198 | 198 | } |
199 | 199 | |
@@ -206,9 +206,9 @@ discard block |
||
206 | 206 | * @param string $sort |
207 | 207 | * @return array |
208 | 208 | */ |
209 | - private static function _sort( $sort = 'ASC' ) { |
|
210 | - $sort = EE_Registry::instance()->REQ->is_set( 'event_query_sort' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'event_query_sort' ) ) : $sort; |
|
211 | - return in_array( $sort, array( 'ASC', 'asc', 'DESC', 'desc' )) ? strtoupper( $sort ) : 'ASC'; |
|
209 | + private static function _sort($sort = 'ASC') { |
|
210 | + $sort = EE_Registry::instance()->REQ->is_set('event_query_sort') ? sanitize_text_field(EE_Registry::instance()->REQ->get('event_query_sort')) : $sort; |
|
211 | + return in_array($sort, array('ASC', 'asc', 'DESC', 'desc')) ? strtoupper($sort) : 'ASC'; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | |
@@ -221,10 +221,10 @@ discard block |
||
221 | 221 | * |
222 | 222 | * @return array array of clauses |
223 | 223 | */ |
224 | - public static function posts_clauses( $clauses, WP_Query $wp_query ) { |
|
225 | - if ( EEH_Event_Query::apply_query_filters( $wp_query ) ) { |
|
224 | + public static function posts_clauses($clauses, WP_Query $wp_query) { |
|
225 | + if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
226 | 226 | global $wpdb; |
227 | - $clauses['groupby'] = $wpdb->posts . '.ID '; |
|
227 | + $clauses['groupby'] = $wpdb->posts.'.ID '; |
|
228 | 228 | } |
229 | 229 | return $clauses; |
230 | 230 | } |
@@ -239,10 +239,10 @@ discard block |
||
239 | 239 | * @param WP_Query $wp_query |
240 | 240 | * @return string |
241 | 241 | */ |
242 | - public static function posts_fields( $SQL, WP_Query $wp_query ) { |
|
243 | - if ( EEH_Event_Query::apply_query_filters( $wp_query ) ) { |
|
242 | + public static function posts_fields($SQL, WP_Query $wp_query) { |
|
243 | + if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
244 | 244 | // adds something like ", wp_esp_datetime.* " to WP Query SELECT statement |
245 | - $SQL .= EEH_Event_Query::posts_fields_sql_for_orderby( EEH_Event_Query::$_event_query_orderby ); |
|
245 | + $SQL .= EEH_Event_Query::posts_fields_sql_for_orderby(EEH_Event_Query::$_event_query_orderby); |
|
246 | 246 | } |
247 | 247 | return $SQL; |
248 | 248 | } |
@@ -257,29 +257,29 @@ discard block |
||
257 | 257 | * @internal param bool|string $mixed $join_terms pass TRUE or term string, doesn't really matter since this value doesn't really get used for anything yet |
258 | 258 | * @return string |
259 | 259 | */ |
260 | - public static function posts_fields_sql_for_orderby( $orderby_params = array() ) { |
|
261 | - $SQL = ', MIN( ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start ) as event_start_date ' ; |
|
262 | - foreach( (array)$orderby_params as $orderby ) { |
|
263 | - switch ( $orderby ) { |
|
260 | + public static function posts_fields_sql_for_orderby($orderby_params = array()) { |
|
261 | + $SQL = ', MIN( '.EEM_Datetime::instance()->table().'.DTT_EVT_start ) as event_start_date '; |
|
262 | + foreach ((array) $orderby_params as $orderby) { |
|
263 | + switch ($orderby) { |
|
264 | 264 | |
265 | 265 | case 'ticket_start' : |
266 | - $SQL .= ', ' . EEM_Ticket::instance()->table() . '.TKT_start_date' ; |
|
266 | + $SQL .= ', '.EEM_Ticket::instance()->table().'.TKT_start_date'; |
|
267 | 267 | break; |
268 | 268 | |
269 | 269 | case 'ticket_end' : |
270 | - $SQL .= ', ' . EEM_Ticket::instance()->table() . '.TKT_end_date' ; |
|
270 | + $SQL .= ', '.EEM_Ticket::instance()->table().'.TKT_end_date'; |
|
271 | 271 | break; |
272 | 272 | |
273 | 273 | case 'venue_title' : |
274 | - $SQL .= ', Venue.post_title AS venue_title' ; |
|
274 | + $SQL .= ', Venue.post_title AS venue_title'; |
|
275 | 275 | break; |
276 | 276 | |
277 | 277 | case 'city' : |
278 | - $SQL .= ', ' . EEM_Venue::instance()->second_table() . '.VNU_city' ; |
|
278 | + $SQL .= ', '.EEM_Venue::instance()->second_table().'.VNU_city'; |
|
279 | 279 | break; |
280 | 280 | |
281 | 281 | case 'state' : |
282 | - $SQL .= ', ' . EEM_State::instance()->table() . '.STA_name' ; |
|
282 | + $SQL .= ', '.EEM_State::instance()->table().'.STA_name'; |
|
283 | 283 | break; |
284 | 284 | |
285 | 285 | } |
@@ -297,12 +297,12 @@ discard block |
||
297 | 297 | * @param WP_Query $wp_query |
298 | 298 | * @return string |
299 | 299 | */ |
300 | - public static function posts_join( $SQL = '', WP_Query $wp_query ) { |
|
301 | - if ( EEH_Event_Query::apply_query_filters( $wp_query ) ) { |
|
300 | + public static function posts_join($SQL = '', WP_Query $wp_query) { |
|
301 | + if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
302 | 302 | // Category |
303 | - $SQL = EEH_Event_Query::posts_join_sql_for_show_expired( $SQL, EEH_Event_Query::$_event_query_show_expired ); |
|
304 | - $SQL = EEH_Event_Query::posts_join_sql_for_terms( $SQL, EEH_Event_Query::$_event_query_category ); |
|
305 | - $SQL = EEH_Event_Query::posts_join_for_orderby( $SQL, EEH_Event_Query::$_event_query_orderby ); |
|
303 | + $SQL = EEH_Event_Query::posts_join_sql_for_show_expired($SQL, EEH_Event_Query::$_event_query_show_expired); |
|
304 | + $SQL = EEH_Event_Query::posts_join_sql_for_terms($SQL, EEH_Event_Query::$_event_query_category); |
|
305 | + $SQL = EEH_Event_Query::posts_join_for_orderby($SQL, EEH_Event_Query::$_event_query_orderby); |
|
306 | 306 | } |
307 | 307 | return $SQL; |
308 | 308 | } |
@@ -317,11 +317,11 @@ discard block |
||
317 | 317 | * @param boolean $show_expired if TRUE, then displayed past events |
318 | 318 | * @return string |
319 | 319 | */ |
320 | - public static function posts_join_sql_for_show_expired( $SQL = '', $show_expired = FALSE ) { |
|
321 | - if ( ! $show_expired ) { |
|
322 | - $join = EEM_Event::instance()->table() . '.ID = ' . EEM_Datetime::instance()->table() . '.' . EEM_Event::instance()->primary_key_name(); |
|
323 | - if ( strpos( $SQL, $join ) === FALSE ) { |
|
324 | - $SQL .= ' INNER JOIN ' . EEM_Datetime::instance()->table() . ' ON ( ' . $join . ' ) '; |
|
320 | + public static function posts_join_sql_for_show_expired($SQL = '', $show_expired = FALSE) { |
|
321 | + if ( ! $show_expired) { |
|
322 | + $join = EEM_Event::instance()->table().'.ID = '.EEM_Datetime::instance()->table().'.'.EEM_Event::instance()->primary_key_name(); |
|
323 | + if (strpos($SQL, $join) === FALSE) { |
|
324 | + $SQL .= ' INNER JOIN '.EEM_Datetime::instance()->table().' ON ( '.$join.' ) '; |
|
325 | 325 | } |
326 | 326 | } |
327 | 327 | return $SQL; |
@@ -337,8 +337,8 @@ discard block |
||
337 | 337 | * @param string $join_terms pass TRUE or term string, doesn't really matter since this value doesn't really get used for anything yet |
338 | 338 | * @return string |
339 | 339 | */ |
340 | - public static function posts_join_sql_for_terms( $SQL = '', $join_terms = '' ) { |
|
341 | - if ( ! empty( $join_terms ) ) { |
|
340 | + public static function posts_join_sql_for_terms($SQL = '', $join_terms = '') { |
|
341 | + if ( ! empty($join_terms)) { |
|
342 | 342 | global $wpdb; |
343 | 343 | $SQL .= " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)"; |
344 | 344 | $SQL .= " LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)"; |
@@ -358,25 +358,25 @@ discard block |
||
358 | 358 | * @param array $orderby_params |
359 | 359 | * @return string |
360 | 360 | */ |
361 | - public static function posts_join_for_orderby( $SQL = '', $orderby_params = array() ) { |
|
362 | - foreach ( (array)$orderby_params as $orderby ) { |
|
363 | - switch ( $orderby ) { |
|
361 | + public static function posts_join_for_orderby($SQL = '', $orderby_params = array()) { |
|
362 | + foreach ((array) $orderby_params as $orderby) { |
|
363 | + switch ($orderby) { |
|
364 | 364 | case 'ticket_start' : |
365 | 365 | case 'ticket_end' : |
366 | - $SQL .= EEH_Event_Query::_posts_join_for_datetime( $SQL, EEM_Datetime_Ticket::instance()->table() . '.' . EEM_Datetime::instance()->primary_key_name() ); |
|
367 | - $SQL .= ' LEFT JOIN ' . EEM_Ticket::instance()->table() . ' ON (' . EEM_Datetime_Ticket::instance()->table() . '.' . EEM_Ticket::instance()->primary_key_name() . ' = ' . EEM_Ticket::instance()->table() . '.' . EEM_Ticket::instance()->primary_key_name() . ' )'; |
|
366 | + $SQL .= EEH_Event_Query::_posts_join_for_datetime($SQL, EEM_Datetime_Ticket::instance()->table().'.'.EEM_Datetime::instance()->primary_key_name()); |
|
367 | + $SQL .= ' LEFT JOIN '.EEM_Ticket::instance()->table().' ON ('.EEM_Datetime_Ticket::instance()->table().'.'.EEM_Ticket::instance()->primary_key_name().' = '.EEM_Ticket::instance()->table().'.'.EEM_Ticket::instance()->primary_key_name().' )'; |
|
368 | 368 | break; |
369 | 369 | case 'venue_title' : |
370 | 370 | case 'city' : |
371 | - $SQL .= EEH_Event_Query::_posts_join_for_event_venue( $SQL ); |
|
371 | + $SQL .= EEH_Event_Query::_posts_join_for_event_venue($SQL); |
|
372 | 372 | break; |
373 | 373 | case 'state' : |
374 | - $SQL .= EEH_Event_Query::_posts_join_for_event_venue( $SQL ); |
|
375 | - $SQL .= EEH_Event_Query::_posts_join_for_venue_state( $SQL ); |
|
374 | + $SQL .= EEH_Event_Query::_posts_join_for_event_venue($SQL); |
|
375 | + $SQL .= EEH_Event_Query::_posts_join_for_venue_state($SQL); |
|
376 | 376 | break; |
377 | 377 | case 'start_date' : |
378 | 378 | default : |
379 | - $SQL .= EEH_Event_Query::_posts_join_for_datetime( $SQL, EEM_Event::instance()->table() . '.ID' ); |
|
379 | + $SQL .= EEH_Event_Query::_posts_join_for_datetime($SQL, EEM_Event::instance()->table().'.ID'); |
|
380 | 380 | break; |
381 | 381 | |
382 | 382 | } |
@@ -394,11 +394,11 @@ discard block |
||
394 | 394 | * @param string $join |
395 | 395 | * @return string |
396 | 396 | */ |
397 | - protected static function _posts_join_for_datetime( $SQL = '', $join = '' ) { |
|
398 | - if ( ! empty( $join )) { |
|
399 | - $join .= ' = ' . EEM_Datetime::instance()->table() . '.' . EEM_Event::instance()->primary_key_name(); |
|
400 | - if ( strpos( $SQL, $join ) === FALSE ) { |
|
401 | - return ' INNER JOIN ' . EEM_Datetime::instance()->table() . ' ON ( ' . $join . ' )'; |
|
397 | + protected static function _posts_join_for_datetime($SQL = '', $join = '') { |
|
398 | + if ( ! empty($join)) { |
|
399 | + $join .= ' = '.EEM_Datetime::instance()->table().'.'.EEM_Event::instance()->primary_key_name(); |
|
400 | + if (strpos($SQL, $join) === FALSE) { |
|
401 | + return ' INNER JOIN '.EEM_Datetime::instance()->table().' ON ( '.$join.' )'; |
|
402 | 402 | } |
403 | 403 | } |
404 | 404 | return ''; |
@@ -413,13 +413,13 @@ discard block |
||
413 | 413 | * @param string $SQL |
414 | 414 | * @return string |
415 | 415 | */ |
416 | - protected static function _posts_join_for_event_venue( $SQL = '' ) { |
|
416 | + protected static function _posts_join_for_event_venue($SQL = '') { |
|
417 | 417 | // Event Venue table name |
418 | 418 | $event_venue_table = EEM_Event_Venue::instance()->table(); |
419 | 419 | // generate conditions for: Event <=> Event Venue JOIN clause |
420 | - $event_to_event_venue_join = EEM_Event::instance()->table() . '.ID = ' . $event_venue_table . '.' . EEM_Event::instance()->primary_key_name(); |
|
420 | + $event_to_event_venue_join = EEM_Event::instance()->table().'.ID = '.$event_venue_table.'.'.EEM_Event::instance()->primary_key_name(); |
|
421 | 421 | // don't add joins if they have already been added |
422 | - if ( strpos( $SQL, $event_to_event_venue_join ) === FALSE ) { |
|
422 | + if (strpos($SQL, $event_to_event_venue_join) === FALSE) { |
|
423 | 423 | // Venue table name |
424 | 424 | $venue_table = EEM_Venue::instance()->table(); |
425 | 425 | // Venue table pk |
@@ -432,10 +432,10 @@ discard block |
||
432 | 432 | $venue_SQL .= " LEFT JOIN $venue_table as Venue ON ( $event_venue_table.$venue_table_pk = Venue.ID )"; |
433 | 433 | // generate JOIN clause for: Venue <=> Venue Meta |
434 | 434 | $venue_SQL .= " LEFT JOIN $venue_meta_table ON ( Venue.ID = $venue_meta_table.$venue_table_pk )"; |
435 | - unset( $event_venue_table, $event_to_event_venue_join, $venue_table, $venue_table_pk, $venue_meta_table ); |
|
435 | + unset($event_venue_table, $event_to_event_venue_join, $venue_table, $venue_table_pk, $venue_meta_table); |
|
436 | 436 | return $venue_SQL; |
437 | 437 | } |
438 | - unset( $event_venue_table, $event_to_event_venue_join ); |
|
438 | + unset($event_venue_table, $event_to_event_venue_join); |
|
439 | 439 | return ''; |
440 | 440 | } |
441 | 441 | |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | * @param string $SQL |
449 | 449 | * @return string |
450 | 450 | */ |
451 | - protected static function _posts_join_for_venue_state( $SQL = '' ) { |
|
451 | + protected static function _posts_join_for_venue_state($SQL = '') { |
|
452 | 452 | // Venue Meta table name |
453 | 453 | $venue_meta_table = EEM_Venue::instance()->second_table(); |
454 | 454 | // State table name |
@@ -456,16 +456,16 @@ discard block |
||
456 | 456 | // State table pk |
457 | 457 | $state_table_pk = EEM_State::instance()->primary_key_name(); |
458 | 458 | // verify vars |
459 | - if ( $venue_meta_table && $state_table && $state_table_pk ) { |
|
459 | + if ($venue_meta_table && $state_table && $state_table_pk) { |
|
460 | 460 | // like: wp_esp_venue_meta.STA_ID = wp_esp_state.STA_ID |
461 | 461 | $join = "$venue_meta_table.$state_table_pk = $state_table.$state_table_pk"; |
462 | 462 | // don't add join if it has already been added |
463 | - if ( strpos( $SQL, $join ) === FALSE ) { |
|
464 | - unset( $state_table_pk, $venue_meta_table, $venue_table_pk ); |
|
463 | + if (strpos($SQL, $join) === FALSE) { |
|
464 | + unset($state_table_pk, $venue_meta_table, $venue_table_pk); |
|
465 | 465 | return " LEFT JOIN $state_table ON ( $join )"; |
466 | 466 | } |
467 | 467 | } |
468 | - unset( $join, $state_table, $state_table_pk, $venue_meta_table, $venue_table_pk ); |
|
468 | + unset($join, $state_table, $state_table_pk, $venue_meta_table, $venue_table_pk); |
|
469 | 469 | return ''; |
470 | 470 | } |
471 | 471 | |
@@ -479,14 +479,14 @@ discard block |
||
479 | 479 | * @param WP_Query $wp_query |
480 | 480 | * @return string |
481 | 481 | */ |
482 | - public static function posts_where( $SQL = '', WP_Query $wp_query ) { |
|
483 | - if ( EEH_Event_Query::apply_query_filters( $wp_query ) ) { |
|
482 | + public static function posts_where($SQL = '', WP_Query $wp_query) { |
|
483 | + if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
484 | 484 | // Show Expired ? |
485 | - $SQL .= EEH_Event_Query::posts_where_sql_for_show_expired( EEH_Event_Query::$_event_query_show_expired ); |
|
485 | + $SQL .= EEH_Event_Query::posts_where_sql_for_show_expired(EEH_Event_Query::$_event_query_show_expired); |
|
486 | 486 | // Category |
487 | - $SQL .= EEH_Event_Query::posts_where_sql_for_event_category_slug( EEH_Event_Query::$_event_query_category ); |
|
487 | + $SQL .= EEH_Event_Query::posts_where_sql_for_event_category_slug(EEH_Event_Query::$_event_query_category); |
|
488 | 488 | // Start Date |
489 | - $SQL .= EEH_Event_Query::posts_where_sql_for_event_list_month( EEH_Event_Query::$_event_query_month ); |
|
489 | + $SQL .= EEH_Event_Query::posts_where_sql_for_event_list_month(EEH_Event_Query::$_event_query_month); |
|
490 | 490 | } |
491 | 491 | return $SQL; |
492 | 492 | } |
@@ -500,8 +500,8 @@ discard block |
||
500 | 500 | * @param boolean $show_expired if TRUE, then displayed past events |
501 | 501 | * @return string |
502 | 502 | */ |
503 | - public static function posts_where_sql_for_show_expired( $show_expired = FALSE ) { |
|
504 | - return ! $show_expired ? ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end > \'' . current_time( 'mysql', TRUE ) . '\' ' : ''; |
|
503 | + public static function posts_where_sql_for_show_expired($show_expired = FALSE) { |
|
504 | + return ! $show_expired ? ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_end > \''.current_time('mysql', TRUE).'\' ' : ''; |
|
505 | 505 | } |
506 | 506 | |
507 | 507 | |
@@ -513,9 +513,9 @@ discard block |
||
513 | 513 | * @param boolean $event_category_slug |
514 | 514 | * @return string |
515 | 515 | */ |
516 | - public static function posts_where_sql_for_event_category_slug( $event_category_slug = NULL ) { |
|
516 | + public static function posts_where_sql_for_event_category_slug($event_category_slug = NULL) { |
|
517 | 517 | global $wpdb; |
518 | - return ! empty( $event_category_slug ) ? " AND {$wpdb->terms}.slug = '{$event_category_slug}' " : ''; |
|
518 | + return ! empty($event_category_slug) ? " AND {$wpdb->terms}.slug = '{$event_category_slug}' " : ''; |
|
519 | 519 | } |
520 | 520 | |
521 | 521 | |
@@ -527,14 +527,14 @@ discard block |
||
527 | 527 | * @param boolean $month |
528 | 528 | * @return string |
529 | 529 | */ |
530 | - public static function posts_where_sql_for_event_list_month( $month = NULL ) { |
|
530 | + public static function posts_where_sql_for_event_list_month($month = NULL) { |
|
531 | 531 | $SQL = ''; |
532 | - if ( ! empty( $month ) ) { |
|
532 | + if ( ! empty($month)) { |
|
533 | 533 | $datetime_table = EEM_Datetime::instance()->table(); |
534 | 534 | // event start date is LESS than the end of the month ( so nothing that doesn't start until next month ) |
535 | - $SQL = " AND {$datetime_table}.DTT_EVT_start <= '" . date( 'Y-m-t 23:59:59', strtotime( $month ) ) . "'"; |
|
535 | + $SQL = " AND {$datetime_table}.DTT_EVT_start <= '".date('Y-m-t 23:59:59', strtotime($month))."'"; |
|
536 | 536 | // event end date is GREATER than the start of the month ( so nothing that ended before this month ) |
537 | - $SQL .= " AND {$datetime_table}.DTT_EVT_end >= '" . date( 'Y-m-01 0:0:00', strtotime( $month ) ) . "' "; |
|
537 | + $SQL .= " AND {$datetime_table}.DTT_EVT_end >= '".date('Y-m-01 0:0:00', strtotime($month))."' "; |
|
538 | 538 | } |
539 | 539 | return $SQL; |
540 | 540 | } |
@@ -549,9 +549,9 @@ discard block |
||
549 | 549 | * @param WP_Query $wp_query |
550 | 550 | * @return string |
551 | 551 | */ |
552 | - public static function posts_orderby( $SQL = '', WP_Query $wp_query ) { |
|
553 | - if ( EEH_Event_Query::apply_query_filters( $wp_query ) ) { |
|
554 | - $SQL = EEH_Event_Query::posts_orderby_sql( EEH_Event_Query::$_event_query_orderby, EEH_Event_Query::$_event_query_sort ); |
|
552 | + public static function posts_orderby($SQL = '', WP_Query $wp_query) { |
|
553 | + if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
554 | + $SQL = EEH_Event_Query::posts_orderby_sql(EEH_Event_Query::$_event_query_orderby, EEH_Event_Query::$_event_query_sort); |
|
555 | 555 | } |
556 | 556 | return $SQL; |
557 | 557 | } |
@@ -582,63 +582,63 @@ discard block |
||
582 | 582 | * @param string $sort |
583 | 583 | * @return string |
584 | 584 | */ |
585 | - public static function posts_orderby_sql( $orderby_params = array(), $sort = 'ASC' ) { |
|
585 | + public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC') { |
|
586 | 586 | global $wpdb; |
587 | 587 | $SQL = ''; |
588 | 588 | $counter = 0; |
589 | 589 | //make sure 'orderby' is set in query params |
590 | - if ( ! isset( self::$_query_params['orderby'] )) { |
|
590 | + if ( ! isset(self::$_query_params['orderby'])) { |
|
591 | 591 | self::$_query_params['orderby'] = array(); |
592 | 592 | } |
593 | 593 | // loop thru $orderby_params (type cast as array) |
594 | - foreach ( (array)$orderby_params as $orderby ) { |
|
594 | + foreach ((array) $orderby_params as $orderby) { |
|
595 | 595 | // check if we have already added this param |
596 | - if ( isset( self::$_query_params['orderby'][ $orderby ] )) { |
|
596 | + if (isset(self::$_query_params['orderby'][$orderby])) { |
|
597 | 597 | // if so then remove from the $orderby_params so that the count() method below is accurate |
598 | - unset( $orderby_params[ $orderby ] ); |
|
598 | + unset($orderby_params[$orderby]); |
|
599 | 599 | // then bump ahead to the next param |
600 | 600 | continue; |
601 | 601 | } |
602 | 602 | // this will ad a comma depending on whether this is the first or last param |
603 | - $glue = $counter == 0 || $counter == count( $orderby_params ) ? ' ' : ', '; |
|
603 | + $glue = $counter == 0 || $counter == count($orderby_params) ? ' ' : ', '; |
|
604 | 604 | // ok what's we dealing with? |
605 | - switch ( $orderby ) { |
|
605 | + switch ($orderby) { |
|
606 | 606 | case 'id' : |
607 | 607 | case 'ID' : |
608 | - $SQL .= $glue . $wpdb->posts . '.ID ' . $sort; |
|
608 | + $SQL .= $glue.$wpdb->posts.'.ID '.$sort; |
|
609 | 609 | break; |
610 | 610 | case 'end_date' : |
611 | - $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_end ' . $sort; |
|
611 | + $SQL .= $glue.EEM_Datetime::instance()->table().'.DTT_EVT_end '.$sort; |
|
612 | 612 | break; |
613 | 613 | case 'event_name' : |
614 | - $SQL .= $glue . $wpdb->posts . '.post_title ' . $sort; |
|
614 | + $SQL .= $glue.$wpdb->posts.'.post_title '.$sort; |
|
615 | 615 | break; |
616 | 616 | case 'category_slug' : |
617 | - $SQL .= $glue . $wpdb->terms . '.slug ' . $sort; |
|
617 | + $SQL .= $glue.$wpdb->terms.'.slug '.$sort; |
|
618 | 618 | break; |
619 | 619 | case 'ticket_start' : |
620 | - $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_start_date ' . $sort; |
|
620 | + $SQL .= $glue.EEM_Ticket::instance()->table().'.TKT_start_date '.$sort; |
|
621 | 621 | break; |
622 | 622 | case 'ticket_end' : |
623 | - $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_end_date ' . $sort; |
|
623 | + $SQL .= $glue.EEM_Ticket::instance()->table().'.TKT_end_date '.$sort; |
|
624 | 624 | break; |
625 | 625 | case 'venue_title' : |
626 | - $SQL .= $glue . 'venue_title ' . $sort; |
|
626 | + $SQL .= $glue.'venue_title '.$sort; |
|
627 | 627 | break; |
628 | 628 | case 'city' : |
629 | - $SQL .= $glue . EEM_Venue::instance()->second_table() . '.VNU_city ' . $sort; |
|
629 | + $SQL .= $glue.EEM_Venue::instance()->second_table().'.VNU_city '.$sort; |
|
630 | 630 | break; |
631 | 631 | case 'state' : |
632 | - $SQL .= $glue . EEM_State::instance()->table() . '.STA_name ' . $sort; |
|
632 | + $SQL .= $glue.EEM_State::instance()->table().'.STA_name '.$sort; |
|
633 | 633 | break; |
634 | 634 | case 'start_date' : |
635 | 635 | default : |
636 | - $SQL .= $glue . ' event_start_date ' . $sort; |
|
636 | + $SQL .= $glue.' event_start_date '.$sort; |
|
637 | 637 | break; |
638 | 638 | } |
639 | 639 | // add to array of orderby params that have been added |
640 | - self::$_query_params['orderby'][ $orderby ] = TRUE; |
|
641 | - $counter ++; |
|
640 | + self::$_query_params['orderby'][$orderby] = TRUE; |
|
641 | + $counter++; |
|
642 | 642 | } |
643 | 643 | return $SQL; |
644 | 644 | } |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -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 Event_Categories_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_categories( $this->_per_page, $this->_current_page); |
|
43 | - $this->_all_data_count = EEM_Term_Taxonomy::instance()->count( array( array( 'taxonomy' => 'espresso_event_categories' ) ) ); |
|
42 | + $this->_data = $this->_admin_page->get_categories($this->_per_page, $this->_current_page); |
|
43 | + $this->_all_data_count = EEM_Term_Taxonomy::instance()->count(array(array('taxonomy' => 'espresso_event_categories'))); |
|
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 category', 'event_espresso' ), |
|
53 | - 'plural' => __('event categories', 'event_espresso' ), |
|
52 | + 'singular' => __('event category', 'event_espresso'), |
|
53 | + 'plural' => __('event categories', 'event_espresso'), |
|
54 | 54 | 'ajax' => TRUE, //for now, |
55 | 55 | 'screen' => $this->_admin_page->get_current_screen()->id |
56 | 56 | ); |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | ); |
65 | 65 | |
66 | 66 | $this->_sortable_columns = array( |
67 | - 'id' => array( 'Term.term_id' => true ), |
|
68 | - 'name' => array( 'Term.slug' => false ), |
|
69 | - 'count' => array( 'term_count' => false ) |
|
67 | + 'id' => array('Term.term_id' => true), |
|
68 | + 'name' => array('Term.slug' => false), |
|
69 | + 'count' => array('term_count' => false) |
|
70 | 70 | ); |
71 | 71 | |
72 | 72 | $this->_primary_column = 'id'; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | |
100 | 100 | public function column_cb($item) { |
101 | - return sprintf( '<input type="checkbox" name="EVT_CAT_ID[]" value="%s" />', $item->get('term_id') ); |
|
101 | + return sprintf('<input type="checkbox" name="EVT_CAT_ID[]" value="%s" />', $item->get('term_id')); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | public function column_id($item) { |
109 | 109 | $content = $item->get('term_id'); |
110 | - $content .= ' <span class="show-on-mobile-view-only">' . $item->get_first_related('Term')->get('name') . '</span>'; |
|
110 | + $content .= ' <span class="show-on-mobile-view-only">'.$item->get_first_related('Term')->get('name').'</span>'; |
|
111 | 111 | return $content; |
112 | 112 | } |
113 | 113 | |
@@ -127,17 +127,17 @@ discard block |
||
127 | 127 | 'EVT_CAT_ID' => $item->get('term_id') |
128 | 128 | ); |
129 | 129 | |
130 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL ); |
|
131 | - $delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EVENTS_ADMIN_URL ); |
|
130 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL); |
|
131 | + $delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EVENTS_ADMIN_URL); |
|
132 | 132 | |
133 | 133 | $actions = array( |
134 | - 'edit' => '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Category', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>' |
|
134 | + 'edit' => '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Category', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>' |
|
135 | 135 | ); |
136 | 136 | |
137 | 137 | |
138 | - $actions['delete'] = '<a href="' . $delete_link . '" title="' . esc_attr__('Delete Category', 'event_espresso') . '">' . __('Delete', 'event_espresso') . '</a>'; |
|
138 | + $actions['delete'] = '<a href="'.$delete_link.'" title="'.esc_attr__('Delete Category', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>'; |
|
139 | 139 | |
140 | - $content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->get_first_related('Term')->get('name') . '</a></strong>'; |
|
140 | + $content = '<strong><a class="row-title" href="'.$edit_link.'">'.$item->get_first_related('Term')->get('name').'</a></strong>'; |
|
141 | 141 | $content .= $this->row_actions($actions); |
142 | 142 | return $content; |
143 | 143 | } |
@@ -146,20 +146,20 @@ discard block |
||
146 | 146 | |
147 | 147 | |
148 | 148 | public function column_shortcode($item) { |
149 | - $content = '[ESPRESSO_EVENTS category_slug=' . $item->get_first_related('Term')->get('slug') . ']'; |
|
149 | + $content = '[ESPRESSO_EVENTS category_slug='.$item->get_first_related('Term')->get('slug').']'; |
|
150 | 150 | return $content; |
151 | 151 | } |
152 | 152 | |
153 | 153 | |
154 | 154 | |
155 | 155 | |
156 | - public function column_count( $item ) { |
|
156 | + public function column_count($item) { |
|
157 | 157 | $e_args = array( |
158 | 158 | 'action' => 'default', |
159 | 159 | 'EVT_CAT' => $item->get_first_related('Term')->ID() |
160 | 160 | ); |
161 | - $e_link = EE_Admin_Page::add_query_args_and_nonce( $e_args, EVENTS_ADMIN_URL ); |
|
162 | - $content = '<a href="' . $e_link . '">' . $item->get('term_count') . '</a>'; |
|
161 | + $e_link = EE_Admin_Page::add_query_args_and_nonce($e_args, EVENTS_ADMIN_URL); |
|
162 | + $content = '<a href="'.$e_link.'">'.$item->get('term_count').'</a>'; |
|
163 | 163 | return $content; |
164 | 164 | } |
165 | 165 | } |
@@ -123,14 +123,14 @@ discard block |
||
123 | 123 | 'tipLocation' => 'left' |
124 | 124 | ) |
125 | 125 | ), |
126 | - 110 => array( |
|
126 | + 110 => array( |
|
127 | 127 | 'id' => 'espresso_event_editor_event_options', |
128 | 128 | 'content' => $this->_event_registration_options_stop(), |
129 | 129 | 'options' => array( |
130 | 130 | 'tipLocation' => 'left' |
131 | 131 | ) |
132 | 132 | ), |
133 | - 120 => array( |
|
133 | + 120 => array( |
|
134 | 134 | 'id' => 'submitpost', |
135 | 135 | 'content' => $this->_publish_event_stop(), |
136 | 136 | 'options' => array( |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | return '<p>' . __('Set a feature image for your event here.', 'event_espresso') . '</p>'; |
197 | 197 | } |
198 | 198 | |
199 | - protected function _publish_event_stop() { |
|
199 | + protected function _publish_event_stop() { |
|
200 | 200 | return '<p>' . __('Easily control the state of your event. The main states are Published, Pending Review, and Draft. Additional states are Cancelled, Postponed, and Sold Out.', 'event_espresso') . '</p>'; |
201 | 201 | } |
202 | 202 |
@@ -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 | /** |
@@ -143,8 +143,8 @@ discard block |
||
143 | 143 | |
144 | 144 | |
145 | 145 | protected function _start() { |
146 | - $content = '<h3>' . __('Event Editor', 'event_espresso') . '</h3>'; |
|
147 | - $content .= '<p>' . __('This tour of the Event Editor will provide an overview of the different areas of the screen to help you understand what they are used for. Let\'s get started on setting up your first event with Event Espresso!', 'event_espresso') . '</p>'; |
|
146 | + $content = '<h3>'.__('Event Editor', 'event_espresso').'</h3>'; |
|
147 | + $content .= '<p>'.__('This tour of the Event Editor will provide an overview of the different areas of the screen to help you understand what they are used for. Let\'s get started on setting up your first event with Event Espresso!', 'event_espresso').'</p>'; |
|
148 | 148 | return $content; |
149 | 149 | } |
150 | 150 | |
@@ -153,51 +153,51 @@ discard block |
||
153 | 153 | } |
154 | 154 | |
155 | 155 | protected function _event_description_stop() { |
156 | - return '<p>' . __('The rich text editor can be used to add information about your event. Images and links can also be added along with your text.', 'event_espresso') . '</p>'; |
|
156 | + return '<p>'.__('The rich text editor can be used to add information about your event. Images and links can also be added along with your text.', 'event_espresso').'</p>'; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | protected function _event_venues_caf() { |
160 | - return '<p>' . __('In this section, you can select the venue that is hosting your event.', 'event_espresso') . '</p>'; |
|
160 | + return '<p>'.__('In this section, you can select the venue that is hosting your event.', 'event_espresso').'</p>'; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | protected function _event_venues_stop() { |
164 | - return '<p>' . __('In this section, you can enter information about the venue that is hosting your event.', 'event_espresso') . '</p>'; |
|
164 | + return '<p>'.__('In this section, you can enter information about the venue that is hosting your event.', 'event_espresso').'</p>'; |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | protected function _event_pricing_stop() { |
168 | - return '<p>' . __('Use the Event Datetime & Ticket section to enter details about when the event is happening and what tickets you want to offer for access to the event.', 'event_espresso') . '</p>'; |
|
168 | + return '<p>'.__('Use the Event Datetime & Ticket section to enter details about when the event is happening and what tickets you want to offer for access to the event.', 'event_espresso').'</p>'; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | protected function _event_pricing_caf() { |
172 | - return '<p>' . __('Use the Event Datetimes & Ticket section to enter details about when the event is happening and what tickets you want to offer for access to the event.', 'event_espresso') . '</p>'; |
|
172 | + return '<p>'.__('Use the Event Datetimes & Ticket section to enter details about when the event is happening and what tickets you want to offer for access to the event.', 'event_espresso').'</p>'; |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | protected function _event_registration_options_stop() { |
176 | - return '<p>' . __('Setup custom options for your event registration.', 'event_espresso') . '</p>'; |
|
176 | + return '<p>'.__('Setup custom options for your event registration.', 'event_espresso').'</p>'; |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | protected function _event_post_tag_stop() { |
180 | - return '<p>' . __('Quickly add tags to your event.', 'event_espresso') . '</p>'; |
|
180 | + return '<p>'.__('Quickly add tags to your event.', 'event_espresso').'</p>'; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | protected function _event_categories_stop() { |
184 | - return '<p>' . __('Events can also be categorized if you wish.', 'event_espresso') . '</p>'; |
|
184 | + return '<p>'.__('Events can also be categorized if you wish.', 'event_espresso').'</p>'; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | protected function _primary_question_stop_caf() { |
188 | - return '<p>' . __('Use the questions group to request information from your primary registrant.', 'event_espresso') . '</p>'; |
|
188 | + return '<p>'.__('Use the questions group to request information from your primary registrant.', 'event_espresso').'</p>'; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | protected function _additional_questions_stop_caf() { |
192 | - return '<p>' . __('Use the questions group to request information from your additional registrant.', 'event_espresso') . '</p>'; |
|
192 | + return '<p>'.__('Use the questions group to request information from your additional registrant.', 'event_espresso').'</p>'; |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | protected function _featured_image_stop() { |
196 | - return '<p>' . __('Set a feature image for your event here.', 'event_espresso') . '</p>'; |
|
196 | + return '<p>'.__('Set a feature image for your event here.', 'event_espresso').'</p>'; |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | protected function _publish_event_stop() { |
200 | - return '<p>' . __('Easily control the state of your event. The main states are Published, Pending Review, and Draft. Additional states are Cancelled, Postponed, and Sold Out.', 'event_espresso') . '</p>'; |
|
200 | + return '<p>'.__('Easily control the state of your event. The main states are Published, Pending Review, and Draft. Additional states are Cancelled, Postponed, and Sold Out.', 'event_espresso').'</p>'; |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | } |
204 | 204 | \ No newline at end of file |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -5,7 +5,7 @@ |
||
5 | 5 | <div class"mt-settings"> |
6 | 6 | <form method="POST" action="" class="mt-settings-form<?php echo $show_form; ?>"> |
7 | 7 | <?php echo $template_form_fields; ?> |
8 | - <?php foreach ( $hidden_fields as $name => $field ) { |
|
8 | + <?php foreach ($hidden_fields as $name => $field) { |
|
9 | 9 | echo $field['field']; |
10 | 10 | } ?> |
11 | 11 | <input type="submit" value="<?php _e('Submit', 'event_espresso'); ?>" class="button-secondary mt-settings-submit no-drag" /> |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | class EE_Attendee_Contact_List_Table extends EE_Admin_List_Table { |
5 | 5 | |
6 | 6 | |
7 | - public function __construct( $admin_page ) { |
|
7 | + public function __construct($admin_page) { |
|
8 | 8 | parent::__construct($admin_page); |
9 | 9 | } |
10 | 10 | |
@@ -12,8 +12,8 @@ discard block |
||
12 | 12 | |
13 | 13 | |
14 | 14 | protected function _setup_data() { |
15 | - $this->_data = $this->_view != 'trash' ? $this->_admin_page->get_attendees( $this->_per_page ) : $this->_admin_page->get_attendees( $this->_per_page, FALSE, TRUE ); |
|
16 | - $this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_attendees( $this->_per_page, TRUE ) : $this->_admin_page->get_attendees( $this->_per_page,TRUE, TRUE ); |
|
15 | + $this->_data = $this->_view != 'trash' ? $this->_admin_page->get_attendees($this->_per_page) : $this->_admin_page->get_attendees($this->_per_page, FALSE, TRUE); |
|
16 | + $this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_attendees($this->_per_page, TRUE) : $this->_admin_page->get_attendees($this->_per_page, TRUE, TRUE); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | ); |
42 | 42 | |
43 | 43 | $this->_sortable_columns = array( |
44 | - 'ATT_ID' => array( 'ATT_ID' => FALSE ), |
|
45 | - 'ATT_lname' => array( 'ATT_lname' => TRUE ), //true means its already sorted |
|
46 | - 'ATT_fname' => array( 'ATT_fname' => FALSE ), |
|
47 | - 'ATT_email' => array( 'ATT_email' => FALSE ), |
|
48 | - 'ATT_city' => array( 'ATT_city' => FALSE ), |
|
49 | - 'STA_ID' => array( 'STA_ID' => FALSE ), |
|
50 | - 'CNT_ISO' => array( 'CNT_ISO' => FALSE ) |
|
44 | + 'ATT_ID' => array('ATT_ID' => FALSE), |
|
45 | + 'ATT_lname' => array('ATT_lname' => TRUE), //true means its already sorted |
|
46 | + 'ATT_fname' => array('ATT_fname' => FALSE), |
|
47 | + 'ATT_email' => array('ATT_email' => FALSE), |
|
48 | + 'ATT_city' => array('ATT_city' => FALSE), |
|
49 | + 'STA_ID' => array('STA_ID' => FALSE), |
|
50 | + 'CNT_ISO' => array('CNT_ISO' => FALSE) |
|
51 | 51 | ); |
52 | 52 | |
53 | 53 | $this->_hidden_columns = array(); |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | |
65 | 65 | |
66 | 66 | protected function _add_view_counts() { |
67 | - $this->_views['in_use']['count'] = $this->_admin_page->get_attendees( $this->_per_page, TRUE ); |
|
68 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_delete_registration' ) ) { |
|
69 | - $this->_views['trash']['count'] = $this->_admin_page->get_attendees( $this->_per_page,TRUE, TRUE ); |
|
67 | + $this->_views['in_use']['count'] = $this->_admin_page->get_attendees($this->_per_page, TRUE); |
|
68 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_delete_registration')) { |
|
69 | + $this->_views['trash']['count'] = $this->_admin_page->get_attendees($this->_per_page, TRUE, TRUE); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | |
91 | 91 | function column_cb($item) { |
92 | - return sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() ); |
|
92 | + return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID()); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | |
98 | 98 | |
99 | 99 | function column_ATT_ID($item) { |
100 | - $content = $item->ID(); |
|
100 | + $content = $item->ID(); |
|
101 | 101 | $attendee_name = $item instanceof EE_Attendee ? $item->full_name() : ''; |
102 | - $content .= ' <span class="show-on-mobile-view-only">' . $attendee_name . '</span>'; |
|
102 | + $content .= ' <span class="show-on-mobile-view-only">'.$attendee_name.'</span>'; |
|
103 | 103 | return $content; |
104 | 104 | } |
105 | 105 | |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | function column_ATT_lname($item) { |
111 | 111 | |
112 | 112 | // edit attendee link |
113 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->ID() ), REG_ADMIN_URL ); |
|
114 | - $name_link = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_contacts', 'espresso_registrations_edit_attendee' ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' . $item->lname() . '</a>' : $item->lname(); |
|
113 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->ID()), REG_ADMIN_URL); |
|
114 | + $name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">'.$item->lname().'</a>' : $item->lname(); |
|
115 | 115 | return $name_link; |
116 | 116 | |
117 | 117 | } |
@@ -124,30 +124,30 @@ discard block |
||
124 | 124 | //Build row actions |
125 | 125 | $actions = array(); |
126 | 126 | // edit attendee link |
127 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_contacts', 'espresso_registrations_edit_attendee' ) ) { |
|
128 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->ID() ), REG_ADMIN_URL ); |
|
129 | - $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' . __( 'Edit', 'event_espresso' ) . '</a>'; |
|
127 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee')) { |
|
128 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->ID()), REG_ADMIN_URL); |
|
129 | + $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'; |
|
130 | 130 | } |
131 | 131 | |
132 | - if ( $this->_view == 'in_use' ) { |
|
132 | + if ($this->_view == 'in_use') { |
|
133 | 133 | // trash attendee link |
134 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_trash_attendees' ) ) { |
|
135 | - $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_attendees', 'ATT_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
136 | - $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Move Contact to Trash', 'event_espresso' ) . '">' . __( 'Trash', 'event_espresso' ) . '</a>'; |
|
134 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) { |
|
135 | + $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_attendees', 'ATT_ID'=>$item->ID()), REG_ADMIN_URL); |
|
136 | + $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Contact to Trash', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>'; |
|
137 | 137 | } |
138 | 138 | } else { |
139 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_restore_attendees' ) ) { |
|
139 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_restore_attendees')) { |
|
140 | 140 | // restore attendee link |
141 | - $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_attendees', 'ATT_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
142 | - $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Contact', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>'; |
|
141 | + $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_attendees', 'ATT_ID'=>$item->ID()), REG_ADMIN_URL); |
|
142 | + $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Contact', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>'; |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
146 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->ID() ), REG_ADMIN_URL ); |
|
147 | - $name_link = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_contacts', 'espresso_registrations_edit_attendee' ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' . $item->fname() . '</a>' : $item->fname(); |
|
146 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->ID()), REG_ADMIN_URL); |
|
147 | + $name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">'.$item->fname().'</a>' : $item->fname(); |
|
148 | 148 | |
149 | 149 | //Return the name contents |
150 | - return sprintf('%1$s %2$s', $name_link, $this->row_actions($actions) ); |
|
150 | + return sprintf('%1$s %2$s', $name_link, $this->row_actions($actions)); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | |
157 | 157 | function column_ATT_email($item) { |
158 | - return '<a href="mailto:' . $item->email() . '">' . $item->email() . '</a>'; |
|
158 | + return '<a href="mailto:'.$item->email().'">'.$item->email().'</a>'; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | |
@@ -175,8 +175,8 @@ discard block |
||
175 | 175 | |
176 | 176 | function column_STA_ID($item) { |
177 | 177 | $states = EEM_State::instance()->get_all_states(); |
178 | - $state = isset( $states[ $item->state_ID() ] ) ? $states[ $item->state_ID() ]->get( 'STA_name' ) : $item->state_ID(); |
|
179 | - return ! is_numeric( $state ) ? $state : ''; |
|
178 | + $state = isset($states[$item->state_ID()]) ? $states[$item->state_ID()]->get('STA_name') : $item->state_ID(); |
|
179 | + return ! is_numeric($state) ? $state : ''; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | function column_CNT_ISO($item) { |
185 | 185 | $countries = EEM_Country::instance()->get_all_countries(); |
186 | 186 | //EEH_Debug_Tools::printr( $countries, '$countries <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
187 | - $country = isset( $countries[ $item->country_ID() ] ) ? $countries[ $item->country_ID() ]->get( 'CNT_name' ) : $item->country_ID(); |
|
188 | - return ! is_numeric( $country ) ? $country : ''; |
|
187 | + $country = isset($countries[$item->country_ID()]) ? $countries[$item->country_ID()]->get('CNT_name') : $item->country_ID(); |
|
188 | + return ! is_numeric($country) ? $country : ''; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -EEH_Template_Validator::verify_instanceof( $attendee, '$attendee', 'EE_Attendee'); |
|
2 | +EEH_Template_Validator::verify_instanceof($attendee, '$attendee', 'EE_Attendee'); |
|
3 | 3 | /** |
4 | 4 | * @var $attendee - instance of EE_Attendee |
5 | 5 | */ |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | class Support_Admin_Page extends EE_Admin_Page { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $routing = TRUE ) { |
|
34 | - parent::__construct( $routing ); |
|
33 | + public function __construct($routing = TRUE) { |
|
34 | + parent::__construct($routing); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | 'nav' => array( |
85 | 85 | 'label' => __('Support', 'event_espresso'), |
86 | 86 | 'order' => 30), |
87 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_support_boxes' ) ), |
|
87 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_support_boxes')), |
|
88 | 88 | 'require_nonce' => FALSE |
89 | 89 | ), |
90 | 90 | 'developers' => array( |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | 'nav' => array( |
99 | 99 | 'label' => __('Shortcodes', 'event_espresso'), |
100 | 100 | 'order' => 60), |
101 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_shortcodes_boxes' ) ), |
|
101 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_shortcodes_boxes')), |
|
102 | 102 | 'require_nonce' => FALSE |
103 | 103 | ), |
104 | 104 | ); |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | |
120 | 120 | |
121 | 121 | protected function _installation() { |
122 | - $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php'; |
|
123 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, '', TRUE); |
|
122 | + $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_installation.template.php'; |
|
123 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, '', TRUE); |
|
124 | 124 | $this->display_admin_page_with_sidebar(); |
125 | 125 | } |
126 | 126 | |
@@ -145,10 +145,10 @@ discard block |
||
145 | 145 | 'other_resources' => __('Other Resources', 'event_espresso') |
146 | 146 | ); |
147 | 147 | |
148 | - foreach ( $boxes as $box => $label ) { |
|
149 | - $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_' . $box . '.template.php'; |
|
148 | + foreach ($boxes as $box => $label) { |
|
149 | + $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_'.$box.'.template.php'; |
|
150 | 150 | $callback_args = array('template_path' => $template_path); |
151 | - add_meta_box( 'espresso_' . $box . '_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], "", TRUE );'), $this->_current_screen->id, 'normal', 'high', $callback_args); |
|
151 | + add_meta_box('espresso_'.$box.'_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], "", TRUE );'), $this->_current_screen->id, 'normal', 'high', $callback_args); |
|
152 | 152 | } |
153 | 153 | } |
154 | 154 | |
@@ -169,15 +169,15 @@ discard block |
||
169 | 169 | 'shortcodes_event_listings' => __('Event Listings', 'event_espresso'), |
170 | 170 | 'shortcodes_ticket_selector' => __('Event Ticket Selector', 'event_espresso'), |
171 | 171 | 'shortcodes_category' => __('Event Categories', 'event_espresso'), |
172 | - 'shortcodes_attendee' => __( 'Event Attendees', 'event_espresso' ) |
|
172 | + 'shortcodes_attendee' => __('Event Attendees', 'event_espresso') |
|
173 | 173 | /*'shortcodes_single_events' => __('Single Events', 'event_espresso'),*/ |
174 | 174 | /*'shortcodes_attendee_listings' => __('Attendee Listings', 'event_espresso'),*/ |
175 | 175 | ); |
176 | 176 | |
177 | - foreach ( $boxes as $box => $label ) { |
|
178 | - $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_' . $box . '.template.php'; |
|
177 | + foreach ($boxes as $box => $label) { |
|
178 | + $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_'.$box.'.template.php'; |
|
179 | 179 | $callback_args = array('template_path' => $template_path); |
180 | - add_meta_box( 'espresso_' . $box . '_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], "", TRUE );'), $this->_current_screen->id, 'normal', 'high', $callback_args); |
|
180 | + add_meta_box('espresso_'.$box.'_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], "", TRUE );'), $this->_current_screen->id, 'normal', 'high', $callback_args); |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 | |
@@ -196,17 +196,17 @@ discard block |
||
196 | 196 | 'important_information' => __('Important Information', 'event_espresso') |
197 | 197 | ); |
198 | 198 | |
199 | - foreach ( $boxes as $box => $label ) { |
|
200 | - $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_' . $box . '.template.php'; |
|
199 | + foreach ($boxes as $box => $label) { |
|
200 | + $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_'.$box.'.template.php'; |
|
201 | 201 | $callback_args = array('template_path' => $template_path, 'template_args' => $this->_template_args); |
202 | - add_meta_box( 'espresso_' . $box . '_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], $metabox["args"]["template_args"], TRUE );'), $this->_current_screen->id, 'normal', 'high', $callback_args); |
|
202 | + add_meta_box('espresso_'.$box.'_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], $metabox["args"]["template_args"], TRUE );'), $this->_current_screen->id, 'normal', 'high', $callback_args); |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | |
206 | 206 | |
207 | 207 | protected function _developers() { |
208 | - $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php'; |
|
209 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, array(), true ); |
|
208 | + $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'developers_admin_details.template.php'; |
|
209 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, array(), true); |
|
210 | 210 | $this->display_admin_page_with_sidebar(); |
211 | 211 | } |
212 | 212 | } //end Support_Admin_Page class |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -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,11 +32,11 @@ discard block |
||
32 | 32 | |
33 | 33 | public function __construct() { |
34 | 34 | //define some help/support page related constants |
35 | - define( 'EE_SUPPORT_PG_SLUG', 'espresso_support' ); |
|
36 | - define( 'EE_SUPPORT_ADMIN_URL', admin_url('admin.php?page=' . EE_SUPPORT_PG_SLUG )); |
|
37 | - define( 'EE_SUPPORT_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES . 'support/templates/'); |
|
38 | - define( 'EE_SUPPORT_ADMIN', EE_ADMIN_PAGES . 'support/' ); |
|
39 | - define( 'EE_SUPPORT_ASSETS_URL', EE_ADMIN_PAGES_URL . 'support/assets/' ); |
|
35 | + define('EE_SUPPORT_PG_SLUG', 'espresso_support'); |
|
36 | + define('EE_SUPPORT_ADMIN_URL', admin_url('admin.php?page='.EE_SUPPORT_PG_SLUG)); |
|
37 | + define('EE_SUPPORT_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES.'support/templates/'); |
|
38 | + define('EE_SUPPORT_ADMIN', EE_ADMIN_PAGES.'support/'); |
|
39 | + define('EE_SUPPORT_ASSETS_URL', EE_ADMIN_PAGES_URL.'support/assets/'); |
|
40 | 40 | parent::__construct(); |
41 | 41 | } |
42 | 42 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | protected function _set_menu_map() { |
48 | - $this->_menu_map = new EE_Admin_Page_Sub_Menu( array( |
|
48 | + $this->_menu_map = new EE_Admin_Page_Sub_Menu(array( |
|
49 | 49 | 'menu_group' => 'extras', |
50 | 50 | 'menu_order' => 30, |
51 | 51 | 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_AND_NETWORK_ADMIN, |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -32,16 +32,16 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function __construct() { |
34 | 34 | |
35 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
36 | - if ( ! defined( 'TXN_PG_SLUG' ) ) { |
|
37 | - define( 'TXN_PG_SLUG', 'espresso_transactions' ); |
|
38 | - define( 'TXN_PG_NAME', ucwords( str_replace( '_', '', TXN_PG_SLUG ) ) ); |
|
39 | - define( 'TXN_ADMIN', EE_ADMIN_PAGES . 'transactions' . DS ); |
|
40 | - define( 'TXN_ADMIN_URL', admin_url( 'admin.php?page=' . TXN_PG_SLUG ) ); |
|
41 | - define( 'TXN_ASSETS_PATH', TXN_ADMIN . 'assets' . DS ); |
|
42 | - define( 'TXN_ASSETS_URL', str_replace( '\\', '/', EE_ADMIN_PAGES_URL . 'transactions/assets' . DS ) ); |
|
43 | - define( 'TXN_TEMPLATE_PATH', TXN_ADMIN . 'templates' . DS ); |
|
44 | - define( 'TXN_TEMPLATE_URL', str_replace( '\\', '/', EE_ADMIN_PAGES_URL . 'transactions/templates' . DS ) ); |
|
35 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
36 | + if ( ! defined('TXN_PG_SLUG')) { |
|
37 | + define('TXN_PG_SLUG', 'espresso_transactions'); |
|
38 | + define('TXN_PG_NAME', ucwords(str_replace('_', '', TXN_PG_SLUG))); |
|
39 | + define('TXN_ADMIN', EE_ADMIN_PAGES.'transactions'.DS); |
|
40 | + define('TXN_ADMIN_URL', admin_url('admin.php?page='.TXN_PG_SLUG)); |
|
41 | + define('TXN_ASSETS_PATH', TXN_ADMIN.'assets'.DS); |
|
42 | + define('TXN_ASSETS_URL', str_replace('\\', '/', EE_ADMIN_PAGES_URL.'transactions/assets'.DS)); |
|
43 | + define('TXN_TEMPLATE_PATH', TXN_ADMIN.'templates'.DS); |
|
44 | + define('TXN_TEMPLATE_URL', str_replace('\\', '/', EE_ADMIN_PAGES_URL.'transactions/templates'.DS)); |
|
45 | 45 | } |
46 | 46 | parent::__construct(); |
47 | 47 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @return void |
64 | 64 | */ |
65 | 65 | protected function _set_menu_map() { |
66 | - $this->_menu_map = new EE_Admin_Page_Sub_Menu( array( |
|
66 | + $this->_menu_map = new EE_Admin_Page_Sub_Menu(array( |
|
67 | 67 | 'menu_group' => 'main', |
68 | 68 | 'menu_order' => 50, |
69 | 69 | 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |